瀏覽代碼

fix: Better escape sequence parsing for GraphQL parser

Matthias Ladkau 2 年之前
父節點
當前提交
14e1981b54
共有 1 個文件被更改,包括 6 次插入0 次删除
  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)
 		}
 	}