diff --git a/src/parser/parser.yy b/src/parser/parser.yy index b3232ee6c72..b2c096517c1 100644 --- a/src/parser/parser.yy +++ b/src/parser/parser.yy @@ -405,18 +405,18 @@ static constexpr size_t kCommentLengthLimit = 256; %type opt_with_properties %type opt_ignore_existed_index -/* Define precedence and associativity of tokens. - * Associativity: - * The associativity of an operator op determines how repeated uses of the operator nest: - * whether ‘x op y op z’ is parsed by grouping x with y first or by grouping y with z first. - * %left specifies left-associativity (grouping x with y first) and %right specifies right-associativity (grouping y with z first). - * %nonassoc specifies no associativity, which means that ‘x op y op z’ is considered a syntax error. - * - * Precedence: - * The precedence of an operator determines how it nests with other operators. - * All the tokens declared in a single precedence declaration have equal precedence and nest together according to their associativity. - * When two tokens declared in different precedence declarations associate, the one declared later has the higher precedence and is grouped first. - */ +// Define precedence and associativity of tokens. +// Associativity: +// The associativity of an operator op determines how repeated uses of the operator nest: +// whether ‘x op y op z’ is parsed by grouping x with y first or by grouping y with z first. +// %left specifies left-associativity (grouping x with y first) and %right specifies right-associativity (grouping y with z first). +// %nonassoc specifies no associativity, which means that ‘x op y op z’ is considered a syntax error. +// +// Precedence: +// The precedence of an operator determines how it nests with other operators. +// All the tokens declared in a single precedence declaration have equal precedence and nest together according to their associativity. +// When two tokens declared in different precedence declarations associate, the one declared later has the higher precedence and is grouped first. + %left QM COLON %left KW_OR KW_XOR %left KW_AND diff --git a/src/parser/scanner.lex b/src/parser/scanner.lex index 7817f906469..ecdeb88b19a 100644 --- a/src/parser/scanner.lex +++ b/src/parser/scanner.lex @@ -29,6 +29,7 @@ static constexpr size_t MAX_STRING = 4096; * accent quoted label, eg. `v2` * comment */ + %x DQ_STR %x SQ_STR %x LB_STR