Added comments
This commit is contained in:
@@ -966,9 +966,9 @@ func thompson(re []postfixNode) (Reg, error) {
|
|||||||
s.groupNum = lparenNode.groupNum
|
s.groupNum = lparenNode.groupNum
|
||||||
to_add := concatenate(lparenNode, s)
|
to_add := concatenate(lparenNode, s)
|
||||||
nfa = append(nfa, to_add)
|
nfa = append(nfa, to_add)
|
||||||
} else if middleNode.groupBegin && len(middleNode.transitions) == 0 { // The middle node is a lone lparen - something like '(())', and I'm looking at the first closing parentheses
|
} else if middleNode.groupBegin && len(middleNode.transitions) == 0 { // The middle node is a lone lparen - something like '(())', and I'm looking at the first rparen
|
||||||
nfa = append(nfa, lparenNode)
|
nfa = append(nfa, lparenNode) // I shouldn't have popped this out, because it is not involved in the current capturing group
|
||||||
s.groupNum = middleNode.groupNum // In this case, the 'middle' node is actually a paren node
|
s.groupNum = middleNode.groupNum // In this case, the 'middle' node is actually an lparen
|
||||||
to_add := concatenate(middleNode, s)
|
to_add := concatenate(middleNode, s)
|
||||||
nfa = append(nfa, to_add)
|
nfa = append(nfa, to_add)
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user