Skip to content
Browse files

peg.go: TypeString: for "" use peekDot instead of matchStrings

  • Loading branch information...
1 parent 590280e commit 6db97c387afe3affd68211123a9876def0744e91 @knieriem committed
Showing with 6 additions and 1 deletion.
  1. +6 −1 peg.go
View
7 peg.go
@@ -1285,7 +1285,12 @@ func (p *%v) Init() {
case TypeCharacter:
ko.cJump(false, "matchChar('%v')", node)
case TypeString:
- ko.cJump(false, "matchString(\"%v\")", node)
+ s := node.String()
+ if s == "" {
+ ko.cJump(false, "peekDot()")
+ } else {
+ ko.cJump(false, "matchString(\"%s\")", s)
+ }
case TypeClass:
ko.cJump(false, "matchClass(%d)", classes[node.String()])
case TypePredicate:

0 comments on commit 6db97c3

Please sign in to comment.
Something went wrong with that request. Please try again.