Compare commits

..

No commits in common. '17e897e2d69cc4b659fefcf7765c29c2f896d846' and '1d32865e767482eadaf8eb22e918b0ae41dbd9d3' have entirely different histories.

@ -5,13 +5,9 @@ fmt:
go fmt ./... go fmt ./...
vet: fmt vet: fmt
go vet ./... go vet ./...
buildLibUnopt: vet
go build -gcflags="all=-N -l" ./...
unopt: buildLibUnopt
go build -C kg/ -gcflags="all=-N -l" -o kg ./...
buildLib: vet buildLib: vet
go build ./... go build -gcflags="all=-N -l" ./...
buildCmd: buildLib buildCmd: buildLib
go build -C kg/ -o kg ./... go build -C kg/ -gcflags="all=-N -l" -o kg ./...
test: buildCmd test: buildCmd
go test -v ./... go test -v ./...

@ -131,9 +131,13 @@ func newEscapedNode(c rune, inCharClass bool) (postfixNode, error) {
case 'v': // Vertical tab case 'v': // Vertical tab
toReturn.nodetype = characterNode toReturn.nodetype = characterNode
toReturn.contents = append(toReturn.contents, rune(11)) toReturn.contents = append(toReturn.contents, rune(11))
case '-': // Literal hyphen case '-': // Literal hyphen - only in character class
if inCharClass {
toReturn.nodetype = characterNode toReturn.nodetype = characterNode
toReturn.contents = append(toReturn.contents, '-') toReturn.contents = append(toReturn.contents, '-')
} else {
return postfixNode{}, fmt.Errorf("invalid escape character")
}
default: // None of the above - append it as a regular character default: // None of the above - append it as a regular character
if isNormalChar(c) { // Normal characters cannot be escaped if isNormalChar(c) { // Normal characters cannot be escaped
return postfixNode{}, fmt.Errorf("invalid escape character") return postfixNode{}, fmt.Errorf("invalid escape character")

Loading…
Cancel
Save