Browse Source

fix: Better escape sequence parsing for GraphQL parser

Matthias Ladkau 2 years ago
parent
commit
14e1981b54
1 changed files with 6 additions and 0 deletions
  1. 6 0
      lang/graphql/parser/lexer.go

+ 6 - 0
lang/graphql/parser/lexer.go

@@ -385,6 +385,12 @@ func (l *lexer) lexStringValue() lexFunc {
 		if r == RuneEOF {
 		if r == RuneEOF {
 			l.emitToken(TokenError, "EOF inside quotes")
 			l.emitToken(TokenError, "EOF inside quotes")
 			return nil
 			return nil
+		} else if r == '\\' {
+
+			// Consume escaped characters
+
+			r = l.next(-1)
+			r = l.next(-1)
 		}
 		}
 	}
 	}