Compare commits
2 Commits
1d32865e76
...
17e897e2d6
Author | SHA1 | Date | |
---|---|---|---|
17e897e2d6 | |||
777c590072 |
8
Makefile
8
Makefile
@@ -5,9 +5,13 @@ fmt:
|
||||
go fmt ./...
|
||||
vet: fmt
|
||||
go vet ./...
|
||||
buildLib: vet
|
||||
buildLibUnopt: vet
|
||||
go build -gcflags="all=-N -l" ./...
|
||||
buildCmd: buildLib
|
||||
unopt: buildLibUnopt
|
||||
go build -C kg/ -gcflags="all=-N -l" -o kg ./...
|
||||
buildLib: vet
|
||||
go build ./...
|
||||
buildCmd: buildLib
|
||||
go build -C kg/ -o kg ./...
|
||||
test: buildCmd
|
||||
go test -v ./...
|
||||
|
@@ -131,13 +131,9 @@ func newEscapedNode(c rune, inCharClass bool) (postfixNode, error) {
|
||||
case 'v': // Vertical tab
|
||||
toReturn.nodetype = characterNode
|
||||
toReturn.contents = append(toReturn.contents, rune(11))
|
||||
case '-': // Literal hyphen - only in character class
|
||||
if inCharClass {
|
||||
case '-': // Literal hyphen
|
||||
toReturn.nodetype = characterNode
|
||||
toReturn.contents = append(toReturn.contents, '-')
|
||||
} else {
|
||||
return postfixNode{}, fmt.Errorf("invalid escape character")
|
||||
}
|
||||
default: // None of the above - append it as a regular character
|
||||
if isNormalChar(c) { // Normal characters cannot be escaped
|
||||
return postfixNode{}, fmt.Errorf("invalid escape character")
|
||||
|
Reference in New Issue
Block a user