diff --git a/parser/gen/CEL.g4 b/parser/gen/CEL.g4 index c1e6c852..5de40073 100644 --- a/parser/gen/CEL.g4 +++ b/parser/gen/CEL.g4 @@ -14,8 +14,6 @@ grammar CEL; -// Note: grammar here should be rather final, but lexis is a moving target. - // Grammar Rules // ============= @@ -93,11 +91,6 @@ literal // Lexer Rules // =========== -// TODO(b/63180832): align implementation with spec at go/api-expr/langdef.md. -// At this point, it would be premature to do this as the spec is still a moving -// target. The current rules were c&p from some other code in google3, and are -// only approximative. - EQUALS : '=='; NOT_EQUALS : '!='; LESS : '<'; @@ -127,31 +120,35 @@ TRUE : 'true'; FALSE : 'false'; NULL : 'null'; -fragment EXPONENT : ('e' | 'E') ( '+' | '-' )? DIGIT+ ; -fragment DIGIT : '0'..'9' ; +fragment BACKSLASH : '\\'; fragment LETTER : 'A'..'Z' | 'a'..'z' ; +fragment DIGIT : '0'..'9' ; +fragment EXPONENT : ('e' | 'E') ( '+' | '-' )? DIGIT+ ; fragment HEXDIGIT : ('0'..'9'|'a'..'f'|'A'..'F') ; -fragment OCTDIGIT : '0'..'7' ; +fragment RAW : 'r' | 'R'; -// TODO: Ensure escape sequences mirror those supported in Google SQL. fragment ESC_SEQ - : '\\' ~('0'..'9'|'a'..'f'|'A'..'F' | '\r' | '\n' | '\t' | 'u') - | UNI_SEQ - | OCT_SEQ + : ESC_CHAR_SEQ + | ESC_BYTE_SEQ + | ESC_UNI_SEQ + | ESC_OCT_SEQ + ; + +fragment ESC_CHAR_SEQ + : BACKSLASH ('a'|'b'|'f'|'n'|'r'|'t'|'v'|'"'|'\''|'\\'|'?'|'`') ; -fragment SPECIAL_ESC_CHAR - : ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') +fragment ESC_OCT_SEQ + : BACKSLASH ('0'..'3') ('0'..'7') ('0'..'7') ; -fragment OCT_SEQ - : '\\' ('0'..'3') ('0'..'7') ('0'..'7') - | '\\' ('0'..'7') ('0'..'7') - | '\\' ('0'..'7') +fragment ESC_BYTE_SEQ + : BACKSLASH ( 'x' | 'X' ) HEXDIGIT HEXDIGIT ; -fragment UNI_SEQ - : '\\' 'u' HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT +fragment ESC_UNI_SEQ + : BACKSLASH 'u' HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT + | BACKSLASH 'U' HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT ; WHITESPACE : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+ -> channel(HIDDEN) ; @@ -173,8 +170,8 @@ NUM_UINT ; STRING - : '"' (ESC_SEQ | ~('"'|'\n'|'\r'))* '"' - | '\'' (ESC_SEQ | ~('\''|'\n'|'\r'))* '\'' + : '"' (ESC_SEQ | ~('\\'|'"'|'\n'|'\r'))* '"' + | '\'' (ESC_SEQ | ~('\\'|'\''|'\n'|'\r'))* '\'' | '"""' (ESC_SEQ | ~('\\'))*? '"""' | '\'\'\'' (ESC_SEQ | ~('\\'))*? '\'\'\'' | RAW '"' ~('"'|'\n'|'\r')* '"' @@ -183,8 +180,6 @@ STRING | RAW '\'\'\'' .*? '\'\'\'' ; -fragment RAW : 'r' | 'R'; - BYTES : ('b' | 'B') STRING; -IDENTIFIER : (LETTER | '_') ( LETTER | DIGIT | '_')*; \ No newline at end of file +IDENTIFIER : (LETTER | '_') ( LETTER | DIGIT | '_')*; diff --git a/parser/gen/cel_base_listener.go b/parser/gen/cel_base_listener.go index ab06c9aa..265ffbbf 100644 --- a/parser/gen/cel_base_listener.go +++ b/parser/gen/cel_base_listener.go @@ -1,18 +1,4 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated from /Users/ozben/go/src/celgo/bin/../parser/gen/CEL.g4 by ANTLR 4.7. +// Generated from /Users/tswadell/lace/go/src/github.com/google/cel-go/bin/../parser/gen/CEL.g4 by ANTLR 4.7. package gen // CEL import "github.com/antlr/antlr4/runtime/Go/antlr" @@ -118,12 +104,6 @@ func (s *BaseCELListener) EnterIdentOrGlobalCall(ctx *IdentOrGlobalCallContext) // ExitIdentOrGlobalCall is called when production IdentOrGlobalCall is exited. func (s *BaseCELListener) ExitIdentOrGlobalCall(ctx *IdentOrGlobalCallContext) {} -// EnterDeprecatedIn is called when production DeprecatedIn is entered. -func (s *BaseCELListener) EnterDeprecatedIn(ctx *DeprecatedInContext) {} - -// ExitDeprecatedIn is called when production DeprecatedIn is exited. -func (s *BaseCELListener) ExitDeprecatedIn(ctx *DeprecatedInContext) {} - // EnterNested is called when production Nested is entered. func (s *BaseCELListener) EnterNested(ctx *NestedContext) {} diff --git a/parser/gen/cel_base_visitor.go b/parser/gen/cel_base_visitor.go index 61d0054e..3b550eb6 100644 --- a/parser/gen/cel_base_visitor.go +++ b/parser/gen/cel_base_visitor.go @@ -1,18 +1,4 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated from /Users/ozben/go/src/celgo/bin/../parser/gen/CEL.g4 by ANTLR 4.7. +// Generated from /Users/tswadell/lace/go/src/github.com/google/cel-go/bin/../parser/gen/CEL.g4 by ANTLR 4.7. package gen // CEL import "github.com/antlr/antlr4/runtime/Go/antlr" @@ -77,10 +63,6 @@ func (v *BaseCELVisitor) VisitIdentOrGlobalCall(ctx *IdentOrGlobalCallContext) i return v.VisitChildren(ctx) } -func (v *BaseCELVisitor) VisitDeprecatedIn(ctx *DeprecatedInContext) interface{} { - return v.VisitChildren(ctx) -} - func (v *BaseCELVisitor) VisitNested(ctx *NestedContext) interface{} { return v.VisitChildren(ctx) } diff --git a/parser/gen/cel_lexer.go b/parser/gen/cel_lexer.go index 74667d2a..6da6c3ac 100644 --- a/parser/gen/cel_lexer.go +++ b/parser/gen/cel_lexer.go @@ -1,18 +1,4 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated from /Users/ozben/go/src/celgo/bin/../parser/gen/CEL.g4 by ANTLR 4.7. +// Generated from /Users/tswadell/lace/go/src/github.com/google/cel-go/bin/../parser/gen/CEL.g4 by ANTLR 4.7. package gen @@ -28,7 +14,7 @@ var _ = fmt.Printf var _ = unicode.IsLetter var serializedLexerAtn = []uint16{ - 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 38, 413, + 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 38, 425, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, @@ -37,53 +23,55 @@ var serializedLexerAtn = []uint16{ 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, - 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 3, 2, 3, 2, 3, 2, 3, 3, - 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, - 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, - 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, - 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, - 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, - 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, - 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 171, 10, 30, 3, 30, 6, - 30, 174, 10, 30, 13, 30, 14, 30, 175, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, - 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 190, 10, 35, 3, - 36, 3, 36, 3, 36, 5, 36, 195, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, - 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 206, 10, 37, 3, 38, 3, 38, 3, 38, 3, - 38, 3, 38, 3, 38, 3, 38, 3, 39, 6, 39, 216, 10, 39, 13, 39, 14, 39, 217, - 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 7, 40, 226, 10, 40, 12, 40, 14, - 40, 229, 11, 40, 3, 40, 3, 40, 3, 41, 6, 41, 234, 10, 41, 13, 41, 14, 41, - 235, 3, 41, 3, 41, 6, 41, 240, 10, 41, 13, 41, 14, 41, 241, 3, 41, 5, 41, - 245, 10, 41, 3, 41, 6, 41, 248, 10, 41, 13, 41, 14, 41, 249, 3, 41, 3, - 41, 3, 41, 3, 41, 6, 41, 256, 10, 41, 13, 41, 14, 41, 257, 3, 41, 5, 41, - 261, 10, 41, 5, 41, 263, 10, 41, 3, 42, 6, 42, 266, 10, 42, 13, 42, 14, - 42, 267, 3, 42, 3, 42, 3, 42, 3, 42, 6, 42, 274, 10, 42, 13, 42, 14, 42, - 275, 5, 42, 278, 10, 42, 3, 43, 6, 43, 281, 10, 43, 13, 43, 14, 43, 282, - 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 6, 43, 291, 10, 43, 13, 43, 14, - 43, 292, 3, 43, 3, 43, 5, 43, 297, 10, 43, 3, 44, 3, 44, 3, 44, 7, 44, - 302, 10, 44, 12, 44, 14, 44, 305, 11, 44, 3, 44, 3, 44, 3, 44, 3, 44, 7, - 44, 311, 10, 44, 12, 44, 14, 44, 314, 11, 44, 3, 44, 3, 44, 3, 44, 3, 44, - 3, 44, 3, 44, 3, 44, 7, 44, 323, 10, 44, 12, 44, 14, 44, 326, 11, 44, 3, - 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 7, 44, 337, - 10, 44, 12, 44, 14, 44, 340, 11, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, - 3, 44, 7, 44, 348, 10, 44, 12, 44, 14, 44, 351, 11, 44, 3, 44, 3, 44, 3, - 44, 3, 44, 3, 44, 7, 44, 358, 10, 44, 12, 44, 14, 44, 361, 11, 44, 3, 44, - 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 7, 44, 371, 10, 44, 12, - 44, 14, 44, 374, 11, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, - 3, 44, 3, 44, 3, 44, 7, 44, 386, 10, 44, 12, 44, 14, 44, 389, 11, 44, 3, - 44, 3, 44, 3, 44, 3, 44, 5, 44, 395, 10, 44, 3, 45, 3, 45, 3, 46, 3, 46, - 3, 46, 3, 47, 3, 47, 5, 47, 404, 10, 47, 3, 47, 3, 47, 3, 47, 7, 47, 409, - 10, 47, 12, 47, 14, 47, 412, 11, 47, 6, 324, 338, 372, 387, 2, 48, 3, 3, - 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, - 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, - 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 2, - 61, 2, 63, 2, 65, 2, 67, 2, 69, 2, 71, 2, 73, 2, 75, 2, 77, 31, 79, 32, - 81, 33, 83, 34, 85, 35, 87, 36, 89, 2, 91, 37, 93, 38, 3, 2, 17, 4, 2, - 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 4, 2, 67, 92, 99, 124, 5, 2, 50, - 59, 67, 72, 99, 104, 8, 2, 11, 12, 15, 15, 50, 59, 67, 72, 99, 104, 119, - 119, 7, 2, 100, 100, 104, 104, 112, 112, 116, 116, 118, 118, 4, 2, 41, - 41, 94, 94, 5, 2, 11, 12, 14, 15, 34, 34, 3, 2, 12, 12, 4, 2, 87, 87, 119, - 119, 5, 2, 12, 12, 15, 15, 36, 36, 5, 2, 12, 12, 15, 15, 41, 41, 3, 2, - 94, 94, 4, 2, 84, 84, 116, 116, 4, 2, 68, 68, 100, 100, 2, 448, 2, 3, 3, + 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 3, 2, 3, + 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, + 6, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, + 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, + 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, + 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, + 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, + 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, + 32, 3, 32, 3, 33, 3, 33, 5, 33, 179, 10, 33, 3, 33, 6, 33, 182, 10, 33, + 13, 33, 14, 33, 183, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, + 36, 5, 36, 194, 10, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, + 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, + 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, + 3, 40, 3, 40, 3, 40, 5, 40, 227, 10, 40, 3, 41, 6, 41, 230, 10, 41, 13, + 41, 14, 41, 231, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 7, 42, 240, + 10, 42, 12, 42, 14, 42, 243, 11, 42, 3, 42, 3, 42, 3, 43, 6, 43, 248, 10, + 43, 13, 43, 14, 43, 249, 3, 43, 3, 43, 6, 43, 254, 10, 43, 13, 43, 14, + 43, 255, 3, 43, 5, 43, 259, 10, 43, 3, 43, 6, 43, 262, 10, 43, 13, 43, + 14, 43, 263, 3, 43, 3, 43, 3, 43, 3, 43, 6, 43, 270, 10, 43, 13, 43, 14, + 43, 271, 3, 43, 5, 43, 275, 10, 43, 5, 43, 277, 10, 43, 3, 44, 6, 44, 280, + 10, 44, 13, 44, 14, 44, 281, 3, 44, 3, 44, 3, 44, 3, 44, 6, 44, 288, 10, + 44, 13, 44, 14, 44, 289, 5, 44, 292, 10, 44, 3, 45, 6, 45, 295, 10, 45, + 13, 45, 14, 45, 296, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 6, 45, 305, + 10, 45, 13, 45, 14, 45, 306, 3, 45, 3, 45, 5, 45, 311, 10, 45, 3, 46, 3, + 46, 3, 46, 7, 46, 316, 10, 46, 12, 46, 14, 46, 319, 11, 46, 3, 46, 3, 46, + 3, 46, 3, 46, 7, 46, 325, 10, 46, 12, 46, 14, 46, 328, 11, 46, 3, 46, 3, + 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 7, 46, 337, 10, 46, 12, 46, 14, + 46, 340, 11, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, + 3, 46, 7, 46, 351, 10, 46, 12, 46, 14, 46, 354, 11, 46, 3, 46, 3, 46, 3, + 46, 3, 46, 3, 46, 3, 46, 7, 46, 362, 10, 46, 12, 46, 14, 46, 365, 11, 46, + 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 7, 46, 372, 10, 46, 12, 46, 14, 46, + 375, 11, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 7, + 46, 385, 10, 46, 12, 46, 14, 46, 388, 11, 46, 3, 46, 3, 46, 3, 46, 3, 46, + 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 7, 46, 400, 10, 46, 12, 46, 14, + 46, 403, 11, 46, 3, 46, 3, 46, 3, 46, 3, 46, 5, 46, 409, 10, 46, 3, 47, + 3, 47, 3, 47, 3, 48, 3, 48, 5, 48, 416, 10, 48, 3, 48, 3, 48, 3, 48, 7, + 48, 421, 10, 48, 12, 48, 14, 48, 424, 11, 48, 6, 338, 352, 386, 401, 2, + 49, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, + 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, + 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, + 59, 2, 61, 2, 63, 2, 65, 2, 67, 2, 69, 2, 71, 2, 73, 2, 75, 2, 77, 2, 79, + 2, 81, 31, 83, 32, 85, 33, 87, 34, 89, 35, 91, 36, 93, 37, 95, 38, 3, 2, + 18, 4, 2, 67, 92, 99, 124, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, + 5, 2, 50, 59, 67, 72, 99, 104, 4, 2, 84, 84, 116, 116, 12, 2, 36, 36, 41, + 41, 65, 65, 94, 94, 98, 100, 104, 104, 112, 112, 116, 116, 118, 118, 120, + 120, 4, 2, 90, 90, 122, 122, 5, 2, 11, 12, 14, 15, 34, 34, 3, 2, 12, 12, + 4, 2, 87, 87, 119, 119, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 6, 2, 12, + 12, 15, 15, 41, 41, 94, 94, 3, 2, 94, 94, 5, 2, 12, 12, 15, 15, 36, 36, + 5, 2, 12, 12, 15, 15, 41, 41, 4, 2, 68, 68, 100, 100, 2, 458, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, @@ -91,138 +79,140 @@ var serializedLexerAtn = []uint16{ 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, - 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, - 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, - 93, 3, 2, 2, 2, 3, 95, 3, 2, 2, 2, 5, 98, 3, 2, 2, 2, 7, 101, 3, 2, 2, - 2, 9, 104, 3, 2, 2, 2, 11, 106, 3, 2, 2, 2, 13, 109, 3, 2, 2, 2, 15, 112, - 3, 2, 2, 2, 17, 114, 3, 2, 2, 2, 19, 117, 3, 2, 2, 2, 21, 120, 3, 2, 2, - 2, 23, 122, 3, 2, 2, 2, 25, 124, 3, 2, 2, 2, 27, 126, 3, 2, 2, 2, 29, 128, - 3, 2, 2, 2, 31, 130, 3, 2, 2, 2, 33, 132, 3, 2, 2, 2, 35, 134, 3, 2, 2, - 2, 37, 136, 3, 2, 2, 2, 39, 138, 3, 2, 2, 2, 41, 140, 3, 2, 2, 2, 43, 142, - 3, 2, 2, 2, 45, 144, 3, 2, 2, 2, 47, 146, 3, 2, 2, 2, 49, 148, 3, 2, 2, - 2, 51, 150, 3, 2, 2, 2, 53, 152, 3, 2, 2, 2, 55, 157, 3, 2, 2, 2, 57, 163, - 3, 2, 2, 2, 59, 168, 3, 2, 2, 2, 61, 177, 3, 2, 2, 2, 63, 179, 3, 2, 2, - 2, 65, 181, 3, 2, 2, 2, 67, 183, 3, 2, 2, 2, 69, 189, 3, 2, 2, 2, 71, 194, - 3, 2, 2, 2, 73, 205, 3, 2, 2, 2, 75, 207, 3, 2, 2, 2, 77, 215, 3, 2, 2, - 2, 79, 221, 3, 2, 2, 2, 81, 262, 3, 2, 2, 2, 83, 277, 3, 2, 2, 2, 85, 296, - 3, 2, 2, 2, 87, 394, 3, 2, 2, 2, 89, 396, 3, 2, 2, 2, 91, 398, 3, 2, 2, - 2, 93, 403, 3, 2, 2, 2, 95, 96, 7, 107, 2, 2, 96, 97, 7, 112, 2, 2, 97, - 4, 3, 2, 2, 2, 98, 99, 7, 63, 2, 2, 99, 100, 7, 63, 2, 2, 100, 6, 3, 2, - 2, 2, 101, 102, 7, 35, 2, 2, 102, 103, 7, 63, 2, 2, 103, 8, 3, 2, 2, 2, - 104, 105, 7, 62, 2, 2, 105, 10, 3, 2, 2, 2, 106, 107, 7, 62, 2, 2, 107, - 108, 7, 63, 2, 2, 108, 12, 3, 2, 2, 2, 109, 110, 7, 64, 2, 2, 110, 111, - 7, 63, 2, 2, 111, 14, 3, 2, 2, 2, 112, 113, 7, 64, 2, 2, 113, 16, 3, 2, - 2, 2, 114, 115, 7, 40, 2, 2, 115, 116, 7, 40, 2, 2, 116, 18, 3, 2, 2, 2, - 117, 118, 7, 126, 2, 2, 118, 119, 7, 126, 2, 2, 119, 20, 3, 2, 2, 2, 120, - 121, 7, 93, 2, 2, 121, 22, 3, 2, 2, 2, 122, 123, 7, 95, 2, 2, 123, 24, - 3, 2, 2, 2, 124, 125, 7, 125, 2, 2, 125, 26, 3, 2, 2, 2, 126, 127, 7, 127, - 2, 2, 127, 28, 3, 2, 2, 2, 128, 129, 7, 42, 2, 2, 129, 30, 3, 2, 2, 2, - 130, 131, 7, 43, 2, 2, 131, 32, 3, 2, 2, 2, 132, 133, 7, 48, 2, 2, 133, - 34, 3, 2, 2, 2, 134, 135, 7, 46, 2, 2, 135, 36, 3, 2, 2, 2, 136, 137, 7, - 47, 2, 2, 137, 38, 3, 2, 2, 2, 138, 139, 7, 35, 2, 2, 139, 40, 3, 2, 2, - 2, 140, 141, 7, 65, 2, 2, 141, 42, 3, 2, 2, 2, 142, 143, 7, 60, 2, 2, 143, - 44, 3, 2, 2, 2, 144, 145, 7, 45, 2, 2, 145, 46, 3, 2, 2, 2, 146, 147, 7, - 44, 2, 2, 147, 48, 3, 2, 2, 2, 148, 149, 7, 49, 2, 2, 149, 50, 3, 2, 2, - 2, 150, 151, 7, 39, 2, 2, 151, 52, 3, 2, 2, 2, 152, 153, 7, 118, 2, 2, - 153, 154, 7, 116, 2, 2, 154, 155, 7, 119, 2, 2, 155, 156, 7, 103, 2, 2, - 156, 54, 3, 2, 2, 2, 157, 158, 7, 104, 2, 2, 158, 159, 7, 99, 2, 2, 159, - 160, 7, 110, 2, 2, 160, 161, 7, 117, 2, 2, 161, 162, 7, 103, 2, 2, 162, - 56, 3, 2, 2, 2, 163, 164, 7, 112, 2, 2, 164, 165, 7, 119, 2, 2, 165, 166, - 7, 110, 2, 2, 166, 167, 7, 110, 2, 2, 167, 58, 3, 2, 2, 2, 168, 170, 9, - 2, 2, 2, 169, 171, 9, 3, 2, 2, 170, 169, 3, 2, 2, 2, 170, 171, 3, 2, 2, - 2, 171, 173, 3, 2, 2, 2, 172, 174, 5, 61, 31, 2, 173, 172, 3, 2, 2, 2, - 174, 175, 3, 2, 2, 2, 175, 173, 3, 2, 2, 2, 175, 176, 3, 2, 2, 2, 176, - 60, 3, 2, 2, 2, 177, 178, 4, 50, 59, 2, 178, 62, 3, 2, 2, 2, 179, 180, - 9, 4, 2, 2, 180, 64, 3, 2, 2, 2, 181, 182, 9, 5, 2, 2, 182, 66, 3, 2, 2, - 2, 183, 184, 4, 50, 57, 2, 184, 68, 3, 2, 2, 2, 185, 186, 7, 94, 2, 2, - 186, 190, 10, 6, 2, 2, 187, 190, 5, 75, 38, 2, 188, 190, 5, 73, 37, 2, - 189, 185, 3, 2, 2, 2, 189, 187, 3, 2, 2, 2, 189, 188, 3, 2, 2, 2, 190, - 70, 3, 2, 2, 2, 191, 195, 9, 7, 2, 2, 193, 195, 9, 8, 2, 2, 194, 191, 3, - 2, 2, 2, 194, 192, 3, 2, 2, 2, 194, 193, 3, 2, 2, 2, 195, 72, 3, 2, 2, - 2, 196, 197, 7, 94, 2, 2, 197, 198, 4, 50, 53, 2, 198, 199, 4, 50, 57, - 2, 199, 206, 4, 50, 57, 2, 200, 201, 7, 94, 2, 2, 201, 202, 4, 50, 57, - 2, 202, 206, 4, 50, 57, 2, 203, 204, 7, 94, 2, 2, 204, 206, 4, 50, 57, - 2, 205, 196, 3, 2, 2, 2, 205, 200, 3, 2, 2, 2, 205, 203, 3, 2, 2, 2, 206, - 74, 3, 2, 2, 2, 207, 208, 7, 94, 2, 2, 208, 209, 7, 119, 2, 2, 209, 210, - 5, 65, 33, 2, 210, 211, 5, 65, 33, 2, 211, 212, 5, 65, 33, 2, 212, 213, - 5, 65, 33, 2, 213, 76, 3, 2, 2, 2, 214, 216, 9, 9, 2, 2, 215, 214, 3, 2, - 2, 2, 216, 217, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, - 218, 219, 3, 2, 2, 2, 219, 220, 8, 39, 2, 2, 220, 78, 3, 2, 2, 2, 221, - 222, 7, 49, 2, 2, 222, 223, 7, 49, 2, 2, 223, 227, 3, 2, 2, 2, 224, 226, - 10, 10, 2, 2, 225, 224, 3, 2, 2, 2, 226, 229, 3, 2, 2, 2, 227, 225, 3, - 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 230, 3, 2, 2, 2, 229, 227, 3, 2, 2, - 2, 230, 231, 8, 40, 2, 2, 231, 80, 3, 2, 2, 2, 232, 234, 5, 61, 31, 2, - 233, 232, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 233, 3, 2, 2, 2, 235, - 236, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 239, 7, 48, 2, 2, 238, 240, - 5, 61, 31, 2, 239, 238, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 239, 3, - 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 244, 3, 2, 2, 2, 243, 245, 5, 59, 30, - 2, 244, 243, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 263, 3, 2, 2, 2, 246, - 248, 5, 61, 31, 2, 247, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 247, - 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 251, 3, 2, 2, 2, 251, 252, 5, 59, - 30, 2, 252, 263, 3, 2, 2, 2, 253, 255, 7, 48, 2, 2, 254, 256, 5, 61, 31, - 2, 255, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, - 258, 3, 2, 2, 2, 258, 260, 3, 2, 2, 2, 259, 261, 5, 59, 30, 2, 260, 259, - 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 263, 3, 2, 2, 2, 262, 233, 3, 2, - 2, 2, 262, 247, 3, 2, 2, 2, 262, 253, 3, 2, 2, 2, 263, 82, 3, 2, 2, 2, - 264, 266, 5, 61, 31, 2, 265, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, - 265, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 278, 3, 2, 2, 2, 269, 270, - 7, 50, 2, 2, 270, 271, 7, 122, 2, 2, 271, 273, 3, 2, 2, 2, 272, 274, 5, - 65, 33, 2, 273, 272, 3, 2, 2, 2, 274, 275, 3, 2, 2, 2, 275, 273, 3, 2, - 2, 2, 275, 276, 3, 2, 2, 2, 276, 278, 3, 2, 2, 2, 277, 265, 3, 2, 2, 2, - 277, 269, 3, 2, 2, 2, 278, 84, 3, 2, 2, 2, 279, 281, 5, 61, 31, 2, 280, - 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 280, 3, 2, 2, 2, 282, 283, - 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 9, 11, 2, 2, 285, 297, 3, 2, - 2, 2, 286, 287, 7, 50, 2, 2, 287, 288, 7, 122, 2, 2, 288, 290, 3, 2, 2, - 2, 289, 291, 5, 65, 33, 2, 290, 289, 3, 2, 2, 2, 291, 292, 3, 2, 2, 2, - 292, 290, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, - 295, 9, 11, 2, 2, 295, 297, 3, 2, 2, 2, 296, 280, 3, 2, 2, 2, 296, 286, - 3, 2, 2, 2, 297, 86, 3, 2, 2, 2, 298, 303, 7, 36, 2, 2, 299, 302, 5, 69, - 35, 2, 300, 302, 10, 12, 2, 2, 301, 299, 3, 2, 2, 2, 301, 300, 3, 2, 2, - 2, 302, 305, 3, 2, 2, 2, 303, 301, 3, 2, 2, 2, 303, 304, 3, 2, 2, 2, 304, - 306, 3, 2, 2, 2, 305, 303, 3, 2, 2, 2, 306, 395, 7, 36, 2, 2, 307, 312, - 7, 41, 2, 2, 308, 311, 5, 69, 35, 2, 309, 311, 10, 13, 2, 2, 310, 308, - 3, 2, 2, 2, 310, 309, 3, 2, 2, 2, 311, 314, 3, 2, 2, 2, 312, 310, 3, 2, - 2, 2, 312, 313, 3, 2, 2, 2, 313, 315, 3, 2, 2, 2, 314, 312, 3, 2, 2, 2, - 315, 395, 7, 41, 2, 2, 316, 317, 7, 36, 2, 2, 317, 318, 7, 36, 2, 2, 318, - 319, 7, 36, 2, 2, 319, 324, 3, 2, 2, 2, 320, 323, 5, 69, 35, 2, 321, 323, - 10, 14, 2, 2, 322, 320, 3, 2, 2, 2, 322, 321, 3, 2, 2, 2, 323, 326, 3, - 2, 2, 2, 324, 325, 3, 2, 2, 2, 324, 322, 3, 2, 2, 2, 325, 327, 3, 2, 2, - 2, 326, 324, 3, 2, 2, 2, 327, 328, 7, 36, 2, 2, 328, 329, 7, 36, 2, 2, - 329, 395, 7, 36, 2, 2, 330, 331, 7, 41, 2, 2, 331, 332, 7, 41, 2, 2, 332, - 333, 7, 41, 2, 2, 333, 338, 3, 2, 2, 2, 334, 337, 5, 69, 35, 2, 335, 337, - 10, 14, 2, 2, 336, 334, 3, 2, 2, 2, 336, 335, 3, 2, 2, 2, 337, 340, 3, - 2, 2, 2, 338, 339, 3, 2, 2, 2, 338, 336, 3, 2, 2, 2, 339, 341, 3, 2, 2, - 2, 340, 338, 3, 2, 2, 2, 341, 342, 7, 41, 2, 2, 342, 343, 7, 41, 2, 2, - 343, 395, 7, 41, 2, 2, 344, 345, 5, 89, 45, 2, 345, 349, 7, 36, 2, 2, 346, - 348, 10, 12, 2, 2, 347, 346, 3, 2, 2, 2, 348, 351, 3, 2, 2, 2, 349, 347, - 3, 2, 2, 2, 349, 350, 3, 2, 2, 2, 350, 352, 3, 2, 2, 2, 351, 349, 3, 2, - 2, 2, 352, 353, 7, 36, 2, 2, 353, 395, 3, 2, 2, 2, 354, 355, 5, 89, 45, - 2, 355, 359, 7, 41, 2, 2, 356, 358, 10, 13, 2, 2, 357, 356, 3, 2, 2, 2, - 358, 361, 3, 2, 2, 2, 359, 357, 3, 2, 2, 2, 359, 360, 3, 2, 2, 2, 360, - 362, 3, 2, 2, 2, 361, 359, 3, 2, 2, 2, 362, 363, 7, 41, 2, 2, 363, 395, - 3, 2, 2, 2, 364, 365, 5, 89, 45, 2, 365, 366, 7, 36, 2, 2, 366, 367, 7, - 36, 2, 2, 367, 368, 7, 36, 2, 2, 368, 372, 3, 2, 2, 2, 369, 371, 11, 2, - 2, 2, 370, 369, 3, 2, 2, 2, 371, 374, 3, 2, 2, 2, 372, 373, 3, 2, 2, 2, - 372, 370, 3, 2, 2, 2, 373, 375, 3, 2, 2, 2, 374, 372, 3, 2, 2, 2, 375, - 376, 7, 36, 2, 2, 376, 377, 7, 36, 2, 2, 377, 378, 7, 36, 2, 2, 378, 395, - 3, 2, 2, 2, 379, 380, 5, 89, 45, 2, 380, 381, 7, 41, 2, 2, 381, 382, 7, - 41, 2, 2, 382, 383, 7, 41, 2, 2, 383, 387, 3, 2, 2, 2, 384, 386, 11, 2, - 2, 2, 385, 384, 3, 2, 2, 2, 386, 389, 3, 2, 2, 2, 387, 388, 3, 2, 2, 2, - 387, 385, 3, 2, 2, 2, 388, 390, 3, 2, 2, 2, 389, 387, 3, 2, 2, 2, 390, - 391, 7, 41, 2, 2, 391, 392, 7, 41, 2, 2, 392, 393, 7, 41, 2, 2, 393, 395, - 3, 2, 2, 2, 394, 298, 3, 2, 2, 2, 394, 307, 3, 2, 2, 2, 394, 316, 3, 2, - 2, 2, 394, 330, 3, 2, 2, 2, 394, 344, 3, 2, 2, 2, 394, 354, 3, 2, 2, 2, - 394, 364, 3, 2, 2, 2, 394, 379, 3, 2, 2, 2, 395, 88, 3, 2, 2, 2, 396, 397, - 9, 15, 2, 2, 397, 90, 3, 2, 2, 2, 398, 399, 9, 16, 2, 2, 399, 400, 5, 87, - 44, 2, 400, 92, 3, 2, 2, 2, 401, 404, 5, 63, 32, 2, 402, 404, 7, 97, 2, - 2, 403, 401, 3, 2, 2, 2, 403, 402, 3, 2, 2, 2, 404, 410, 3, 2, 2, 2, 405, - 409, 5, 63, 32, 2, 406, 409, 5, 61, 31, 2, 407, 409, 7, 97, 2, 2, 408, - 405, 3, 2, 2, 2, 408, 406, 3, 2, 2, 2, 408, 407, 3, 2, 2, 2, 409, 412, - 3, 2, 2, 2, 410, 408, 3, 2, 2, 2, 410, 411, 3, 2, 2, 2, 411, 94, 3, 2, - 2, 2, 412, 410, 3, 2, 2, 2, 39, 2, 170, 175, 189, 194, 205, 217, 227, 235, - 241, 244, 249, 257, 260, 262, 267, 275, 277, 282, 292, 296, 301, 303, 310, - 312, 322, 324, 336, 338, 349, 359, 372, 387, 394, 403, 408, 410, 3, 2, - 3, 2, + 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, + 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, + 95, 3, 2, 2, 2, 3, 97, 3, 2, 2, 2, 5, 100, 3, 2, 2, 2, 7, 103, 3, 2, 2, + 2, 9, 106, 3, 2, 2, 2, 11, 108, 3, 2, 2, 2, 13, 111, 3, 2, 2, 2, 15, 114, + 3, 2, 2, 2, 17, 116, 3, 2, 2, 2, 19, 119, 3, 2, 2, 2, 21, 122, 3, 2, 2, + 2, 23, 124, 3, 2, 2, 2, 25, 126, 3, 2, 2, 2, 27, 128, 3, 2, 2, 2, 29, 130, + 3, 2, 2, 2, 31, 132, 3, 2, 2, 2, 33, 134, 3, 2, 2, 2, 35, 136, 3, 2, 2, + 2, 37, 138, 3, 2, 2, 2, 39, 140, 3, 2, 2, 2, 41, 142, 3, 2, 2, 2, 43, 144, + 3, 2, 2, 2, 45, 146, 3, 2, 2, 2, 47, 148, 3, 2, 2, 2, 49, 150, 3, 2, 2, + 2, 51, 152, 3, 2, 2, 2, 53, 154, 3, 2, 2, 2, 55, 159, 3, 2, 2, 2, 57, 165, + 3, 2, 2, 2, 59, 170, 3, 2, 2, 2, 61, 172, 3, 2, 2, 2, 63, 174, 3, 2, 2, + 2, 65, 176, 3, 2, 2, 2, 67, 185, 3, 2, 2, 2, 69, 187, 3, 2, 2, 2, 71, 193, + 3, 2, 2, 2, 73, 195, 3, 2, 2, 2, 75, 198, 3, 2, 2, 2, 77, 203, 3, 2, 2, + 2, 79, 226, 3, 2, 2, 2, 81, 229, 3, 2, 2, 2, 83, 235, 3, 2, 2, 2, 85, 276, + 3, 2, 2, 2, 87, 291, 3, 2, 2, 2, 89, 310, 3, 2, 2, 2, 91, 408, 3, 2, 2, + 2, 93, 410, 3, 2, 2, 2, 95, 415, 3, 2, 2, 2, 97, 98, 7, 107, 2, 2, 98, + 99, 7, 112, 2, 2, 99, 4, 3, 2, 2, 2, 100, 101, 7, 63, 2, 2, 101, 102, 7, + 63, 2, 2, 102, 6, 3, 2, 2, 2, 103, 104, 7, 35, 2, 2, 104, 105, 7, 63, 2, + 2, 105, 8, 3, 2, 2, 2, 106, 107, 7, 62, 2, 2, 107, 10, 3, 2, 2, 2, 108, + 109, 7, 62, 2, 2, 109, 110, 7, 63, 2, 2, 110, 12, 3, 2, 2, 2, 111, 112, + 7, 64, 2, 2, 112, 113, 7, 63, 2, 2, 113, 14, 3, 2, 2, 2, 114, 115, 7, 64, + 2, 2, 115, 16, 3, 2, 2, 2, 116, 117, 7, 40, 2, 2, 117, 118, 7, 40, 2, 2, + 118, 18, 3, 2, 2, 2, 119, 120, 7, 126, 2, 2, 120, 121, 7, 126, 2, 2, 121, + 20, 3, 2, 2, 2, 122, 123, 7, 93, 2, 2, 123, 22, 3, 2, 2, 2, 124, 125, 7, + 95, 2, 2, 125, 24, 3, 2, 2, 2, 126, 127, 7, 125, 2, 2, 127, 26, 3, 2, 2, + 2, 128, 129, 7, 127, 2, 2, 129, 28, 3, 2, 2, 2, 130, 131, 7, 42, 2, 2, + 131, 30, 3, 2, 2, 2, 132, 133, 7, 43, 2, 2, 133, 32, 3, 2, 2, 2, 134, 135, + 7, 48, 2, 2, 135, 34, 3, 2, 2, 2, 136, 137, 7, 46, 2, 2, 137, 36, 3, 2, + 2, 2, 138, 139, 7, 47, 2, 2, 139, 38, 3, 2, 2, 2, 140, 141, 7, 35, 2, 2, + 141, 40, 3, 2, 2, 2, 142, 143, 7, 65, 2, 2, 143, 42, 3, 2, 2, 2, 144, 145, + 7, 60, 2, 2, 145, 44, 3, 2, 2, 2, 146, 147, 7, 45, 2, 2, 147, 46, 3, 2, + 2, 2, 148, 149, 7, 44, 2, 2, 149, 48, 3, 2, 2, 2, 150, 151, 7, 49, 2, 2, + 151, 50, 3, 2, 2, 2, 152, 153, 7, 39, 2, 2, 153, 52, 3, 2, 2, 2, 154, 155, + 7, 118, 2, 2, 155, 156, 7, 116, 2, 2, 156, 157, 7, 119, 2, 2, 157, 158, + 7, 103, 2, 2, 158, 54, 3, 2, 2, 2, 159, 160, 7, 104, 2, 2, 160, 161, 7, + 99, 2, 2, 161, 162, 7, 110, 2, 2, 162, 163, 7, 117, 2, 2, 163, 164, 7, + 103, 2, 2, 164, 56, 3, 2, 2, 2, 165, 166, 7, 112, 2, 2, 166, 167, 7, 119, + 2, 2, 167, 168, 7, 110, 2, 2, 168, 169, 7, 110, 2, 2, 169, 58, 3, 2, 2, + 2, 170, 171, 7, 94, 2, 2, 171, 60, 3, 2, 2, 2, 172, 173, 9, 2, 2, 2, 173, + 62, 3, 2, 2, 2, 174, 175, 4, 50, 59, 2, 175, 64, 3, 2, 2, 2, 176, 178, + 9, 3, 2, 2, 177, 179, 9, 4, 2, 2, 178, 177, 3, 2, 2, 2, 178, 179, 3, 2, + 2, 2, 179, 181, 3, 2, 2, 2, 180, 182, 5, 63, 32, 2, 181, 180, 3, 2, 2, + 2, 182, 183, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, + 66, 3, 2, 2, 2, 185, 186, 9, 5, 2, 2, 186, 68, 3, 2, 2, 2, 187, 188, 9, + 6, 2, 2, 188, 70, 3, 2, 2, 2, 189, 194, 5, 73, 37, 2, 190, 194, 5, 77, + 39, 2, 191, 194, 5, 79, 40, 2, 192, 194, 5, 75, 38, 2, 193, 189, 3, 2, + 2, 2, 193, 190, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 193, 192, 3, 2, 2, 2, + 194, 72, 3, 2, 2, 2, 195, 196, 5, 59, 30, 2, 196, 197, 9, 7, 2, 2, 197, + 74, 3, 2, 2, 2, 198, 199, 5, 59, 30, 2, 199, 200, 4, 50, 53, 2, 200, 201, + 4, 50, 57, 2, 201, 202, 4, 50, 57, 2, 202, 76, 3, 2, 2, 2, 203, 204, 5, + 59, 30, 2, 204, 205, 9, 8, 2, 2, 205, 206, 5, 67, 34, 2, 206, 207, 5, 67, + 34, 2, 207, 78, 3, 2, 2, 2, 208, 209, 5, 59, 30, 2, 209, 210, 7, 119, 2, + 2, 210, 211, 5, 67, 34, 2, 211, 212, 5, 67, 34, 2, 212, 213, 5, 67, 34, + 2, 213, 214, 5, 67, 34, 2, 214, 227, 3, 2, 2, 2, 215, 216, 5, 59, 30, 2, + 216, 217, 7, 87, 2, 2, 217, 218, 5, 67, 34, 2, 218, 219, 5, 67, 34, 2, + 219, 220, 5, 67, 34, 2, 220, 221, 5, 67, 34, 2, 221, 222, 5, 67, 34, 2, + 222, 223, 5, 67, 34, 2, 223, 224, 5, 67, 34, 2, 224, 225, 5, 67, 34, 2, + 225, 227, 3, 2, 2, 2, 226, 208, 3, 2, 2, 2, 226, 215, 3, 2, 2, 2, 227, + 80, 3, 2, 2, 2, 228, 230, 9, 9, 2, 2, 229, 228, 3, 2, 2, 2, 230, 231, 3, + 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 233, 3, 2, 2, + 2, 233, 234, 8, 41, 2, 2, 234, 82, 3, 2, 2, 2, 235, 236, 7, 49, 2, 2, 236, + 237, 7, 49, 2, 2, 237, 241, 3, 2, 2, 2, 238, 240, 10, 10, 2, 2, 239, 238, + 3, 2, 2, 2, 240, 243, 3, 2, 2, 2, 241, 239, 3, 2, 2, 2, 241, 242, 3, 2, + 2, 2, 242, 244, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 244, 245, 8, 42, 2, 2, + 245, 84, 3, 2, 2, 2, 246, 248, 5, 63, 32, 2, 247, 246, 3, 2, 2, 2, 248, + 249, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 251, + 3, 2, 2, 2, 251, 253, 7, 48, 2, 2, 252, 254, 5, 63, 32, 2, 253, 252, 3, + 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 253, 3, 2, 2, 2, 255, 256, 3, 2, 2, + 2, 256, 258, 3, 2, 2, 2, 257, 259, 5, 65, 33, 2, 258, 257, 3, 2, 2, 2, + 258, 259, 3, 2, 2, 2, 259, 277, 3, 2, 2, 2, 260, 262, 5, 63, 32, 2, 261, + 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, + 3, 2, 2, 2, 264, 265, 3, 2, 2, 2, 265, 266, 5, 65, 33, 2, 266, 277, 3, + 2, 2, 2, 267, 269, 7, 48, 2, 2, 268, 270, 5, 63, 32, 2, 269, 268, 3, 2, + 2, 2, 270, 271, 3, 2, 2, 2, 271, 269, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, + 272, 274, 3, 2, 2, 2, 273, 275, 5, 65, 33, 2, 274, 273, 3, 2, 2, 2, 274, + 275, 3, 2, 2, 2, 275, 277, 3, 2, 2, 2, 276, 247, 3, 2, 2, 2, 276, 261, + 3, 2, 2, 2, 276, 267, 3, 2, 2, 2, 277, 86, 3, 2, 2, 2, 278, 280, 5, 63, + 32, 2, 279, 278, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, + 281, 282, 3, 2, 2, 2, 282, 292, 3, 2, 2, 2, 283, 284, 7, 50, 2, 2, 284, + 285, 7, 122, 2, 2, 285, 287, 3, 2, 2, 2, 286, 288, 5, 67, 34, 2, 287, 286, + 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 287, 3, 2, 2, 2, 289, 290, 3, 2, + 2, 2, 290, 292, 3, 2, 2, 2, 291, 279, 3, 2, 2, 2, 291, 283, 3, 2, 2, 2, + 292, 88, 3, 2, 2, 2, 293, 295, 5, 63, 32, 2, 294, 293, 3, 2, 2, 2, 295, + 296, 3, 2, 2, 2, 296, 294, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 298, + 3, 2, 2, 2, 298, 299, 9, 11, 2, 2, 299, 311, 3, 2, 2, 2, 300, 301, 7, 50, + 2, 2, 301, 302, 7, 122, 2, 2, 302, 304, 3, 2, 2, 2, 303, 305, 5, 67, 34, + 2, 304, 303, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 304, 3, 2, 2, 2, 306, + 307, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 309, 9, 11, 2, 2, 309, 311, + 3, 2, 2, 2, 310, 294, 3, 2, 2, 2, 310, 300, 3, 2, 2, 2, 311, 90, 3, 2, + 2, 2, 312, 317, 7, 36, 2, 2, 313, 316, 5, 71, 36, 2, 314, 316, 10, 12, + 2, 2, 315, 313, 3, 2, 2, 2, 315, 314, 3, 2, 2, 2, 316, 319, 3, 2, 2, 2, + 317, 315, 3, 2, 2, 2, 317, 318, 3, 2, 2, 2, 318, 320, 3, 2, 2, 2, 319, + 317, 3, 2, 2, 2, 320, 409, 7, 36, 2, 2, 321, 326, 7, 41, 2, 2, 322, 325, + 5, 71, 36, 2, 323, 325, 10, 13, 2, 2, 324, 322, 3, 2, 2, 2, 324, 323, 3, + 2, 2, 2, 325, 328, 3, 2, 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, + 2, 327, 329, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 329, 409, 7, 41, 2, 2, 330, + 331, 7, 36, 2, 2, 331, 332, 7, 36, 2, 2, 332, 333, 7, 36, 2, 2, 333, 338, + 3, 2, 2, 2, 334, 337, 5, 71, 36, 2, 335, 337, 10, 14, 2, 2, 336, 334, 3, + 2, 2, 2, 336, 335, 3, 2, 2, 2, 337, 340, 3, 2, 2, 2, 338, 339, 3, 2, 2, + 2, 338, 336, 3, 2, 2, 2, 339, 341, 3, 2, 2, 2, 340, 338, 3, 2, 2, 2, 341, + 342, 7, 36, 2, 2, 342, 343, 7, 36, 2, 2, 343, 409, 7, 36, 2, 2, 344, 345, + 7, 41, 2, 2, 345, 346, 7, 41, 2, 2, 346, 347, 7, 41, 2, 2, 347, 352, 3, + 2, 2, 2, 348, 351, 5, 71, 36, 2, 349, 351, 10, 14, 2, 2, 350, 348, 3, 2, + 2, 2, 350, 349, 3, 2, 2, 2, 351, 354, 3, 2, 2, 2, 352, 353, 3, 2, 2, 2, + 352, 350, 3, 2, 2, 2, 353, 355, 3, 2, 2, 2, 354, 352, 3, 2, 2, 2, 355, + 356, 7, 41, 2, 2, 356, 357, 7, 41, 2, 2, 357, 409, 7, 41, 2, 2, 358, 359, + 5, 69, 35, 2, 359, 363, 7, 36, 2, 2, 360, 362, 10, 15, 2, 2, 361, 360, + 3, 2, 2, 2, 362, 365, 3, 2, 2, 2, 363, 361, 3, 2, 2, 2, 363, 364, 3, 2, + 2, 2, 364, 366, 3, 2, 2, 2, 365, 363, 3, 2, 2, 2, 366, 367, 7, 36, 2, 2, + 367, 409, 3, 2, 2, 2, 368, 369, 5, 69, 35, 2, 369, 373, 7, 41, 2, 2, 370, + 372, 10, 16, 2, 2, 371, 370, 3, 2, 2, 2, 372, 375, 3, 2, 2, 2, 373, 371, + 3, 2, 2, 2, 373, 374, 3, 2, 2, 2, 374, 376, 3, 2, 2, 2, 375, 373, 3, 2, + 2, 2, 376, 377, 7, 41, 2, 2, 377, 409, 3, 2, 2, 2, 378, 379, 5, 69, 35, + 2, 379, 380, 7, 36, 2, 2, 380, 381, 7, 36, 2, 2, 381, 382, 7, 36, 2, 2, + 382, 386, 3, 2, 2, 2, 383, 385, 11, 2, 2, 2, 384, 383, 3, 2, 2, 2, 385, + 388, 3, 2, 2, 2, 386, 387, 3, 2, 2, 2, 386, 384, 3, 2, 2, 2, 387, 389, + 3, 2, 2, 2, 388, 386, 3, 2, 2, 2, 389, 390, 7, 36, 2, 2, 390, 391, 7, 36, + 2, 2, 391, 392, 7, 36, 2, 2, 392, 409, 3, 2, 2, 2, 393, 394, 5, 69, 35, + 2, 394, 395, 7, 41, 2, 2, 395, 396, 7, 41, 2, 2, 396, 397, 7, 41, 2, 2, + 397, 401, 3, 2, 2, 2, 398, 400, 11, 2, 2, 2, 399, 398, 3, 2, 2, 2, 400, + 403, 3, 2, 2, 2, 401, 402, 3, 2, 2, 2, 401, 399, 3, 2, 2, 2, 402, 404, + 3, 2, 2, 2, 403, 401, 3, 2, 2, 2, 404, 405, 7, 41, 2, 2, 405, 406, 7, 41, + 2, 2, 406, 407, 7, 41, 2, 2, 407, 409, 3, 2, 2, 2, 408, 312, 3, 2, 2, 2, + 408, 321, 3, 2, 2, 2, 408, 330, 3, 2, 2, 2, 408, 344, 3, 2, 2, 2, 408, + 358, 3, 2, 2, 2, 408, 368, 3, 2, 2, 2, 408, 378, 3, 2, 2, 2, 408, 393, + 3, 2, 2, 2, 409, 92, 3, 2, 2, 2, 410, 411, 9, 17, 2, 2, 411, 412, 5, 91, + 46, 2, 412, 94, 3, 2, 2, 2, 413, 416, 5, 61, 31, 2, 414, 416, 7, 97, 2, + 2, 415, 413, 3, 2, 2, 2, 415, 414, 3, 2, 2, 2, 416, 422, 3, 2, 2, 2, 417, + 421, 5, 61, 31, 2, 418, 421, 5, 63, 32, 2, 419, 421, 7, 97, 2, 2, 420, + 417, 3, 2, 2, 2, 420, 418, 3, 2, 2, 2, 420, 419, 3, 2, 2, 2, 421, 424, + 3, 2, 2, 2, 422, 420, 3, 2, 2, 2, 422, 423, 3, 2, 2, 2, 423, 96, 3, 2, + 2, 2, 424, 422, 3, 2, 2, 2, 38, 2, 178, 183, 193, 226, 231, 241, 249, 255, + 258, 263, 271, 274, 276, 281, 289, 291, 296, 306, 310, 315, 317, 324, 326, + 336, 338, 350, 352, 363, 373, 386, 401, 408, 415, 420, 422, 3, 2, 3, 2, } var lexerDeserializer = antlr.NewATNDeserializer(nil) @@ -254,10 +244,10 @@ var lexerRuleNames = []string{ "T__0", "EQUALS", "NOT_EQUALS", "LESS", "LESS_EQUALS", "GREATER_EQUALS", "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE", "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK", - "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "TRUE", "FALSE", "NULL", "EXPONENT", - "DIGIT", "LETTER", "HEXDIGIT", "OCTDIGIT", "ESC_SEQ", "SPECIAL_ESC_CHAR", - "OCT_SEQ", "UNI_SEQ", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", - "NUM_UINT", "STRING", "RAW", "BYTES", "IDENTIFIER", + "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "TRUE", "FALSE", "NULL", "BACKSLASH", + "LETTER", "DIGIT", "EXPONENT", "HEXDIGIT", "RAW", "ESC_SEQ", "ESC_CHAR_SEQ", + "ESC_OCT_SEQ", "ESC_BYTE_SEQ", "ESC_UNI_SEQ", "WHITESPACE", "COMMENT", + "NUM_FLOAT", "NUM_INT", "NUM_UINT", "STRING", "BYTES", "IDENTIFIER", } type CELLexer struct { diff --git a/parser/gen/cel_listener.go b/parser/gen/cel_listener.go index c5018f0a..9e2a2af7 100644 --- a/parser/gen/cel_listener.go +++ b/parser/gen/cel_listener.go @@ -1,18 +1,4 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated from /Users/ozben/go/src/celgo/bin/../parser/gen/CEL.g4 by ANTLR 4.7. +// Generated from /Users/tswadell/lace/go/src/github.com/google/cel-go/bin/../parser/gen/CEL.g4 by ANTLR 4.7. package gen // CEL import "github.com/antlr/antlr4/runtime/Go/antlr" @@ -63,9 +49,6 @@ type CELListener interface { // EnterIdentOrGlobalCall is called when entering the IdentOrGlobalCall production. EnterIdentOrGlobalCall(c *IdentOrGlobalCallContext) - // EnterDeprecatedIn is called when entering the DeprecatedIn production. - EnterDeprecatedIn(c *DeprecatedInContext) - // EnterNested is called when entering the Nested production. EnterNested(c *NestedContext) @@ -153,9 +136,6 @@ type CELListener interface { // ExitIdentOrGlobalCall is called when exiting the IdentOrGlobalCall production. ExitIdentOrGlobalCall(c *IdentOrGlobalCallContext) - // ExitDeprecatedIn is called when exiting the DeprecatedIn production. - ExitDeprecatedIn(c *DeprecatedInContext) - // ExitNested is called when exiting the Nested production. ExitNested(c *NestedContext) diff --git a/parser/gen/cel_parser.go b/parser/gen/cel_parser.go index 51af0b91..55a3975f 100644 --- a/parser/gen/cel_parser.go +++ b/parser/gen/cel_parser.go @@ -1,18 +1,4 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated from /Users/ozben/go/src/celgo/bin/../parser/gen/CEL.g4 by ANTLR 4.7. +// Generated from /Users/tswadell/lace/go/src/github.com/google/cel-go/bin/../parser/gen/CEL.g4 by ANTLR 4.7. package gen // CEL import ( @@ -29,7 +15,7 @@ var _ = reflect.Copy var _ = strconv.Itoa var parserATN = []uint16{ - 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 38, 205, + 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 38, 199, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, @@ -43,85 +29,82 @@ var parserATN = []uint16{ 9, 107, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 117, 10, 9, 3, 9, 7, 9, 120, 10, 9, 12, 9, 14, 9, 123, 11, 9, 3, 10, 5, 10, 126, 10, 10, 3, 10, 3, 10, 3, 10, 5, 10, 131, 10, 10, 3, 10, 5, 10, 134, - 10, 10, 3, 10, 3, 10, 3, 10, 5, 10, 139, 10, 10, 3, 10, 3, 10, 3, 10, 3, - 10, 3, 10, 3, 10, 3, 10, 5, 10, 148, 10, 10, 3, 10, 5, 10, 151, 10, 10, - 3, 10, 3, 10, 3, 10, 5, 10, 156, 10, 10, 3, 10, 3, 10, 5, 10, 160, 10, - 10, 3, 11, 3, 11, 3, 11, 7, 11, 165, 10, 11, 12, 11, 14, 11, 168, 11, 11, - 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 7, 12, 177, 10, 12, 12, - 12, 14, 12, 180, 11, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, - 3, 13, 7, 13, 190, 10, 13, 12, 13, 14, 13, 193, 11, 13, 3, 14, 3, 14, 3, - 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 203, 10, 14, 3, 14, 2, 5, - 10, 12, 16, 15, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 2, 5, 3, - 2, 3, 9, 3, 2, 25, 27, 4, 2, 20, 20, 24, 24, 2, 229, 2, 28, 3, 2, 2, 2, - 4, 31, 3, 2, 2, 2, 6, 39, 3, 2, 2, 2, 8, 47, 3, 2, 2, 2, 10, 55, 3, 2, - 2, 2, 12, 66, 3, 2, 2, 2, 14, 93, 3, 2, 2, 2, 16, 95, 3, 2, 2, 2, 18, 159, - 3, 2, 2, 2, 20, 161, 3, 2, 2, 2, 22, 169, 3, 2, 2, 2, 24, 181, 3, 2, 2, - 2, 26, 202, 3, 2, 2, 2, 28, 29, 5, 4, 3, 2, 29, 30, 7, 2, 2, 3, 30, 3, - 3, 2, 2, 2, 31, 37, 5, 6, 4, 2, 32, 33, 7, 22, 2, 2, 33, 34, 5, 6, 4, 2, - 34, 35, 7, 23, 2, 2, 35, 36, 5, 4, 3, 2, 36, 38, 3, 2, 2, 2, 37, 32, 3, - 2, 2, 2, 37, 38, 3, 2, 2, 2, 38, 5, 3, 2, 2, 2, 39, 44, 5, 8, 5, 2, 40, - 41, 7, 11, 2, 2, 41, 43, 5, 8, 5, 2, 42, 40, 3, 2, 2, 2, 43, 46, 3, 2, - 2, 2, 44, 42, 3, 2, 2, 2, 44, 45, 3, 2, 2, 2, 45, 7, 3, 2, 2, 2, 46, 44, - 3, 2, 2, 2, 47, 52, 5, 10, 6, 2, 48, 49, 7, 10, 2, 2, 49, 51, 5, 10, 6, - 2, 50, 48, 3, 2, 2, 2, 51, 54, 3, 2, 2, 2, 52, 50, 3, 2, 2, 2, 52, 53, - 3, 2, 2, 2, 53, 9, 3, 2, 2, 2, 54, 52, 3, 2, 2, 2, 55, 56, 8, 6, 1, 2, - 56, 57, 5, 12, 7, 2, 57, 63, 3, 2, 2, 2, 58, 59, 12, 3, 2, 2, 59, 60, 9, - 2, 2, 2, 60, 62, 5, 10, 6, 4, 61, 58, 3, 2, 2, 2, 62, 65, 3, 2, 2, 2, 63, - 61, 3, 2, 2, 2, 63, 64, 3, 2, 2, 2, 64, 11, 3, 2, 2, 2, 65, 63, 3, 2, 2, - 2, 66, 67, 8, 7, 1, 2, 67, 68, 5, 14, 8, 2, 68, 77, 3, 2, 2, 2, 69, 70, - 12, 4, 2, 2, 70, 71, 9, 3, 2, 2, 71, 76, 5, 12, 7, 5, 72, 73, 12, 3, 2, - 2, 73, 74, 9, 4, 2, 2, 74, 76, 5, 12, 7, 4, 75, 69, 3, 2, 2, 2, 75, 72, - 3, 2, 2, 2, 76, 79, 3, 2, 2, 2, 77, 75, 3, 2, 2, 2, 77, 78, 3, 2, 2, 2, - 78, 13, 3, 2, 2, 2, 79, 77, 3, 2, 2, 2, 80, 94, 5, 16, 9, 2, 81, 83, 7, - 21, 2, 2, 82, 81, 3, 2, 2, 2, 83, 84, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, - 85, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 94, 5, 16, 9, 2, 87, 89, 7, 20, - 2, 2, 88, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, - 3, 2, 2, 2, 91, 92, 3, 2, 2, 2, 92, 94, 5, 16, 9, 2, 93, 80, 3, 2, 2, 2, - 93, 82, 3, 2, 2, 2, 93, 88, 3, 2, 2, 2, 94, 15, 3, 2, 2, 2, 95, 96, 8, - 9, 1, 2, 96, 97, 5, 18, 10, 2, 97, 121, 3, 2, 2, 2, 98, 99, 12, 5, 2, 2, - 99, 100, 7, 18, 2, 2, 100, 106, 7, 38, 2, 2, 101, 103, 7, 16, 2, 2, 102, - 104, 5, 20, 11, 2, 103, 102, 3, 2, 2, 2, 103, 104, 3, 2, 2, 2, 104, 105, - 3, 2, 2, 2, 105, 107, 7, 17, 2, 2, 106, 101, 3, 2, 2, 2, 106, 107, 3, 2, - 2, 2, 107, 120, 3, 2, 2, 2, 108, 109, 12, 4, 2, 2, 109, 110, 7, 12, 2, - 2, 110, 111, 5, 4, 3, 2, 111, 112, 7, 13, 2, 2, 112, 120, 3, 2, 2, 2, 113, - 114, 12, 3, 2, 2, 114, 116, 7, 14, 2, 2, 115, 117, 5, 22, 12, 2, 116, 115, - 3, 2, 2, 2, 116, 117, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 120, 7, 15, - 2, 2, 119, 98, 3, 2, 2, 2, 119, 108, 3, 2, 2, 2, 119, 113, 3, 2, 2, 2, - 120, 123, 3, 2, 2, 2, 121, 119, 3, 2, 2, 2, 121, 122, 3, 2, 2, 2, 122, - 17, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 124, 126, 7, 18, 2, 2, 125, 124, - 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 127, 3, 2, 2, 2, 127, 133, 7, 38, - 2, 2, 128, 130, 7, 16, 2, 2, 129, 131, 5, 20, 11, 2, 130, 129, 3, 2, 2, - 2, 130, 131, 3, 2, 2, 2, 131, 132, 3, 2, 2, 2, 132, 134, 7, 17, 2, 2, 133, - 128, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 160, 3, 2, 2, 2, 135, 136, - 7, 3, 2, 2, 136, 138, 7, 16, 2, 2, 137, 139, 5, 20, 11, 2, 138, 137, 3, - 2, 2, 2, 138, 139, 3, 2, 2, 2, 139, 140, 3, 2, 2, 2, 140, 160, 7, 17, 2, - 2, 141, 142, 7, 16, 2, 2, 142, 143, 5, 4, 3, 2, 143, 144, 7, 17, 2, 2, - 144, 160, 3, 2, 2, 2, 145, 147, 7, 12, 2, 2, 146, 148, 5, 20, 11, 2, 147, - 146, 3, 2, 2, 2, 147, 148, 3, 2, 2, 2, 148, 150, 3, 2, 2, 2, 149, 151, - 7, 19, 2, 2, 150, 149, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 152, 3, 2, - 2, 2, 152, 160, 7, 13, 2, 2, 153, 155, 7, 14, 2, 2, 154, 156, 5, 24, 13, - 2, 155, 154, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, - 160, 7, 15, 2, 2, 158, 160, 5, 26, 14, 2, 159, 125, 3, 2, 2, 2, 159, 135, - 3, 2, 2, 2, 159, 141, 3, 2, 2, 2, 159, 145, 3, 2, 2, 2, 159, 153, 3, 2, - 2, 2, 159, 158, 3, 2, 2, 2, 160, 19, 3, 2, 2, 2, 161, 166, 5, 4, 3, 2, - 162, 163, 7, 19, 2, 2, 163, 165, 5, 4, 3, 2, 164, 162, 3, 2, 2, 2, 165, - 168, 3, 2, 2, 2, 166, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 21, 3, - 2, 2, 2, 168, 166, 3, 2, 2, 2, 169, 170, 7, 38, 2, 2, 170, 171, 7, 23, - 2, 2, 171, 178, 5, 4, 3, 2, 172, 173, 7, 19, 2, 2, 173, 174, 7, 38, 2, - 2, 174, 175, 7, 23, 2, 2, 175, 177, 5, 4, 3, 2, 176, 172, 3, 2, 2, 2, 177, - 180, 3, 2, 2, 2, 178, 176, 3, 2, 2, 2, 178, 179, 3, 2, 2, 2, 179, 23, 3, - 2, 2, 2, 180, 178, 3, 2, 2, 2, 181, 182, 5, 4, 3, 2, 182, 183, 7, 23, 2, - 2, 183, 191, 5, 4, 3, 2, 184, 185, 7, 19, 2, 2, 185, 186, 5, 4, 3, 2, 186, - 187, 7, 23, 2, 2, 187, 188, 5, 4, 3, 2, 188, 190, 3, 2, 2, 2, 189, 184, - 3, 2, 2, 2, 190, 193, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, - 2, 2, 192, 25, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 194, 203, 7, 34, 2, 2, - 195, 203, 7, 35, 2, 2, 196, 203, 7, 33, 2, 2, 197, 203, 7, 36, 2, 2, 198, - 203, 7, 37, 2, 2, 199, 203, 7, 28, 2, 2, 200, 203, 7, 29, 2, 2, 201, 203, - 7, 30, 2, 2, 202, 194, 3, 2, 2, 2, 202, 195, 3, 2, 2, 2, 202, 196, 3, 2, - 2, 2, 202, 197, 3, 2, 2, 2, 202, 198, 3, 2, 2, 2, 202, 199, 3, 2, 2, 2, - 202, 200, 3, 2, 2, 2, 202, 201, 3, 2, 2, 2, 203, 27, 3, 2, 2, 2, 28, 37, - 44, 52, 63, 75, 77, 84, 90, 93, 103, 106, 116, 119, 121, 125, 130, 133, - 138, 147, 150, 155, 159, 166, 178, 191, 202, + 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 142, 10, 10, 3, + 10, 5, 10, 145, 10, 10, 3, 10, 3, 10, 3, 10, 5, 10, 150, 10, 10, 3, 10, + 3, 10, 5, 10, 154, 10, 10, 3, 11, 3, 11, 3, 11, 7, 11, 159, 10, 11, 12, + 11, 14, 11, 162, 11, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, + 7, 12, 171, 10, 12, 12, 12, 14, 12, 174, 11, 12, 3, 13, 3, 13, 3, 13, 3, + 13, 3, 13, 3, 13, 3, 13, 3, 13, 7, 13, 184, 10, 13, 12, 13, 14, 13, 187, + 11, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, + 197, 10, 14, 3, 14, 2, 5, 10, 12, 16, 15, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 2, 5, 3, 2, 3, 9, 3, 2, 25, 27, 4, 2, 20, 20, 24, 24, 2, + 221, 2, 28, 3, 2, 2, 2, 4, 31, 3, 2, 2, 2, 6, 39, 3, 2, 2, 2, 8, 47, 3, + 2, 2, 2, 10, 55, 3, 2, 2, 2, 12, 66, 3, 2, 2, 2, 14, 93, 3, 2, 2, 2, 16, + 95, 3, 2, 2, 2, 18, 153, 3, 2, 2, 2, 20, 155, 3, 2, 2, 2, 22, 163, 3, 2, + 2, 2, 24, 175, 3, 2, 2, 2, 26, 196, 3, 2, 2, 2, 28, 29, 5, 4, 3, 2, 29, + 30, 7, 2, 2, 3, 30, 3, 3, 2, 2, 2, 31, 37, 5, 6, 4, 2, 32, 33, 7, 22, 2, + 2, 33, 34, 5, 6, 4, 2, 34, 35, 7, 23, 2, 2, 35, 36, 5, 4, 3, 2, 36, 38, + 3, 2, 2, 2, 37, 32, 3, 2, 2, 2, 37, 38, 3, 2, 2, 2, 38, 5, 3, 2, 2, 2, + 39, 44, 5, 8, 5, 2, 40, 41, 7, 11, 2, 2, 41, 43, 5, 8, 5, 2, 42, 40, 3, + 2, 2, 2, 43, 46, 3, 2, 2, 2, 44, 42, 3, 2, 2, 2, 44, 45, 3, 2, 2, 2, 45, + 7, 3, 2, 2, 2, 46, 44, 3, 2, 2, 2, 47, 52, 5, 10, 6, 2, 48, 49, 7, 10, + 2, 2, 49, 51, 5, 10, 6, 2, 50, 48, 3, 2, 2, 2, 51, 54, 3, 2, 2, 2, 52, + 50, 3, 2, 2, 2, 52, 53, 3, 2, 2, 2, 53, 9, 3, 2, 2, 2, 54, 52, 3, 2, 2, + 2, 55, 56, 8, 6, 1, 2, 56, 57, 5, 12, 7, 2, 57, 63, 3, 2, 2, 2, 58, 59, + 12, 3, 2, 2, 59, 60, 9, 2, 2, 2, 60, 62, 5, 10, 6, 4, 61, 58, 3, 2, 2, + 2, 62, 65, 3, 2, 2, 2, 63, 61, 3, 2, 2, 2, 63, 64, 3, 2, 2, 2, 64, 11, + 3, 2, 2, 2, 65, 63, 3, 2, 2, 2, 66, 67, 8, 7, 1, 2, 67, 68, 5, 14, 8, 2, + 68, 77, 3, 2, 2, 2, 69, 70, 12, 4, 2, 2, 70, 71, 9, 3, 2, 2, 71, 76, 5, + 12, 7, 5, 72, 73, 12, 3, 2, 2, 73, 74, 9, 4, 2, 2, 74, 76, 5, 12, 7, 4, + 75, 69, 3, 2, 2, 2, 75, 72, 3, 2, 2, 2, 76, 79, 3, 2, 2, 2, 77, 75, 3, + 2, 2, 2, 77, 78, 3, 2, 2, 2, 78, 13, 3, 2, 2, 2, 79, 77, 3, 2, 2, 2, 80, + 94, 5, 16, 9, 2, 81, 83, 7, 21, 2, 2, 82, 81, 3, 2, 2, 2, 83, 84, 3, 2, + 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 94, + 5, 16, 9, 2, 87, 89, 7, 20, 2, 2, 88, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, + 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 92, 3, 2, 2, 2, 92, 94, + 5, 16, 9, 2, 93, 80, 3, 2, 2, 2, 93, 82, 3, 2, 2, 2, 93, 88, 3, 2, 2, 2, + 94, 15, 3, 2, 2, 2, 95, 96, 8, 9, 1, 2, 96, 97, 5, 18, 10, 2, 97, 121, + 3, 2, 2, 2, 98, 99, 12, 5, 2, 2, 99, 100, 7, 18, 2, 2, 100, 106, 7, 38, + 2, 2, 101, 103, 7, 16, 2, 2, 102, 104, 5, 20, 11, 2, 103, 102, 3, 2, 2, + 2, 103, 104, 3, 2, 2, 2, 104, 105, 3, 2, 2, 2, 105, 107, 7, 17, 2, 2, 106, + 101, 3, 2, 2, 2, 106, 107, 3, 2, 2, 2, 107, 120, 3, 2, 2, 2, 108, 109, + 12, 4, 2, 2, 109, 110, 7, 12, 2, 2, 110, 111, 5, 4, 3, 2, 111, 112, 7, + 13, 2, 2, 112, 120, 3, 2, 2, 2, 113, 114, 12, 3, 2, 2, 114, 116, 7, 14, + 2, 2, 115, 117, 5, 22, 12, 2, 116, 115, 3, 2, 2, 2, 116, 117, 3, 2, 2, + 2, 117, 118, 3, 2, 2, 2, 118, 120, 7, 15, 2, 2, 119, 98, 3, 2, 2, 2, 119, + 108, 3, 2, 2, 2, 119, 113, 3, 2, 2, 2, 120, 123, 3, 2, 2, 2, 121, 119, + 3, 2, 2, 2, 121, 122, 3, 2, 2, 2, 122, 17, 3, 2, 2, 2, 123, 121, 3, 2, + 2, 2, 124, 126, 7, 18, 2, 2, 125, 124, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, + 126, 127, 3, 2, 2, 2, 127, 133, 7, 38, 2, 2, 128, 130, 7, 16, 2, 2, 129, + 131, 5, 20, 11, 2, 130, 129, 3, 2, 2, 2, 130, 131, 3, 2, 2, 2, 131, 132, + 3, 2, 2, 2, 132, 134, 7, 17, 2, 2, 133, 128, 3, 2, 2, 2, 133, 134, 3, 2, + 2, 2, 134, 154, 3, 2, 2, 2, 135, 136, 7, 16, 2, 2, 136, 137, 5, 4, 3, 2, + 137, 138, 7, 17, 2, 2, 138, 154, 3, 2, 2, 2, 139, 141, 7, 12, 2, 2, 140, + 142, 5, 20, 11, 2, 141, 140, 3, 2, 2, 2, 141, 142, 3, 2, 2, 2, 142, 144, + 3, 2, 2, 2, 143, 145, 7, 19, 2, 2, 144, 143, 3, 2, 2, 2, 144, 145, 3, 2, + 2, 2, 145, 146, 3, 2, 2, 2, 146, 154, 7, 13, 2, 2, 147, 149, 7, 14, 2, + 2, 148, 150, 5, 24, 13, 2, 149, 148, 3, 2, 2, 2, 149, 150, 3, 2, 2, 2, + 150, 151, 3, 2, 2, 2, 151, 154, 7, 15, 2, 2, 152, 154, 5, 26, 14, 2, 153, + 125, 3, 2, 2, 2, 153, 135, 3, 2, 2, 2, 153, 139, 3, 2, 2, 2, 153, 147, + 3, 2, 2, 2, 153, 152, 3, 2, 2, 2, 154, 19, 3, 2, 2, 2, 155, 160, 5, 4, + 3, 2, 156, 157, 7, 19, 2, 2, 157, 159, 5, 4, 3, 2, 158, 156, 3, 2, 2, 2, + 159, 162, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, + 21, 3, 2, 2, 2, 162, 160, 3, 2, 2, 2, 163, 164, 7, 38, 2, 2, 164, 165, + 7, 23, 2, 2, 165, 172, 5, 4, 3, 2, 166, 167, 7, 19, 2, 2, 167, 168, 7, + 38, 2, 2, 168, 169, 7, 23, 2, 2, 169, 171, 5, 4, 3, 2, 170, 166, 3, 2, + 2, 2, 171, 174, 3, 2, 2, 2, 172, 170, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, + 173, 23, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 175, 176, 5, 4, 3, 2, 176, 177, + 7, 23, 2, 2, 177, 185, 5, 4, 3, 2, 178, 179, 7, 19, 2, 2, 179, 180, 5, + 4, 3, 2, 180, 181, 7, 23, 2, 2, 181, 182, 5, 4, 3, 2, 182, 184, 3, 2, 2, + 2, 183, 178, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 185, + 186, 3, 2, 2, 2, 186, 25, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 188, 197, 7, + 34, 2, 2, 189, 197, 7, 35, 2, 2, 190, 197, 7, 33, 2, 2, 191, 197, 7, 36, + 2, 2, 192, 197, 7, 37, 2, 2, 193, 197, 7, 28, 2, 2, 194, 197, 7, 29, 2, + 2, 195, 197, 7, 30, 2, 2, 196, 188, 3, 2, 2, 2, 196, 189, 3, 2, 2, 2, 196, + 190, 3, 2, 2, 2, 196, 191, 3, 2, 2, 2, 196, 192, 3, 2, 2, 2, 196, 193, + 3, 2, 2, 2, 196, 194, 3, 2, 2, 2, 196, 195, 3, 2, 2, 2, 197, 27, 3, 2, + 2, 2, 27, 37, 44, 52, 63, 75, 77, 84, 90, 93, 103, 106, 116, 119, 121, + 125, 130, 133, 141, 144, 149, 153, 160, 172, 185, 196, } var deserializer = antlr.NewATNDeserializer(nil) var deserializedATN = deserializer.DeserializeFromUInt16(parserATN) @@ -1653,7 +1636,7 @@ func (p *CELParser) Unary() (localctx IUnaryContext) { p.GetErrorHandler().Sync(p) switch p.GetTokenStream().LA(1) { - case CELParserT__0, CELParserLBRACKET, CELParserLBRACE, CELParserLPAREN, CELParserDOT, CELParserTRUE, CELParserFALSE, CELParserNULL, CELParserNUM_FLOAT, CELParserNUM_INT, CELParserNUM_UINT, CELParserSTRING, CELParserBYTES, CELParserIDENTIFIER: + case CELParserLBRACKET, CELParserLBRACE, CELParserLPAREN, CELParserDOT, CELParserTRUE, CELParserFALSE, CELParserNULL, CELParserNUM_FLOAT, CELParserNUM_INT, CELParserNUM_UINT, CELParserSTRING, CELParserBYTES, CELParserIDENTIFIER: localctx = NewStatementExprContext(p, localctx) p.EnterOuterAlt(localctx, 1) { @@ -2137,7 +2120,7 @@ func (p *CELParser) statement(_p int) (localctx IStatementContext) { p.GetErrorHandler().Sync(p) _la = p.GetTokenStream().LA(1) - if (((_la)&-(0x1f+1)) == 0 && ((1<:1:2: Syntax error: token recognition error at: '@' | *@a | b | .^ -ERROR: :1:1: Syntax error: extraneous input '*' expecting {'in', '[', '{', '(', '.', '-', '!', 'true', 'false', 'null', NUM_FLOAT, NUM_INT, NUM_UINT, STRING, BYTES, IDENTIFIER} +ERROR: :1:1: Syntax error: extraneous input '*' expecting {'[', '{', '(', '.', '-', '!', 'true', 'false', 'null', NUM_FLOAT, NUM_INT, NUM_UINT, STRING, BYTES, IDENTIFIER} | *@a | b | ^ ERROR: :1:5: Syntax error: token recognition error at: '| ' @@ -496,7 +496,7 @@ ERROR: :1:13: expected a qualified name ERROR: :1:5: Syntax error: token recognition error at: '$' | 1 + $ | ....^ -ERROR: :1:6: Syntax error: mismatched input '' expecting {'in', '[', '{', '(', '.', '-', '!', 'true', 'false', 'null', NUM_FLOAT, NUM_INT, NUM_UINT, STRING, BYTES, IDENTIFIER} +ERROR: :1:6: Syntax error: mismatched input '' expecting {'[', '{', '(', '.', '-', '!', 'true', 'false', 'null', NUM_FLOAT, NUM_INT, NUM_UINT, STRING, BYTES, IDENTIFIER} | 1 + $ | .....^ `, @@ -598,10 +598,10 @@ ERROR: :1:7: argument must be a simple name { I: `1 + +`, E: ` -ERROR: :1:5: Syntax error: mismatched input '+' expecting {'in', '[', '{', '(', '.', '-', '!', 'true', 'false', 'null', NUM_FLOAT, NUM_INT, NUM_UINT, STRING, BYTES, IDENTIFIER} +ERROR: :1:5: Syntax error: mismatched input '+' expecting {'[', '{', '(', '.', '-', '!', 'true', 'false', 'null', NUM_FLOAT, NUM_INT, NUM_UINT, STRING, BYTES, IDENTIFIER} | 1 + + | ....^ -ERROR: :1:6: Syntax error: mismatched input '' expecting {'in', '[', '{', '(', '.', '-', '!', 'true', 'false', 'null', NUM_FLOAT, NUM_INT, NUM_UINT, STRING, BYTES, IDENTIFIER} +ERROR: :1:6: Syntax error: mismatched input '' expecting {'[', '{', '(', '.', '-', '!', 'true', 'false', 'null', NUM_FLOAT, NUM_INT, NUM_UINT, STRING, BYTES, IDENTIFIER} | 1 + + | .....^ `, @@ -620,6 +620,57 @@ ERROR: :1:6: Syntax error: mismatched input '' expecting {'in', '[', | {"a": 1}."a" | .........^`, }, + + { + I: `"\xC3\XBF"`, + P: `"ÿ"^#1:*syntax.Literal_StringValue#`, + }, + + { + I: `"\303\277"`, + P: `"ÿ"^#1:*syntax.Literal_StringValue#`, + }, + + { + I: `"hi\u263A \u263Athere"`, + P: `"hi☺ ☺there"^#1:*syntax.Literal_StringValue#`, + }, + + { + I: `"\U000003A8\?"`, + P: `"Ψ?"^#1:*syntax.Literal_StringValue#`, + }, + + { + I: `"\a\b\f\n\r\t\v'\"\\\? Legal escapes"`, + P: `"\a\b\f\n\r\t\v'\"\\? Legal escapes"^#1:*syntax.Literal_StringValue#`, + }, + + { + I: `"\xFh"`, + E: `ERROR: :1:1: Syntax error: token recognition error at: '"\xFh' + | "\xFh" + | ^ + ERROR: :1:6: Syntax error: token recognition error at: '"' + | "\xFh" + | .....^ + ERROR: :1:7: Syntax error: mismatched input '' expecting {'[', '{', '(', '.', '-', '!', 'true', 'false', 'null', NUM_FLOAT, NUM_INT, NUM_UINT, STRING, BYTES, IDENTIFIER} + | "\xFh" + | ......^`, + }, + + { + I: `"\a\b\f\n\r\t\v\'\"\\\? Illegal escape \>"`, + E: `ERROR: :1:1: Syntax error: token recognition error at: '"\a\b\f\n\r\t\v\'\"\\\? Illegal escape \>' + | "\a\b\f\n\r\t\v\'\"\\\? Illegal escape \>" + | ^ + ERROR: :1:42: Syntax error: token recognition error at: '"' + | "\a\b\f\n\r\t\v\'\"\\\? Illegal escape \>" + | .........................................^ + ERROR: :1:43: Syntax error: mismatched input '' expecting {'[', '{', '(', '.', '-', '!', 'true', 'false', 'null', NUM_FLOAT, NUM_INT, NUM_UINT, STRING, BYTES, IDENTIFIER} + | "\a\b\f\n\r\t\v\'\"\\\? Illegal escape \>" + | ..........................................^`, + }, } type testInfo struct { diff --git a/parser/unescape_test.go b/parser/unescape_test.go index 39291aad..10bd3477 100644 --- a/parser/unescape_test.go +++ b/parser/unescape_test.go @@ -112,3 +112,21 @@ func TestUnescapeUnicodeSequence(t *testing.T) { t.Errorf("Got '%v', wanted '%v'", text, `☺☺`) } } + +func TestUnescapeLegalEscapes(t *testing.T) { + text, err := unescape(`"\a\b\f\n\r\t\v\'\"\\\? Legal escapes"`) + if err != nil { + t.Error(err) + } + if text != "\a\b\f\n\r\t\v'\"\\? Legal escapes" { + t.Errorf("Got '%v', wanted '%v'", text, "\a\b\f\n\r\t\v'\"\\? Legal escapes") + } +} + +func TestUnescapeIllegalEscapes(t *testing.T) { + // The first escape sequences are legal, but the '\>' is not. + text, err := unescape(`"\a\b\f\n\r\t\v\'\"\\\? Illegal escape \>"`) + if err == nil { + t.Errorf("Got '%v', expected error", text) + } +}