Pārlūkot izejas kodu

fix: Better escape sequence parsing for GraphQL parser

Matthias Ladkau 2 gadi atpakaļ
vecāks
revīzija
14e1981b54
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  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 {
 			l.emitToken(TokenError, "EOF inside quotes")
 			return nil
+		} else if r == '\\' {
+
+			// Consume escaped characters
+
+			r = l.next(-1)
+			r = l.next(-1)
 		}
 	}