From 422312dd947f36ececcffb621f518e1823a9dfeb Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 2 Apr 2024 15:14:38 +0100 Subject: [PATCH 001/130] initial setup changes --- pkg/analyzer/analyzer.go | 8 +++++++ pkg/model/model.go | 1 + pkg/parser/bicep/parser.go | 49 ++++++++++++++++++++++++++++++++++++++ pkg/scan/scan.go | 10 +++++++- 4 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 pkg/parser/bicep/parser.go diff --git a/pkg/analyzer/analyzer.go b/pkg/analyzer/analyzer.go index 0d4a0db48bb..10172fc941b 100644 --- a/pkg/analyzer/analyzer.go +++ b/pkg/analyzer/analyzer.go @@ -88,6 +88,7 @@ var ( ".cfg": true, ".conf": true, ".ini": true, + ".bicep": true, } supportedRegexes = map[string][]string{ "azureresourcemanager": append(armRegexTypes, arm), @@ -117,6 +118,7 @@ const ( json = ".json" sh = ".sh" arm = "azureresourcemanager" + bicep = "bicep" kubernetes = "kubernetes" terraform = "terraform" gdm = "googledeploymentmanager" @@ -393,6 +395,12 @@ func (a *analyzerInfo) worker(results, unwanted chan<- string, locCount chan<- i results <- terraform locCount <- linesCount } + // Bicep + case ".bicep": + if a.isAvailableType(bicep) { + results <- bicep + locCount <- linesCount + } // GRPC case ".proto": if a.isAvailableType(grpc) { diff --git a/pkg/model/model.go b/pkg/model/model.go index e0be5089ed1..bbbfc28fec1 100644 --- a/pkg/model/model.go +++ b/pkg/model/model.go @@ -13,6 +13,7 @@ import ( // Constants to describe what kind of file refers const ( KindTerraform FileKind = "TF" + KindBICEP FileKind = "BICEP" KindJSON FileKind = "JSON" KindYAML FileKind = "YAML" KindYML FileKind = "YML" diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go new file mode 100644 index 00000000000..add9ea0a7dd --- /dev/null +++ b/pkg/parser/bicep/parser.go @@ -0,0 +1,49 @@ +package bicep + +import ( + "github.com/Checkmarx/kics/pkg/model" +) + +type Parser struct { +} + +// Parse - parses bicep to JSON_Bicep template (json file) +func (p *Parser) Parse(_ string, fileContent []byte) ([]model.Document, []int, error) { + + return nil, nil, nil +} + +// GetKind returns the kind of the parser +func (p *Parser) GetKind() model.FileKind { + return model.KindBICEP +} + +// SupportedExtensions returns Bicep extensions +func (p *Parser) SupportedExtensions() []string { + return []string{".bicep"} +} + +// SupportedTypes returns types supported by this parser, which are bicep files +func (p *Parser) SupportedTypes() map[string]bool { + return map[string]bool{"bicep": true, "azureresourcemanager": true} +} + +// GetCommentToken return the comment token of Bicep files - # +func (p *Parser) GetCommentToken() string { + return "//" +} + +// StringifyContent converts original content into string formatted version +func (p *Parser) StringifyContent(content []byte) (string, error) { + return string(content), nil +} + +// Resolve resolves bicep files variables +func (p *Parser) Resolve(fileContent []byte, _ string, _ bool) ([]byte, error) { + return fileContent, nil +} + +// GetResolvedFiles returns the list of files that are resolved +func (p *Parser) GetResolvedFiles() map[string]model.ResolvedFile { + return make(map[string]model.ResolvedFile) +} diff --git a/pkg/scan/scan.go b/pkg/scan/scan.go index bdf9c4c6951..d3d4fb5e3ad 100644 --- a/pkg/scan/scan.go +++ b/pkg/scan/scan.go @@ -4,6 +4,7 @@ package scan import ( "context" "os" + "slices" "github.com/Checkmarx/kics/assets" "github.com/Checkmarx/kics/pkg/engine" @@ -15,6 +16,7 @@ import ( "github.com/Checkmarx/kics/pkg/parser" ansibleConfigParser "github.com/Checkmarx/kics/pkg/parser/ansible/ini/config" ansibleHostsParser "github.com/Checkmarx/kics/pkg/parser/ansible/ini/hosts" + bicepParser "github.com/Checkmarx/kics/pkg/parser/bicep" buildahParser "github.com/Checkmarx/kics/pkg/parser/buildah" dockerParser "github.com/Checkmarx/kics/pkg/parser/docker" protoParser "github.com/Checkmarx/kics/pkg/parser/grpc" @@ -55,9 +57,14 @@ func (c *Client) initScan(ctx context.Context) (*executeScanParameters, error) { return nil, nil } + platform := c.ScanParams.Platform + if slices.Contains(platform, "bicep") && !slices.Contains(platform, "azureresourcemanager") { + platform = append(platform, "azureresourcemanager") + } + querySource := source.NewFilesystemSource( c.ScanParams.QueriesPath, - c.ScanParams.Platform, + platform, c.ScanParams.CloudProvider, c.ScanParams.LibrariesPath, c.ScanParams.ExperimentalQueries) @@ -229,6 +236,7 @@ func (c *Client) createService( Add(&jsonParser.Parser{}). Add(&yamlParser.Parser{}). Add(terraformParser.NewDefaultWithVarsPath(c.ScanParams.TerraformVarsPath)). + Add(&bicepParser.Parser{}). Add(&dockerParser.Parser{}). Add(&protoParser.Parser{}). Add(&buildahParser.Parser{}). From 2468d7a0f2c7378ea378acd10d947a790db1e7bf Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 2 Apr 2024 16:43:09 +0100 Subject: [PATCH 002/130] created antlr for bicep --- pkg/parser/bicep/antlr/bicep.g4 | 170 ++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 pkg/parser/bicep/antlr/bicep.g4 diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 new file mode 100644 index 00000000000..46d7c3900ba --- /dev/null +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -0,0 +1,170 @@ +grammar bicep; + +// program -> statement* EOF +program: statement* EOF; + +statement: parameterDecl | variableDecl | resourceDecl | NL; + +// parameterDecl -> decorator* "parameter" IDENTIFIER(name) typeExpression parameterDefaultValue? NL +// | decorator* "parameter" IDENTIFIER(name) "resource" interpString(type) parameterDefaultValue? NL +// | +parameterDecl: + decorator* PARAM name = identifier ( + typeExpression parameterDefaultValue? + | RESOURCE type = interpString parameterDefaultValue? + ) NL; + +// parameterDefaultValue -> "=" expression +parameterDefaultValue: ASSIGN expression; + +// variableDecl -> decorator* "variable" IDENTIFIER(name) "=" expression NL +variableDecl: + decorator* VAR name = identifier ASSIGN expression NL; + +// resourceDecl -> decorator* "resource" IDENTIFIER(name) interpString(type) "existing"? "=" (ifCondition | object | forExpression) NL +resourceDecl: + decorator* RESOURCE name = identifier type = interpString ASSIGN ( + object + ) NL; + +// interpString -> stringLeftPiece ( expression stringMiddlePiece )* expression stringRightPiece | stringComplete +interpString: + STRING_LEFT_PIECE (expression STRING_MIDDLE_PIECE)* expression STRING_RIGHT_PIECE + | STRING_COMPLETE; + +// expression -> expression "[" expression "]" | expression "." IDENTIFIER(property) | expression +// ":" IDENTIFIER(name) +expression: + expression OBRACK expression CBRACK + | expression DOT property = identifier + | expression COL name = identifier + | primaryExpression; + +// primaryExpression -> literalValue | interpString | multilineString | array | object | +// parenthesizedExpression +primaryExpression: + literalValue + | interpString + | MULTILINE_STRING + | array + | object + | parenthesizedExpression; + +// parenthesizedExpression -> "(" expression ")" +parenthesizedExpression: OPAR expression CPAR; + +// typeExpression -> singularTypeExpression ("|" singularTypeExpression)* +typeExpression: type = identifier (PIPE type = identifier)*; + +// literalValue -> NUMBER | "true" | "false" | "null" +literalValue: NUMBER | TRUE | FALSE | NULL | identifier; + +// object -> "{" ( NL+ ( objectProperty NL+ )* )? "}" +object: OBRACE (NL+ ( objectProperty NL+)*)? CBRACE; + +// objectProperty -> ( IDENTIFIER(name) | interpString ) ":" expression +objectProperty: (name = identifier | interpString) COL expression; + +// array -> "[" ( NL+ arrayItem* )? "]" +array: OBRACK (NL+ arrayItem*)? CBRACK; + +// arrayItem -> expression NL+ +arrayItem: expression NL+; + +// decorator -> "@" decoratorExpression NL +decorator: AT decoratorExpression NL; + +// decoratorExpression -> functionCall | memberExpression "." functionCall +decoratorExpression: functionCall | expression DOT functionCall; + +// functionCall -> IDENTIFIER "(" argumentList? ")" +functionCall: identifier OPAR argumentList? CPAR; + +// argumentList -> expression ("," expression)* +argumentList: expression (COMMA expression)*; + +identifier: + IDENTIFIER + | PARAM + | RESOURCE + | VAR + | TRUE + | FALSE + | NULL + | STRING + | INT + | BOOL; + +// multilineString -> "'''" + MULTILINESTRINGCHAR+ + "'''" +MULTILINE_STRING: '\'\'\'' .*? '\'\'\''; + +AT: '@'; + +COMMA: ','; + +OBRACK: '['; + +CBRACK: ']'; + +OPAR: '('; + +CPAR: ')'; + +DOT: '.'; + +PIPE: '|'; + +COL: ':'; + +ASSIGN: '='; + +OBRACE: '{'; + +CBRACE: '}'; + +PARAM: 'param'; + +VAR: 'var'; + +TRUE: 'true'; + +FALSE: 'false'; + +NULL: 'null'; + +RESOURCE: 'resource'; + +// stringLeftPiece -> "'" STRINGCHAR* "${" +STRING_LEFT_PIECE: '\'' STRINGCHAR* '${'; + +// stringMiddlePiece -> "}" STRINGCHAR* "${" +STRING_MIDDLE_PIECE: '}' STRINGCHAR* '${'; + +// stringRightPiece -> "}" STRINGCHAR* "'" +STRING_RIGHT_PIECE: '}' STRINGCHAR* '\''; + +// stringComplete -> "'" STRINGCHAR* "'" +STRING_COMPLETE: '\'' STRINGCHAR* '\''; + +STRING: 'string'; + +INT: 'int'; + +BOOL: 'bool'; + +IDENTIFIER: [a-zA-Z_] [a-zA-Z_0-9]*; + +NUMBER: [0-9]+ ('.' [0-9]+)?; + +// NL -> ("\n" | "\r")+ +NL: [\r\n]+; + +SPACES: [ \t]+ -> skip; + +UNKNOWN: .; + +fragment STRINGCHAR: ~[\\'\n\r\t$] | ESCAPE; + +fragment ESCAPE: '\\' ([\\'nrt$] | 'u{' HEX+ '}'); + +fragment HEX: [0-9a-fA-F]; \ No newline at end of file From 8f3012611d5f9f5de4b42bac1ba8d27d05dbe5d6 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Tue, 2 Apr 2024 17:18:39 +0100 Subject: [PATCH 003/130] generation of antlr files for parser --- pkg/parser/bicep/antlr/parser/bicep.interp | 94 + pkg/parser/bicep/antlr/parser/bicep.tokens | 52 + .../bicep/antlr/parser/bicepLexer.interp | 113 + .../bicep/antlr/parser/bicepLexer.tokens | 52 + .../bicep/antlr/parser/bicep_base_listener.go | 148 + .../bicep/antlr/parser/bicep_base_visitor.go | 93 + pkg/parser/bicep/antlr/parser/bicep_lexer.go | 250 + .../bicep/antlr/parser/bicep_listener.go | 136 + pkg/parser/bicep/antlr/parser/bicep_parser.go | 4664 +++++++++++++++++ .../bicep/antlr/parser/bicep_visitor.go | 73 + 10 files changed, 5675 insertions(+) create mode 100644 pkg/parser/bicep/antlr/parser/bicep.interp create mode 100644 pkg/parser/bicep/antlr/parser/bicep.tokens create mode 100644 pkg/parser/bicep/antlr/parser/bicepLexer.interp create mode 100644 pkg/parser/bicep/antlr/parser/bicepLexer.tokens create mode 100644 pkg/parser/bicep/antlr/parser/bicep_base_listener.go create mode 100644 pkg/parser/bicep/antlr/parser/bicep_base_visitor.go create mode 100644 pkg/parser/bicep/antlr/parser/bicep_lexer.go create mode 100644 pkg/parser/bicep/antlr/parser/bicep_listener.go create mode 100644 pkg/parser/bicep/antlr/parser/bicep_parser.go create mode 100644 pkg/parser/bicep/antlr/parser/bicep_visitor.go diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp new file mode 100644 index 00000000000..ca23f806100 --- /dev/null +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -0,0 +1,94 @@ +token literal names: +null +null +'@' +',' +'[' +']' +'(' +')' +'.' +'|' +':' +'=' +'{' +'}' +'param' +'var' +'true' +'false' +'null' +'resource' +null +null +null +null +'string' +'int' +'bool' +null +null +null +null +null + +token symbolic names: +null +MULTILINE_STRING +AT +COMMA +OBRACK +CBRACK +OPAR +CPAR +DOT +PIPE +COL +ASSIGN +OBRACE +CBRACE +PARAM +VAR +TRUE +FALSE +NULL +RESOURCE +STRING_LEFT_PIECE +STRING_MIDDLE_PIECE +STRING_RIGHT_PIECE +STRING_COMPLETE +STRING +INT +BOOL +IDENTIFIER +NUMBER +NL +SPACES +UNKNOWN + +rule names: +program +statement +parameterDecl +parameterDefaultValue +variableDecl +resourceDecl +interpString +expression +primaryExpression +parenthesizedExpression +typeExpression +literalValue +object +objectProperty +array +arrayItem +decorator +decoratorExpression +functionCall +argumentList +identifier + + +atn: +[4, 1, 31, 245, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 55, 8, 1, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 67, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 72, 8, 2, 3, 2, 74, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 94, 8, 5, 10, 5, 12, 5, 97, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 119, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 146, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 5, 10, 155, 8, 10, 10, 10, 12, 10, 158, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 165, 8, 11, 1, 12, 1, 12, 4, 12, 169, 8, 12, 11, 12, 12, 12, 170, 1, 12, 1, 12, 4, 12, 175, 8, 12, 11, 12, 12, 12, 176, 5, 12, 179, 8, 12, 10, 12, 12, 12, 182, 9, 12, 3, 12, 184, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 190, 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 4, 14, 197, 8, 14, 11, 14, 12, 14, 198, 1, 14, 5, 14, 202, 8, 14, 10, 14, 12, 14, 205, 9, 14, 3, 14, 207, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 4, 15, 213, 8, 15, 11, 15, 12, 15, 214, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 226, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 231, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 5, 19, 238, 8, 19, 10, 19, 12, 19, 241, 9, 19, 1, 20, 1, 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 260, 0, 45, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, 0, 16, 145, 1, 0, 0, 0, 18, 147, 1, 0, 0, 0, 20, 151, 1, 0, 0, 0, 22, 164, 1, 0, 0, 0, 24, 166, 1, 0, 0, 0, 26, 189, 1, 0, 0, 0, 28, 194, 1, 0, 0, 0, 30, 210, 1, 0, 0, 0, 32, 216, 1, 0, 0, 0, 34, 225, 1, 0, 0, 0, 36, 227, 1, 0, 0, 0, 38, 234, 1, 0, 0, 0, 40, 242, 1, 0, 0, 0, 42, 44, 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, 5, 0, 53, 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 19, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 29, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 29, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, 5, 22, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 23, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 146, 3, 22, 11, 0, 140, 146, 3, 12, 6, 0, 141, 146, 5, 1, 0, 0, 142, 146, 3, 28, 14, 0, 143, 146, 3, 24, 12, 0, 144, 146, 3, 18, 9, 0, 145, 139, 1, 0, 0, 0, 145, 140, 1, 0, 0, 0, 145, 141, 1, 0, 0, 0, 145, 142, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 145, 144, 1, 0, 0, 0, 146, 17, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, 3, 14, 7, 0, 149, 150, 5, 7, 0, 0, 150, 19, 1, 0, 0, 0, 151, 156, 3, 40, 20, 0, 152, 153, 5, 9, 0, 0, 153, 155, 3, 40, 20, 0, 154, 152, 1, 0, 0, 0, 155, 158, 1, 0, 0, 0, 156, 154, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 21, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 159, 165, 5, 28, 0, 0, 160, 165, 5, 16, 0, 0, 161, 165, 5, 17, 0, 0, 162, 165, 5, 18, 0, 0, 163, 165, 3, 40, 20, 0, 164, 159, 1, 0, 0, 0, 164, 160, 1, 0, 0, 0, 164, 161, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 164, 163, 1, 0, 0, 0, 165, 23, 1, 0, 0, 0, 166, 183, 5, 12, 0, 0, 167, 169, 5, 29, 0, 0, 168, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 180, 1, 0, 0, 0, 172, 174, 3, 26, 13, 0, 173, 175, 5, 29, 0, 0, 174, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 1, 0, 0, 0, 178, 172, 1, 0, 0, 0, 179, 182, 1, 0, 0, 0, 180, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 183, 168, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 186, 5, 13, 0, 0, 186, 25, 1, 0, 0, 0, 187, 190, 3, 40, 20, 0, 188, 190, 3, 12, 6, 0, 189, 187, 1, 0, 0, 0, 189, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 5, 10, 0, 0, 192, 193, 3, 14, 7, 0, 193, 27, 1, 0, 0, 0, 194, 206, 5, 4, 0, 0, 195, 197, 5, 29, 0, 0, 196, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 203, 1, 0, 0, 0, 200, 202, 3, 30, 15, 0, 201, 200, 1, 0, 0, 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 196, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 208, 1, 0, 0, 0, 208, 209, 5, 5, 0, 0, 209, 29, 1, 0, 0, 0, 210, 212, 3, 14, 7, 0, 211, 213, 5, 29, 0, 0, 212, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 31, 1, 0, 0, 0, 216, 217, 5, 2, 0, 0, 217, 218, 3, 34, 17, 0, 218, 219, 5, 29, 0, 0, 219, 33, 1, 0, 0, 0, 220, 226, 3, 36, 18, 0, 221, 222, 3, 14, 7, 0, 222, 223, 5, 8, 0, 0, 223, 224, 3, 36, 18, 0, 224, 226, 1, 0, 0, 0, 225, 220, 1, 0, 0, 0, 225, 221, 1, 0, 0, 0, 226, 35, 1, 0, 0, 0, 227, 228, 3, 40, 20, 0, 228, 230, 5, 6, 0, 0, 229, 231, 3, 38, 19, 0, 230, 229, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 5, 7, 0, 0, 233, 37, 1, 0, 0, 0, 234, 239, 3, 14, 7, 0, 235, 236, 5, 3, 0, 0, 236, 238, 3, 14, 7, 0, 237, 235, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 39, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 7, 0, 0, 0, 243, 41, 1, 0, 0, 0, 27, 45, 54, 59, 66, 71, 73, 83, 95, 111, 118, 134, 136, 145, 156, 164, 170, 176, 180, 183, 189, 198, 203, 206, 214, 225, 230, 239] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep.tokens b/pkg/parser/bicep/antlr/parser/bicep.tokens new file mode 100644 index 00000000000..04a820d5969 --- /dev/null +++ b/pkg/parser/bicep/antlr/parser/bicep.tokens @@ -0,0 +1,52 @@ +MULTILINE_STRING=1 +AT=2 +COMMA=3 +OBRACK=4 +CBRACK=5 +OPAR=6 +CPAR=7 +DOT=8 +PIPE=9 +COL=10 +ASSIGN=11 +OBRACE=12 +CBRACE=13 +PARAM=14 +VAR=15 +TRUE=16 +FALSE=17 +NULL=18 +RESOURCE=19 +STRING_LEFT_PIECE=20 +STRING_MIDDLE_PIECE=21 +STRING_RIGHT_PIECE=22 +STRING_COMPLETE=23 +STRING=24 +INT=25 +BOOL=26 +IDENTIFIER=27 +NUMBER=28 +NL=29 +SPACES=30 +UNKNOWN=31 +'@'=2 +','=3 +'['=4 +']'=5 +'('=6 +')'=7 +'.'=8 +'|'=9 +':'=10 +'='=11 +'{'=12 +'}'=13 +'param'=14 +'var'=15 +'true'=16 +'false'=17 +'null'=18 +'resource'=19 +'string'=24 +'int'=25 +'bool'=26 diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.interp b/pkg/parser/bicep/antlr/parser/bicepLexer.interp new file mode 100644 index 00000000000..00a4f8969f1 --- /dev/null +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.interp @@ -0,0 +1,113 @@ +token literal names: +null +null +'@' +',' +'[' +']' +'(' +')' +'.' +'|' +':' +'=' +'{' +'}' +'param' +'var' +'true' +'false' +'null' +'resource' +null +null +null +null +'string' +'int' +'bool' +null +null +null +null +null + +token symbolic names: +null +MULTILINE_STRING +AT +COMMA +OBRACK +CBRACK +OPAR +CPAR +DOT +PIPE +COL +ASSIGN +OBRACE +CBRACE +PARAM +VAR +TRUE +FALSE +NULL +RESOURCE +STRING_LEFT_PIECE +STRING_MIDDLE_PIECE +STRING_RIGHT_PIECE +STRING_COMPLETE +STRING +INT +BOOL +IDENTIFIER +NUMBER +NL +SPACES +UNKNOWN + +rule names: +MULTILINE_STRING +AT +COMMA +OBRACK +CBRACK +OPAR +CPAR +DOT +PIPE +COL +ASSIGN +OBRACE +CBRACE +PARAM +VAR +TRUE +FALSE +NULL +RESOURCE +STRING_LEFT_PIECE +STRING_MIDDLE_PIECE +STRING_RIGHT_PIECE +STRING_COMPLETE +STRING +INT +BOOL +IDENTIFIER +NUMBER +NL +SPACES +UNKNOWN +STRINGCHAR +ESCAPE +HEX + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[4, 0, 31, 250, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 75, 8, 0, 10, 0, 12, 0, 78, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 145, 8, 19, 10, 19, 12, 19, 148, 9, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 155, 8, 20, 10, 20, 12, 20, 158, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 165, 8, 21, 10, 21, 12, 21, 168, 9, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 174, 8, 22, 10, 22, 12, 22, 177, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 5, 26, 199, 8, 26, 10, 26, 12, 26, 202, 9, 26, 1, 27, 4, 27, 205, 8, 27, 11, 27, 12, 27, 206, 1, 27, 1, 27, 4, 27, 211, 8, 27, 11, 27, 12, 27, 212, 3, 27, 215, 8, 27, 1, 28, 4, 28, 218, 8, 28, 11, 28, 12, 28, 219, 1, 29, 4, 29, 223, 8, 29, 11, 29, 12, 29, 224, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 233, 8, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 4, 32, 241, 8, 32, 11, 32, 12, 32, 242, 1, 32, 1, 32, 3, 32, 247, 8, 32, 1, 33, 1, 33, 1, 76, 0, 34, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 0, 65, 0, 67, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 260, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 1, 69, 1, 0, 0, 0, 3, 83, 1, 0, 0, 0, 5, 85, 1, 0, 0, 0, 7, 87, 1, 0, 0, 0, 9, 89, 1, 0, 0, 0, 11, 91, 1, 0, 0, 0, 13, 93, 1, 0, 0, 0, 15, 95, 1, 0, 0, 0, 17, 97, 1, 0, 0, 0, 19, 99, 1, 0, 0, 0, 21, 101, 1, 0, 0, 0, 23, 103, 1, 0, 0, 0, 25, 105, 1, 0, 0, 0, 27, 107, 1, 0, 0, 0, 29, 113, 1, 0, 0, 0, 31, 117, 1, 0, 0, 0, 33, 122, 1, 0, 0, 0, 35, 128, 1, 0, 0, 0, 37, 133, 1, 0, 0, 0, 39, 142, 1, 0, 0, 0, 41, 152, 1, 0, 0, 0, 43, 162, 1, 0, 0, 0, 45, 171, 1, 0, 0, 0, 47, 180, 1, 0, 0, 0, 49, 187, 1, 0, 0, 0, 51, 191, 1, 0, 0, 0, 53, 196, 1, 0, 0, 0, 55, 204, 1, 0, 0, 0, 57, 217, 1, 0, 0, 0, 59, 222, 1, 0, 0, 0, 61, 228, 1, 0, 0, 0, 63, 232, 1, 0, 0, 0, 65, 234, 1, 0, 0, 0, 67, 248, 1, 0, 0, 0, 69, 70, 5, 39, 0, 0, 70, 71, 5, 39, 0, 0, 71, 72, 5, 39, 0, 0, 72, 76, 1, 0, 0, 0, 73, 75, 9, 0, 0, 0, 74, 73, 1, 0, 0, 0, 75, 78, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 77, 79, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 79, 80, 5, 39, 0, 0, 80, 81, 5, 39, 0, 0, 81, 82, 5, 39, 0, 0, 82, 2, 1, 0, 0, 0, 83, 84, 5, 64, 0, 0, 84, 4, 1, 0, 0, 0, 85, 86, 5, 44, 0, 0, 86, 6, 1, 0, 0, 0, 87, 88, 5, 91, 0, 0, 88, 8, 1, 0, 0, 0, 89, 90, 5, 93, 0, 0, 90, 10, 1, 0, 0, 0, 91, 92, 5, 40, 0, 0, 92, 12, 1, 0, 0, 0, 93, 94, 5, 41, 0, 0, 94, 14, 1, 0, 0, 0, 95, 96, 5, 46, 0, 0, 96, 16, 1, 0, 0, 0, 97, 98, 5, 124, 0, 0, 98, 18, 1, 0, 0, 0, 99, 100, 5, 58, 0, 0, 100, 20, 1, 0, 0, 0, 101, 102, 5, 61, 0, 0, 102, 22, 1, 0, 0, 0, 103, 104, 5, 123, 0, 0, 104, 24, 1, 0, 0, 0, 105, 106, 5, 125, 0, 0, 106, 26, 1, 0, 0, 0, 107, 108, 5, 112, 0, 0, 108, 109, 5, 97, 0, 0, 109, 110, 5, 114, 0, 0, 110, 111, 5, 97, 0, 0, 111, 112, 5, 109, 0, 0, 112, 28, 1, 0, 0, 0, 113, 114, 5, 118, 0, 0, 114, 115, 5, 97, 0, 0, 115, 116, 5, 114, 0, 0, 116, 30, 1, 0, 0, 0, 117, 118, 5, 116, 0, 0, 118, 119, 5, 114, 0, 0, 119, 120, 5, 117, 0, 0, 120, 121, 5, 101, 0, 0, 121, 32, 1, 0, 0, 0, 122, 123, 5, 102, 0, 0, 123, 124, 5, 97, 0, 0, 124, 125, 5, 108, 0, 0, 125, 126, 5, 115, 0, 0, 126, 127, 5, 101, 0, 0, 127, 34, 1, 0, 0, 0, 128, 129, 5, 110, 0, 0, 129, 130, 5, 117, 0, 0, 130, 131, 5, 108, 0, 0, 131, 132, 5, 108, 0, 0, 132, 36, 1, 0, 0, 0, 133, 134, 5, 114, 0, 0, 134, 135, 5, 101, 0, 0, 135, 136, 5, 115, 0, 0, 136, 137, 5, 111, 0, 0, 137, 138, 5, 117, 0, 0, 138, 139, 5, 114, 0, 0, 139, 140, 5, 99, 0, 0, 140, 141, 5, 101, 0, 0, 141, 38, 1, 0, 0, 0, 142, 146, 5, 39, 0, 0, 143, 145, 3, 63, 31, 0, 144, 143, 1, 0, 0, 0, 145, 148, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 149, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 149, 150, 5, 36, 0, 0, 150, 151, 5, 123, 0, 0, 151, 40, 1, 0, 0, 0, 152, 156, 5, 125, 0, 0, 153, 155, 3, 63, 31, 0, 154, 153, 1, 0, 0, 0, 155, 158, 1, 0, 0, 0, 156, 154, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 159, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 159, 160, 5, 36, 0, 0, 160, 161, 5, 123, 0, 0, 161, 42, 1, 0, 0, 0, 162, 166, 5, 125, 0, 0, 163, 165, 3, 63, 31, 0, 164, 163, 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 169, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 170, 5, 39, 0, 0, 170, 44, 1, 0, 0, 0, 171, 175, 5, 39, 0, 0, 172, 174, 3, 63, 31, 0, 173, 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 39, 0, 0, 179, 46, 1, 0, 0, 0, 180, 181, 5, 115, 0, 0, 181, 182, 5, 116, 0, 0, 182, 183, 5, 114, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 110, 0, 0, 185, 186, 5, 103, 0, 0, 186, 48, 1, 0, 0, 0, 187, 188, 5, 105, 0, 0, 188, 189, 5, 110, 0, 0, 189, 190, 5, 116, 0, 0, 190, 50, 1, 0, 0, 0, 191, 192, 5, 98, 0, 0, 192, 193, 5, 111, 0, 0, 193, 194, 5, 111, 0, 0, 194, 195, 5, 108, 0, 0, 195, 52, 1, 0, 0, 0, 196, 200, 7, 0, 0, 0, 197, 199, 7, 1, 0, 0, 198, 197, 1, 0, 0, 0, 199, 202, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 54, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 203, 205, 7, 2, 0, 0, 204, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 214, 1, 0, 0, 0, 208, 210, 5, 46, 0, 0, 209, 211, 7, 2, 0, 0, 210, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 215, 1, 0, 0, 0, 214, 208, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 56, 1, 0, 0, 0, 216, 218, 7, 3, 0, 0, 217, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 58, 1, 0, 0, 0, 221, 223, 7, 4, 0, 0, 222, 221, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 227, 6, 29, 0, 0, 227, 60, 1, 0, 0, 0, 228, 229, 9, 0, 0, 0, 229, 62, 1, 0, 0, 0, 230, 233, 8, 5, 0, 0, 231, 233, 3, 65, 32, 0, 232, 230, 1, 0, 0, 0, 232, 231, 1, 0, 0, 0, 233, 64, 1, 0, 0, 0, 234, 246, 5, 92, 0, 0, 235, 247, 7, 6, 0, 0, 236, 237, 5, 117, 0, 0, 237, 238, 5, 123, 0, 0, 238, 240, 1, 0, 0, 0, 239, 241, 3, 67, 33, 0, 240, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 5, 125, 0, 0, 245, 247, 1, 0, 0, 0, 246, 235, 1, 0, 0, 0, 246, 236, 1, 0, 0, 0, 247, 66, 1, 0, 0, 0, 248, 249, 7, 7, 0, 0, 249, 68, 1, 0, 0, 0, 15, 0, 76, 146, 156, 166, 175, 200, 206, 212, 214, 219, 224, 232, 242, 246, 1, 6, 0, 0] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens new file mode 100644 index 00000000000..04a820d5969 --- /dev/null +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens @@ -0,0 +1,52 @@ +MULTILINE_STRING=1 +AT=2 +COMMA=3 +OBRACK=4 +CBRACK=5 +OPAR=6 +CPAR=7 +DOT=8 +PIPE=9 +COL=10 +ASSIGN=11 +OBRACE=12 +CBRACE=13 +PARAM=14 +VAR=15 +TRUE=16 +FALSE=17 +NULL=18 +RESOURCE=19 +STRING_LEFT_PIECE=20 +STRING_MIDDLE_PIECE=21 +STRING_RIGHT_PIECE=22 +STRING_COMPLETE=23 +STRING=24 +INT=25 +BOOL=26 +IDENTIFIER=27 +NUMBER=28 +NL=29 +SPACES=30 +UNKNOWN=31 +'@'=2 +','=3 +'['=4 +']'=5 +'('=6 +')'=7 +'.'=8 +'|'=9 +':'=10 +'='=11 +'{'=12 +'}'=13 +'param'=14 +'var'=15 +'true'=16 +'false'=17 +'null'=18 +'resource'=19 +'string'=24 +'int'=25 +'bool'=26 diff --git a/pkg/parser/bicep/antlr/parser/bicep_base_listener.go b/pkg/parser/bicep/antlr/parser/bicep_base_listener.go new file mode 100644 index 00000000000..24ac47ccdba --- /dev/null +++ b/pkg/parser/bicep/antlr/parser/bicep_base_listener.go @@ -0,0 +1,148 @@ +// Code generated from bicep.g4 by ANTLR 4.13.1. DO NOT EDIT. + +package parser // bicep + +import "github.com/antlr4-go/antlr/v4" + +// BasebicepListener is a complete listener for a parse tree produced by bicepParser. +type BasebicepListener struct{} + +var _ bicepListener = &BasebicepListener{} + +// VisitTerminal is called when a terminal node is visited. +func (s *BasebicepListener) VisitTerminal(node antlr.TerminalNode) {} + +// VisitErrorNode is called when an error node is visited. +func (s *BasebicepListener) VisitErrorNode(node antlr.ErrorNode) {} + +// EnterEveryRule is called when any rule is entered. +func (s *BasebicepListener) EnterEveryRule(ctx antlr.ParserRuleContext) {} + +// ExitEveryRule is called when any rule is exited. +func (s *BasebicepListener) ExitEveryRule(ctx antlr.ParserRuleContext) {} + +// EnterProgram is called when production program is entered. +func (s *BasebicepListener) EnterProgram(ctx *ProgramContext) {} + +// ExitProgram is called when production program is exited. +func (s *BasebicepListener) ExitProgram(ctx *ProgramContext) {} + +// EnterStatement is called when production statement is entered. +func (s *BasebicepListener) EnterStatement(ctx *StatementContext) {} + +// ExitStatement is called when production statement is exited. +func (s *BasebicepListener) ExitStatement(ctx *StatementContext) {} + +// EnterParameterDecl is called when production parameterDecl is entered. +func (s *BasebicepListener) EnterParameterDecl(ctx *ParameterDeclContext) {} + +// ExitParameterDecl is called when production parameterDecl is exited. +func (s *BasebicepListener) ExitParameterDecl(ctx *ParameterDeclContext) {} + +// EnterParameterDefaultValue is called when production parameterDefaultValue is entered. +func (s *BasebicepListener) EnterParameterDefaultValue(ctx *ParameterDefaultValueContext) {} + +// ExitParameterDefaultValue is called when production parameterDefaultValue is exited. +func (s *BasebicepListener) ExitParameterDefaultValue(ctx *ParameterDefaultValueContext) {} + +// EnterVariableDecl is called when production variableDecl is entered. +func (s *BasebicepListener) EnterVariableDecl(ctx *VariableDeclContext) {} + +// ExitVariableDecl is called when production variableDecl is exited. +func (s *BasebicepListener) ExitVariableDecl(ctx *VariableDeclContext) {} + +// EnterResourceDecl is called when production resourceDecl is entered. +func (s *BasebicepListener) EnterResourceDecl(ctx *ResourceDeclContext) {} + +// ExitResourceDecl is called when production resourceDecl is exited. +func (s *BasebicepListener) ExitResourceDecl(ctx *ResourceDeclContext) {} + +// EnterInterpString is called when production interpString is entered. +func (s *BasebicepListener) EnterInterpString(ctx *InterpStringContext) {} + +// ExitInterpString is called when production interpString is exited. +func (s *BasebicepListener) ExitInterpString(ctx *InterpStringContext) {} + +// EnterExpression is called when production expression is entered. +func (s *BasebicepListener) EnterExpression(ctx *ExpressionContext) {} + +// ExitExpression is called when production expression is exited. +func (s *BasebicepListener) ExitExpression(ctx *ExpressionContext) {} + +// EnterPrimaryExpression is called when production primaryExpression is entered. +func (s *BasebicepListener) EnterPrimaryExpression(ctx *PrimaryExpressionContext) {} + +// ExitPrimaryExpression is called when production primaryExpression is exited. +func (s *BasebicepListener) ExitPrimaryExpression(ctx *PrimaryExpressionContext) {} + +// EnterParenthesizedExpression is called when production parenthesizedExpression is entered. +func (s *BasebicepListener) EnterParenthesizedExpression(ctx *ParenthesizedExpressionContext) {} + +// ExitParenthesizedExpression is called when production parenthesizedExpression is exited. +func (s *BasebicepListener) ExitParenthesizedExpression(ctx *ParenthesizedExpressionContext) {} + +// EnterTypeExpression is called when production typeExpression is entered. +func (s *BasebicepListener) EnterTypeExpression(ctx *TypeExpressionContext) {} + +// ExitTypeExpression is called when production typeExpression is exited. +func (s *BasebicepListener) ExitTypeExpression(ctx *TypeExpressionContext) {} + +// EnterLiteralValue is called when production literalValue is entered. +func (s *BasebicepListener) EnterLiteralValue(ctx *LiteralValueContext) {} + +// ExitLiteralValue is called when production literalValue is exited. +func (s *BasebicepListener) ExitLiteralValue(ctx *LiteralValueContext) {} + +// EnterObject is called when production object is entered. +func (s *BasebicepListener) EnterObject(ctx *ObjectContext) {} + +// ExitObject is called when production object is exited. +func (s *BasebicepListener) ExitObject(ctx *ObjectContext) {} + +// EnterObjectProperty is called when production objectProperty is entered. +func (s *BasebicepListener) EnterObjectProperty(ctx *ObjectPropertyContext) {} + +// ExitObjectProperty is called when production objectProperty is exited. +func (s *BasebicepListener) ExitObjectProperty(ctx *ObjectPropertyContext) {} + +// EnterArray is called when production array is entered. +func (s *BasebicepListener) EnterArray(ctx *ArrayContext) {} + +// ExitArray is called when production array is exited. +func (s *BasebicepListener) ExitArray(ctx *ArrayContext) {} + +// EnterArrayItem is called when production arrayItem is entered. +func (s *BasebicepListener) EnterArrayItem(ctx *ArrayItemContext) {} + +// ExitArrayItem is called when production arrayItem is exited. +func (s *BasebicepListener) ExitArrayItem(ctx *ArrayItemContext) {} + +// EnterDecorator is called when production decorator is entered. +func (s *BasebicepListener) EnterDecorator(ctx *DecoratorContext) {} + +// ExitDecorator is called when production decorator is exited. +func (s *BasebicepListener) ExitDecorator(ctx *DecoratorContext) {} + +// EnterDecoratorExpression is called when production decoratorExpression is entered. +func (s *BasebicepListener) EnterDecoratorExpression(ctx *DecoratorExpressionContext) {} + +// ExitDecoratorExpression is called when production decoratorExpression is exited. +func (s *BasebicepListener) ExitDecoratorExpression(ctx *DecoratorExpressionContext) {} + +// EnterFunctionCall is called when production functionCall is entered. +func (s *BasebicepListener) EnterFunctionCall(ctx *FunctionCallContext) {} + +// ExitFunctionCall is called when production functionCall is exited. +func (s *BasebicepListener) ExitFunctionCall(ctx *FunctionCallContext) {} + +// EnterArgumentList is called when production argumentList is entered. +func (s *BasebicepListener) EnterArgumentList(ctx *ArgumentListContext) {} + +// ExitArgumentList is called when production argumentList is exited. +func (s *BasebicepListener) ExitArgumentList(ctx *ArgumentListContext) {} + +// EnterIdentifier is called when production identifier is entered. +func (s *BasebicepListener) EnterIdentifier(ctx *IdentifierContext) {} + +// ExitIdentifier is called when production identifier is exited. +func (s *BasebicepListener) ExitIdentifier(ctx *IdentifierContext) {} diff --git a/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go new file mode 100644 index 00000000000..06eb42a8b6e --- /dev/null +++ b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go @@ -0,0 +1,93 @@ +// Code generated from bicep.g4 by ANTLR 4.13.1. DO NOT EDIT. + +package parser // bicep + +import "github.com/antlr4-go/antlr/v4" + +type BasebicepVisitor struct { + *antlr.BaseParseTreeVisitor +} + +func (v *BasebicepVisitor) VisitProgram(ctx *ProgramContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitStatement(ctx *StatementContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitParameterDecl(ctx *ParameterDeclContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitParameterDefaultValue(ctx *ParameterDefaultValueContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitVariableDecl(ctx *VariableDeclContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitResourceDecl(ctx *ResourceDeclContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitInterpString(ctx *InterpStringContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitExpression(ctx *ExpressionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitPrimaryExpression(ctx *PrimaryExpressionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitParenthesizedExpression(ctx *ParenthesizedExpressionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitTypeExpression(ctx *TypeExpressionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitLiteralValue(ctx *LiteralValueContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitObject(ctx *ObjectContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitObjectProperty(ctx *ObjectPropertyContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitArray(ctx *ArrayContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitArrayItem(ctx *ArrayItemContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitDecorator(ctx *DecoratorContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitDecoratorExpression(ctx *DecoratorExpressionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitFunctionCall(ctx *FunctionCallContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitArgumentList(ctx *ArgumentListContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitIdentifier(ctx *IdentifierContext) interface{} { + return v.VisitChildren(ctx) +} diff --git a/pkg/parser/bicep/antlr/parser/bicep_lexer.go b/pkg/parser/bicep/antlr/parser/bicep_lexer.go new file mode 100644 index 00000000000..196dd99a884 --- /dev/null +++ b/pkg/parser/bicep/antlr/parser/bicep_lexer.go @@ -0,0 +1,250 @@ +// Code generated from bicep.g4 by ANTLR 4.13.1. DO NOT EDIT. + +package parser + +import ( + "fmt" + "github.com/antlr4-go/antlr/v4" + "sync" + "unicode" +) + +// Suppress unused import error +var _ = fmt.Printf +var _ = sync.Once{} +var _ = unicode.IsLetter + +type bicepLexer struct { + *antlr.BaseLexer + channelNames []string + modeNames []string + // TODO: EOF string +} + +var BicepLexerLexerStaticData struct { + once sync.Once + serializedATN []int32 + ChannelNames []string + ModeNames []string + LiteralNames []string + SymbolicNames []string + RuleNames []string + PredictionContextCache *antlr.PredictionContextCache + atn *antlr.ATN + decisionToDFA []*antlr.DFA +} + +func biceplexerLexerInit() { + staticData := &BicepLexerLexerStaticData + staticData.ChannelNames = []string{ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN", + } + staticData.ModeNames = []string{ + "DEFAULT_MODE", + } + staticData.LiteralNames = []string{ + "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", + "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", + "'resource'", "", "", "", "", "'string'", "'int'", "'bool'", + } + staticData.SymbolicNames = []string{ + "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", + "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", + "TRUE", "FALSE", "NULL", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", + "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IDENTIFIER", + "NUMBER", "NL", "SPACES", "UNKNOWN", + } + staticData.RuleNames = []string{ + "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", + "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", + "TRUE", "FALSE", "NULL", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", + "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IDENTIFIER", + "NUMBER", "NL", "SPACES", "UNKNOWN", "STRINGCHAR", "ESCAPE", "HEX", + } + staticData.PredictionContextCache = antlr.NewPredictionContextCache() + staticData.serializedATN = []int32{ + 4, 0, 31, 250, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, + 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, + 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, + 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, + 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, + 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, + 0, 75, 8, 0, 10, 0, 12, 0, 78, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, + 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, + 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, + 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, + 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, + 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, + 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 145, 8, 19, 10, 19, 12, 19, 148, + 9, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 155, 8, 20, 10, 20, 12, + 20, 158, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 165, 8, 21, 10, + 21, 12, 21, 168, 9, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 174, 8, 22, + 10, 22, 12, 22, 177, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, + 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, + 1, 25, 1, 26, 1, 26, 5, 26, 199, 8, 26, 10, 26, 12, 26, 202, 9, 26, 1, + 27, 4, 27, 205, 8, 27, 11, 27, 12, 27, 206, 1, 27, 1, 27, 4, 27, 211, 8, + 27, 11, 27, 12, 27, 212, 3, 27, 215, 8, 27, 1, 28, 4, 28, 218, 8, 28, 11, + 28, 12, 28, 219, 1, 29, 4, 29, 223, 8, 29, 11, 29, 12, 29, 224, 1, 29, + 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 233, 8, 31, 1, 32, 1, 32, 1, + 32, 1, 32, 1, 32, 1, 32, 4, 32, 241, 8, 32, 11, 32, 12, 32, 242, 1, 32, + 1, 32, 3, 32, 247, 8, 32, 1, 33, 1, 33, 1, 76, 0, 34, 1, 1, 3, 2, 5, 3, + 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, + 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, + 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, + 63, 0, 65, 0, 67, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, + 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, + 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, + 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, + 102, 260, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, + 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, + 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, + 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, + 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, + 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, + 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, + 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, + 1, 0, 0, 0, 1, 69, 1, 0, 0, 0, 3, 83, 1, 0, 0, 0, 5, 85, 1, 0, 0, 0, 7, + 87, 1, 0, 0, 0, 9, 89, 1, 0, 0, 0, 11, 91, 1, 0, 0, 0, 13, 93, 1, 0, 0, + 0, 15, 95, 1, 0, 0, 0, 17, 97, 1, 0, 0, 0, 19, 99, 1, 0, 0, 0, 21, 101, + 1, 0, 0, 0, 23, 103, 1, 0, 0, 0, 25, 105, 1, 0, 0, 0, 27, 107, 1, 0, 0, + 0, 29, 113, 1, 0, 0, 0, 31, 117, 1, 0, 0, 0, 33, 122, 1, 0, 0, 0, 35, 128, + 1, 0, 0, 0, 37, 133, 1, 0, 0, 0, 39, 142, 1, 0, 0, 0, 41, 152, 1, 0, 0, + 0, 43, 162, 1, 0, 0, 0, 45, 171, 1, 0, 0, 0, 47, 180, 1, 0, 0, 0, 49, 187, + 1, 0, 0, 0, 51, 191, 1, 0, 0, 0, 53, 196, 1, 0, 0, 0, 55, 204, 1, 0, 0, + 0, 57, 217, 1, 0, 0, 0, 59, 222, 1, 0, 0, 0, 61, 228, 1, 0, 0, 0, 63, 232, + 1, 0, 0, 0, 65, 234, 1, 0, 0, 0, 67, 248, 1, 0, 0, 0, 69, 70, 5, 39, 0, + 0, 70, 71, 5, 39, 0, 0, 71, 72, 5, 39, 0, 0, 72, 76, 1, 0, 0, 0, 73, 75, + 9, 0, 0, 0, 74, 73, 1, 0, 0, 0, 75, 78, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, + 76, 74, 1, 0, 0, 0, 77, 79, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 79, 80, 5, + 39, 0, 0, 80, 81, 5, 39, 0, 0, 81, 82, 5, 39, 0, 0, 82, 2, 1, 0, 0, 0, + 83, 84, 5, 64, 0, 0, 84, 4, 1, 0, 0, 0, 85, 86, 5, 44, 0, 0, 86, 6, 1, + 0, 0, 0, 87, 88, 5, 91, 0, 0, 88, 8, 1, 0, 0, 0, 89, 90, 5, 93, 0, 0, 90, + 10, 1, 0, 0, 0, 91, 92, 5, 40, 0, 0, 92, 12, 1, 0, 0, 0, 93, 94, 5, 41, + 0, 0, 94, 14, 1, 0, 0, 0, 95, 96, 5, 46, 0, 0, 96, 16, 1, 0, 0, 0, 97, + 98, 5, 124, 0, 0, 98, 18, 1, 0, 0, 0, 99, 100, 5, 58, 0, 0, 100, 20, 1, + 0, 0, 0, 101, 102, 5, 61, 0, 0, 102, 22, 1, 0, 0, 0, 103, 104, 5, 123, + 0, 0, 104, 24, 1, 0, 0, 0, 105, 106, 5, 125, 0, 0, 106, 26, 1, 0, 0, 0, + 107, 108, 5, 112, 0, 0, 108, 109, 5, 97, 0, 0, 109, 110, 5, 114, 0, 0, + 110, 111, 5, 97, 0, 0, 111, 112, 5, 109, 0, 0, 112, 28, 1, 0, 0, 0, 113, + 114, 5, 118, 0, 0, 114, 115, 5, 97, 0, 0, 115, 116, 5, 114, 0, 0, 116, + 30, 1, 0, 0, 0, 117, 118, 5, 116, 0, 0, 118, 119, 5, 114, 0, 0, 119, 120, + 5, 117, 0, 0, 120, 121, 5, 101, 0, 0, 121, 32, 1, 0, 0, 0, 122, 123, 5, + 102, 0, 0, 123, 124, 5, 97, 0, 0, 124, 125, 5, 108, 0, 0, 125, 126, 5, + 115, 0, 0, 126, 127, 5, 101, 0, 0, 127, 34, 1, 0, 0, 0, 128, 129, 5, 110, + 0, 0, 129, 130, 5, 117, 0, 0, 130, 131, 5, 108, 0, 0, 131, 132, 5, 108, + 0, 0, 132, 36, 1, 0, 0, 0, 133, 134, 5, 114, 0, 0, 134, 135, 5, 101, 0, + 0, 135, 136, 5, 115, 0, 0, 136, 137, 5, 111, 0, 0, 137, 138, 5, 117, 0, + 0, 138, 139, 5, 114, 0, 0, 139, 140, 5, 99, 0, 0, 140, 141, 5, 101, 0, + 0, 141, 38, 1, 0, 0, 0, 142, 146, 5, 39, 0, 0, 143, 145, 3, 63, 31, 0, + 144, 143, 1, 0, 0, 0, 145, 148, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, + 147, 1, 0, 0, 0, 147, 149, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 149, 150, + 5, 36, 0, 0, 150, 151, 5, 123, 0, 0, 151, 40, 1, 0, 0, 0, 152, 156, 5, + 125, 0, 0, 153, 155, 3, 63, 31, 0, 154, 153, 1, 0, 0, 0, 155, 158, 1, 0, + 0, 0, 156, 154, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 159, 1, 0, 0, 0, + 158, 156, 1, 0, 0, 0, 159, 160, 5, 36, 0, 0, 160, 161, 5, 123, 0, 0, 161, + 42, 1, 0, 0, 0, 162, 166, 5, 125, 0, 0, 163, 165, 3, 63, 31, 0, 164, 163, + 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, + 0, 0, 167, 169, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 170, 5, 39, 0, 0, + 170, 44, 1, 0, 0, 0, 171, 175, 5, 39, 0, 0, 172, 174, 3, 63, 31, 0, 173, + 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, + 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 39, + 0, 0, 179, 46, 1, 0, 0, 0, 180, 181, 5, 115, 0, 0, 181, 182, 5, 116, 0, + 0, 182, 183, 5, 114, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 110, 0, + 0, 185, 186, 5, 103, 0, 0, 186, 48, 1, 0, 0, 0, 187, 188, 5, 105, 0, 0, + 188, 189, 5, 110, 0, 0, 189, 190, 5, 116, 0, 0, 190, 50, 1, 0, 0, 0, 191, + 192, 5, 98, 0, 0, 192, 193, 5, 111, 0, 0, 193, 194, 5, 111, 0, 0, 194, + 195, 5, 108, 0, 0, 195, 52, 1, 0, 0, 0, 196, 200, 7, 0, 0, 0, 197, 199, + 7, 1, 0, 0, 198, 197, 1, 0, 0, 0, 199, 202, 1, 0, 0, 0, 200, 198, 1, 0, + 0, 0, 200, 201, 1, 0, 0, 0, 201, 54, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, + 203, 205, 7, 2, 0, 0, 204, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, + 204, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 214, 1, 0, 0, 0, 208, 210, + 5, 46, 0, 0, 209, 211, 7, 2, 0, 0, 210, 209, 1, 0, 0, 0, 211, 212, 1, 0, + 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 215, 1, 0, 0, 0, + 214, 208, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 56, 1, 0, 0, 0, 216, 218, + 7, 3, 0, 0, 217, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 217, 1, 0, + 0, 0, 219, 220, 1, 0, 0, 0, 220, 58, 1, 0, 0, 0, 221, 223, 7, 4, 0, 0, + 222, 221, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, + 225, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 227, 6, 29, 0, 0, 227, 60, + 1, 0, 0, 0, 228, 229, 9, 0, 0, 0, 229, 62, 1, 0, 0, 0, 230, 233, 8, 5, + 0, 0, 231, 233, 3, 65, 32, 0, 232, 230, 1, 0, 0, 0, 232, 231, 1, 0, 0, + 0, 233, 64, 1, 0, 0, 0, 234, 246, 5, 92, 0, 0, 235, 247, 7, 6, 0, 0, 236, + 237, 5, 117, 0, 0, 237, 238, 5, 123, 0, 0, 238, 240, 1, 0, 0, 0, 239, 241, + 3, 67, 33, 0, 240, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 240, 1, + 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 5, 125, + 0, 0, 245, 247, 1, 0, 0, 0, 246, 235, 1, 0, 0, 0, 246, 236, 1, 0, 0, 0, + 247, 66, 1, 0, 0, 0, 248, 249, 7, 7, 0, 0, 249, 68, 1, 0, 0, 0, 15, 0, + 76, 146, 156, 166, 175, 200, 206, 212, 214, 219, 224, 232, 242, 246, 1, + 6, 0, 0, + } + deserializer := antlr.NewATNDeserializer(nil) + staticData.atn = deserializer.Deserialize(staticData.serializedATN) + atn := staticData.atn + staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) + decisionToDFA := staticData.decisionToDFA + for index, state := range atn.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(state, index) + } +} + +// bicepLexerInit initializes any static state used to implement bicepLexer. By default the +// static state used to implement the lexer is lazily initialized during the first call to +// NewbicepLexer(). You can call this function if you wish to initialize the static state ahead +// of time. +func BicepLexerInit() { + staticData := &BicepLexerLexerStaticData + staticData.once.Do(biceplexerLexerInit) +} + +// NewbicepLexer produces a new lexer instance for the optional input antlr.CharStream. +func NewbicepLexer(input antlr.CharStream) *bicepLexer { + BicepLexerInit() + l := new(bicepLexer) + l.BaseLexer = antlr.NewBaseLexer(input) + staticData := &BicepLexerLexerStaticData + l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache) + l.channelNames = staticData.ChannelNames + l.modeNames = staticData.ModeNames + l.RuleNames = staticData.RuleNames + l.LiteralNames = staticData.LiteralNames + l.SymbolicNames = staticData.SymbolicNames + l.GrammarFileName = "bicep.g4" + // TODO: l.EOF = antlr.TokenEOF + + return l +} + +// bicepLexer tokens. +const ( + bicepLexerMULTILINE_STRING = 1 + bicepLexerAT = 2 + bicepLexerCOMMA = 3 + bicepLexerOBRACK = 4 + bicepLexerCBRACK = 5 + bicepLexerOPAR = 6 + bicepLexerCPAR = 7 + bicepLexerDOT = 8 + bicepLexerPIPE = 9 + bicepLexerCOL = 10 + bicepLexerASSIGN = 11 + bicepLexerOBRACE = 12 + bicepLexerCBRACE = 13 + bicepLexerPARAM = 14 + bicepLexerVAR = 15 + bicepLexerTRUE = 16 + bicepLexerFALSE = 17 + bicepLexerNULL = 18 + bicepLexerRESOURCE = 19 + bicepLexerSTRING_LEFT_PIECE = 20 + bicepLexerSTRING_MIDDLE_PIECE = 21 + bicepLexerSTRING_RIGHT_PIECE = 22 + bicepLexerSTRING_COMPLETE = 23 + bicepLexerSTRING = 24 + bicepLexerINT = 25 + bicepLexerBOOL = 26 + bicepLexerIDENTIFIER = 27 + bicepLexerNUMBER = 28 + bicepLexerNL = 29 + bicepLexerSPACES = 30 + bicepLexerUNKNOWN = 31 +) diff --git a/pkg/parser/bicep/antlr/parser/bicep_listener.go b/pkg/parser/bicep/antlr/parser/bicep_listener.go new file mode 100644 index 00000000000..f807ec71028 --- /dev/null +++ b/pkg/parser/bicep/antlr/parser/bicep_listener.go @@ -0,0 +1,136 @@ +// Code generated from bicep.g4 by ANTLR 4.13.1. DO NOT EDIT. + +package parser // bicep + +import "github.com/antlr4-go/antlr/v4" + +// bicepListener is a complete listener for a parse tree produced by bicepParser. +type bicepListener interface { + antlr.ParseTreeListener + + // EnterProgram is called when entering the program production. + EnterProgram(c *ProgramContext) + + // EnterStatement is called when entering the statement production. + EnterStatement(c *StatementContext) + + // EnterParameterDecl is called when entering the parameterDecl production. + EnterParameterDecl(c *ParameterDeclContext) + + // EnterParameterDefaultValue is called when entering the parameterDefaultValue production. + EnterParameterDefaultValue(c *ParameterDefaultValueContext) + + // EnterVariableDecl is called when entering the variableDecl production. + EnterVariableDecl(c *VariableDeclContext) + + // EnterResourceDecl is called when entering the resourceDecl production. + EnterResourceDecl(c *ResourceDeclContext) + + // EnterInterpString is called when entering the interpString production. + EnterInterpString(c *InterpStringContext) + + // EnterExpression is called when entering the expression production. + EnterExpression(c *ExpressionContext) + + // EnterPrimaryExpression is called when entering the primaryExpression production. + EnterPrimaryExpression(c *PrimaryExpressionContext) + + // EnterParenthesizedExpression is called when entering the parenthesizedExpression production. + EnterParenthesizedExpression(c *ParenthesizedExpressionContext) + + // EnterTypeExpression is called when entering the typeExpression production. + EnterTypeExpression(c *TypeExpressionContext) + + // EnterLiteralValue is called when entering the literalValue production. + EnterLiteralValue(c *LiteralValueContext) + + // EnterObject is called when entering the object production. + EnterObject(c *ObjectContext) + + // EnterObjectProperty is called when entering the objectProperty production. + EnterObjectProperty(c *ObjectPropertyContext) + + // EnterArray is called when entering the array production. + EnterArray(c *ArrayContext) + + // EnterArrayItem is called when entering the arrayItem production. + EnterArrayItem(c *ArrayItemContext) + + // EnterDecorator is called when entering the decorator production. + EnterDecorator(c *DecoratorContext) + + // EnterDecoratorExpression is called when entering the decoratorExpression production. + EnterDecoratorExpression(c *DecoratorExpressionContext) + + // EnterFunctionCall is called when entering the functionCall production. + EnterFunctionCall(c *FunctionCallContext) + + // EnterArgumentList is called when entering the argumentList production. + EnterArgumentList(c *ArgumentListContext) + + // EnterIdentifier is called when entering the identifier production. + EnterIdentifier(c *IdentifierContext) + + // ExitProgram is called when exiting the program production. + ExitProgram(c *ProgramContext) + + // ExitStatement is called when exiting the statement production. + ExitStatement(c *StatementContext) + + // ExitParameterDecl is called when exiting the parameterDecl production. + ExitParameterDecl(c *ParameterDeclContext) + + // ExitParameterDefaultValue is called when exiting the parameterDefaultValue production. + ExitParameterDefaultValue(c *ParameterDefaultValueContext) + + // ExitVariableDecl is called when exiting the variableDecl production. + ExitVariableDecl(c *VariableDeclContext) + + // ExitResourceDecl is called when exiting the resourceDecl production. + ExitResourceDecl(c *ResourceDeclContext) + + // ExitInterpString is called when exiting the interpString production. + ExitInterpString(c *InterpStringContext) + + // ExitExpression is called when exiting the expression production. + ExitExpression(c *ExpressionContext) + + // ExitPrimaryExpression is called when exiting the primaryExpression production. + ExitPrimaryExpression(c *PrimaryExpressionContext) + + // ExitParenthesizedExpression is called when exiting the parenthesizedExpression production. + ExitParenthesizedExpression(c *ParenthesizedExpressionContext) + + // ExitTypeExpression is called when exiting the typeExpression production. + ExitTypeExpression(c *TypeExpressionContext) + + // ExitLiteralValue is called when exiting the literalValue production. + ExitLiteralValue(c *LiteralValueContext) + + // ExitObject is called when exiting the object production. + ExitObject(c *ObjectContext) + + // ExitObjectProperty is called when exiting the objectProperty production. + ExitObjectProperty(c *ObjectPropertyContext) + + // ExitArray is called when exiting the array production. + ExitArray(c *ArrayContext) + + // ExitArrayItem is called when exiting the arrayItem production. + ExitArrayItem(c *ArrayItemContext) + + // ExitDecorator is called when exiting the decorator production. + ExitDecorator(c *DecoratorContext) + + // ExitDecoratorExpression is called when exiting the decoratorExpression production. + ExitDecoratorExpression(c *DecoratorExpressionContext) + + // ExitFunctionCall is called when exiting the functionCall production. + ExitFunctionCall(c *FunctionCallContext) + + // ExitArgumentList is called when exiting the argumentList production. + ExitArgumentList(c *ArgumentListContext) + + // ExitIdentifier is called when exiting the identifier production. + ExitIdentifier(c *IdentifierContext) +} diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go new file mode 100644 index 00000000000..601a65fe5d0 --- /dev/null +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -0,0 +1,4664 @@ +// Code generated from bicep.g4 by ANTLR 4.13.1. DO NOT EDIT. + +package parser // bicep + +import ( + "fmt" + "strconv" + "sync" + + "github.com/antlr4-go/antlr/v4" +) + +// Suppress unused import errors +var _ = fmt.Printf +var _ = strconv.Itoa +var _ = sync.Once{} + +type bicepParser struct { + *antlr.BaseParser +} + +var BicepParserStaticData struct { + once sync.Once + serializedATN []int32 + LiteralNames []string + SymbolicNames []string + RuleNames []string + PredictionContextCache *antlr.PredictionContextCache + atn *antlr.ATN + decisionToDFA []*antlr.DFA +} + +func bicepParserInit() { + staticData := &BicepParserStaticData + staticData.LiteralNames = []string{ + "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", + "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", + "'resource'", "", "", "", "", "'string'", "'int'", "'bool'", + } + staticData.SymbolicNames = []string{ + "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", + "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", + "TRUE", "FALSE", "NULL", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", + "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IDENTIFIER", + "NUMBER", "NL", "SPACES", "UNKNOWN", + } + staticData.RuleNames = []string{ + "program", "statement", "parameterDecl", "parameterDefaultValue", "variableDecl", + "resourceDecl", "interpString", "expression", "primaryExpression", "parenthesizedExpression", + "typeExpression", "literalValue", "object", "objectProperty", "array", + "arrayItem", "decorator", "decoratorExpression", "functionCall", "argumentList", + "identifier", + } + staticData.PredictionContextCache = antlr.NewPredictionContextCache() + staticData.serializedATN = []int32{ + 4, 1, 31, 245, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, + 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, + 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, + 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 1, 55, 8, 1, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 3, 2, 67, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 72, 8, 2, + 3, 2, 74, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 82, 8, 4, 10, + 4, 12, 4, 85, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 94, + 8, 5, 10, 5, 12, 5, 97, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, + 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, + 1, 6, 1, 6, 1, 6, 3, 6, 119, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, + 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, + 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 146, 8, 8, + 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 5, 10, 155, 8, 10, 10, 10, + 12, 10, 158, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 165, 8, 11, + 1, 12, 1, 12, 4, 12, 169, 8, 12, 11, 12, 12, 12, 170, 1, 12, 1, 12, 4, + 12, 175, 8, 12, 11, 12, 12, 12, 176, 5, 12, 179, 8, 12, 10, 12, 12, 12, + 182, 9, 12, 3, 12, 184, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 190, + 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 4, 14, 197, 8, 14, 11, 14, 12, + 14, 198, 1, 14, 5, 14, 202, 8, 14, 10, 14, 12, 14, 205, 9, 14, 3, 14, 207, + 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 4, 15, 213, 8, 15, 11, 15, 12, 15, 214, + 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 226, + 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 231, 8, 18, 1, 18, 1, 18, 1, 19, 1, + 19, 1, 19, 5, 19, 238, 8, 19, 10, 19, 12, 19, 241, 9, 19, 1, 20, 1, 20, + 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, + 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 260, 0, 45, 1, + 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, + 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, + 0, 16, 145, 1, 0, 0, 0, 18, 147, 1, 0, 0, 0, 20, 151, 1, 0, 0, 0, 22, 164, + 1, 0, 0, 0, 24, 166, 1, 0, 0, 0, 26, 189, 1, 0, 0, 0, 28, 194, 1, 0, 0, + 0, 30, 210, 1, 0, 0, 0, 32, 216, 1, 0, 0, 0, 34, 225, 1, 0, 0, 0, 36, 227, + 1, 0, 0, 0, 38, 234, 1, 0, 0, 0, 40, 242, 1, 0, 0, 0, 42, 44, 3, 2, 1, + 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, + 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, + 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, + 5, 0, 53, 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, + 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, + 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, + 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, + 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, + 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 19, 0, 0, + 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, + 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, + 75, 1, 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, + 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, + 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, + 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, + 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 29, + 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, + 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, + 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, 40, 20, 0, 100, + 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, + 5, 29, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, 0, 106, 107, 3, 14, + 7, 0, 107, 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, + 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, + 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, + 5, 22, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 23, 0, 0, 118, 105, 1, + 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, + 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, + 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, + 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, + 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, + 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, + 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, + 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 146, 3, 22, 11, 0, 140, + 146, 3, 12, 6, 0, 141, 146, 5, 1, 0, 0, 142, 146, 3, 28, 14, 0, 143, 146, + 3, 24, 12, 0, 144, 146, 3, 18, 9, 0, 145, 139, 1, 0, 0, 0, 145, 140, 1, + 0, 0, 0, 145, 141, 1, 0, 0, 0, 145, 142, 1, 0, 0, 0, 145, 143, 1, 0, 0, + 0, 145, 144, 1, 0, 0, 0, 146, 17, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, + 149, 3, 14, 7, 0, 149, 150, 5, 7, 0, 0, 150, 19, 1, 0, 0, 0, 151, 156, + 3, 40, 20, 0, 152, 153, 5, 9, 0, 0, 153, 155, 3, 40, 20, 0, 154, 152, 1, + 0, 0, 0, 155, 158, 1, 0, 0, 0, 156, 154, 1, 0, 0, 0, 156, 157, 1, 0, 0, + 0, 157, 21, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 159, 165, 5, 28, 0, 0, 160, + 165, 5, 16, 0, 0, 161, 165, 5, 17, 0, 0, 162, 165, 5, 18, 0, 0, 163, 165, + 3, 40, 20, 0, 164, 159, 1, 0, 0, 0, 164, 160, 1, 0, 0, 0, 164, 161, 1, + 0, 0, 0, 164, 162, 1, 0, 0, 0, 164, 163, 1, 0, 0, 0, 165, 23, 1, 0, 0, + 0, 166, 183, 5, 12, 0, 0, 167, 169, 5, 29, 0, 0, 168, 167, 1, 0, 0, 0, + 169, 170, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, + 180, 1, 0, 0, 0, 172, 174, 3, 26, 13, 0, 173, 175, 5, 29, 0, 0, 174, 173, + 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, + 0, 0, 177, 179, 1, 0, 0, 0, 178, 172, 1, 0, 0, 0, 179, 182, 1, 0, 0, 0, + 180, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, + 180, 1, 0, 0, 0, 183, 168, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, + 1, 0, 0, 0, 185, 186, 5, 13, 0, 0, 186, 25, 1, 0, 0, 0, 187, 190, 3, 40, + 20, 0, 188, 190, 3, 12, 6, 0, 189, 187, 1, 0, 0, 0, 189, 188, 1, 0, 0, + 0, 190, 191, 1, 0, 0, 0, 191, 192, 5, 10, 0, 0, 192, 193, 3, 14, 7, 0, + 193, 27, 1, 0, 0, 0, 194, 206, 5, 4, 0, 0, 195, 197, 5, 29, 0, 0, 196, + 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, + 1, 0, 0, 0, 199, 203, 1, 0, 0, 0, 200, 202, 3, 30, 15, 0, 201, 200, 1, + 0, 0, 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, + 0, 204, 207, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 196, 1, 0, 0, 0, 206, + 207, 1, 0, 0, 0, 207, 208, 1, 0, 0, 0, 208, 209, 5, 5, 0, 0, 209, 29, 1, + 0, 0, 0, 210, 212, 3, 14, 7, 0, 211, 213, 5, 29, 0, 0, 212, 211, 1, 0, + 0, 0, 213, 214, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, + 215, 31, 1, 0, 0, 0, 216, 217, 5, 2, 0, 0, 217, 218, 3, 34, 17, 0, 218, + 219, 5, 29, 0, 0, 219, 33, 1, 0, 0, 0, 220, 226, 3, 36, 18, 0, 221, 222, + 3, 14, 7, 0, 222, 223, 5, 8, 0, 0, 223, 224, 3, 36, 18, 0, 224, 226, 1, + 0, 0, 0, 225, 220, 1, 0, 0, 0, 225, 221, 1, 0, 0, 0, 226, 35, 1, 0, 0, + 0, 227, 228, 3, 40, 20, 0, 228, 230, 5, 6, 0, 0, 229, 231, 3, 38, 19, 0, + 230, 229, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, + 233, 5, 7, 0, 0, 233, 37, 1, 0, 0, 0, 234, 239, 3, 14, 7, 0, 235, 236, + 5, 3, 0, 0, 236, 238, 3, 14, 7, 0, 237, 235, 1, 0, 0, 0, 238, 241, 1, 0, + 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 39, 1, 0, 0, 0, + 241, 239, 1, 0, 0, 0, 242, 243, 7, 0, 0, 0, 243, 41, 1, 0, 0, 0, 27, 45, + 54, 59, 66, 71, 73, 83, 95, 111, 118, 134, 136, 145, 156, 164, 170, 176, + 180, 183, 189, 198, 203, 206, 214, 225, 230, 239, + } + deserializer := antlr.NewATNDeserializer(nil) + staticData.atn = deserializer.Deserialize(staticData.serializedATN) + atn := staticData.atn + staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) + decisionToDFA := staticData.decisionToDFA + for index, state := range atn.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(state, index) + } +} + +// bicepParserInit initializes any static state used to implement bicepParser. By default the +// static state used to implement the parser is lazily initialized during the first call to +// NewbicepParser(). You can call this function if you wish to initialize the static state ahead +// of time. +func BicepParserInit() { + staticData := &BicepParserStaticData + staticData.once.Do(bicepParserInit) +} + +// NewbicepParser produces a new parser instance for the optional input antlr.TokenStream. +func NewbicepParser(input antlr.TokenStream) *bicepParser { + BicepParserInit() + this := new(bicepParser) + this.BaseParser = antlr.NewBaseParser(input) + staticData := &BicepParserStaticData + this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache) + this.RuleNames = staticData.RuleNames + this.LiteralNames = staticData.LiteralNames + this.SymbolicNames = staticData.SymbolicNames + this.GrammarFileName = "bicep.g4" + + return this +} + +// bicepParser tokens. +const ( + bicepParserEOF = antlr.TokenEOF + bicepParserMULTILINE_STRING = 1 + bicepParserAT = 2 + bicepParserCOMMA = 3 + bicepParserOBRACK = 4 + bicepParserCBRACK = 5 + bicepParserOPAR = 6 + bicepParserCPAR = 7 + bicepParserDOT = 8 + bicepParserPIPE = 9 + bicepParserCOL = 10 + bicepParserASSIGN = 11 + bicepParserOBRACE = 12 + bicepParserCBRACE = 13 + bicepParserPARAM = 14 + bicepParserVAR = 15 + bicepParserTRUE = 16 + bicepParserFALSE = 17 + bicepParserNULL = 18 + bicepParserRESOURCE = 19 + bicepParserSTRING_LEFT_PIECE = 20 + bicepParserSTRING_MIDDLE_PIECE = 21 + bicepParserSTRING_RIGHT_PIECE = 22 + bicepParserSTRING_COMPLETE = 23 + bicepParserSTRING = 24 + bicepParserINT = 25 + bicepParserBOOL = 26 + bicepParserIDENTIFIER = 27 + bicepParserNUMBER = 28 + bicepParserNL = 29 + bicepParserSPACES = 30 + bicepParserUNKNOWN = 31 +) + +// bicepParser rules. +const ( + bicepParserRULE_program = 0 + bicepParserRULE_statement = 1 + bicepParserRULE_parameterDecl = 2 + bicepParserRULE_parameterDefaultValue = 3 + bicepParserRULE_variableDecl = 4 + bicepParserRULE_resourceDecl = 5 + bicepParserRULE_interpString = 6 + bicepParserRULE_expression = 7 + bicepParserRULE_primaryExpression = 8 + bicepParserRULE_parenthesizedExpression = 9 + bicepParserRULE_typeExpression = 10 + bicepParserRULE_literalValue = 11 + bicepParserRULE_object = 12 + bicepParserRULE_objectProperty = 13 + bicepParserRULE_array = 14 + bicepParserRULE_arrayItem = 15 + bicepParserRULE_decorator = 16 + bicepParserRULE_decoratorExpression = 17 + bicepParserRULE_functionCall = 18 + bicepParserRULE_argumentList = 19 + bicepParserRULE_identifier = 20 +) + +// IProgramContext is an interface to support dynamic dispatch. +type IProgramContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + EOF() antlr.TerminalNode + AllStatement() []IStatementContext + Statement(i int) IStatementContext + + // IsProgramContext differentiates from other interfaces. + IsProgramContext() +} + +type ProgramContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyProgramContext() *ProgramContext { + var p = new(ProgramContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_program + return p +} + +func InitEmptyProgramContext(p *ProgramContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_program +} + +func (*ProgramContext) IsProgramContext() {} + +func NewProgramContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ProgramContext { + var p = new(ProgramContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_program + + return p +} + +func (s *ProgramContext) GetParser() antlr.Parser { return s.parser } + +func (s *ProgramContext) EOF() antlr.TerminalNode { + return s.GetToken(bicepParserEOF, 0) +} + +func (s *ProgramContext) AllStatement() []IStatementContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IStatementContext); ok { + len++ + } + } + + tst := make([]IStatementContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IStatementContext); ok { + tst[i] = t.(IStatementContext) + i++ + } + } + + return tst +} + +func (s *ProgramContext) Statement(i int) IStatementContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStatementContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IStatementContext) +} + +func (s *ProgramContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ProgramContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ProgramContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterProgram(s) + } +} + +func (s *ProgramContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitProgram(s) + } +} + +func (s *ProgramContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitProgram(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) Program() (localctx IProgramContext) { + localctx = NewProgramContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 0, bicepParserRULE_program) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(45) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&537444356) != 0 { + { + p.SetState(42) + p.Statement() + } + + p.SetState(47) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(48) + p.Match(bicepParserEOF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IStatementContext is an interface to support dynamic dispatch. +type IStatementContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + ParameterDecl() IParameterDeclContext + VariableDecl() IVariableDeclContext + ResourceDecl() IResourceDeclContext + NL() antlr.TerminalNode + + // IsStatementContext differentiates from other interfaces. + IsStatementContext() +} + +type StatementContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyStatementContext() *StatementContext { + var p = new(StatementContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_statement + return p +} + +func InitEmptyStatementContext(p *StatementContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_statement +} + +func (*StatementContext) IsStatementContext() {} + +func NewStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StatementContext { + var p = new(StatementContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_statement + + return p +} + +func (s *StatementContext) GetParser() antlr.Parser { return s.parser } + +func (s *StatementContext) ParameterDecl() IParameterDeclContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IParameterDeclContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IParameterDeclContext) +} + +func (s *StatementContext) VariableDecl() IVariableDeclContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IVariableDeclContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IVariableDeclContext) +} + +func (s *StatementContext) ResourceDecl() IResourceDeclContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IResourceDeclContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IResourceDeclContext) +} + +func (s *StatementContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *StatementContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *StatementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *StatementContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterStatement(s) + } +} + +func (s *StatementContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitStatement(s) + } +} + +func (s *StatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitStatement(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) Statement() (localctx IStatementContext) { + localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 2, bicepParserRULE_statement) + p.SetState(54) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 1, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(50) + p.ParameterDecl() + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(51) + p.VariableDecl() + } + + case 3: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(52) + p.ResourceDecl() + } + + case 4: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(53) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IParameterDeclContext is an interface to support dynamic dispatch. +type IParameterDeclContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetName returns the name rule contexts. + GetName() IIdentifierContext + + // GetType_ returns the type_ rule contexts. + GetType_() IInterpStringContext + + // SetName sets the name rule contexts. + SetName(IIdentifierContext) + + // SetType_ sets the type_ rule contexts. + SetType_(IInterpStringContext) + + // Getter signatures + PARAM() antlr.TerminalNode + NL() antlr.TerminalNode + Identifier() IIdentifierContext + TypeExpression() ITypeExpressionContext + RESOURCE() antlr.TerminalNode + AllDecorator() []IDecoratorContext + Decorator(i int) IDecoratorContext + InterpString() IInterpStringContext + ParameterDefaultValue() IParameterDefaultValueContext + + // IsParameterDeclContext differentiates from other interfaces. + IsParameterDeclContext() +} + +type ParameterDeclContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + name IIdentifierContext + type_ IInterpStringContext +} + +func NewEmptyParameterDeclContext() *ParameterDeclContext { + var p = new(ParameterDeclContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_parameterDecl + return p +} + +func InitEmptyParameterDeclContext(p *ParameterDeclContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_parameterDecl +} + +func (*ParameterDeclContext) IsParameterDeclContext() {} + +func NewParameterDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParameterDeclContext { + var p = new(ParameterDeclContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_parameterDecl + + return p +} + +func (s *ParameterDeclContext) GetParser() antlr.Parser { return s.parser } + +func (s *ParameterDeclContext) GetName() IIdentifierContext { return s.name } + +func (s *ParameterDeclContext) GetType_() IInterpStringContext { return s.type_ } + +func (s *ParameterDeclContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *ParameterDeclContext) SetType_(v IInterpStringContext) { s.type_ = v } + +func (s *ParameterDeclContext) PARAM() antlr.TerminalNode { + return s.GetToken(bicepParserPARAM, 0) +} + +func (s *ParameterDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *ParameterDeclContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *ParameterDeclContext) TypeExpression() ITypeExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITypeExpressionContext) +} + +func (s *ParameterDeclContext) RESOURCE() antlr.TerminalNode { + return s.GetToken(bicepParserRESOURCE, 0) +} + +func (s *ParameterDeclContext) AllDecorator() []IDecoratorContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDecoratorContext); ok { + len++ + } + } + + tst := make([]IDecoratorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) + i++ + } + } + + return tst +} + +func (s *ParameterDeclContext) Decorator(i int) IDecoratorContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecoratorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDecoratorContext) +} + +func (s *ParameterDeclContext) InterpString() IInterpStringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInterpStringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInterpStringContext) +} + +func (s *ParameterDeclContext) ParameterDefaultValue() IParameterDefaultValueContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IParameterDefaultValueContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IParameterDefaultValueContext) +} + +func (s *ParameterDeclContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ParameterDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ParameterDeclContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterParameterDecl(s) + } +} + +func (s *ParameterDeclContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitParameterDecl(s) + } +} + +func (s *ParameterDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitParameterDecl(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { + localctx = NewParameterDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 4, bicepParserRULE_parameterDecl) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(59) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserAT { + { + p.SetState(56) + p.Decorator() + } + + p.SetState(61) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(62) + p.Match(bicepParserPARAM) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(63) + + var _x = p.Identifier() + + localctx.(*ParameterDeclContext).name = _x + } + p.SetState(73) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext()) { + case 1: + { + p.SetState(64) + p.TypeExpression() + } + p.SetState(66) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == bicepParserASSIGN { + { + p.SetState(65) + p.ParameterDefaultValue() + } + + } + + case 2: + { + p.SetState(68) + p.Match(bicepParserRESOURCE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(69) + + var _x = p.InterpString() + + localctx.(*ParameterDeclContext).type_ = _x + } + p.SetState(71) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == bicepParserASSIGN { + { + p.SetState(70) + p.ParameterDefaultValue() + } + + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + { + p.SetState(75) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IParameterDefaultValueContext is an interface to support dynamic dispatch. +type IParameterDefaultValueContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + ASSIGN() antlr.TerminalNode + Expression() IExpressionContext + + // IsParameterDefaultValueContext differentiates from other interfaces. + IsParameterDefaultValueContext() +} + +type ParameterDefaultValueContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyParameterDefaultValueContext() *ParameterDefaultValueContext { + var p = new(ParameterDefaultValueContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_parameterDefaultValue + return p +} + +func InitEmptyParameterDefaultValueContext(p *ParameterDefaultValueContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_parameterDefaultValue +} + +func (*ParameterDefaultValueContext) IsParameterDefaultValueContext() {} + +func NewParameterDefaultValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParameterDefaultValueContext { + var p = new(ParameterDefaultValueContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_parameterDefaultValue + + return p +} + +func (s *ParameterDefaultValueContext) GetParser() antlr.Parser { return s.parser } + +func (s *ParameterDefaultValueContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) +} + +func (s *ParameterDefaultValueContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *ParameterDefaultValueContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ParameterDefaultValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ParameterDefaultValueContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterParameterDefaultValue(s) + } +} + +func (s *ParameterDefaultValueContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitParameterDefaultValue(s) + } +} + +func (s *ParameterDefaultValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitParameterDefaultValue(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) ParameterDefaultValue() (localctx IParameterDefaultValueContext) { + localctx = NewParameterDefaultValueContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 6, bicepParserRULE_parameterDefaultValue) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(77) + p.Match(bicepParserASSIGN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(78) + p.expression(0) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IVariableDeclContext is an interface to support dynamic dispatch. +type IVariableDeclContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetName returns the name rule contexts. + GetName() IIdentifierContext + + // SetName sets the name rule contexts. + SetName(IIdentifierContext) + + // Getter signatures + VAR() antlr.TerminalNode + ASSIGN() antlr.TerminalNode + Expression() IExpressionContext + NL() antlr.TerminalNode + Identifier() IIdentifierContext + AllDecorator() []IDecoratorContext + Decorator(i int) IDecoratorContext + + // IsVariableDeclContext differentiates from other interfaces. + IsVariableDeclContext() +} + +type VariableDeclContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + name IIdentifierContext +} + +func NewEmptyVariableDeclContext() *VariableDeclContext { + var p = new(VariableDeclContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_variableDecl + return p +} + +func InitEmptyVariableDeclContext(p *VariableDeclContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_variableDecl +} + +func (*VariableDeclContext) IsVariableDeclContext() {} + +func NewVariableDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *VariableDeclContext { + var p = new(VariableDeclContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_variableDecl + + return p +} + +func (s *VariableDeclContext) GetParser() antlr.Parser { return s.parser } + +func (s *VariableDeclContext) GetName() IIdentifierContext { return s.name } + +func (s *VariableDeclContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *VariableDeclContext) VAR() antlr.TerminalNode { + return s.GetToken(bicepParserVAR, 0) +} + +func (s *VariableDeclContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) +} + +func (s *VariableDeclContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *VariableDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *VariableDeclContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *VariableDeclContext) AllDecorator() []IDecoratorContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDecoratorContext); ok { + len++ + } + } + + tst := make([]IDecoratorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) + i++ + } + } + + return tst +} + +func (s *VariableDeclContext) Decorator(i int) IDecoratorContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecoratorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDecoratorContext) +} + +func (s *VariableDeclContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *VariableDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *VariableDeclContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterVariableDecl(s) + } +} + +func (s *VariableDeclContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitVariableDecl(s) + } +} + +func (s *VariableDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitVariableDecl(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { + localctx = NewVariableDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 8, bicepParserRULE_variableDecl) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(83) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserAT { + { + p.SetState(80) + p.Decorator() + } + + p.SetState(85) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(86) + p.Match(bicepParserVAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(87) + + var _x = p.Identifier() + + localctx.(*VariableDeclContext).name = _x + } + { + p.SetState(88) + p.Match(bicepParserASSIGN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(89) + p.expression(0) + } + { + p.SetState(90) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IResourceDeclContext is an interface to support dynamic dispatch. +type IResourceDeclContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetName returns the name rule contexts. + GetName() IIdentifierContext + + // GetType_ returns the type_ rule contexts. + GetType_() IInterpStringContext + + // SetName sets the name rule contexts. + SetName(IIdentifierContext) + + // SetType_ sets the type_ rule contexts. + SetType_(IInterpStringContext) + + // Getter signatures + RESOURCE() antlr.TerminalNode + ASSIGN() antlr.TerminalNode + NL() antlr.TerminalNode + Identifier() IIdentifierContext + InterpString() IInterpStringContext + Object() IObjectContext + AllDecorator() []IDecoratorContext + Decorator(i int) IDecoratorContext + + // IsResourceDeclContext differentiates from other interfaces. + IsResourceDeclContext() +} + +type ResourceDeclContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + name IIdentifierContext + type_ IInterpStringContext +} + +func NewEmptyResourceDeclContext() *ResourceDeclContext { + var p = new(ResourceDeclContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_resourceDecl + return p +} + +func InitEmptyResourceDeclContext(p *ResourceDeclContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_resourceDecl +} + +func (*ResourceDeclContext) IsResourceDeclContext() {} + +func NewResourceDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ResourceDeclContext { + var p = new(ResourceDeclContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_resourceDecl + + return p +} + +func (s *ResourceDeclContext) GetParser() antlr.Parser { return s.parser } + +func (s *ResourceDeclContext) GetName() IIdentifierContext { return s.name } + +func (s *ResourceDeclContext) GetType_() IInterpStringContext { return s.type_ } + +func (s *ResourceDeclContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *ResourceDeclContext) SetType_(v IInterpStringContext) { s.type_ = v } + +func (s *ResourceDeclContext) RESOURCE() antlr.TerminalNode { + return s.GetToken(bicepParserRESOURCE, 0) +} + +func (s *ResourceDeclContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) +} + +func (s *ResourceDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *ResourceDeclContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *ResourceDeclContext) InterpString() IInterpStringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInterpStringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInterpStringContext) +} + +func (s *ResourceDeclContext) Object() IObjectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IObjectContext) +} + +func (s *ResourceDeclContext) AllDecorator() []IDecoratorContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDecoratorContext); ok { + len++ + } + } + + tst := make([]IDecoratorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) + i++ + } + } + + return tst +} + +func (s *ResourceDeclContext) Decorator(i int) IDecoratorContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecoratorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDecoratorContext) +} + +func (s *ResourceDeclContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ResourceDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ResourceDeclContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterResourceDecl(s) + } +} + +func (s *ResourceDeclContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitResourceDecl(s) + } +} + +func (s *ResourceDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitResourceDecl(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { + localctx = NewResourceDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 10, bicepParserRULE_resourceDecl) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(95) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserAT { + { + p.SetState(92) + p.Decorator() + } + + p.SetState(97) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(98) + p.Match(bicepParserRESOURCE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(99) + + var _x = p.Identifier() + + localctx.(*ResourceDeclContext).name = _x + } + { + p.SetState(100) + + var _x = p.InterpString() + + localctx.(*ResourceDeclContext).type_ = _x + } + { + p.SetState(101) + p.Match(bicepParserASSIGN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + { + p.SetState(102) + p.Object() + } + + { + p.SetState(103) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IInterpStringContext is an interface to support dynamic dispatch. +type IInterpStringContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + STRING_LEFT_PIECE() antlr.TerminalNode + AllExpression() []IExpressionContext + Expression(i int) IExpressionContext + STRING_RIGHT_PIECE() antlr.TerminalNode + AllSTRING_MIDDLE_PIECE() []antlr.TerminalNode + STRING_MIDDLE_PIECE(i int) antlr.TerminalNode + STRING_COMPLETE() antlr.TerminalNode + + // IsInterpStringContext differentiates from other interfaces. + IsInterpStringContext() +} + +type InterpStringContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyInterpStringContext() *InterpStringContext { + var p = new(InterpStringContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_interpString + return p +} + +func InitEmptyInterpStringContext(p *InterpStringContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_interpString +} + +func (*InterpStringContext) IsInterpStringContext() {} + +func NewInterpStringContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *InterpStringContext { + var p = new(InterpStringContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_interpString + + return p +} + +func (s *InterpStringContext) GetParser() antlr.Parser { return s.parser } + +func (s *InterpStringContext) STRING_LEFT_PIECE() antlr.TerminalNode { + return s.GetToken(bicepParserSTRING_LEFT_PIECE, 0) +} + +func (s *InterpStringContext) AllExpression() []IExpressionContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExpressionContext); ok { + len++ + } + } + + tst := make([]IExpressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExpressionContext); ok { + tst[i] = t.(IExpressionContext) + i++ + } + } + + return tst +} + +func (s *InterpStringContext) Expression(i int) IExpressionContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *InterpStringContext) STRING_RIGHT_PIECE() antlr.TerminalNode { + return s.GetToken(bicepParserSTRING_RIGHT_PIECE, 0) +} + +func (s *InterpStringContext) AllSTRING_MIDDLE_PIECE() []antlr.TerminalNode { + return s.GetTokens(bicepParserSTRING_MIDDLE_PIECE) +} + +func (s *InterpStringContext) STRING_MIDDLE_PIECE(i int) antlr.TerminalNode { + return s.GetToken(bicepParserSTRING_MIDDLE_PIECE, i) +} + +func (s *InterpStringContext) STRING_COMPLETE() antlr.TerminalNode { + return s.GetToken(bicepParserSTRING_COMPLETE, 0) +} + +func (s *InterpStringContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *InterpStringContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *InterpStringContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterInterpString(s) + } +} + +func (s *InterpStringContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitInterpString(s) + } +} + +func (s *InterpStringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitInterpString(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) InterpString() (localctx IInterpStringContext) { + localctx = NewInterpStringContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 12, bicepParserRULE_interpString) + var _alt int + + p.SetState(118) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case bicepParserSTRING_LEFT_PIECE: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(105) + p.Match(bicepParserSTRING_LEFT_PIECE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(111) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(106) + p.expression(0) + } + { + p.SetState(107) + p.Match(bicepParserSTRING_MIDDLE_PIECE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + p.SetState(113) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + { + p.SetState(114) + p.expression(0) + } + { + p.SetState(115) + p.Match(bicepParserSTRING_RIGHT_PIECE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case bicepParserSTRING_COMPLETE: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(117) + p.Match(bicepParserSTRING_COMPLETE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExpressionContext is an interface to support dynamic dispatch. +type IExpressionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetProperty returns the property rule contexts. + GetProperty() IIdentifierContext + + // GetName returns the name rule contexts. + GetName() IIdentifierContext + + // SetProperty sets the property rule contexts. + SetProperty(IIdentifierContext) + + // SetName sets the name rule contexts. + SetName(IIdentifierContext) + + // Getter signatures + PrimaryExpression() IPrimaryExpressionContext + AllExpression() []IExpressionContext + Expression(i int) IExpressionContext + OBRACK() antlr.TerminalNode + CBRACK() antlr.TerminalNode + DOT() antlr.TerminalNode + Identifier() IIdentifierContext + COL() antlr.TerminalNode + + // IsExpressionContext differentiates from other interfaces. + IsExpressionContext() +} + +type ExpressionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + property IIdentifierContext + name IIdentifierContext +} + +func NewEmptyExpressionContext() *ExpressionContext { + var p = new(ExpressionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_expression + return p +} + +func InitEmptyExpressionContext(p *ExpressionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_expression +} + +func (*ExpressionContext) IsExpressionContext() {} + +func NewExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExpressionContext { + var p = new(ExpressionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_expression + + return p +} + +func (s *ExpressionContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExpressionContext) GetProperty() IIdentifierContext { return s.property } + +func (s *ExpressionContext) GetName() IIdentifierContext { return s.name } + +func (s *ExpressionContext) SetProperty(v IIdentifierContext) { s.property = v } + +func (s *ExpressionContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *ExpressionContext) PrimaryExpression() IPrimaryExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPrimaryExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPrimaryExpressionContext) +} + +func (s *ExpressionContext) AllExpression() []IExpressionContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExpressionContext); ok { + len++ + } + } + + tst := make([]IExpressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExpressionContext); ok { + tst[i] = t.(IExpressionContext) + i++ + } + } + + return tst +} + +func (s *ExpressionContext) Expression(i int) IExpressionContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *ExpressionContext) OBRACK() antlr.TerminalNode { + return s.GetToken(bicepParserOBRACK, 0) +} + +func (s *ExpressionContext) CBRACK() antlr.TerminalNode { + return s.GetToken(bicepParserCBRACK, 0) +} + +func (s *ExpressionContext) DOT() antlr.TerminalNode { + return s.GetToken(bicepParserDOT, 0) +} + +func (s *ExpressionContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *ExpressionContext) COL() antlr.TerminalNode { + return s.GetToken(bicepParserCOL, 0) +} + +func (s *ExpressionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ExpressionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterExpression(s) + } +} + +func (s *ExpressionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitExpression(s) + } +} + +func (s *ExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitExpression(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) Expression() (localctx IExpressionContext) { + return p.expression(0) +} + +func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewExpressionContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx IExpressionContext = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 14 + p.EnterRecursionRule(localctx, 14, bicepParserRULE_expression, _p) + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(121) + p.PrimaryExpression() + } + + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(136) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + p.SetState(134) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 10, p.GetParserRuleContext()) { + case 1: + localctx = NewExpressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) + p.SetState(123) + + if !(p.Precpred(p.GetParserRuleContext(), 4)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) + goto errorExit + } + { + p.SetState(124) + p.Match(bicepParserOBRACK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(125) + p.expression(0) + } + { + p.SetState(126) + p.Match(bicepParserCBRACK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + localctx = NewExpressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) + p.SetState(128) + + if !(p.Precpred(p.GetParserRuleContext(), 3)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + goto errorExit + } + { + p.SetState(129) + p.Match(bicepParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(130) + + var _x = p.Identifier() + + localctx.(*ExpressionContext).property = _x + } + + case 3: + localctx = NewExpressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) + p.SetState(131) + + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + goto errorExit + } + { + p.SetState(132) + p.Match(bicepParserCOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(133) + + var _x = p.Identifier() + + localctx.(*ExpressionContext).name = _x + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + + } + p.SetState(138) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IPrimaryExpressionContext is an interface to support dynamic dispatch. +type IPrimaryExpressionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + LiteralValue() ILiteralValueContext + InterpString() IInterpStringContext + MULTILINE_STRING() antlr.TerminalNode + Array() IArrayContext + Object() IObjectContext + ParenthesizedExpression() IParenthesizedExpressionContext + + // IsPrimaryExpressionContext differentiates from other interfaces. + IsPrimaryExpressionContext() +} + +type PrimaryExpressionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyPrimaryExpressionContext() *PrimaryExpressionContext { + var p = new(PrimaryExpressionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_primaryExpression + return p +} + +func InitEmptyPrimaryExpressionContext(p *PrimaryExpressionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_primaryExpression +} + +func (*PrimaryExpressionContext) IsPrimaryExpressionContext() {} + +func NewPrimaryExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PrimaryExpressionContext { + var p = new(PrimaryExpressionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_primaryExpression + + return p +} + +func (s *PrimaryExpressionContext) GetParser() antlr.Parser { return s.parser } + +func (s *PrimaryExpressionContext) LiteralValue() ILiteralValueContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILiteralValueContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ILiteralValueContext) +} + +func (s *PrimaryExpressionContext) InterpString() IInterpStringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInterpStringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInterpStringContext) +} + +func (s *PrimaryExpressionContext) MULTILINE_STRING() antlr.TerminalNode { + return s.GetToken(bicepParserMULTILINE_STRING, 0) +} + +func (s *PrimaryExpressionContext) Array() IArrayContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArrayContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArrayContext) +} + +func (s *PrimaryExpressionContext) Object() IObjectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IObjectContext) +} + +func (s *PrimaryExpressionContext) ParenthesizedExpression() IParenthesizedExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IParenthesizedExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IParenthesizedExpressionContext) +} + +func (s *PrimaryExpressionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PrimaryExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *PrimaryExpressionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterPrimaryExpression(s) + } +} + +func (s *PrimaryExpressionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitPrimaryExpression(s) + } +} + +func (s *PrimaryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitPrimaryExpression(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { + localctx = NewPrimaryExpressionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 16, bicepParserRULE_primaryExpression) + p.SetState(145) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER, bicepParserNUMBER: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(139) + p.LiteralValue() + } + + case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(140) + p.InterpString() + } + + case bicepParserMULTILINE_STRING: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(141) + p.Match(bicepParserMULTILINE_STRING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case bicepParserOBRACK: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(142) + p.Array() + } + + case bicepParserOBRACE: + p.EnterOuterAlt(localctx, 5) + { + p.SetState(143) + p.Object() + } + + case bicepParserOPAR: + p.EnterOuterAlt(localctx, 6) + { + p.SetState(144) + p.ParenthesizedExpression() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IParenthesizedExpressionContext is an interface to support dynamic dispatch. +type IParenthesizedExpressionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + OPAR() antlr.TerminalNode + Expression() IExpressionContext + CPAR() antlr.TerminalNode + + // IsParenthesizedExpressionContext differentiates from other interfaces. + IsParenthesizedExpressionContext() +} + +type ParenthesizedExpressionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyParenthesizedExpressionContext() *ParenthesizedExpressionContext { + var p = new(ParenthesizedExpressionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_parenthesizedExpression + return p +} + +func InitEmptyParenthesizedExpressionContext(p *ParenthesizedExpressionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_parenthesizedExpression +} + +func (*ParenthesizedExpressionContext) IsParenthesizedExpressionContext() {} + +func NewParenthesizedExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParenthesizedExpressionContext { + var p = new(ParenthesizedExpressionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_parenthesizedExpression + + return p +} + +func (s *ParenthesizedExpressionContext) GetParser() antlr.Parser { return s.parser } + +func (s *ParenthesizedExpressionContext) OPAR() antlr.TerminalNode { + return s.GetToken(bicepParserOPAR, 0) +} + +func (s *ParenthesizedExpressionContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *ParenthesizedExpressionContext) CPAR() antlr.TerminalNode { + return s.GetToken(bicepParserCPAR, 0) +} + +func (s *ParenthesizedExpressionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ParenthesizedExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ParenthesizedExpressionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterParenthesizedExpression(s) + } +} + +func (s *ParenthesizedExpressionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitParenthesizedExpression(s) + } +} + +func (s *ParenthesizedExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitParenthesizedExpression(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressionContext) { + localctx = NewParenthesizedExpressionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, bicepParserRULE_parenthesizedExpression) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(147) + p.Match(bicepParserOPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(148) + p.expression(0) + } + { + p.SetState(149) + p.Match(bicepParserCPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ITypeExpressionContext is an interface to support dynamic dispatch. +type ITypeExpressionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetType_ returns the type_ rule contexts. + GetType_() IIdentifierContext + + // SetType_ sets the type_ rule contexts. + SetType_(IIdentifierContext) + + // Getter signatures + AllIdentifier() []IIdentifierContext + Identifier(i int) IIdentifierContext + AllPIPE() []antlr.TerminalNode + PIPE(i int) antlr.TerminalNode + + // IsTypeExpressionContext differentiates from other interfaces. + IsTypeExpressionContext() +} + +type TypeExpressionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + type_ IIdentifierContext +} + +func NewEmptyTypeExpressionContext() *TypeExpressionContext { + var p = new(TypeExpressionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_typeExpression + return p +} + +func InitEmptyTypeExpressionContext(p *TypeExpressionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_typeExpression +} + +func (*TypeExpressionContext) IsTypeExpressionContext() {} + +func NewTypeExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeExpressionContext { + var p = new(TypeExpressionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_typeExpression + + return p +} + +func (s *TypeExpressionContext) GetParser() antlr.Parser { return s.parser } + +func (s *TypeExpressionContext) GetType_() IIdentifierContext { return s.type_ } + +func (s *TypeExpressionContext) SetType_(v IIdentifierContext) { s.type_ = v } + +func (s *TypeExpressionContext) AllIdentifier() []IIdentifierContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IIdentifierContext); ok { + len++ + } + } + + tst := make([]IIdentifierContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IIdentifierContext); ok { + tst[i] = t.(IIdentifierContext) + i++ + } + } + + return tst +} + +func (s *TypeExpressionContext) Identifier(i int) IIdentifierContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *TypeExpressionContext) AllPIPE() []antlr.TerminalNode { + return s.GetTokens(bicepParserPIPE) +} + +func (s *TypeExpressionContext) PIPE(i int) antlr.TerminalNode { + return s.GetToken(bicepParserPIPE, i) +} + +func (s *TypeExpressionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TypeExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TypeExpressionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterTypeExpression(s) + } +} + +func (s *TypeExpressionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitTypeExpression(s) + } +} + +func (s *TypeExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitTypeExpression(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { + localctx = NewTypeExpressionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 20, bicepParserRULE_typeExpression) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(151) + + var _x = p.Identifier() + + localctx.(*TypeExpressionContext).type_ = _x + } + p.SetState(156) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserPIPE { + { + p.SetState(152) + p.Match(bicepParserPIPE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(153) + + var _x = p.Identifier() + + localctx.(*TypeExpressionContext).type_ = _x + } + + p.SetState(158) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ILiteralValueContext is an interface to support dynamic dispatch. +type ILiteralValueContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + NUMBER() antlr.TerminalNode + TRUE() antlr.TerminalNode + FALSE() antlr.TerminalNode + NULL() antlr.TerminalNode + Identifier() IIdentifierContext + + // IsLiteralValueContext differentiates from other interfaces. + IsLiteralValueContext() +} + +type LiteralValueContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyLiteralValueContext() *LiteralValueContext { + var p = new(LiteralValueContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_literalValue + return p +} + +func InitEmptyLiteralValueContext(p *LiteralValueContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_literalValue +} + +func (*LiteralValueContext) IsLiteralValueContext() {} + +func NewLiteralValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralValueContext { + var p = new(LiteralValueContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_literalValue + + return p +} + +func (s *LiteralValueContext) GetParser() antlr.Parser { return s.parser } + +func (s *LiteralValueContext) NUMBER() antlr.TerminalNode { + return s.GetToken(bicepParserNUMBER, 0) +} + +func (s *LiteralValueContext) TRUE() antlr.TerminalNode { + return s.GetToken(bicepParserTRUE, 0) +} + +func (s *LiteralValueContext) FALSE() antlr.TerminalNode { + return s.GetToken(bicepParserFALSE, 0) +} + +func (s *LiteralValueContext) NULL() antlr.TerminalNode { + return s.GetToken(bicepParserNULL, 0) +} + +func (s *LiteralValueContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *LiteralValueContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LiteralValueContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterLiteralValue(s) + } +} + +func (s *LiteralValueContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitLiteralValue(s) + } +} + +func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitLiteralValue(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { + localctx = NewLiteralValueContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 22, bicepParserRULE_literalValue) + p.SetState(164) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(159) + p.Match(bicepParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(160) + p.Match(bicepParserTRUE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 3: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(161) + p.Match(bicepParserFALSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 4: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(162) + p.Match(bicepParserNULL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 5: + p.EnterOuterAlt(localctx, 5) + { + p.SetState(163) + p.Identifier() + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IObjectContext is an interface to support dynamic dispatch. +type IObjectContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + OBRACE() antlr.TerminalNode + CBRACE() antlr.TerminalNode + AllNL() []antlr.TerminalNode + NL(i int) antlr.TerminalNode + AllObjectProperty() []IObjectPropertyContext + ObjectProperty(i int) IObjectPropertyContext + + // IsObjectContext differentiates from other interfaces. + IsObjectContext() +} + +type ObjectContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyObjectContext() *ObjectContext { + var p = new(ObjectContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_object + return p +} + +func InitEmptyObjectContext(p *ObjectContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_object +} + +func (*ObjectContext) IsObjectContext() {} + +func NewObjectContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ObjectContext { + var p = new(ObjectContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_object + + return p +} + +func (s *ObjectContext) GetParser() antlr.Parser { return s.parser } + +func (s *ObjectContext) OBRACE() antlr.TerminalNode { + return s.GetToken(bicepParserOBRACE, 0) +} + +func (s *ObjectContext) CBRACE() antlr.TerminalNode { + return s.GetToken(bicepParserCBRACE, 0) +} + +func (s *ObjectContext) AllNL() []antlr.TerminalNode { + return s.GetTokens(bicepParserNL) +} + +func (s *ObjectContext) NL(i int) antlr.TerminalNode { + return s.GetToken(bicepParserNL, i) +} + +func (s *ObjectContext) AllObjectProperty() []IObjectPropertyContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IObjectPropertyContext); ok { + len++ + } + } + + tst := make([]IObjectPropertyContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IObjectPropertyContext); ok { + tst[i] = t.(IObjectPropertyContext) + i++ + } + } + + return tst +} + +func (s *ObjectContext) ObjectProperty(i int) IObjectPropertyContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjectPropertyContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IObjectPropertyContext) +} + +func (s *ObjectContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ObjectContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ObjectContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterObject(s) + } +} + +func (s *ObjectContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitObject(s) + } +} + +func (s *ObjectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitObject(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) Object() (localctx IObjectContext) { + localctx = NewObjectContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 24, bicepParserRULE_object) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(166) + p.Match(bicepParserOBRACE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(183) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == bicepParserNL { + p.SetState(168) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = _la == bicepParserNL { + { + p.SetState(167) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(170) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(180) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&262127616) != 0 { + { + p.SetState(172) + p.ObjectProperty() + } + p.SetState(174) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = _la == bicepParserNL { + { + p.SetState(173) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(176) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + p.SetState(182) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(185) + p.Match(bicepParserCBRACE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IObjectPropertyContext is an interface to support dynamic dispatch. +type IObjectPropertyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetName returns the name rule contexts. + GetName() IIdentifierContext + + // SetName sets the name rule contexts. + SetName(IIdentifierContext) + + // Getter signatures + COL() antlr.TerminalNode + Expression() IExpressionContext + InterpString() IInterpStringContext + Identifier() IIdentifierContext + + // IsObjectPropertyContext differentiates from other interfaces. + IsObjectPropertyContext() +} + +type ObjectPropertyContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + name IIdentifierContext +} + +func NewEmptyObjectPropertyContext() *ObjectPropertyContext { + var p = new(ObjectPropertyContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_objectProperty + return p +} + +func InitEmptyObjectPropertyContext(p *ObjectPropertyContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_objectProperty +} + +func (*ObjectPropertyContext) IsObjectPropertyContext() {} + +func NewObjectPropertyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ObjectPropertyContext { + var p = new(ObjectPropertyContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_objectProperty + + return p +} + +func (s *ObjectPropertyContext) GetParser() antlr.Parser { return s.parser } + +func (s *ObjectPropertyContext) GetName() IIdentifierContext { return s.name } + +func (s *ObjectPropertyContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *ObjectPropertyContext) COL() antlr.TerminalNode { + return s.GetToken(bicepParserCOL, 0) +} + +func (s *ObjectPropertyContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *ObjectPropertyContext) InterpString() IInterpStringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInterpStringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInterpStringContext) +} + +func (s *ObjectPropertyContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *ObjectPropertyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ObjectPropertyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ObjectPropertyContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterObjectProperty(s) + } +} + +func (s *ObjectPropertyContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitObjectProperty(s) + } +} + +func (s *ObjectPropertyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitObjectProperty(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { + localctx = NewObjectPropertyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 26, bicepParserRULE_objectProperty) + p.EnterOuterAlt(localctx, 1) + p.SetState(189) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: + { + p.SetState(187) + + var _x = p.Identifier() + + localctx.(*ObjectPropertyContext).name = _x + } + + case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: + { + p.SetState(188) + p.InterpString() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + { + p.SetState(191) + p.Match(bicepParserCOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(192) + p.expression(0) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IArrayContext is an interface to support dynamic dispatch. +type IArrayContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + OBRACK() antlr.TerminalNode + CBRACK() antlr.TerminalNode + AllNL() []antlr.TerminalNode + NL(i int) antlr.TerminalNode + AllArrayItem() []IArrayItemContext + ArrayItem(i int) IArrayItemContext + + // IsArrayContext differentiates from other interfaces. + IsArrayContext() +} + +type ArrayContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyArrayContext() *ArrayContext { + var p = new(ArrayContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_array + return p +} + +func InitEmptyArrayContext(p *ArrayContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_array +} + +func (*ArrayContext) IsArrayContext() {} + +func NewArrayContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArrayContext { + var p = new(ArrayContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_array + + return p +} + +func (s *ArrayContext) GetParser() antlr.Parser { return s.parser } + +func (s *ArrayContext) OBRACK() antlr.TerminalNode { + return s.GetToken(bicepParserOBRACK, 0) +} + +func (s *ArrayContext) CBRACK() antlr.TerminalNode { + return s.GetToken(bicepParserCBRACK, 0) +} + +func (s *ArrayContext) AllNL() []antlr.TerminalNode { + return s.GetTokens(bicepParserNL) +} + +func (s *ArrayContext) NL(i int) antlr.TerminalNode { + return s.GetToken(bicepParserNL, i) +} + +func (s *ArrayContext) AllArrayItem() []IArrayItemContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IArrayItemContext); ok { + len++ + } + } + + tst := make([]IArrayItemContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IArrayItemContext); ok { + tst[i] = t.(IArrayItemContext) + i++ + } + } + + return tst +} + +func (s *ArrayContext) ArrayItem(i int) IArrayItemContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArrayItemContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IArrayItemContext) +} + +func (s *ArrayContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ArrayContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ArrayContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterArray(s) + } +} + +func (s *ArrayContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitArray(s) + } +} + +func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitArray(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) Array() (localctx IArrayContext) { + localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 28, bicepParserRULE_array) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(194) + p.Match(bicepParserOBRACK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(206) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == bicepParserNL { + p.SetState(196) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = _la == bicepParserNL { + { + p.SetState(195) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(198) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(203) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&530567250) != 0 { + { + p.SetState(200) + p.ArrayItem() + } + + p.SetState(205) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(208) + p.Match(bicepParserCBRACK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IArrayItemContext is an interface to support dynamic dispatch. +type IArrayItemContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Expression() IExpressionContext + AllNL() []antlr.TerminalNode + NL(i int) antlr.TerminalNode + + // IsArrayItemContext differentiates from other interfaces. + IsArrayItemContext() +} + +type ArrayItemContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyArrayItemContext() *ArrayItemContext { + var p = new(ArrayItemContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_arrayItem + return p +} + +func InitEmptyArrayItemContext(p *ArrayItemContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_arrayItem +} + +func (*ArrayItemContext) IsArrayItemContext() {} + +func NewArrayItemContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArrayItemContext { + var p = new(ArrayItemContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_arrayItem + + return p +} + +func (s *ArrayItemContext) GetParser() antlr.Parser { return s.parser } + +func (s *ArrayItemContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *ArrayItemContext) AllNL() []antlr.TerminalNode { + return s.GetTokens(bicepParserNL) +} + +func (s *ArrayItemContext) NL(i int) antlr.TerminalNode { + return s.GetToken(bicepParserNL, i) +} + +func (s *ArrayItemContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ArrayItemContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ArrayItemContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterArrayItem(s) + } +} + +func (s *ArrayItemContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitArrayItem(s) + } +} + +func (s *ArrayItemContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitArrayItem(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { + localctx = NewArrayItemContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 30, bicepParserRULE_arrayItem) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(210) + p.expression(0) + } + p.SetState(212) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = _la == bicepParserNL { + { + p.SetState(211) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(214) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IDecoratorContext is an interface to support dynamic dispatch. +type IDecoratorContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AT() antlr.TerminalNode + DecoratorExpression() IDecoratorExpressionContext + NL() antlr.TerminalNode + + // IsDecoratorContext differentiates from other interfaces. + IsDecoratorContext() +} + +type DecoratorContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDecoratorContext() *DecoratorContext { + var p = new(DecoratorContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_decorator + return p +} + +func InitEmptyDecoratorContext(p *DecoratorContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_decorator +} + +func (*DecoratorContext) IsDecoratorContext() {} + +func NewDecoratorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DecoratorContext { + var p = new(DecoratorContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_decorator + + return p +} + +func (s *DecoratorContext) GetParser() antlr.Parser { return s.parser } + +func (s *DecoratorContext) AT() antlr.TerminalNode { + return s.GetToken(bicepParserAT, 0) +} + +func (s *DecoratorContext) DecoratorExpression() IDecoratorExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecoratorExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDecoratorExpressionContext) +} + +func (s *DecoratorContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *DecoratorContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DecoratorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DecoratorContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterDecorator(s) + } +} + +func (s *DecoratorContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitDecorator(s) + } +} + +func (s *DecoratorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitDecorator(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) Decorator() (localctx IDecoratorContext) { + localctx = NewDecoratorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 32, bicepParserRULE_decorator) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(216) + p.Match(bicepParserAT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(217) + p.DecoratorExpression() + } + { + p.SetState(218) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IDecoratorExpressionContext is an interface to support dynamic dispatch. +type IDecoratorExpressionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + FunctionCall() IFunctionCallContext + Expression() IExpressionContext + DOT() antlr.TerminalNode + + // IsDecoratorExpressionContext differentiates from other interfaces. + IsDecoratorExpressionContext() +} + +type DecoratorExpressionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDecoratorExpressionContext() *DecoratorExpressionContext { + var p = new(DecoratorExpressionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_decoratorExpression + return p +} + +func InitEmptyDecoratorExpressionContext(p *DecoratorExpressionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_decoratorExpression +} + +func (*DecoratorExpressionContext) IsDecoratorExpressionContext() {} + +func NewDecoratorExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DecoratorExpressionContext { + var p = new(DecoratorExpressionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_decoratorExpression + + return p +} + +func (s *DecoratorExpressionContext) GetParser() antlr.Parser { return s.parser } + +func (s *DecoratorExpressionContext) FunctionCall() IFunctionCallContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFunctionCallContext) +} + +func (s *DecoratorExpressionContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *DecoratorExpressionContext) DOT() antlr.TerminalNode { + return s.GetToken(bicepParserDOT, 0) +} + +func (s *DecoratorExpressionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DecoratorExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DecoratorExpressionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterDecoratorExpression(s) + } +} + +func (s *DecoratorExpressionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitDecoratorExpression(s) + } +} + +func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitDecoratorExpression(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { + localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 34, bicepParserRULE_decoratorExpression) + p.SetState(225) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(220) + p.FunctionCall() + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(221) + p.expression(0) + } + { + p.SetState(222) + p.Match(bicepParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(223) + p.FunctionCall() + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IFunctionCallContext is an interface to support dynamic dispatch. +type IFunctionCallContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Identifier() IIdentifierContext + OPAR() antlr.TerminalNode + CPAR() antlr.TerminalNode + ArgumentList() IArgumentListContext + + // IsFunctionCallContext differentiates from other interfaces. + IsFunctionCallContext() +} + +type FunctionCallContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyFunctionCallContext() *FunctionCallContext { + var p = new(FunctionCallContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_functionCall + return p +} + +func InitEmptyFunctionCallContext(p *FunctionCallContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_functionCall +} + +func (*FunctionCallContext) IsFunctionCallContext() {} + +func NewFunctionCallContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FunctionCallContext { + var p = new(FunctionCallContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_functionCall + + return p +} + +func (s *FunctionCallContext) GetParser() antlr.Parser { return s.parser } + +func (s *FunctionCallContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *FunctionCallContext) OPAR() antlr.TerminalNode { + return s.GetToken(bicepParserOPAR, 0) +} + +func (s *FunctionCallContext) CPAR() antlr.TerminalNode { + return s.GetToken(bicepParserCPAR, 0) +} + +func (s *FunctionCallContext) ArgumentList() IArgumentListContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentListContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentListContext) +} + +func (s *FunctionCallContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FunctionCallContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *FunctionCallContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterFunctionCall(s) + } +} + +func (s *FunctionCallContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitFunctionCall(s) + } +} + +func (s *FunctionCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitFunctionCall(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { + localctx = NewFunctionCallContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 36, bicepParserRULE_functionCall) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(227) + p.Identifier() + } + { + p.SetState(228) + p.Match(bicepParserOPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(230) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&530567250) != 0 { + { + p.SetState(229) + p.ArgumentList() + } + + } + { + p.SetState(232) + p.Match(bicepParserCPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IArgumentListContext is an interface to support dynamic dispatch. +type IArgumentListContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AllExpression() []IExpressionContext + Expression(i int) IExpressionContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsArgumentListContext differentiates from other interfaces. + IsArgumentListContext() +} + +type ArgumentListContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyArgumentListContext() *ArgumentListContext { + var p = new(ArgumentListContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_argumentList + return p +} + +func InitEmptyArgumentListContext(p *ArgumentListContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_argumentList +} + +func (*ArgumentListContext) IsArgumentListContext() {} + +func NewArgumentListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArgumentListContext { + var p = new(ArgumentListContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_argumentList + + return p +} + +func (s *ArgumentListContext) GetParser() antlr.Parser { return s.parser } + +func (s *ArgumentListContext) AllExpression() []IExpressionContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExpressionContext); ok { + len++ + } + } + + tst := make([]IExpressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExpressionContext); ok { + tst[i] = t.(IExpressionContext) + i++ + } + } + + return tst +} + +func (s *ArgumentListContext) Expression(i int) IExpressionContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *ArgumentListContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(bicepParserCOMMA) +} + +func (s *ArgumentListContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(bicepParserCOMMA, i) +} + +func (s *ArgumentListContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ArgumentListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ArgumentListContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterArgumentList(s) + } +} + +func (s *ArgumentListContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitArgumentList(s) + } +} + +func (s *ArgumentListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitArgumentList(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { + localctx = NewArgumentListContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 38, bicepParserRULE_argumentList) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(234) + p.expression(0) + } + p.SetState(239) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserCOMMA { + { + p.SetState(235) + p.Match(bicepParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(236) + p.expression(0) + } + + p.SetState(241) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IIdentifierContext is an interface to support dynamic dispatch. +type IIdentifierContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + IDENTIFIER() antlr.TerminalNode + PARAM() antlr.TerminalNode + RESOURCE() antlr.TerminalNode + VAR() antlr.TerminalNode + TRUE() antlr.TerminalNode + FALSE() antlr.TerminalNode + NULL() antlr.TerminalNode + STRING() antlr.TerminalNode + INT() antlr.TerminalNode + BOOL() antlr.TerminalNode + + // IsIdentifierContext differentiates from other interfaces. + IsIdentifierContext() +} + +type IdentifierContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIdentifierContext() *IdentifierContext { + var p = new(IdentifierContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_identifier + return p +} + +func InitEmptyIdentifierContext(p *IdentifierContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_identifier +} + +func (*IdentifierContext) IsIdentifierContext() {} + +func NewIdentifierContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IdentifierContext { + var p = new(IdentifierContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_identifier + + return p +} + +func (s *IdentifierContext) GetParser() antlr.Parser { return s.parser } + +func (s *IdentifierContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(bicepParserIDENTIFIER, 0) +} + +func (s *IdentifierContext) PARAM() antlr.TerminalNode { + return s.GetToken(bicepParserPARAM, 0) +} + +func (s *IdentifierContext) RESOURCE() antlr.TerminalNode { + return s.GetToken(bicepParserRESOURCE, 0) +} + +func (s *IdentifierContext) VAR() antlr.TerminalNode { + return s.GetToken(bicepParserVAR, 0) +} + +func (s *IdentifierContext) TRUE() antlr.TerminalNode { + return s.GetToken(bicepParserTRUE, 0) +} + +func (s *IdentifierContext) FALSE() antlr.TerminalNode { + return s.GetToken(bicepParserFALSE, 0) +} + +func (s *IdentifierContext) NULL() antlr.TerminalNode { + return s.GetToken(bicepParserNULL, 0) +} + +func (s *IdentifierContext) STRING() antlr.TerminalNode { + return s.GetToken(bicepParserSTRING, 0) +} + +func (s *IdentifierContext) INT() antlr.TerminalNode { + return s.GetToken(bicepParserINT, 0) +} + +func (s *IdentifierContext) BOOL() antlr.TerminalNode { + return s.GetToken(bicepParserBOOL, 0) +} + +func (s *IdentifierContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IdentifierContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IdentifierContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.EnterIdentifier(s) + } +} + +func (s *IdentifierContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(bicepListener); ok { + listenerT.ExitIdentifier(s) + } +} + +func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitIdentifier(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) Identifier() (localctx IIdentifierContext) { + localctx = NewIdentifierContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 40, bicepParserRULE_identifier) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(242) + _la = p.GetTokenStream().LA(1) + + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&252690432) != 0) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +func (p *bicepParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { + switch ruleIndex { + case 7: + var t *ExpressionContext = nil + if localctx != nil { + t = localctx.(*ExpressionContext) + } + return p.Expression_Sempred(t, predIndex) + + default: + panic("No predicate with index: " + fmt.Sprint(ruleIndex)) + } +} + +func (p *bicepParser) Expression_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 0: + return p.Precpred(p.GetParserRuleContext(), 4) + + case 1: + return p.Precpred(p.GetParserRuleContext(), 3) + + case 2: + return p.Precpred(p.GetParserRuleContext(), 2) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} diff --git a/pkg/parser/bicep/antlr/parser/bicep_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_visitor.go new file mode 100644 index 00000000000..5dfbaa2a70b --- /dev/null +++ b/pkg/parser/bicep/antlr/parser/bicep_visitor.go @@ -0,0 +1,73 @@ +// Code generated from bicep.g4 by ANTLR 4.13.1. DO NOT EDIT. + +package parser // bicep + +import "github.com/antlr4-go/antlr/v4" + +// A complete Visitor for a parse tree produced by bicepParser. +type bicepVisitor interface { + antlr.ParseTreeVisitor + + // Visit a parse tree produced by bicepParser#program. + VisitProgram(ctx *ProgramContext) interface{} + + // Visit a parse tree produced by bicepParser#statement. + VisitStatement(ctx *StatementContext) interface{} + + // Visit a parse tree produced by bicepParser#parameterDecl. + VisitParameterDecl(ctx *ParameterDeclContext) interface{} + + // Visit a parse tree produced by bicepParser#parameterDefaultValue. + VisitParameterDefaultValue(ctx *ParameterDefaultValueContext) interface{} + + // Visit a parse tree produced by bicepParser#variableDecl. + VisitVariableDecl(ctx *VariableDeclContext) interface{} + + // Visit a parse tree produced by bicepParser#resourceDecl. + VisitResourceDecl(ctx *ResourceDeclContext) interface{} + + // Visit a parse tree produced by bicepParser#interpString. + VisitInterpString(ctx *InterpStringContext) interface{} + + // Visit a parse tree produced by bicepParser#expression. + VisitExpression(ctx *ExpressionContext) interface{} + + // Visit a parse tree produced by bicepParser#primaryExpression. + VisitPrimaryExpression(ctx *PrimaryExpressionContext) interface{} + + // Visit a parse tree produced by bicepParser#parenthesizedExpression. + VisitParenthesizedExpression(ctx *ParenthesizedExpressionContext) interface{} + + // Visit a parse tree produced by bicepParser#typeExpression. + VisitTypeExpression(ctx *TypeExpressionContext) interface{} + + // Visit a parse tree produced by bicepParser#literalValue. + VisitLiteralValue(ctx *LiteralValueContext) interface{} + + // Visit a parse tree produced by bicepParser#object. + VisitObject(ctx *ObjectContext) interface{} + + // Visit a parse tree produced by bicepParser#objectProperty. + VisitObjectProperty(ctx *ObjectPropertyContext) interface{} + + // Visit a parse tree produced by bicepParser#array. + VisitArray(ctx *ArrayContext) interface{} + + // Visit a parse tree produced by bicepParser#arrayItem. + VisitArrayItem(ctx *ArrayItemContext) interface{} + + // Visit a parse tree produced by bicepParser#decorator. + VisitDecorator(ctx *DecoratorContext) interface{} + + // Visit a parse tree produced by bicepParser#decoratorExpression. + VisitDecoratorExpression(ctx *DecoratorExpressionContext) interface{} + + // Visit a parse tree produced by bicepParser#functionCall. + VisitFunctionCall(ctx *FunctionCallContext) interface{} + + // Visit a parse tree produced by bicepParser#argumentList. + VisitArgumentList(ctx *ArgumentListContext) interface{} + + // Visit a parse tree produced by bicepParser#identifier. + VisitIdentifier(ctx *IdentifierContext) interface{} +} From 561d66c584ba7eabd3d3d41ceb63697790845a6c Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Tue, 2 Apr 2024 18:25:50 +0100 Subject: [PATCH 004/130] visit resource, param & var implementation --- pkg/parser/bicep/parser.go | 331 ++++++++++++++++++++++++++++++++++++- 1 file changed, 329 insertions(+), 2 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index add9ea0a7dd..d06ea25a609 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -1,18 +1,345 @@ package bicep import ( + "fmt" + "strings" + "github.com/Checkmarx/kics/pkg/model" + "github.com/Checkmarx/kics/pkg/parser/bicep/antlr/parser" + "github.com/antlr4-go/antlr/v4" ) type Parser struct { } -// Parse - parses bicep to JSON_Bicep template (json file) -func (p *Parser) Parse(_ string, fileContent []byte) ([]model.Document, []int, error) { +type BicepVisitor struct { + parser.BasebicepVisitor + paramList map[string]interface{} + varList map[string]interface{} + resourceList []interface{} +} + +func NewBicepVisitor() *BicepVisitor { + paramList := map[string]interface{}{} + varList := map[string]interface{}{} + resourceList := []interface{}{} + return &BicepVisitor{paramList: paramList, varList: varList, resourceList: resourceList} + +} + +// Parse - parses bicep to BicepVisitor template (json file) +func (p *Parser) Parse(file string, _ []byte) ([]model.Document, []int, error) { + bicepVisitor := NewBicepVisitor() + stream, _ := antlr.NewFileStream(file) + lexer := parser.NewbicepLexer(stream) + + tokenStream := antlr.NewCommonTokenStream(lexer, antlr.TokenDefaultChannel) + bicepParser := parser.NewbicepParser(tokenStream) + // bicepParser.RemoveErrorListeners() + // bicepParser.AddErrorListener(antlr.NewDiagnosticErrorListener(true)) + + bicepParser.Program().Accept(bicepVisitor) + fmt.Println("\nParameters: ", bicepVisitor.paramList) + fmt.Println("\nVariables: ", bicepVisitor.varList) + fmt.Println("\nResources: ", bicepVisitor.resourceList) return nil, nil, nil } +func (v *BicepVisitor) VisitProgram(ctx *parser.ProgramContext) interface{} { + for _, val := range ctx.AllStatement() { + val.Accept(v) + } + + return nil +} + +func (s *BicepVisitor) VisitStatement(ctx *parser.StatementContext) interface{} { + + if ctx.ParameterDecl() != nil { + return ctx.ParameterDecl().Accept(s) + } + if ctx.VariableDecl() != nil { + return ctx.VariableDecl().Accept(s) + } + if ctx.ResourceDecl() != nil { + return ctx.ResourceDecl().Accept(s) + } + + return nil +} + +// VisitParameterDecl is called when production paramDecl is visited. +func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) interface{} { + var decorators []interface{} + param := map[string]interface{}{} + identifier := ctx.Identifier().Accept(s) + paramVal := ctx.ParameterDefaultValue().Accept(s) + param["value"] = paramVal + if ctx.TypeExpression() != nil { + typeExpression := ctx.TypeExpression().Accept(s) + param["type"] = typeExpression + } + + for _, val := range ctx.AllDecorator() { + decorators = append(decorators, val.Accept(s)) + } + param["decorators"] = decorators + s.paramList[identifier.(string)] = param + return nil +} + +// VisitParameterDecl is called when production paramDecl is visited. +func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interface{} { + var variable = map[string]interface{}{} + var decorators []interface{} + identifier := ctx.Identifier().Accept(s) + expression := ctx.Expression().Accept(s) + + for _, val := range ctx.AllDecorator() { + decorators = append(decorators, val.Accept(s)) + } + variable["decorators"] = decorators + variable["value"] = expression + s.varList[identifier.(string)] = variable + + return nil +} + +func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interface{} { + resource := map[string]interface{}{} + var decorators []interface{} + interpString := ctx.InterpString().Accept(s) + identifier := ctx.Identifier().Accept(s) + resourceType := strings.Split(interpString.(string), "@")[0] + apiVersion := strings.Split(interpString.(string), "@")[1] + resource["type"] = resourceType + resource["apiVersion"] = apiVersion + for _, val := range ctx.AllDecorator() { + decorators = append(decorators, val.Accept(s)) + } + resource["decorators"] = decorators + resource["name"] = identifier + if ctx.Object() != nil { + object := ctx.Object().Accept(s) + for key, val := range object.(map[string]interface{}) { + resource[key] = val + } + } + + s.resourceList = append(s.resourceList, resource) + + return nil +} + +// VisitParameterDefaultValue is called when production paramDecl is visited. +func (s *BicepVisitor) VisitParameterDefaultValue(ctx *parser.ParameterDefaultValueContext) interface{} { + param := ctx.Expression().Accept(s) + return param +} + +func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{} { + if ctx.GetChildCount() > 1 { + if ctx.Identifier() != nil { + identifier := ctx.Identifier().Accept(s) + fmt.Println(identifier) + if ctx.DOT() != nil { + fmt.Println("DOT") + } else { + fmt.Println("COL") + } + } else { + for _, val := range ctx.AllExpression() { + val.Accept(s) + } + } + } else { + return ctx.PrimaryExpression().Accept(s) + } + return nil +} + +// VisitPrimaryExpression is called when production primaryExpression is visited. +func (s *BicepVisitor) VisitPrimaryExpression(ctx *parser.PrimaryExpressionContext) interface{} { + if ctx.LiteralValue() != nil { + return ctx.LiteralValue().Accept(s) + } + if ctx.InterpString() != nil { + return ctx.InterpString().Accept(s) + } + if ctx.MULTILINE_STRING() != nil { + return ctx.MULTILINE_STRING().GetText() + } + if ctx.Array() != nil { + return ctx.Array().Accept(s) + } + if ctx.Object() != nil { + return ctx.Object().Accept(s) + } + if ctx.ParenthesizedExpression() != nil { + return ctx.ParenthesizedExpression().Accept(s) + } + + return nil +} + +// VisitInterpString is called when production interpString is visited. +func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interface{} { + if ctx.NUMBER() != nil { + return ctx.NUMBER().GetText() + } + if ctx.TRUE() != nil { + return ctx.TRUE().GetText() + } + if ctx.FALSE() != nil { + return ctx.FALSE().GetText() + } + if ctx.NULL() != nil { + return ctx.NULL().GetText() + } + if ctx.Identifier() != nil { + return ctx.Identifier().Accept(s) + } + + return nil +} + +// VisitInterpString is called when production interpString is visited. +func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interface{} { + if ctx.GetChildCount() > 1 { + interpString := []interface{}{} + interpString = append(interpString, ctx.STRING_LEFT_PIECE().GetText()) + if ctx.AllSTRING_MIDDLE_PIECE() != nil { + for idx, val := range ctx.AllSTRING_MIDDLE_PIECE() { + interpString = append(interpString, ctx.Expression(idx).Accept(s)) + interpString = append(interpString, val.GetText()) + } + } + // Last expression with string right piece + interpString = append(interpString, ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())).Accept(s)) + interpString = append(interpString, ctx.STRING_RIGHT_PIECE().GetText()) + return interpString + } else { + return ctx.STRING_COMPLETE().GetText() + } +} + +func (s *BicepVisitor) VisitArray(ctx *parser.ArrayContext) interface{} { + array := []interface{}{} + for _, val := range ctx.AllArrayItem() { + expression := val.Accept(s) + array = append(array, expression) + } + return array +} + +func (s *BicepVisitor) VisitArrayItem(ctx *parser.ArrayItemContext) interface{} { + return ctx.Expression().Accept(s) +} + +func (s *BicepVisitor) VisitObject(ctx *parser.ObjectContext) interface{} { + object := map[string]interface{}{} + for _, val := range ctx.AllObjectProperty() { + objectProperty := val.Accept(s).(map[string]interface{}) + for key, val := range objectProperty { + object[key] = val + } + } + + return object +} + +func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) interface{} { + objectProperty := map[string]interface{}{} + if ctx.Identifier() != nil { + identifier := ctx.Identifier().Accept(s) + objectProperty[identifier.(string)] = ctx.Expression().Accept(s) + } + if ctx.InterpString() != nil { + interpString := ctx.InterpString().Accept(s) + objectProperty[interpString.(string)] = ctx.Expression().Accept(s) + } + + return objectProperty +} + +func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{} { + if ctx.IDENTIFIER() != nil { + return ctx.IDENTIFIER().GetText() + } + if (ctx.PARAM()) != nil { + return ctx.PARAM().GetText() + } + if (ctx.RESOURCE()) != nil { + return ctx.RESOURCE().GetText() + } + if (ctx.VAR()) != nil { + return ctx.VAR().GetText() + } + if (ctx.TRUE()) != nil { + return ctx.TRUE().GetText() + } + if (ctx.FALSE()) != nil { + return ctx.FALSE().GetText() + } + if (ctx.NULL()) != nil { + return ctx.NULL().GetText() + } + if (ctx.STRING()) != nil { + return ctx.STRING().GetText() + } + if (ctx.INT()) != nil { + return ctx.INT().GetText() + } + if (ctx.BOOL()) != nil { + return ctx.BOOL().GetText() + } + return nil +} + +func (s *BicepVisitor) VisitParenthesizedExpression(ctx *parser.ParenthesizedExpressionContext) interface{} { + return ctx.Expression().Accept(s) +} + +func (s *BicepVisitor) VisitDecorator(ctx *parser.DecoratorContext) interface{} { + decorator := ctx.DecoratorExpression().Accept(s) + return decorator +} + +func (s *BicepVisitor) VisitDecoratorExpression(ctx *parser.DecoratorExpressionContext) interface{} { + return ctx.FunctionCall().Accept(s) +} + +func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interface{} { + identifier := ctx.Identifier().Accept(s) + var argumentList []interface{} + if ctx.ArgumentList().GetChildCount() > 0 { + argumentList = ctx.ArgumentList().Accept(s).([]interface{}) + } + functionCall := map[string]interface{}{ + identifier.(string): argumentList, + } + + return functionCall +} + +func (s *BicepVisitor) VisitArgumentList(ctx *parser.ArgumentListContext) interface{} { + var argumentList []interface{} + for _, val := range ctx.AllExpression() { + argument := val.Accept(s) + argumentList = append(argumentList, argument) + } + return argumentList +} + +func (s *BicepVisitor) VisitTypeExpression(ctx *parser.TypeExpressionContext) interface{} { + identifiers := []string{} + for _, val := range ctx.AllIdentifier() { + identifiers = append(identifiers, val.Accept(s).(string)) + } + return identifiers +} + // GetKind returns the kind of the parser func (p *Parser) GetKind() model.FileKind { return model.KindBICEP From 2b1b1c5c4a7bb6fcb37336aa55b35fa6bba92382 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 3 Apr 2024 11:43:11 +0100 Subject: [PATCH 005/130] fixed functioncall grammar --- pkg/parser/bicep/antlr/bicep.g4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index 46d7c3900ba..e0d4adeacb4 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -78,7 +78,7 @@ decorator: AT decoratorExpression NL; decoratorExpression: functionCall | expression DOT functionCall; // functionCall -> IDENTIFIER "(" argumentList? ")" -functionCall: identifier OPAR argumentList? CPAR; +functionCall: identifier OPAR (NL+ argumentList)? NL+ CPAR; // argumentList -> expression ("," expression)* argumentList: expression (COMMA expression)*; From 094c916c678c38b84d04729c112068cd064caf46 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 3 Apr 2024 11:43:49 +0100 Subject: [PATCH 006/130] generating payload for bicep files --- pkg/parser/bicep/parser.go | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index d06ea25a609..f2e26862fa7 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -1,6 +1,7 @@ package bicep import ( + "encoding/json" "fmt" "strings" @@ -19,16 +20,30 @@ type BicepVisitor struct { resourceList []interface{} } +type JSONBicep struct { + Parameters map[string]interface{} `json:"parameters"` + Variables map[string]interface{} `json:"variables"` + Resources []interface{} `json:"resources"` +} + func NewBicepVisitor() *BicepVisitor { paramList := map[string]interface{}{} varList := map[string]interface{}{} resourceList := []interface{}{} return &BicepVisitor{paramList: paramList, varList: varList, resourceList: resourceList} +} +func convertVisitorToJSONBicep(visitor *BicepVisitor) *JSONBicep { + return &JSONBicep{ + Parameters: visitor.paramList, + Variables: visitor.varList, + Resources: visitor.resourceList, + } } // Parse - parses bicep to BicepVisitor template (json file) func (p *Parser) Parse(file string, _ []byte) ([]model.Document, []int, error) { + fmt.Println(file) bicepVisitor := NewBicepVisitor() stream, _ := antlr.NewFileStream(file) lexer := parser.NewbicepLexer(stream) @@ -43,7 +58,20 @@ func (p *Parser) Parse(file string, _ []byte) ([]model.Document, []int, error) { fmt.Println("\nVariables: ", bicepVisitor.varList) fmt.Println("\nResources: ", bicepVisitor.resourceList) - return nil, nil, nil + var doc model.Document + + jBicep := convertVisitorToJSONBicep(bicepVisitor) + bicepBytes, err := json.Marshal(jBicep) + if err != nil { + return nil, nil, err + } + + err = json.Unmarshal(bicepBytes, &doc) + if err != nil { + return nil, nil, err + } + + return []model.Document{doc}, nil, nil } func (v *BicepVisitor) VisitProgram(ctx *parser.ProgramContext) interface{} { @@ -74,8 +102,10 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte var decorators []interface{} param := map[string]interface{}{} identifier := ctx.Identifier().Accept(s) - paramVal := ctx.ParameterDefaultValue().Accept(s) - param["value"] = paramVal + if ctx.ParameterDefaultValue() != nil { + paramVal := ctx.ParameterDefaultValue().Accept(s) + param["value"] = paramVal + } if ctx.TypeExpression() != nil { typeExpression := ctx.TypeExpression().Accept(s) param["type"] = typeExpression @@ -313,7 +343,7 @@ func (s *BicepVisitor) VisitDecoratorExpression(ctx *parser.DecoratorExpressionC func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interface{} { identifier := ctx.Identifier().Accept(s) var argumentList []interface{} - if ctx.ArgumentList().GetChildCount() > 0 { + if ctx.ArgumentList() != nil { argumentList = ctx.ArgumentList().Accept(s).([]interface{}) } functionCall := map[string]interface{}{ From 7b39ad9c266c5b09441a6c3b88ebb4591ee8afbe Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 3 Apr 2024 14:30:42 +0100 Subject: [PATCH 007/130] fixed parsing of function call --- pkg/parser/bicep/antlr/bicep.g4 | 7 +- pkg/parser/bicep/antlr/parser/bicep.interp | 2 +- .../bicep/antlr/parser/bicep_base_listener.go | 148 ---- .../bicep/antlr/parser/bicep_listener.go | 136 ---- pkg/parser/bicep/antlr/parser/bicep_parser.go | 762 ++++++++---------- pkg/parser/bicep/parser.go | 16 + 6 files changed, 352 insertions(+), 719 deletions(-) delete mode 100644 pkg/parser/bicep/antlr/parser/bicep_base_listener.go delete mode 100644 pkg/parser/bicep/antlr/parser/bicep_listener.go diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index e0d4adeacb4..12131845fba 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -44,6 +44,7 @@ expression: // parenthesizedExpression primaryExpression: literalValue + | functionCall | interpString | MULTILINE_STRING | array @@ -51,7 +52,7 @@ primaryExpression: | parenthesizedExpression; // parenthesizedExpression -> "(" expression ")" -parenthesizedExpression: OPAR expression CPAR; +parenthesizedExpression: OPAR NL? expression NL? CPAR; // typeExpression -> singularTypeExpression ("|" singularTypeExpression)* typeExpression: type = identifier (PIPE type = identifier)*; @@ -78,10 +79,10 @@ decorator: AT decoratorExpression NL; decoratorExpression: functionCall | expression DOT functionCall; // functionCall -> IDENTIFIER "(" argumentList? ")" -functionCall: identifier OPAR (NL+ argumentList)? NL+ CPAR; +functionCall: identifier OPAR (NL? argumentList)? NL? CPAR; // argumentList -> expression ("," expression)* -argumentList: expression (COMMA expression)*; +argumentList: expression (COMMA NL? expression)*; identifier: IDENTIFIER diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index ca23f806100..5f524622e0d 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -91,4 +91,4 @@ identifier atn: -[4, 1, 31, 245, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 55, 8, 1, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 67, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 72, 8, 2, 3, 2, 74, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 94, 8, 5, 10, 5, 12, 5, 97, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 119, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 146, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 5, 10, 155, 8, 10, 10, 10, 12, 10, 158, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 165, 8, 11, 1, 12, 1, 12, 4, 12, 169, 8, 12, 11, 12, 12, 12, 170, 1, 12, 1, 12, 4, 12, 175, 8, 12, 11, 12, 12, 12, 176, 5, 12, 179, 8, 12, 10, 12, 12, 12, 182, 9, 12, 3, 12, 184, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 190, 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 4, 14, 197, 8, 14, 11, 14, 12, 14, 198, 1, 14, 5, 14, 202, 8, 14, 10, 14, 12, 14, 205, 9, 14, 3, 14, 207, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 4, 15, 213, 8, 15, 11, 15, 12, 15, 214, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 226, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 231, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 5, 19, 238, 8, 19, 10, 19, 12, 19, 241, 9, 19, 1, 20, 1, 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 260, 0, 45, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, 0, 16, 145, 1, 0, 0, 0, 18, 147, 1, 0, 0, 0, 20, 151, 1, 0, 0, 0, 22, 164, 1, 0, 0, 0, 24, 166, 1, 0, 0, 0, 26, 189, 1, 0, 0, 0, 28, 194, 1, 0, 0, 0, 30, 210, 1, 0, 0, 0, 32, 216, 1, 0, 0, 0, 34, 225, 1, 0, 0, 0, 36, 227, 1, 0, 0, 0, 38, 234, 1, 0, 0, 0, 40, 242, 1, 0, 0, 0, 42, 44, 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, 5, 0, 53, 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 19, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 29, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 29, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, 5, 22, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 23, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 146, 3, 22, 11, 0, 140, 146, 3, 12, 6, 0, 141, 146, 5, 1, 0, 0, 142, 146, 3, 28, 14, 0, 143, 146, 3, 24, 12, 0, 144, 146, 3, 18, 9, 0, 145, 139, 1, 0, 0, 0, 145, 140, 1, 0, 0, 0, 145, 141, 1, 0, 0, 0, 145, 142, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 145, 144, 1, 0, 0, 0, 146, 17, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, 3, 14, 7, 0, 149, 150, 5, 7, 0, 0, 150, 19, 1, 0, 0, 0, 151, 156, 3, 40, 20, 0, 152, 153, 5, 9, 0, 0, 153, 155, 3, 40, 20, 0, 154, 152, 1, 0, 0, 0, 155, 158, 1, 0, 0, 0, 156, 154, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 21, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 159, 165, 5, 28, 0, 0, 160, 165, 5, 16, 0, 0, 161, 165, 5, 17, 0, 0, 162, 165, 5, 18, 0, 0, 163, 165, 3, 40, 20, 0, 164, 159, 1, 0, 0, 0, 164, 160, 1, 0, 0, 0, 164, 161, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 164, 163, 1, 0, 0, 0, 165, 23, 1, 0, 0, 0, 166, 183, 5, 12, 0, 0, 167, 169, 5, 29, 0, 0, 168, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 180, 1, 0, 0, 0, 172, 174, 3, 26, 13, 0, 173, 175, 5, 29, 0, 0, 174, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 1, 0, 0, 0, 178, 172, 1, 0, 0, 0, 179, 182, 1, 0, 0, 0, 180, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 183, 168, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 186, 5, 13, 0, 0, 186, 25, 1, 0, 0, 0, 187, 190, 3, 40, 20, 0, 188, 190, 3, 12, 6, 0, 189, 187, 1, 0, 0, 0, 189, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 5, 10, 0, 0, 192, 193, 3, 14, 7, 0, 193, 27, 1, 0, 0, 0, 194, 206, 5, 4, 0, 0, 195, 197, 5, 29, 0, 0, 196, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 203, 1, 0, 0, 0, 200, 202, 3, 30, 15, 0, 201, 200, 1, 0, 0, 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 196, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 208, 1, 0, 0, 0, 208, 209, 5, 5, 0, 0, 209, 29, 1, 0, 0, 0, 210, 212, 3, 14, 7, 0, 211, 213, 5, 29, 0, 0, 212, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 31, 1, 0, 0, 0, 216, 217, 5, 2, 0, 0, 217, 218, 3, 34, 17, 0, 218, 219, 5, 29, 0, 0, 219, 33, 1, 0, 0, 0, 220, 226, 3, 36, 18, 0, 221, 222, 3, 14, 7, 0, 222, 223, 5, 8, 0, 0, 223, 224, 3, 36, 18, 0, 224, 226, 1, 0, 0, 0, 225, 220, 1, 0, 0, 0, 225, 221, 1, 0, 0, 0, 226, 35, 1, 0, 0, 0, 227, 228, 3, 40, 20, 0, 228, 230, 5, 6, 0, 0, 229, 231, 3, 38, 19, 0, 230, 229, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 5, 7, 0, 0, 233, 37, 1, 0, 0, 0, 234, 239, 3, 14, 7, 0, 235, 236, 5, 3, 0, 0, 236, 238, 3, 14, 7, 0, 237, 235, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 39, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 7, 0, 0, 0, 243, 41, 1, 0, 0, 0, 27, 45, 54, 59, 66, 71, 73, 83, 95, 111, 118, 134, 136, 145, 156, 164, 170, 176, 180, 183, 189, 198, 203, 206, 214, 225, 230, 239] \ No newline at end of file +[4, 1, 31, 261, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 55, 8, 1, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 67, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 72, 8, 2, 3, 2, 74, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 94, 8, 5, 10, 5, 12, 5, 97, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 119, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 147, 8, 8, 1, 9, 1, 9, 3, 9, 151, 8, 9, 1, 9, 1, 9, 3, 9, 155, 8, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 172, 8, 11, 1, 12, 1, 12, 4, 12, 176, 8, 12, 11, 12, 12, 12, 177, 1, 12, 1, 12, 4, 12, 182, 8, 12, 11, 12, 12, 12, 183, 5, 12, 186, 8, 12, 10, 12, 12, 12, 189, 9, 12, 3, 12, 191, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 197, 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 4, 14, 204, 8, 14, 11, 14, 12, 14, 205, 1, 14, 5, 14, 209, 8, 14, 10, 14, 12, 14, 212, 9, 14, 3, 14, 214, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 4, 15, 220, 8, 15, 11, 15, 12, 15, 221, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 233, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 238, 8, 18, 1, 18, 3, 18, 241, 8, 18, 1, 18, 3, 18, 244, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 3, 19, 251, 8, 19, 1, 19, 5, 19, 254, 8, 19, 10, 19, 12, 19, 257, 9, 19, 1, 20, 1, 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 282, 0, 45, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, 1, 0, 0, 0, 22, 171, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 196, 1, 0, 0, 0, 28, 201, 1, 0, 0, 0, 30, 217, 1, 0, 0, 0, 32, 223, 1, 0, 0, 0, 34, 232, 1, 0, 0, 0, 36, 234, 1, 0, 0, 0, 38, 247, 1, 0, 0, 0, 40, 258, 1, 0, 0, 0, 42, 44, 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, 5, 0, 53, 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 19, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 29, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 29, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, 5, 22, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 23, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 147, 3, 22, 11, 0, 140, 147, 3, 36, 18, 0, 141, 147, 3, 12, 6, 0, 142, 147, 5, 1, 0, 0, 143, 147, 3, 28, 14, 0, 144, 147, 3, 24, 12, 0, 145, 147, 3, 18, 9, 0, 146, 139, 1, 0, 0, 0, 146, 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0, 146, 143, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 145, 1, 0, 0, 0, 147, 17, 1, 0, 0, 0, 148, 150, 5, 6, 0, 0, 149, 151, 5, 29, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 3, 14, 7, 0, 153, 155, 5, 29, 0, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 7, 0, 0, 157, 19, 1, 0, 0, 0, 158, 163, 3, 40, 20, 0, 159, 160, 5, 9, 0, 0, 160, 162, 3, 40, 20, 0, 161, 159, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 21, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 172, 5, 28, 0, 0, 167, 172, 5, 16, 0, 0, 168, 172, 5, 17, 0, 0, 169, 172, 5, 18, 0, 0, 170, 172, 3, 40, 20, 0, 171, 166, 1, 0, 0, 0, 171, 167, 1, 0, 0, 0, 171, 168, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 170, 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, 173, 190, 5, 12, 0, 0, 174, 176, 5, 29, 0, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 187, 1, 0, 0, 0, 179, 181, 3, 26, 13, 0, 180, 182, 5, 29, 0, 0, 181, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 179, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 175, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 13, 0, 0, 193, 25, 1, 0, 0, 0, 194, 197, 3, 40, 20, 0, 195, 197, 3, 12, 6, 0, 196, 194, 1, 0, 0, 0, 196, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 5, 10, 0, 0, 199, 200, 3, 14, 7, 0, 200, 27, 1, 0, 0, 0, 201, 213, 5, 4, 0, 0, 202, 204, 5, 29, 0, 0, 203, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 210, 1, 0, 0, 0, 207, 209, 3, 30, 15, 0, 208, 207, 1, 0, 0, 0, 209, 212, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 210, 211, 1, 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 213, 203, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 216, 5, 5, 0, 0, 216, 29, 1, 0, 0, 0, 217, 219, 3, 14, 7, 0, 218, 220, 5, 29, 0, 0, 219, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 31, 1, 0, 0, 0, 223, 224, 5, 2, 0, 0, 224, 225, 3, 34, 17, 0, 225, 226, 5, 29, 0, 0, 226, 33, 1, 0, 0, 0, 227, 233, 3, 36, 18, 0, 228, 229, 3, 14, 7, 0, 229, 230, 5, 8, 0, 0, 230, 231, 3, 36, 18, 0, 231, 233, 1, 0, 0, 0, 232, 227, 1, 0, 0, 0, 232, 228, 1, 0, 0, 0, 233, 35, 1, 0, 0, 0, 234, 235, 3, 40, 20, 0, 235, 240, 5, 6, 0, 0, 236, 238, 5, 29, 0, 0, 237, 236, 1, 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 241, 3, 38, 19, 0, 240, 237, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, 244, 5, 29, 0, 0, 243, 242, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, 5, 7, 0, 0, 246, 37, 1, 0, 0, 0, 247, 255, 3, 14, 7, 0, 248, 250, 5, 3, 0, 0, 249, 251, 5, 29, 0, 0, 250, 249, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 254, 3, 14, 7, 0, 253, 248, 1, 0, 0, 0, 254, 257, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 39, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 258, 259, 7, 0, 0, 0, 259, 41, 1, 0, 0, 0, 32, 45, 54, 59, 66, 71, 73, 83, 95, 111, 118, 134, 136, 146, 150, 154, 163, 171, 177, 183, 187, 190, 196, 205, 210, 213, 221, 232, 237, 240, 243, 250, 255] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep_base_listener.go b/pkg/parser/bicep/antlr/parser/bicep_base_listener.go deleted file mode 100644 index 24ac47ccdba..00000000000 --- a/pkg/parser/bicep/antlr/parser/bicep_base_listener.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated from bicep.g4 by ANTLR 4.13.1. DO NOT EDIT. - -package parser // bicep - -import "github.com/antlr4-go/antlr/v4" - -// BasebicepListener is a complete listener for a parse tree produced by bicepParser. -type BasebicepListener struct{} - -var _ bicepListener = &BasebicepListener{} - -// VisitTerminal is called when a terminal node is visited. -func (s *BasebicepListener) VisitTerminal(node antlr.TerminalNode) {} - -// VisitErrorNode is called when an error node is visited. -func (s *BasebicepListener) VisitErrorNode(node antlr.ErrorNode) {} - -// EnterEveryRule is called when any rule is entered. -func (s *BasebicepListener) EnterEveryRule(ctx antlr.ParserRuleContext) {} - -// ExitEveryRule is called when any rule is exited. -func (s *BasebicepListener) ExitEveryRule(ctx antlr.ParserRuleContext) {} - -// EnterProgram is called when production program is entered. -func (s *BasebicepListener) EnterProgram(ctx *ProgramContext) {} - -// ExitProgram is called when production program is exited. -func (s *BasebicepListener) ExitProgram(ctx *ProgramContext) {} - -// EnterStatement is called when production statement is entered. -func (s *BasebicepListener) EnterStatement(ctx *StatementContext) {} - -// ExitStatement is called when production statement is exited. -func (s *BasebicepListener) ExitStatement(ctx *StatementContext) {} - -// EnterParameterDecl is called when production parameterDecl is entered. -func (s *BasebicepListener) EnterParameterDecl(ctx *ParameterDeclContext) {} - -// ExitParameterDecl is called when production parameterDecl is exited. -func (s *BasebicepListener) ExitParameterDecl(ctx *ParameterDeclContext) {} - -// EnterParameterDefaultValue is called when production parameterDefaultValue is entered. -func (s *BasebicepListener) EnterParameterDefaultValue(ctx *ParameterDefaultValueContext) {} - -// ExitParameterDefaultValue is called when production parameterDefaultValue is exited. -func (s *BasebicepListener) ExitParameterDefaultValue(ctx *ParameterDefaultValueContext) {} - -// EnterVariableDecl is called when production variableDecl is entered. -func (s *BasebicepListener) EnterVariableDecl(ctx *VariableDeclContext) {} - -// ExitVariableDecl is called when production variableDecl is exited. -func (s *BasebicepListener) ExitVariableDecl(ctx *VariableDeclContext) {} - -// EnterResourceDecl is called when production resourceDecl is entered. -func (s *BasebicepListener) EnterResourceDecl(ctx *ResourceDeclContext) {} - -// ExitResourceDecl is called when production resourceDecl is exited. -func (s *BasebicepListener) ExitResourceDecl(ctx *ResourceDeclContext) {} - -// EnterInterpString is called when production interpString is entered. -func (s *BasebicepListener) EnterInterpString(ctx *InterpStringContext) {} - -// ExitInterpString is called when production interpString is exited. -func (s *BasebicepListener) ExitInterpString(ctx *InterpStringContext) {} - -// EnterExpression is called when production expression is entered. -func (s *BasebicepListener) EnterExpression(ctx *ExpressionContext) {} - -// ExitExpression is called when production expression is exited. -func (s *BasebicepListener) ExitExpression(ctx *ExpressionContext) {} - -// EnterPrimaryExpression is called when production primaryExpression is entered. -func (s *BasebicepListener) EnterPrimaryExpression(ctx *PrimaryExpressionContext) {} - -// ExitPrimaryExpression is called when production primaryExpression is exited. -func (s *BasebicepListener) ExitPrimaryExpression(ctx *PrimaryExpressionContext) {} - -// EnterParenthesizedExpression is called when production parenthesizedExpression is entered. -func (s *BasebicepListener) EnterParenthesizedExpression(ctx *ParenthesizedExpressionContext) {} - -// ExitParenthesizedExpression is called when production parenthesizedExpression is exited. -func (s *BasebicepListener) ExitParenthesizedExpression(ctx *ParenthesizedExpressionContext) {} - -// EnterTypeExpression is called when production typeExpression is entered. -func (s *BasebicepListener) EnterTypeExpression(ctx *TypeExpressionContext) {} - -// ExitTypeExpression is called when production typeExpression is exited. -func (s *BasebicepListener) ExitTypeExpression(ctx *TypeExpressionContext) {} - -// EnterLiteralValue is called when production literalValue is entered. -func (s *BasebicepListener) EnterLiteralValue(ctx *LiteralValueContext) {} - -// ExitLiteralValue is called when production literalValue is exited. -func (s *BasebicepListener) ExitLiteralValue(ctx *LiteralValueContext) {} - -// EnterObject is called when production object is entered. -func (s *BasebicepListener) EnterObject(ctx *ObjectContext) {} - -// ExitObject is called when production object is exited. -func (s *BasebicepListener) ExitObject(ctx *ObjectContext) {} - -// EnterObjectProperty is called when production objectProperty is entered. -func (s *BasebicepListener) EnterObjectProperty(ctx *ObjectPropertyContext) {} - -// ExitObjectProperty is called when production objectProperty is exited. -func (s *BasebicepListener) ExitObjectProperty(ctx *ObjectPropertyContext) {} - -// EnterArray is called when production array is entered. -func (s *BasebicepListener) EnterArray(ctx *ArrayContext) {} - -// ExitArray is called when production array is exited. -func (s *BasebicepListener) ExitArray(ctx *ArrayContext) {} - -// EnterArrayItem is called when production arrayItem is entered. -func (s *BasebicepListener) EnterArrayItem(ctx *ArrayItemContext) {} - -// ExitArrayItem is called when production arrayItem is exited. -func (s *BasebicepListener) ExitArrayItem(ctx *ArrayItemContext) {} - -// EnterDecorator is called when production decorator is entered. -func (s *BasebicepListener) EnterDecorator(ctx *DecoratorContext) {} - -// ExitDecorator is called when production decorator is exited. -func (s *BasebicepListener) ExitDecorator(ctx *DecoratorContext) {} - -// EnterDecoratorExpression is called when production decoratorExpression is entered. -func (s *BasebicepListener) EnterDecoratorExpression(ctx *DecoratorExpressionContext) {} - -// ExitDecoratorExpression is called when production decoratorExpression is exited. -func (s *BasebicepListener) ExitDecoratorExpression(ctx *DecoratorExpressionContext) {} - -// EnterFunctionCall is called when production functionCall is entered. -func (s *BasebicepListener) EnterFunctionCall(ctx *FunctionCallContext) {} - -// ExitFunctionCall is called when production functionCall is exited. -func (s *BasebicepListener) ExitFunctionCall(ctx *FunctionCallContext) {} - -// EnterArgumentList is called when production argumentList is entered. -func (s *BasebicepListener) EnterArgumentList(ctx *ArgumentListContext) {} - -// ExitArgumentList is called when production argumentList is exited. -func (s *BasebicepListener) ExitArgumentList(ctx *ArgumentListContext) {} - -// EnterIdentifier is called when production identifier is entered. -func (s *BasebicepListener) EnterIdentifier(ctx *IdentifierContext) {} - -// ExitIdentifier is called when production identifier is exited. -func (s *BasebicepListener) ExitIdentifier(ctx *IdentifierContext) {} diff --git a/pkg/parser/bicep/antlr/parser/bicep_listener.go b/pkg/parser/bicep/antlr/parser/bicep_listener.go deleted file mode 100644 index f807ec71028..00000000000 --- a/pkg/parser/bicep/antlr/parser/bicep_listener.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated from bicep.g4 by ANTLR 4.13.1. DO NOT EDIT. - -package parser // bicep - -import "github.com/antlr4-go/antlr/v4" - -// bicepListener is a complete listener for a parse tree produced by bicepParser. -type bicepListener interface { - antlr.ParseTreeListener - - // EnterProgram is called when entering the program production. - EnterProgram(c *ProgramContext) - - // EnterStatement is called when entering the statement production. - EnterStatement(c *StatementContext) - - // EnterParameterDecl is called when entering the parameterDecl production. - EnterParameterDecl(c *ParameterDeclContext) - - // EnterParameterDefaultValue is called when entering the parameterDefaultValue production. - EnterParameterDefaultValue(c *ParameterDefaultValueContext) - - // EnterVariableDecl is called when entering the variableDecl production. - EnterVariableDecl(c *VariableDeclContext) - - // EnterResourceDecl is called when entering the resourceDecl production. - EnterResourceDecl(c *ResourceDeclContext) - - // EnterInterpString is called when entering the interpString production. - EnterInterpString(c *InterpStringContext) - - // EnterExpression is called when entering the expression production. - EnterExpression(c *ExpressionContext) - - // EnterPrimaryExpression is called when entering the primaryExpression production. - EnterPrimaryExpression(c *PrimaryExpressionContext) - - // EnterParenthesizedExpression is called when entering the parenthesizedExpression production. - EnterParenthesizedExpression(c *ParenthesizedExpressionContext) - - // EnterTypeExpression is called when entering the typeExpression production. - EnterTypeExpression(c *TypeExpressionContext) - - // EnterLiteralValue is called when entering the literalValue production. - EnterLiteralValue(c *LiteralValueContext) - - // EnterObject is called when entering the object production. - EnterObject(c *ObjectContext) - - // EnterObjectProperty is called when entering the objectProperty production. - EnterObjectProperty(c *ObjectPropertyContext) - - // EnterArray is called when entering the array production. - EnterArray(c *ArrayContext) - - // EnterArrayItem is called when entering the arrayItem production. - EnterArrayItem(c *ArrayItemContext) - - // EnterDecorator is called when entering the decorator production. - EnterDecorator(c *DecoratorContext) - - // EnterDecoratorExpression is called when entering the decoratorExpression production. - EnterDecoratorExpression(c *DecoratorExpressionContext) - - // EnterFunctionCall is called when entering the functionCall production. - EnterFunctionCall(c *FunctionCallContext) - - // EnterArgumentList is called when entering the argumentList production. - EnterArgumentList(c *ArgumentListContext) - - // EnterIdentifier is called when entering the identifier production. - EnterIdentifier(c *IdentifierContext) - - // ExitProgram is called when exiting the program production. - ExitProgram(c *ProgramContext) - - // ExitStatement is called when exiting the statement production. - ExitStatement(c *StatementContext) - - // ExitParameterDecl is called when exiting the parameterDecl production. - ExitParameterDecl(c *ParameterDeclContext) - - // ExitParameterDefaultValue is called when exiting the parameterDefaultValue production. - ExitParameterDefaultValue(c *ParameterDefaultValueContext) - - // ExitVariableDecl is called when exiting the variableDecl production. - ExitVariableDecl(c *VariableDeclContext) - - // ExitResourceDecl is called when exiting the resourceDecl production. - ExitResourceDecl(c *ResourceDeclContext) - - // ExitInterpString is called when exiting the interpString production. - ExitInterpString(c *InterpStringContext) - - // ExitExpression is called when exiting the expression production. - ExitExpression(c *ExpressionContext) - - // ExitPrimaryExpression is called when exiting the primaryExpression production. - ExitPrimaryExpression(c *PrimaryExpressionContext) - - // ExitParenthesizedExpression is called when exiting the parenthesizedExpression production. - ExitParenthesizedExpression(c *ParenthesizedExpressionContext) - - // ExitTypeExpression is called when exiting the typeExpression production. - ExitTypeExpression(c *TypeExpressionContext) - - // ExitLiteralValue is called when exiting the literalValue production. - ExitLiteralValue(c *LiteralValueContext) - - // ExitObject is called when exiting the object production. - ExitObject(c *ObjectContext) - - // ExitObjectProperty is called when exiting the objectProperty production. - ExitObjectProperty(c *ObjectPropertyContext) - - // ExitArray is called when exiting the array production. - ExitArray(c *ArrayContext) - - // ExitArrayItem is called when exiting the arrayItem production. - ExitArrayItem(c *ArrayItemContext) - - // ExitDecorator is called when exiting the decorator production. - ExitDecorator(c *DecoratorContext) - - // ExitDecoratorExpression is called when exiting the decoratorExpression production. - ExitDecoratorExpression(c *DecoratorExpressionContext) - - // ExitFunctionCall is called when exiting the functionCall production. - ExitFunctionCall(c *FunctionCallContext) - - // ExitArgumentList is called when exiting the argumentList production. - ExitArgumentList(c *ArgumentListContext) - - // ExitIdentifier is called when exiting the identifier production. - ExitIdentifier(c *IdentifierContext) -} diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 601a65fe5d0..59c16e7b789 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -53,7 +53,7 @@ func bicepParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 31, 245, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 31, 261, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, @@ -66,100 +66,109 @@ func bicepParserInit() { 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 119, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, - 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 146, 8, 8, - 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 5, 10, 155, 8, 10, 10, 10, - 12, 10, 158, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 165, 8, 11, - 1, 12, 1, 12, 4, 12, 169, 8, 12, 11, 12, 12, 12, 170, 1, 12, 1, 12, 4, - 12, 175, 8, 12, 11, 12, 12, 12, 176, 5, 12, 179, 8, 12, 10, 12, 12, 12, - 182, 9, 12, 3, 12, 184, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 190, - 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 4, 14, 197, 8, 14, 11, 14, 12, - 14, 198, 1, 14, 5, 14, 202, 8, 14, 10, 14, 12, 14, 205, 9, 14, 3, 14, 207, - 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 4, 15, 213, 8, 15, 11, 15, 12, 15, 214, - 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 226, - 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 231, 8, 18, 1, 18, 1, 18, 1, 19, 1, - 19, 1, 19, 5, 19, 238, 8, 19, 10, 19, 12, 19, 241, 9, 19, 1, 20, 1, 20, - 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, - 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 260, 0, 45, 1, - 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, - 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, - 0, 16, 145, 1, 0, 0, 0, 18, 147, 1, 0, 0, 0, 20, 151, 1, 0, 0, 0, 22, 164, - 1, 0, 0, 0, 24, 166, 1, 0, 0, 0, 26, 189, 1, 0, 0, 0, 28, 194, 1, 0, 0, - 0, 30, 210, 1, 0, 0, 0, 32, 216, 1, 0, 0, 0, 34, 225, 1, 0, 0, 0, 36, 227, - 1, 0, 0, 0, 38, 234, 1, 0, 0, 0, 40, 242, 1, 0, 0, 0, 42, 44, 3, 2, 1, - 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, - 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, - 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, - 5, 0, 53, 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, - 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, - 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, - 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, - 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, - 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 19, 0, 0, - 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, - 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, - 75, 1, 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, - 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, - 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, - 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, - 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 29, - 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, - 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, - 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, 40, 20, 0, 100, - 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, - 5, 29, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, 0, 106, 107, 3, 14, - 7, 0, 107, 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, - 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, - 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, - 5, 22, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 23, 0, 0, 118, 105, 1, - 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, - 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, - 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, - 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, - 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, - 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, - 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, - 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 146, 3, 22, 11, 0, 140, - 146, 3, 12, 6, 0, 141, 146, 5, 1, 0, 0, 142, 146, 3, 28, 14, 0, 143, 146, - 3, 24, 12, 0, 144, 146, 3, 18, 9, 0, 145, 139, 1, 0, 0, 0, 145, 140, 1, - 0, 0, 0, 145, 141, 1, 0, 0, 0, 145, 142, 1, 0, 0, 0, 145, 143, 1, 0, 0, - 0, 145, 144, 1, 0, 0, 0, 146, 17, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, - 149, 3, 14, 7, 0, 149, 150, 5, 7, 0, 0, 150, 19, 1, 0, 0, 0, 151, 156, - 3, 40, 20, 0, 152, 153, 5, 9, 0, 0, 153, 155, 3, 40, 20, 0, 154, 152, 1, - 0, 0, 0, 155, 158, 1, 0, 0, 0, 156, 154, 1, 0, 0, 0, 156, 157, 1, 0, 0, - 0, 157, 21, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 159, 165, 5, 28, 0, 0, 160, - 165, 5, 16, 0, 0, 161, 165, 5, 17, 0, 0, 162, 165, 5, 18, 0, 0, 163, 165, - 3, 40, 20, 0, 164, 159, 1, 0, 0, 0, 164, 160, 1, 0, 0, 0, 164, 161, 1, - 0, 0, 0, 164, 162, 1, 0, 0, 0, 164, 163, 1, 0, 0, 0, 165, 23, 1, 0, 0, - 0, 166, 183, 5, 12, 0, 0, 167, 169, 5, 29, 0, 0, 168, 167, 1, 0, 0, 0, - 169, 170, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, - 180, 1, 0, 0, 0, 172, 174, 3, 26, 13, 0, 173, 175, 5, 29, 0, 0, 174, 173, - 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, - 0, 0, 177, 179, 1, 0, 0, 0, 178, 172, 1, 0, 0, 0, 179, 182, 1, 0, 0, 0, - 180, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, - 180, 1, 0, 0, 0, 183, 168, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, - 1, 0, 0, 0, 185, 186, 5, 13, 0, 0, 186, 25, 1, 0, 0, 0, 187, 190, 3, 40, - 20, 0, 188, 190, 3, 12, 6, 0, 189, 187, 1, 0, 0, 0, 189, 188, 1, 0, 0, - 0, 190, 191, 1, 0, 0, 0, 191, 192, 5, 10, 0, 0, 192, 193, 3, 14, 7, 0, - 193, 27, 1, 0, 0, 0, 194, 206, 5, 4, 0, 0, 195, 197, 5, 29, 0, 0, 196, - 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, - 1, 0, 0, 0, 199, 203, 1, 0, 0, 0, 200, 202, 3, 30, 15, 0, 201, 200, 1, - 0, 0, 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, - 0, 204, 207, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 196, 1, 0, 0, 0, 206, - 207, 1, 0, 0, 0, 207, 208, 1, 0, 0, 0, 208, 209, 5, 5, 0, 0, 209, 29, 1, - 0, 0, 0, 210, 212, 3, 14, 7, 0, 211, 213, 5, 29, 0, 0, 212, 211, 1, 0, - 0, 0, 213, 214, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, - 215, 31, 1, 0, 0, 0, 216, 217, 5, 2, 0, 0, 217, 218, 3, 34, 17, 0, 218, - 219, 5, 29, 0, 0, 219, 33, 1, 0, 0, 0, 220, 226, 3, 36, 18, 0, 221, 222, - 3, 14, 7, 0, 222, 223, 5, 8, 0, 0, 223, 224, 3, 36, 18, 0, 224, 226, 1, - 0, 0, 0, 225, 220, 1, 0, 0, 0, 225, 221, 1, 0, 0, 0, 226, 35, 1, 0, 0, - 0, 227, 228, 3, 40, 20, 0, 228, 230, 5, 6, 0, 0, 229, 231, 3, 38, 19, 0, - 230, 229, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, - 233, 5, 7, 0, 0, 233, 37, 1, 0, 0, 0, 234, 239, 3, 14, 7, 0, 235, 236, - 5, 3, 0, 0, 236, 238, 3, 14, 7, 0, 237, 235, 1, 0, 0, 0, 238, 241, 1, 0, - 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 39, 1, 0, 0, 0, - 241, 239, 1, 0, 0, 0, 242, 243, 7, 0, 0, 0, 243, 41, 1, 0, 0, 0, 27, 45, - 54, 59, 66, 71, 73, 83, 95, 111, 118, 134, 136, 145, 156, 164, 170, 176, - 180, 183, 189, 198, 203, 206, 214, 225, 230, 239, + 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 147, + 8, 8, 1, 9, 1, 9, 3, 9, 151, 8, 9, 1, 9, 1, 9, 3, 9, 155, 8, 9, 1, 9, 1, + 9, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, + 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 172, 8, 11, 1, 12, 1, 12, 4, + 12, 176, 8, 12, 11, 12, 12, 12, 177, 1, 12, 1, 12, 4, 12, 182, 8, 12, 11, + 12, 12, 12, 183, 5, 12, 186, 8, 12, 10, 12, 12, 12, 189, 9, 12, 3, 12, + 191, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 197, 8, 13, 1, 13, 1, 13, + 1, 13, 1, 14, 1, 14, 4, 14, 204, 8, 14, 11, 14, 12, 14, 205, 1, 14, 5, + 14, 209, 8, 14, 10, 14, 12, 14, 212, 9, 14, 3, 14, 214, 8, 14, 1, 14, 1, + 14, 1, 15, 1, 15, 4, 15, 220, 8, 15, 11, 15, 12, 15, 221, 1, 16, 1, 16, + 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 233, 8, 17, 1, + 18, 1, 18, 1, 18, 3, 18, 238, 8, 18, 1, 18, 3, 18, 241, 8, 18, 1, 18, 3, + 18, 244, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 3, 19, 251, 8, 19, 1, + 19, 5, 19, 254, 8, 19, 10, 19, 12, 19, 257, 9, 19, 1, 20, 1, 20, 1, 20, + 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, + 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 282, 0, 45, 1, 0, 0, 0, + 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, + 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, 0, 16, 146, + 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, 1, 0, 0, 0, 22, 171, 1, 0, 0, + 0, 24, 173, 1, 0, 0, 0, 26, 196, 1, 0, 0, 0, 28, 201, 1, 0, 0, 0, 30, 217, + 1, 0, 0, 0, 32, 223, 1, 0, 0, 0, 34, 232, 1, 0, 0, 0, 36, 234, 1, 0, 0, + 0, 38, 247, 1, 0, 0, 0, 40, 258, 1, 0, 0, 0, 42, 44, 3, 2, 1, 0, 43, 42, + 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, + 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, + 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, 5, 0, 53, + 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, 52, 1, 0, + 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, 0, 57, + 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, + 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, 63, 73, + 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, 1, 0, 0, + 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 19, 0, 0, 69, 71, + 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, + 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, 75, 1, + 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, 0, 0, 78, + 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, 80, 1, 0, + 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, + 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, 3, 40, 20, + 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 29, 0, 0, 91, 9, + 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, + 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, + 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, 40, 20, 0, 100, 101, 3, 12, + 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 29, 0, + 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, 0, 106, 107, 3, 14, 7, 0, 107, + 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, 110, 113, + 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, + 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, 5, 22, 0, + 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 23, 0, 0, 118, 105, 1, 0, 0, 0, 118, + 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, 0, 121, 122, + 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, 124, 125, 5, + 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, + 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, + 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, + 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, + 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, + 0, 0, 138, 136, 1, 0, 0, 0, 139, 147, 3, 22, 11, 0, 140, 147, 3, 36, 18, + 0, 141, 147, 3, 12, 6, 0, 142, 147, 5, 1, 0, 0, 143, 147, 3, 28, 14, 0, + 144, 147, 3, 24, 12, 0, 145, 147, 3, 18, 9, 0, 146, 139, 1, 0, 0, 0, 146, + 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0, 146, 143, + 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 145, 1, 0, 0, 0, 147, 17, 1, 0, + 0, 0, 148, 150, 5, 6, 0, 0, 149, 151, 5, 29, 0, 0, 150, 149, 1, 0, 0, 0, + 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 3, 14, 7, 0, 153, + 155, 5, 29, 0, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, + 1, 0, 0, 0, 156, 157, 5, 7, 0, 0, 157, 19, 1, 0, 0, 0, 158, 163, 3, 40, + 20, 0, 159, 160, 5, 9, 0, 0, 160, 162, 3, 40, 20, 0, 161, 159, 1, 0, 0, + 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, + 21, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 172, 5, 28, 0, 0, 167, 172, + 5, 16, 0, 0, 168, 172, 5, 17, 0, 0, 169, 172, 5, 18, 0, 0, 170, 172, 3, + 40, 20, 0, 171, 166, 1, 0, 0, 0, 171, 167, 1, 0, 0, 0, 171, 168, 1, 0, + 0, 0, 171, 169, 1, 0, 0, 0, 171, 170, 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, + 173, 190, 5, 12, 0, 0, 174, 176, 5, 29, 0, 0, 175, 174, 1, 0, 0, 0, 176, + 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 187, + 1, 0, 0, 0, 179, 181, 3, 26, 13, 0, 180, 182, 5, 29, 0, 0, 181, 180, 1, + 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, + 0, 184, 186, 1, 0, 0, 0, 185, 179, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, + 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, + 1, 0, 0, 0, 190, 175, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, + 0, 0, 192, 193, 5, 13, 0, 0, 193, 25, 1, 0, 0, 0, 194, 197, 3, 40, 20, + 0, 195, 197, 3, 12, 6, 0, 196, 194, 1, 0, 0, 0, 196, 195, 1, 0, 0, 0, 197, + 198, 1, 0, 0, 0, 198, 199, 5, 10, 0, 0, 199, 200, 3, 14, 7, 0, 200, 27, + 1, 0, 0, 0, 201, 213, 5, 4, 0, 0, 202, 204, 5, 29, 0, 0, 203, 202, 1, 0, + 0, 0, 204, 205, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, + 206, 210, 1, 0, 0, 0, 207, 209, 3, 30, 15, 0, 208, 207, 1, 0, 0, 0, 209, + 212, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 210, 211, 1, 0, 0, 0, 211, 214, + 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 213, 203, 1, 0, 0, 0, 213, 214, 1, 0, + 0, 0, 214, 215, 1, 0, 0, 0, 215, 216, 5, 5, 0, 0, 216, 29, 1, 0, 0, 0, + 217, 219, 3, 14, 7, 0, 218, 220, 5, 29, 0, 0, 219, 218, 1, 0, 0, 0, 220, + 221, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 31, 1, + 0, 0, 0, 223, 224, 5, 2, 0, 0, 224, 225, 3, 34, 17, 0, 225, 226, 5, 29, + 0, 0, 226, 33, 1, 0, 0, 0, 227, 233, 3, 36, 18, 0, 228, 229, 3, 14, 7, + 0, 229, 230, 5, 8, 0, 0, 230, 231, 3, 36, 18, 0, 231, 233, 1, 0, 0, 0, + 232, 227, 1, 0, 0, 0, 232, 228, 1, 0, 0, 0, 233, 35, 1, 0, 0, 0, 234, 235, + 3, 40, 20, 0, 235, 240, 5, 6, 0, 0, 236, 238, 5, 29, 0, 0, 237, 236, 1, + 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 241, 3, 38, 19, + 0, 240, 237, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, + 244, 5, 29, 0, 0, 243, 242, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, + 1, 0, 0, 0, 245, 246, 5, 7, 0, 0, 246, 37, 1, 0, 0, 0, 247, 255, 3, 14, + 7, 0, 248, 250, 5, 3, 0, 0, 249, 251, 5, 29, 0, 0, 250, 249, 1, 0, 0, 0, + 250, 251, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 254, 3, 14, 7, 0, 253, + 248, 1, 0, 0, 0, 254, 257, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, + 1, 0, 0, 0, 256, 39, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 258, 259, 7, 0, + 0, 0, 259, 41, 1, 0, 0, 0, 32, 45, 54, 59, 66, 71, 73, 83, 95, 111, 118, + 134, 136, 146, 150, 154, 163, 171, 177, 183, 187, 190, 196, 205, 210, 213, + 221, 232, 237, 240, 243, 250, 255, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -357,18 +366,6 @@ func (s *ProgramContext) ToStringTree(ruleNames []string, recog antlr.Recognizer return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ProgramContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterProgram(s) - } -} - -func (s *ProgramContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitProgram(s) - } -} - func (s *ProgramContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -536,18 +533,6 @@ func (s *StatementContext) ToStringTree(ruleNames []string, recog antlr.Recogniz return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *StatementContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterStatement(s) - } -} - -func (s *StatementContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitStatement(s) - } -} - func (s *StatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -818,18 +803,6 @@ func (s *ParameterDeclContext) ToStringTree(ruleNames []string, recog antlr.Reco return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ParameterDeclContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterParameterDecl(s) - } -} - -func (s *ParameterDeclContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitParameterDecl(s) - } -} - func (s *ParameterDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -1039,18 +1012,6 @@ func (s *ParameterDefaultValueContext) ToStringTree(ruleNames []string, recog an return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ParameterDefaultValueContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterParameterDefaultValue(s) - } -} - -func (s *ParameterDefaultValueContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitParameterDefaultValue(s) - } -} - func (s *ParameterDefaultValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -1247,18 +1208,6 @@ func (s *VariableDeclContext) ToStringTree(ruleNames []string, recog antlr.Recog return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *VariableDeclContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterVariableDecl(s) - } -} - -func (s *VariableDeclContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitVariableDecl(s) - } -} - func (s *VariableDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -1528,18 +1477,6 @@ func (s *ResourceDeclContext) ToStringTree(ruleNames []string, recog antlr.Recog return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ResourceDeclContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterResourceDecl(s) - } -} - -func (s *ResourceDeclContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitResourceDecl(s) - } -} - func (s *ResourceDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -1755,18 +1692,6 @@ func (s *InterpStringContext) ToStringTree(ruleNames []string, recog antlr.Recog return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *InterpStringContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterInterpString(s) - } -} - -func (s *InterpStringContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitInterpString(s) - } -} - func (s *InterpStringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -2048,18 +1973,6 @@ func (s *ExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recogni return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ExpressionContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterExpression(s) - } -} - -func (s *ExpressionContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitExpression(s) - } -} - func (s *ExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -2232,6 +2145,7 @@ type IPrimaryExpressionContext interface { // Getter signatures LiteralValue() ILiteralValueContext + FunctionCall() IFunctionCallContext InterpString() IInterpStringContext MULTILINE_STRING() antlr.TerminalNode Array() IArrayContext @@ -2290,6 +2204,22 @@ func (s *PrimaryExpressionContext) LiteralValue() ILiteralValueContext { return t.(ILiteralValueContext) } +func (s *PrimaryExpressionContext) FunctionCall() IFunctionCallContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFunctionCallContext) +} + func (s *PrimaryExpressionContext) InterpString() IInterpStringContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { @@ -2366,18 +2296,6 @@ func (s *PrimaryExpressionContext) ToStringTree(ruleNames []string, recog antlr. return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *PrimaryExpressionContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterPrimaryExpression(s) - } -} - -func (s *PrimaryExpressionContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitPrimaryExpression(s) - } -} - func (s *PrimaryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -2391,31 +2309,38 @@ func (s *PrimaryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interf func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { localctx = NewPrimaryExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 16, bicepParserRULE_primaryExpression) - p.SetState(145) + p.SetState(146) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetTokenStream().LA(1) { - case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER, bicepParserNUMBER: + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 12, p.GetParserRuleContext()) { + case 1: p.EnterOuterAlt(localctx, 1) { p.SetState(139) p.LiteralValue() } - case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: + case 2: p.EnterOuterAlt(localctx, 2) { p.SetState(140) - p.InterpString() + p.FunctionCall() } - case bicepParserMULTILINE_STRING: + case 3: p.EnterOuterAlt(localctx, 3) { p.SetState(141) + p.InterpString() + } + + case 4: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(142) p.Match(bicepParserMULTILINE_STRING) if p.HasError() { // Recognition error - abort rule @@ -2423,29 +2348,28 @@ func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { } } - case bicepParserOBRACK: - p.EnterOuterAlt(localctx, 4) + case 5: + p.EnterOuterAlt(localctx, 5) { - p.SetState(142) + p.SetState(143) p.Array() } - case bicepParserOBRACE: - p.EnterOuterAlt(localctx, 5) + case 6: + p.EnterOuterAlt(localctx, 6) { - p.SetState(143) + p.SetState(144) p.Object() } - case bicepParserOPAR: - p.EnterOuterAlt(localctx, 6) + case 7: + p.EnterOuterAlt(localctx, 7) { - p.SetState(144) + p.SetState(145) p.ParenthesizedExpression() } - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + case antlr.ATNInvalidAltNumber: goto errorExit } @@ -2473,6 +2397,8 @@ type IParenthesizedExpressionContext interface { OPAR() antlr.TerminalNode Expression() IExpressionContext CPAR() antlr.TerminalNode + AllNL() []antlr.TerminalNode + NL(i int) antlr.TerminalNode // IsParenthesizedExpressionContext differentiates from other interfaces. IsParenthesizedExpressionContext() @@ -2534,24 +2460,20 @@ func (s *ParenthesizedExpressionContext) CPAR() antlr.TerminalNode { return s.GetToken(bicepParserCPAR, 0) } -func (s *ParenthesizedExpressionContext) GetRuleContext() antlr.RuleContext { - return s +func (s *ParenthesizedExpressionContext) AllNL() []antlr.TerminalNode { + return s.GetTokens(bicepParserNL) } -func (s *ParenthesizedExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *ParenthesizedExpressionContext) NL(i int) antlr.TerminalNode { + return s.GetToken(bicepParserNL, i) } -func (s *ParenthesizedExpressionContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterParenthesizedExpression(s) - } +func (s *ParenthesizedExpressionContext) GetRuleContext() antlr.RuleContext { + return s } -func (s *ParenthesizedExpressionContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitParenthesizedExpression(s) - } +func (s *ParenthesizedExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) } func (s *ParenthesizedExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { @@ -2567,21 +2489,59 @@ func (s *ParenthesizedExpressionContext) Accept(visitor antlr.ParseTreeVisitor) func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressionContext) { localctx = NewParenthesizedExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 18, bicepParserRULE_parenthesizedExpression) + var _la int + p.EnterOuterAlt(localctx, 1) { - p.SetState(147) + p.SetState(148) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } + p.SetState(150) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == bicepParserNL { + { + p.SetState(149) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } { - p.SetState(148) + p.SetState(152) p.expression(0) } + p.SetState(154) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == bicepParserNL { + { + p.SetState(153) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } { - p.SetState(149) + p.SetState(156) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -2719,18 +2679,6 @@ func (s *TypeExpressionContext) ToStringTree(ruleNames []string, recog antlr.Rec return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *TypeExpressionContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterTypeExpression(s) - } -} - -func (s *TypeExpressionContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitTypeExpression(s) - } -} - func (s *TypeExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -2748,13 +2696,13 @@ func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(151) + p.SetState(158) var _x = p.Identifier() localctx.(*TypeExpressionContext).type_ = _x } - p.SetState(156) + p.SetState(163) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2763,7 +2711,7 @@ func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { for _la == bicepParserPIPE { { - p.SetState(152) + p.SetState(159) p.Match(bicepParserPIPE) if p.HasError() { // Recognition error - abort rule @@ -2771,14 +2719,14 @@ func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { } } { - p.SetState(153) + p.SetState(160) var _x = p.Identifier() localctx.(*TypeExpressionContext).type_ = _x } - p.SetState(158) + p.SetState(165) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2889,18 +2837,6 @@ func (s *LiteralValueContext) ToStringTree(ruleNames []string, recog antlr.Recog return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *LiteralValueContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterLiteralValue(s) - } -} - -func (s *LiteralValueContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitLiteralValue(s) - } -} - func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -2914,17 +2850,17 @@ func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { localctx = NewLiteralValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 22, bicepParserRULE_literalValue) - p.SetState(164) + p.SetState(171) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(159) + p.SetState(166) p.Match(bicepParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -2935,7 +2871,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(160) + p.SetState(167) p.Match(bicepParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -2946,7 +2882,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(161) + p.SetState(168) p.Match(bicepParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -2957,7 +2893,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(162) + p.SetState(169) p.Match(bicepParserNULL) if p.HasError() { // Recognition error - abort rule @@ -2968,7 +2904,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(163) + p.SetState(170) p.Identifier() } @@ -3105,18 +3041,6 @@ func (s *ObjectContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ObjectContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterObject(s) - } -} - -func (s *ObjectContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitObject(s) - } -} - func (s *ObjectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -3134,14 +3058,14 @@ func (p *bicepParser) Object() (localctx IObjectContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(166) + p.SetState(173) p.Match(bicepParserOBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(183) + p.SetState(190) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3149,7 +3073,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) if _la == bicepParserNL { - p.SetState(168) + p.SetState(175) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3158,7 +3082,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(167) + p.SetState(174) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3166,14 +3090,14 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(170) + p.SetState(177) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(180) + p.SetState(187) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3182,10 +3106,10 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&262127616) != 0 { { - p.SetState(172) + p.SetState(179) p.ObjectProperty() } - p.SetState(174) + p.SetState(181) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3194,7 +3118,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(173) + p.SetState(180) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3202,7 +3126,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(176) + p.SetState(183) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3210,7 +3134,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) } - p.SetState(182) + p.SetState(189) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3220,7 +3144,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } { - p.SetState(185) + p.SetState(192) p.Match(bicepParserCBRACE) if p.HasError() { // Recognition error - abort rule @@ -3361,18 +3285,6 @@ func (s *ObjectPropertyContext) ToStringTree(ruleNames []string, recog antlr.Rec return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ObjectPropertyContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterObjectProperty(s) - } -} - -func (s *ObjectPropertyContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitObjectProperty(s) - } -} - func (s *ObjectPropertyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -3387,7 +3299,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { localctx = NewObjectPropertyContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 26, bicepParserRULE_objectProperty) p.EnterOuterAlt(localctx, 1) - p.SetState(189) + p.SetState(196) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3396,7 +3308,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: { - p.SetState(187) + p.SetState(194) var _x = p.Identifier() @@ -3405,7 +3317,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: { - p.SetState(188) + p.SetState(195) p.InterpString() } @@ -3414,7 +3326,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { goto errorExit } { - p.SetState(191) + p.SetState(198) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3422,7 +3334,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } } { - p.SetState(192) + p.SetState(199) p.expression(0) } @@ -3555,18 +3467,6 @@ func (s *ArrayContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ArrayContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterArray(s) - } -} - -func (s *ArrayContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitArray(s) - } -} - func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -3584,14 +3484,14 @@ func (p *bicepParser) Array() (localctx IArrayContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(194) + p.SetState(201) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(206) + p.SetState(213) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3599,7 +3499,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { _la = p.GetTokenStream().LA(1) if _la == bicepParserNL { - p.SetState(196) + p.SetState(203) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3608,7 +3508,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(195) + p.SetState(202) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3616,14 +3516,14 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } } - p.SetState(198) + p.SetState(205) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(203) + p.SetState(210) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3632,11 +3532,11 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&530567250) != 0 { { - p.SetState(200) + p.SetState(207) p.ArrayItem() } - p.SetState(205) + p.SetState(212) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3646,7 +3546,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } { - p.SetState(208) + p.SetState(215) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -3747,18 +3647,6 @@ func (s *ArrayItemContext) ToStringTree(ruleNames []string, recog antlr.Recogniz return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ArrayItemContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterArrayItem(s) - } -} - -func (s *ArrayItemContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitArrayItem(s) - } -} - func (s *ArrayItemContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -3776,10 +3664,10 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(210) + p.SetState(217) p.expression(0) } - p.SetState(212) + p.SetState(219) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3788,7 +3676,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(211) + p.SetState(218) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3796,7 +3684,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - p.SetState(214) + p.SetState(221) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3897,18 +3785,6 @@ func (s *DecoratorContext) ToStringTree(ruleNames []string, recog antlr.Recogniz return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *DecoratorContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterDecorator(s) - } -} - -func (s *DecoratorContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitDecorator(s) - } -} - func (s *DecoratorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -3924,7 +3800,7 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { p.EnterRule(localctx, 32, bicepParserRULE_decorator) p.EnterOuterAlt(localctx, 1) { - p.SetState(216) + p.SetState(223) p.Match(bicepParserAT) if p.HasError() { // Recognition error - abort rule @@ -3932,11 +3808,11 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { } } { - p.SetState(217) + p.SetState(224) p.DecoratorExpression() } { - p.SetState(218) + p.SetState(225) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4049,18 +3925,6 @@ func (s *DecoratorExpressionContext) ToStringTree(ruleNames []string, recog antl return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *DecoratorExpressionContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterDecoratorExpression(s) - } -} - -func (s *DecoratorExpressionContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitDecoratorExpression(s) - } -} - func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -4074,28 +3938,28 @@ func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, bicepParserRULE_decoratorExpression) - p.SetState(225) + p.SetState(232) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 26, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(220) + p.SetState(227) p.FunctionCall() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(221) + p.SetState(228) p.expression(0) } { - p.SetState(222) + p.SetState(229) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -4103,7 +3967,7 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex } } { - p.SetState(223) + p.SetState(230) p.FunctionCall() } @@ -4136,6 +4000,8 @@ type IFunctionCallContext interface { OPAR() antlr.TerminalNode CPAR() antlr.TerminalNode ArgumentList() IArgumentListContext + AllNL() []antlr.TerminalNode + NL(i int) antlr.TerminalNode // IsFunctionCallContext differentiates from other interfaces. IsFunctionCallContext() @@ -4213,24 +4079,20 @@ func (s *FunctionCallContext) ArgumentList() IArgumentListContext { return t.(IArgumentListContext) } -func (s *FunctionCallContext) GetRuleContext() antlr.RuleContext { - return s +func (s *FunctionCallContext) AllNL() []antlr.TerminalNode { + return s.GetTokens(bicepParserNL) } -func (s *FunctionCallContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *FunctionCallContext) NL(i int) antlr.TerminalNode { + return s.GetToken(bicepParserNL, i) } -func (s *FunctionCallContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterFunctionCall(s) - } +func (s *FunctionCallContext) GetRuleContext() antlr.RuleContext { + return s } -func (s *FunctionCallContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitFunctionCall(s) - } +func (s *FunctionCallContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) } func (s *FunctionCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { @@ -4250,33 +4112,67 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(227) + p.SetState(234) p.Identifier() } { - p.SetState(228) + p.SetState(235) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(230) + p.SetState(240) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext()) == 1 { + p.SetState(237) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == bicepParserNL { + { + p.SetState(236) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(239) + p.ArgumentList() + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(243) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&530567250) != 0 { + if _la == bicepParserNL { { - p.SetState(229) - p.ArgumentList() + p.SetState(242) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } { - p.SetState(232) + p.SetState(245) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -4309,6 +4205,8 @@ type IArgumentListContext interface { Expression(i int) IExpressionContext AllCOMMA() []antlr.TerminalNode COMMA(i int) antlr.TerminalNode + AllNL() []antlr.TerminalNode + NL(i int) antlr.TerminalNode // IsArgumentListContext differentiates from other interfaces. IsArgumentListContext() @@ -4395,24 +4293,20 @@ func (s *ArgumentListContext) COMMA(i int) antlr.TerminalNode { return s.GetToken(bicepParserCOMMA, i) } -func (s *ArgumentListContext) GetRuleContext() antlr.RuleContext { - return s +func (s *ArgumentListContext) AllNL() []antlr.TerminalNode { + return s.GetTokens(bicepParserNL) } -func (s *ArgumentListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *ArgumentListContext) NL(i int) antlr.TerminalNode { + return s.GetToken(bicepParserNL, i) } -func (s *ArgumentListContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterArgumentList(s) - } +func (s *ArgumentListContext) GetRuleContext() antlr.RuleContext { + return s } -func (s *ArgumentListContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitArgumentList(s) - } +func (s *ArgumentListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) } func (s *ArgumentListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { @@ -4432,10 +4326,10 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(234) + p.SetState(247) p.expression(0) } - p.SetState(239) + p.SetState(255) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4444,19 +4338,37 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { for _la == bicepParserCOMMA { { - p.SetState(235) + p.SetState(248) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } + p.SetState(250) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == bicepParserNL { + { + p.SetState(249) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } { - p.SetState(236) + p.SetState(252) p.expression(0) } - p.SetState(241) + p.SetState(257) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4580,18 +4492,6 @@ func (s *IdentifierContext) ToStringTree(ruleNames []string, recog antlr.Recogni return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *IdentifierContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.EnterIdentifier(s) - } -} - -func (s *IdentifierContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(bicepListener); ok { - listenerT.ExitIdentifier(s) - } -} - func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: @@ -4609,7 +4509,7 @@ func (p *bicepParser) Identifier() (localctx IIdentifierContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(242) + p.SetState(258) _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&252690432) != 0) { diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index f2e26862fa7..69e085520cd 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -170,6 +170,7 @@ func (s *BicepVisitor) VisitParameterDefaultValue(ctx *parser.ParameterDefaultVa func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{} { if ctx.GetChildCount() > 1 { + fmt.Println("Expression1") if ctx.Identifier() != nil { identifier := ctx.Identifier().Accept(s) fmt.Println(identifier) @@ -184,6 +185,7 @@ func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{ } } } else { + fmt.Println("Expression2") return ctx.PrimaryExpression().Accept(s) } return nil @@ -194,7 +196,12 @@ func (s *BicepVisitor) VisitPrimaryExpression(ctx *parser.PrimaryExpressionConte if ctx.LiteralValue() != nil { return ctx.LiteralValue().Accept(s) } + if ctx.FunctionCall() != nil { + fmt.Println("Function Call Primary Expression") + return ctx.FunctionCall().Accept(s) + } if ctx.InterpString() != nil { + fmt.Println("InterpString Primary Expression") return ctx.InterpString().Accept(s) } if ctx.MULTILINE_STRING() != nil { @@ -204,9 +211,11 @@ func (s *BicepVisitor) VisitPrimaryExpression(ctx *parser.PrimaryExpressionConte return ctx.Array().Accept(s) } if ctx.Object() != nil { + fmt.Println("Object Primary Expression") return ctx.Object().Accept(s) } if ctx.ParenthesizedExpression() != nil { + fmt.Println("ParenthesizedExpression Primary Expression") return ctx.ParenthesizedExpression().Accept(s) } @@ -250,6 +259,7 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf interpString = append(interpString, ctx.STRING_RIGHT_PIECE().GetText()) return interpString } else { + fmt.Println("InterpString: ", ctx.STRING_COMPLETE().GetText()) return ctx.STRING_COMPLETE().GetText() } } @@ -281,12 +291,15 @@ func (s *BicepVisitor) VisitObject(ctx *parser.ObjectContext) interface{} { func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) interface{} { objectProperty := map[string]interface{}{} + fmt.Println("VisitObjectProperty") if ctx.Identifier() != nil { identifier := ctx.Identifier().Accept(s) + fmt.Println("VisitObjectProperty2: ", identifier.(string)) objectProperty[identifier.(string)] = ctx.Expression().Accept(s) } if ctx.InterpString() != nil { interpString := ctx.InterpString().Accept(s) + fmt.Println("VisitObjectProperty3: ", interpString.(string)) objectProperty[interpString.(string)] = ctx.Expression().Accept(s) } @@ -343,7 +356,9 @@ func (s *BicepVisitor) VisitDecoratorExpression(ctx *parser.DecoratorExpressionC func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interface{} { identifier := ctx.Identifier().Accept(s) var argumentList []interface{} + fmt.Println("VisitFunctionCall: ", identifier) if ctx.ArgumentList() != nil { + fmt.Println("Function Call ArgumentList") argumentList = ctx.ArgumentList().Accept(s).([]interface{}) } functionCall := map[string]interface{}{ @@ -356,6 +371,7 @@ func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interf func (s *BicepVisitor) VisitArgumentList(ctx *parser.ArgumentListContext) interface{} { var argumentList []interface{} for _, val := range ctx.AllExpression() { + fmt.Println("VisitArgumentList") argument := val.Accept(s) argumentList = append(argumentList, argument) } From 1a1efc5d9dc703bc8e7a4173a4502281dcfc66d7 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 3 Apr 2024 15:18:29 +0100 Subject: [PATCH 008/130] fix grammar for arrays --- pkg/parser/bicep/antlr/bicep.g4 | 8 +- pkg/parser/bicep/antlr/parser/bicep.interp | 2 +- pkg/parser/bicep/antlr/parser/bicep_parser.go | 358 +++++++++--------- 3 files changed, 193 insertions(+), 175 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index 12131845fba..9c092031873 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -66,11 +66,11 @@ object: OBRACE (NL+ ( objectProperty NL+)*)? CBRACE; // objectProperty -> ( IDENTIFIER(name) | interpString ) ":" expression objectProperty: (name = identifier | interpString) COL expression; -// array -> "[" ( NL+ arrayItem* )? "]" -array: OBRACK (NL+ arrayItem*)? CBRACK; +// array -> "[" NL* arrayItem* "]" +array: OBRACK NL* arrayItem* CBRACK; -// arrayItem -> expression NL+ -arrayItem: expression NL+; +// arrayItem -> expression (NL+|COMMA)? +arrayItem: expression (NL+|COMMA)?; // decorator -> "@" decoratorExpression NL decorator: AT decoratorExpression NL; diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index 5f524622e0d..4eefca1180c 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -91,4 +91,4 @@ identifier atn: -[4, 1, 31, 261, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 55, 8, 1, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 67, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 72, 8, 2, 3, 2, 74, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 94, 8, 5, 10, 5, 12, 5, 97, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 119, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 147, 8, 8, 1, 9, 1, 9, 3, 9, 151, 8, 9, 1, 9, 1, 9, 3, 9, 155, 8, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 172, 8, 11, 1, 12, 1, 12, 4, 12, 176, 8, 12, 11, 12, 12, 12, 177, 1, 12, 1, 12, 4, 12, 182, 8, 12, 11, 12, 12, 12, 183, 5, 12, 186, 8, 12, 10, 12, 12, 12, 189, 9, 12, 3, 12, 191, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 197, 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 4, 14, 204, 8, 14, 11, 14, 12, 14, 205, 1, 14, 5, 14, 209, 8, 14, 10, 14, 12, 14, 212, 9, 14, 3, 14, 214, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 4, 15, 220, 8, 15, 11, 15, 12, 15, 221, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 233, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 238, 8, 18, 1, 18, 3, 18, 241, 8, 18, 1, 18, 3, 18, 244, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 3, 19, 251, 8, 19, 1, 19, 5, 19, 254, 8, 19, 10, 19, 12, 19, 257, 9, 19, 1, 20, 1, 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 282, 0, 45, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, 1, 0, 0, 0, 22, 171, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 196, 1, 0, 0, 0, 28, 201, 1, 0, 0, 0, 30, 217, 1, 0, 0, 0, 32, 223, 1, 0, 0, 0, 34, 232, 1, 0, 0, 0, 36, 234, 1, 0, 0, 0, 38, 247, 1, 0, 0, 0, 40, 258, 1, 0, 0, 0, 42, 44, 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, 5, 0, 53, 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 19, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 29, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 29, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, 5, 22, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 23, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 147, 3, 22, 11, 0, 140, 147, 3, 36, 18, 0, 141, 147, 3, 12, 6, 0, 142, 147, 5, 1, 0, 0, 143, 147, 3, 28, 14, 0, 144, 147, 3, 24, 12, 0, 145, 147, 3, 18, 9, 0, 146, 139, 1, 0, 0, 0, 146, 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0, 146, 143, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 145, 1, 0, 0, 0, 147, 17, 1, 0, 0, 0, 148, 150, 5, 6, 0, 0, 149, 151, 5, 29, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 3, 14, 7, 0, 153, 155, 5, 29, 0, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 7, 0, 0, 157, 19, 1, 0, 0, 0, 158, 163, 3, 40, 20, 0, 159, 160, 5, 9, 0, 0, 160, 162, 3, 40, 20, 0, 161, 159, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 21, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 172, 5, 28, 0, 0, 167, 172, 5, 16, 0, 0, 168, 172, 5, 17, 0, 0, 169, 172, 5, 18, 0, 0, 170, 172, 3, 40, 20, 0, 171, 166, 1, 0, 0, 0, 171, 167, 1, 0, 0, 0, 171, 168, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 170, 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, 173, 190, 5, 12, 0, 0, 174, 176, 5, 29, 0, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 187, 1, 0, 0, 0, 179, 181, 3, 26, 13, 0, 180, 182, 5, 29, 0, 0, 181, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 179, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 175, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 13, 0, 0, 193, 25, 1, 0, 0, 0, 194, 197, 3, 40, 20, 0, 195, 197, 3, 12, 6, 0, 196, 194, 1, 0, 0, 0, 196, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 5, 10, 0, 0, 199, 200, 3, 14, 7, 0, 200, 27, 1, 0, 0, 0, 201, 213, 5, 4, 0, 0, 202, 204, 5, 29, 0, 0, 203, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 210, 1, 0, 0, 0, 207, 209, 3, 30, 15, 0, 208, 207, 1, 0, 0, 0, 209, 212, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 210, 211, 1, 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 213, 203, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 216, 5, 5, 0, 0, 216, 29, 1, 0, 0, 0, 217, 219, 3, 14, 7, 0, 218, 220, 5, 29, 0, 0, 219, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 31, 1, 0, 0, 0, 223, 224, 5, 2, 0, 0, 224, 225, 3, 34, 17, 0, 225, 226, 5, 29, 0, 0, 226, 33, 1, 0, 0, 0, 227, 233, 3, 36, 18, 0, 228, 229, 3, 14, 7, 0, 229, 230, 5, 8, 0, 0, 230, 231, 3, 36, 18, 0, 231, 233, 1, 0, 0, 0, 232, 227, 1, 0, 0, 0, 232, 228, 1, 0, 0, 0, 233, 35, 1, 0, 0, 0, 234, 235, 3, 40, 20, 0, 235, 240, 5, 6, 0, 0, 236, 238, 5, 29, 0, 0, 237, 236, 1, 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 241, 3, 38, 19, 0, 240, 237, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, 244, 5, 29, 0, 0, 243, 242, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, 5, 7, 0, 0, 246, 37, 1, 0, 0, 0, 247, 255, 3, 14, 7, 0, 248, 250, 5, 3, 0, 0, 249, 251, 5, 29, 0, 0, 250, 249, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 254, 3, 14, 7, 0, 253, 248, 1, 0, 0, 0, 254, 257, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 39, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 258, 259, 7, 0, 0, 0, 259, 41, 1, 0, 0, 0, 32, 45, 54, 59, 66, 71, 73, 83, 95, 111, 118, 134, 136, 146, 150, 154, 163, 171, 177, 183, 187, 190, 196, 205, 210, 213, 221, 232, 237, 240, 243, 250, 255] \ No newline at end of file +[4, 1, 31, 263, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 55, 8, 1, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 67, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 72, 8, 2, 3, 2, 74, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 94, 8, 5, 10, 5, 12, 5, 97, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 119, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 147, 8, 8, 1, 9, 1, 9, 3, 9, 151, 8, 9, 1, 9, 1, 9, 3, 9, 155, 8, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 172, 8, 11, 1, 12, 1, 12, 4, 12, 176, 8, 12, 11, 12, 12, 12, 177, 1, 12, 1, 12, 4, 12, 182, 8, 12, 11, 12, 12, 12, 183, 5, 12, 186, 8, 12, 10, 12, 12, 12, 189, 9, 12, 3, 12, 191, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 197, 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 204, 8, 14, 10, 14, 12, 14, 207, 9, 14, 1, 14, 5, 14, 210, 8, 14, 10, 14, 12, 14, 213, 9, 14, 1, 14, 1, 14, 1, 15, 1, 15, 4, 15, 219, 8, 15, 11, 15, 12, 15, 220, 1, 15, 3, 15, 224, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 235, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 240, 8, 18, 1, 18, 3, 18, 243, 8, 18, 1, 18, 3, 18, 246, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 3, 19, 253, 8, 19, 1, 19, 5, 19, 256, 8, 19, 10, 19, 12, 19, 259, 9, 19, 1, 20, 1, 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 285, 0, 45, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, 1, 0, 0, 0, 22, 171, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 196, 1, 0, 0, 0, 28, 201, 1, 0, 0, 0, 30, 216, 1, 0, 0, 0, 32, 225, 1, 0, 0, 0, 34, 234, 1, 0, 0, 0, 36, 236, 1, 0, 0, 0, 38, 249, 1, 0, 0, 0, 40, 260, 1, 0, 0, 0, 42, 44, 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, 5, 0, 53, 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 19, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 29, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 29, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, 5, 22, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 23, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 147, 3, 22, 11, 0, 140, 147, 3, 36, 18, 0, 141, 147, 3, 12, 6, 0, 142, 147, 5, 1, 0, 0, 143, 147, 3, 28, 14, 0, 144, 147, 3, 24, 12, 0, 145, 147, 3, 18, 9, 0, 146, 139, 1, 0, 0, 0, 146, 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0, 146, 143, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 145, 1, 0, 0, 0, 147, 17, 1, 0, 0, 0, 148, 150, 5, 6, 0, 0, 149, 151, 5, 29, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 3, 14, 7, 0, 153, 155, 5, 29, 0, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 7, 0, 0, 157, 19, 1, 0, 0, 0, 158, 163, 3, 40, 20, 0, 159, 160, 5, 9, 0, 0, 160, 162, 3, 40, 20, 0, 161, 159, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 21, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 172, 5, 28, 0, 0, 167, 172, 5, 16, 0, 0, 168, 172, 5, 17, 0, 0, 169, 172, 5, 18, 0, 0, 170, 172, 3, 40, 20, 0, 171, 166, 1, 0, 0, 0, 171, 167, 1, 0, 0, 0, 171, 168, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 170, 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, 173, 190, 5, 12, 0, 0, 174, 176, 5, 29, 0, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 187, 1, 0, 0, 0, 179, 181, 3, 26, 13, 0, 180, 182, 5, 29, 0, 0, 181, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 179, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 175, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 13, 0, 0, 193, 25, 1, 0, 0, 0, 194, 197, 3, 40, 20, 0, 195, 197, 3, 12, 6, 0, 196, 194, 1, 0, 0, 0, 196, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 5, 10, 0, 0, 199, 200, 3, 14, 7, 0, 200, 27, 1, 0, 0, 0, 201, 205, 5, 4, 0, 0, 202, 204, 5, 29, 0, 0, 203, 202, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 211, 1, 0, 0, 0, 207, 205, 1, 0, 0, 0, 208, 210, 3, 30, 15, 0, 209, 208, 1, 0, 0, 0, 210, 213, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 214, 1, 0, 0, 0, 213, 211, 1, 0, 0, 0, 214, 215, 5, 5, 0, 0, 215, 29, 1, 0, 0, 0, 216, 223, 3, 14, 7, 0, 217, 219, 5, 29, 0, 0, 218, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 224, 5, 3, 0, 0, 223, 218, 1, 0, 0, 0, 223, 222, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 31, 1, 0, 0, 0, 225, 226, 5, 2, 0, 0, 226, 227, 3, 34, 17, 0, 227, 228, 5, 29, 0, 0, 228, 33, 1, 0, 0, 0, 229, 235, 3, 36, 18, 0, 230, 231, 3, 14, 7, 0, 231, 232, 5, 8, 0, 0, 232, 233, 3, 36, 18, 0, 233, 235, 1, 0, 0, 0, 234, 229, 1, 0, 0, 0, 234, 230, 1, 0, 0, 0, 235, 35, 1, 0, 0, 0, 236, 237, 3, 40, 20, 0, 237, 242, 5, 6, 0, 0, 238, 240, 5, 29, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 3, 38, 19, 0, 242, 239, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 245, 1, 0, 0, 0, 244, 246, 5, 29, 0, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 5, 7, 0, 0, 248, 37, 1, 0, 0, 0, 249, 257, 3, 14, 7, 0, 250, 252, 5, 3, 0, 0, 251, 253, 5, 29, 0, 0, 252, 251, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 3, 14, 7, 0, 255, 250, 1, 0, 0, 0, 256, 259, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 39, 1, 0, 0, 0, 259, 257, 1, 0, 0, 0, 260, 261, 7, 0, 0, 0, 261, 41, 1, 0, 0, 0, 32, 45, 54, 59, 66, 71, 73, 83, 95, 111, 118, 134, 136, 146, 150, 154, 163, 171, 177, 183, 187, 190, 196, 205, 211, 220, 223, 234, 239, 242, 245, 252, 257] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 59c16e7b789..50d17b74ad1 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -53,7 +53,7 @@ func bicepParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 31, 261, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 31, 263, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, @@ -73,102 +73,103 @@ func bicepParserInit() { 12, 176, 8, 12, 11, 12, 12, 12, 177, 1, 12, 1, 12, 4, 12, 182, 8, 12, 11, 12, 12, 12, 183, 5, 12, 186, 8, 12, 10, 12, 12, 12, 189, 9, 12, 3, 12, 191, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 197, 8, 13, 1, 13, 1, 13, - 1, 13, 1, 14, 1, 14, 4, 14, 204, 8, 14, 11, 14, 12, 14, 205, 1, 14, 5, - 14, 209, 8, 14, 10, 14, 12, 14, 212, 9, 14, 3, 14, 214, 8, 14, 1, 14, 1, - 14, 1, 15, 1, 15, 4, 15, 220, 8, 15, 11, 15, 12, 15, 221, 1, 16, 1, 16, - 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 233, 8, 17, 1, - 18, 1, 18, 1, 18, 3, 18, 238, 8, 18, 1, 18, 3, 18, 241, 8, 18, 1, 18, 3, - 18, 244, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 3, 19, 251, 8, 19, 1, - 19, 5, 19, 254, 8, 19, 10, 19, 12, 19, 257, 9, 19, 1, 20, 1, 20, 1, 20, - 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, - 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 282, 0, 45, 1, 0, 0, 0, - 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, - 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, 0, 16, 146, - 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, 1, 0, 0, 0, 22, 171, 1, 0, 0, - 0, 24, 173, 1, 0, 0, 0, 26, 196, 1, 0, 0, 0, 28, 201, 1, 0, 0, 0, 30, 217, - 1, 0, 0, 0, 32, 223, 1, 0, 0, 0, 34, 232, 1, 0, 0, 0, 36, 234, 1, 0, 0, - 0, 38, 247, 1, 0, 0, 0, 40, 258, 1, 0, 0, 0, 42, 44, 3, 2, 1, 0, 43, 42, - 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, - 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, - 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, 5, 0, 53, - 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, 52, 1, 0, - 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, 0, 57, - 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, - 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, 63, 73, - 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, 1, 0, 0, - 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 19, 0, 0, 69, 71, - 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, - 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, 75, 1, - 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, 0, 0, 78, - 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, 80, 1, 0, - 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, - 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, 3, 40, 20, - 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 29, 0, 0, 91, 9, - 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, - 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, - 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, 40, 20, 0, 100, 101, 3, 12, - 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 29, 0, - 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, 0, 106, 107, 3, 14, 7, 0, 107, - 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, 110, 113, - 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, - 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, 5, 22, 0, - 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 23, 0, 0, 118, 105, 1, 0, 0, 0, 118, - 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, 0, 121, 122, - 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, 124, 125, 5, - 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, - 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, - 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, - 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, - 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, - 0, 0, 138, 136, 1, 0, 0, 0, 139, 147, 3, 22, 11, 0, 140, 147, 3, 36, 18, - 0, 141, 147, 3, 12, 6, 0, 142, 147, 5, 1, 0, 0, 143, 147, 3, 28, 14, 0, - 144, 147, 3, 24, 12, 0, 145, 147, 3, 18, 9, 0, 146, 139, 1, 0, 0, 0, 146, - 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0, 146, 143, - 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 145, 1, 0, 0, 0, 147, 17, 1, 0, - 0, 0, 148, 150, 5, 6, 0, 0, 149, 151, 5, 29, 0, 0, 150, 149, 1, 0, 0, 0, - 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 3, 14, 7, 0, 153, - 155, 5, 29, 0, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, - 1, 0, 0, 0, 156, 157, 5, 7, 0, 0, 157, 19, 1, 0, 0, 0, 158, 163, 3, 40, - 20, 0, 159, 160, 5, 9, 0, 0, 160, 162, 3, 40, 20, 0, 161, 159, 1, 0, 0, - 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, - 21, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 172, 5, 28, 0, 0, 167, 172, - 5, 16, 0, 0, 168, 172, 5, 17, 0, 0, 169, 172, 5, 18, 0, 0, 170, 172, 3, - 40, 20, 0, 171, 166, 1, 0, 0, 0, 171, 167, 1, 0, 0, 0, 171, 168, 1, 0, - 0, 0, 171, 169, 1, 0, 0, 0, 171, 170, 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, - 173, 190, 5, 12, 0, 0, 174, 176, 5, 29, 0, 0, 175, 174, 1, 0, 0, 0, 176, - 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 187, - 1, 0, 0, 0, 179, 181, 3, 26, 13, 0, 180, 182, 5, 29, 0, 0, 181, 180, 1, - 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, - 0, 184, 186, 1, 0, 0, 0, 185, 179, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, - 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, - 1, 0, 0, 0, 190, 175, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, - 0, 0, 192, 193, 5, 13, 0, 0, 193, 25, 1, 0, 0, 0, 194, 197, 3, 40, 20, - 0, 195, 197, 3, 12, 6, 0, 196, 194, 1, 0, 0, 0, 196, 195, 1, 0, 0, 0, 197, - 198, 1, 0, 0, 0, 198, 199, 5, 10, 0, 0, 199, 200, 3, 14, 7, 0, 200, 27, - 1, 0, 0, 0, 201, 213, 5, 4, 0, 0, 202, 204, 5, 29, 0, 0, 203, 202, 1, 0, - 0, 0, 204, 205, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, - 206, 210, 1, 0, 0, 0, 207, 209, 3, 30, 15, 0, 208, 207, 1, 0, 0, 0, 209, - 212, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 210, 211, 1, 0, 0, 0, 211, 214, - 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 213, 203, 1, 0, 0, 0, 213, 214, 1, 0, - 0, 0, 214, 215, 1, 0, 0, 0, 215, 216, 5, 5, 0, 0, 216, 29, 1, 0, 0, 0, - 217, 219, 3, 14, 7, 0, 218, 220, 5, 29, 0, 0, 219, 218, 1, 0, 0, 0, 220, - 221, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 31, 1, - 0, 0, 0, 223, 224, 5, 2, 0, 0, 224, 225, 3, 34, 17, 0, 225, 226, 5, 29, - 0, 0, 226, 33, 1, 0, 0, 0, 227, 233, 3, 36, 18, 0, 228, 229, 3, 14, 7, - 0, 229, 230, 5, 8, 0, 0, 230, 231, 3, 36, 18, 0, 231, 233, 1, 0, 0, 0, - 232, 227, 1, 0, 0, 0, 232, 228, 1, 0, 0, 0, 233, 35, 1, 0, 0, 0, 234, 235, - 3, 40, 20, 0, 235, 240, 5, 6, 0, 0, 236, 238, 5, 29, 0, 0, 237, 236, 1, - 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 241, 3, 38, 19, - 0, 240, 237, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, - 244, 5, 29, 0, 0, 243, 242, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, - 1, 0, 0, 0, 245, 246, 5, 7, 0, 0, 246, 37, 1, 0, 0, 0, 247, 255, 3, 14, - 7, 0, 248, 250, 5, 3, 0, 0, 249, 251, 5, 29, 0, 0, 250, 249, 1, 0, 0, 0, - 250, 251, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 254, 3, 14, 7, 0, 253, - 248, 1, 0, 0, 0, 254, 257, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, - 1, 0, 0, 0, 256, 39, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 258, 259, 7, 0, - 0, 0, 259, 41, 1, 0, 0, 0, 32, 45, 54, 59, 66, 71, 73, 83, 95, 111, 118, - 134, 136, 146, 150, 154, 163, 171, 177, 183, 187, 190, 196, 205, 210, 213, - 221, 232, 237, 240, 243, 250, 255, + 1, 13, 1, 14, 1, 14, 5, 14, 204, 8, 14, 10, 14, 12, 14, 207, 9, 14, 1, + 14, 5, 14, 210, 8, 14, 10, 14, 12, 14, 213, 9, 14, 1, 14, 1, 14, 1, 15, + 1, 15, 4, 15, 219, 8, 15, 11, 15, 12, 15, 220, 1, 15, 3, 15, 224, 8, 15, + 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 235, + 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 240, 8, 18, 1, 18, 3, 18, 243, 8, 18, + 1, 18, 3, 18, 246, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 3, 19, 253, + 8, 19, 1, 19, 5, 19, 256, 8, 19, 10, 19, 12, 19, 259, 9, 19, 1, 20, 1, + 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, + 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 285, 0, 45, + 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, + 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, + 0, 0, 16, 146, 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, 1, 0, 0, 0, 22, + 171, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 196, 1, 0, 0, 0, 28, 201, 1, + 0, 0, 0, 30, 216, 1, 0, 0, 0, 32, 225, 1, 0, 0, 0, 34, 234, 1, 0, 0, 0, + 36, 236, 1, 0, 0, 0, 38, 249, 1, 0, 0, 0, 40, 260, 1, 0, 0, 0, 42, 44, + 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, + 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, + 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, + 55, 3, 10, 5, 0, 53, 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, + 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, + 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, + 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, + 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, + 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, + 5, 19, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, + 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, + 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, + 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, + 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, + 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, + 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, + 0, 90, 91, 5, 29, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, + 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, + 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, + 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, + 12, 0, 103, 104, 5, 29, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, + 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, + 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, + 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, + 3, 14, 7, 0, 115, 116, 5, 22, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, + 23, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, + 0, 120, 121, 6, 7, -1, 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, + 123, 124, 10, 4, 0, 0, 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, + 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, + 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, + 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, + 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, + 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 147, + 3, 22, 11, 0, 140, 147, 3, 36, 18, 0, 141, 147, 3, 12, 6, 0, 142, 147, + 5, 1, 0, 0, 143, 147, 3, 28, 14, 0, 144, 147, 3, 24, 12, 0, 145, 147, 3, + 18, 9, 0, 146, 139, 1, 0, 0, 0, 146, 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, + 0, 146, 142, 1, 0, 0, 0, 146, 143, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, + 145, 1, 0, 0, 0, 147, 17, 1, 0, 0, 0, 148, 150, 5, 6, 0, 0, 149, 151, 5, + 29, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, + 0, 152, 154, 3, 14, 7, 0, 153, 155, 5, 29, 0, 0, 154, 153, 1, 0, 0, 0, + 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 7, 0, 0, 157, + 19, 1, 0, 0, 0, 158, 163, 3, 40, 20, 0, 159, 160, 5, 9, 0, 0, 160, 162, + 3, 40, 20, 0, 161, 159, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, + 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 21, 1, 0, 0, 0, 165, 163, 1, 0, 0, + 0, 166, 172, 5, 28, 0, 0, 167, 172, 5, 16, 0, 0, 168, 172, 5, 17, 0, 0, + 169, 172, 5, 18, 0, 0, 170, 172, 3, 40, 20, 0, 171, 166, 1, 0, 0, 0, 171, + 167, 1, 0, 0, 0, 171, 168, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 170, + 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, 173, 190, 5, 12, 0, 0, 174, 176, 5, 29, + 0, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, + 177, 178, 1, 0, 0, 0, 178, 187, 1, 0, 0, 0, 179, 181, 3, 26, 13, 0, 180, + 182, 5, 29, 0, 0, 181, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, + 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 179, 1, 0, + 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, + 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 175, 1, 0, 0, 0, 190, + 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 13, 0, 0, 193, 25, + 1, 0, 0, 0, 194, 197, 3, 40, 20, 0, 195, 197, 3, 12, 6, 0, 196, 194, 1, + 0, 0, 0, 196, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 5, 10, 0, + 0, 199, 200, 3, 14, 7, 0, 200, 27, 1, 0, 0, 0, 201, 205, 5, 4, 0, 0, 202, + 204, 5, 29, 0, 0, 203, 202, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, + 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 211, 1, 0, 0, 0, 207, 205, 1, 0, + 0, 0, 208, 210, 3, 30, 15, 0, 209, 208, 1, 0, 0, 0, 210, 213, 1, 0, 0, + 0, 211, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 214, 1, 0, 0, 0, 213, + 211, 1, 0, 0, 0, 214, 215, 5, 5, 0, 0, 215, 29, 1, 0, 0, 0, 216, 223, 3, + 14, 7, 0, 217, 219, 5, 29, 0, 0, 218, 217, 1, 0, 0, 0, 219, 220, 1, 0, + 0, 0, 220, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, + 222, 224, 5, 3, 0, 0, 223, 218, 1, 0, 0, 0, 223, 222, 1, 0, 0, 0, 223, + 224, 1, 0, 0, 0, 224, 31, 1, 0, 0, 0, 225, 226, 5, 2, 0, 0, 226, 227, 3, + 34, 17, 0, 227, 228, 5, 29, 0, 0, 228, 33, 1, 0, 0, 0, 229, 235, 3, 36, + 18, 0, 230, 231, 3, 14, 7, 0, 231, 232, 5, 8, 0, 0, 232, 233, 3, 36, 18, + 0, 233, 235, 1, 0, 0, 0, 234, 229, 1, 0, 0, 0, 234, 230, 1, 0, 0, 0, 235, + 35, 1, 0, 0, 0, 236, 237, 3, 40, 20, 0, 237, 242, 5, 6, 0, 0, 238, 240, + 5, 29, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 241, 1, 0, + 0, 0, 241, 243, 3, 38, 19, 0, 242, 239, 1, 0, 0, 0, 242, 243, 1, 0, 0, + 0, 243, 245, 1, 0, 0, 0, 244, 246, 5, 29, 0, 0, 245, 244, 1, 0, 0, 0, 245, + 246, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 5, 7, 0, 0, 248, 37, 1, + 0, 0, 0, 249, 257, 3, 14, 7, 0, 250, 252, 5, 3, 0, 0, 251, 253, 5, 29, + 0, 0, 252, 251, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, + 254, 256, 3, 14, 7, 0, 255, 250, 1, 0, 0, 0, 256, 259, 1, 0, 0, 0, 257, + 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 39, 1, 0, 0, 0, 259, 257, 1, + 0, 0, 0, 260, 261, 7, 0, 0, 0, 261, 41, 1, 0, 0, 0, 32, 45, 54, 59, 66, + 71, 73, 83, 95, 111, 118, 134, 136, 146, 150, 154, 163, 171, 177, 183, + 187, 190, 196, 205, 211, 220, 223, 234, 239, 242, 245, 252, 257, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -3491,62 +3492,52 @@ func (p *bicepParser) Array() (localctx IArrayContext) { goto errorExit } } - p.SetState(213) + p.SetState(205) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if _la == bicepParserNL { - p.SetState(203) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for ok := true; ok; ok = _la == bicepParserNL { - { - p.SetState(202) - p.Match(bicepParserNL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - p.SetState(205) - p.GetErrorHandler().Sync(p) + for _la == bicepParserNL { + { + p.SetState(202) + p.Match(bicepParserNL) if p.HasError() { + // Recognition error - abort rule goto errorExit } - _la = p.GetTokenStream().LA(1) } - p.SetState(210) + + p.SetState(207) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) + } + p.SetState(211) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&530567250) != 0 { - { - p.SetState(207) - p.ArrayItem() - } - - p.SetState(212) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&530567250) != 0 { + { + p.SetState(208) + p.ArrayItem() } + p.SetState(213) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) } { - p.SetState(215) + p.SetState(214) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -3576,6 +3567,7 @@ type IArrayItemContext interface { // Getter signatures Expression() IExpressionContext + COMMA() antlr.TerminalNode AllNL() []antlr.TerminalNode NL(i int) antlr.TerminalNode @@ -3631,6 +3623,10 @@ func (s *ArrayItemContext) Expression() IExpressionContext { return t.(IExpressionContext) } +func (s *ArrayItemContext) COMMA() antlr.TerminalNode { + return s.GetToken(bicepParserCOMMA, 0) +} + func (s *ArrayItemContext) AllNL() []antlr.TerminalNode { return s.GetTokens(bicepParserNL) } @@ -3664,32 +3660,54 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(217) + p.SetState(216) p.expression(0) } - p.SetState(219) + p.SetState(223) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _la = p.GetTokenStream().LA(1) + switch p.GetTokenStream().LA(1) { + case bicepParserNL: + p.SetState(218) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = _la == bicepParserNL { + { + p.SetState(217) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - for ok := true; ok; ok = _la == bicepParserNL { + p.SetState(220) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + case bicepParserCOMMA: { - p.SetState(218) - p.Match(bicepParserNL) + p.SetState(222) + p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(221) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) + case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserCBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserRESOURCE, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER, bicepParserNUMBER: + + default: } errorExit: @@ -3800,7 +3818,7 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { p.EnterRule(localctx, 32, bicepParserRULE_decorator) p.EnterOuterAlt(localctx, 1) { - p.SetState(223) + p.SetState(225) p.Match(bicepParserAT) if p.HasError() { // Recognition error - abort rule @@ -3808,11 +3826,11 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { } } { - p.SetState(224) + p.SetState(226) p.DecoratorExpression() } { - p.SetState(225) + p.SetState(227) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3938,7 +3956,7 @@ func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, bicepParserRULE_decoratorExpression) - p.SetState(232) + p.SetState(234) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3948,18 +3966,18 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(227) + p.SetState(229) p.FunctionCall() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(228) + p.SetState(230) p.expression(0) } { - p.SetState(229) + p.SetState(231) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -3967,7 +3985,7 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex } } { - p.SetState(230) + p.SetState(232) p.FunctionCall() } @@ -4112,22 +4130,22 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(234) + p.SetState(236) p.Identifier() } { - p.SetState(235) + p.SetState(237) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(240) + p.SetState(242) p.GetErrorHandler().Sync(p) if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext()) == 1 { - p.SetState(237) + p.SetState(239) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4136,7 +4154,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(236) + p.SetState(238) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4146,14 +4164,14 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(239) + p.SetState(241) p.ArgumentList() } } else if p.HasError() { // JIM goto errorExit } - p.SetState(243) + p.SetState(245) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4162,7 +4180,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(242) + p.SetState(244) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4172,7 +4190,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(245) + p.SetState(247) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -4326,10 +4344,10 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(247) + p.SetState(249) p.expression(0) } - p.SetState(255) + p.SetState(257) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4338,14 +4356,14 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { for _la == bicepParserCOMMA { { - p.SetState(248) + p.SetState(250) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(250) + p.SetState(252) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4354,7 +4372,7 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { if _la == bicepParserNL { { - p.SetState(249) + p.SetState(251) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4364,11 +4382,11 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { } { - p.SetState(252) + p.SetState(254) p.expression(0) } - p.SetState(257) + p.SetState(259) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4509,7 +4527,7 @@ func (p *bicepParser) Identifier() (localctx IIdentifierContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(258) + p.SetState(260) _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&252690432) != 0) { From 99425467617f7907e69de0978f4a122fd5c319ea Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 3 Apr 2024 18:06:39 +0100 Subject: [PATCH 009/130] added parsing for corner cases --- pkg/parser/bicep/parser.go | 62 +++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 69e085520cd..b6e4c22773c 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -170,25 +170,23 @@ func (s *BicepVisitor) VisitParameterDefaultValue(ctx *parser.ParameterDefaultVa func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{} { if ctx.GetChildCount() > 1 { - fmt.Println("Expression1") if ctx.Identifier() != nil { identifier := ctx.Identifier().Accept(s) - fmt.Println(identifier) + exp := ctx.Expression(0).Accept(s) + fmt.Println(exp) if ctx.DOT() != nil { - fmt.Println("DOT") - } else { - fmt.Println("COL") + return identifier.(string) } + + return nil } else { for _, val := range ctx.AllExpression() { val.Accept(s) } } - } else { - fmt.Println("Expression2") - return ctx.PrimaryExpression().Accept(s) } - return nil + + return ctx.PrimaryExpression().Accept(s) } // VisitPrimaryExpression is called when production primaryExpression is visited. @@ -197,11 +195,9 @@ func (s *BicepVisitor) VisitPrimaryExpression(ctx *parser.PrimaryExpressionConte return ctx.LiteralValue().Accept(s) } if ctx.FunctionCall() != nil { - fmt.Println("Function Call Primary Expression") return ctx.FunctionCall().Accept(s) } if ctx.InterpString() != nil { - fmt.Println("InterpString Primary Expression") return ctx.InterpString().Accept(s) } if ctx.MULTILINE_STRING() != nil { @@ -211,18 +207,15 @@ func (s *BicepVisitor) VisitPrimaryExpression(ctx *parser.PrimaryExpressionConte return ctx.Array().Accept(s) } if ctx.Object() != nil { - fmt.Println("Object Primary Expression") return ctx.Object().Accept(s) } if ctx.ParenthesizedExpression() != nil { - fmt.Println("ParenthesizedExpression Primary Expression") return ctx.ParenthesizedExpression().Accept(s) } return nil } -// VisitInterpString is called when production interpString is visited. func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interface{} { if ctx.NUMBER() != nil { return ctx.NUMBER().GetText() @@ -248,7 +241,7 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf if ctx.GetChildCount() > 1 { interpString := []interface{}{} interpString = append(interpString, ctx.STRING_LEFT_PIECE().GetText()) - if ctx.AllSTRING_MIDDLE_PIECE() != nil { + if ctx.AllSTRING_MIDDLE_PIECE() != nil && (len(ctx.AllSTRING_MIDDLE_PIECE()) > 0) { for idx, val := range ctx.AllSTRING_MIDDLE_PIECE() { interpString = append(interpString, ctx.Expression(idx).Accept(s)) interpString = append(interpString, val.GetText()) @@ -257,11 +250,31 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf // Last expression with string right piece interpString = append(interpString, ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())).Accept(s)) interpString = append(interpString, ctx.STRING_RIGHT_PIECE().GetText()) - return interpString - } else { - fmt.Println("InterpString: ", ctx.STRING_COMPLETE().GetText()) - return ctx.STRING_COMPLETE().GetText() + str := "" + for _, v := range interpString { + switch v := v.(type) { + case (string): + str = str + v + case (map[string][]interface{}): + for identifier, argumentList := range v { + resStr := "[" + identifier + "(" + for idx, arg := range argumentList { + resStr += arg.(string) + if idx < len(argumentList)-1 { + resStr += ", " + } + } + + resStr += ")]" + str += resStr + } + } + + } + return str } + + return ctx.STRING_COMPLETE().GetText() } func (s *BicepVisitor) VisitArray(ctx *parser.ArrayContext) interface{} { @@ -290,17 +303,15 @@ func (s *BicepVisitor) VisitObject(ctx *parser.ObjectContext) interface{} { } func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) interface{} { + objectValue := ctx.Expression().Accept(s) objectProperty := map[string]interface{}{} - fmt.Println("VisitObjectProperty") if ctx.Identifier() != nil { identifier := ctx.Identifier().Accept(s) - fmt.Println("VisitObjectProperty2: ", identifier.(string)) objectProperty[identifier.(string)] = ctx.Expression().Accept(s) } if ctx.InterpString() != nil { interpString := ctx.InterpString().Accept(s) - fmt.Println("VisitObjectProperty3: ", interpString.(string)) - objectProperty[interpString.(string)] = ctx.Expression().Accept(s) + objectProperty[interpString.(string)] = objectValue } return objectProperty @@ -337,7 +348,7 @@ func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{ if (ctx.BOOL()) != nil { return ctx.BOOL().GetText() } - return nil + return "" } func (s *BicepVisitor) VisitParenthesizedExpression(ctx *parser.ParenthesizedExpressionContext) interface{} { @@ -356,9 +367,7 @@ func (s *BicepVisitor) VisitDecoratorExpression(ctx *parser.DecoratorExpressionC func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interface{} { identifier := ctx.Identifier().Accept(s) var argumentList []interface{} - fmt.Println("VisitFunctionCall: ", identifier) if ctx.ArgumentList() != nil { - fmt.Println("Function Call ArgumentList") argumentList = ctx.ArgumentList().Accept(s).([]interface{}) } functionCall := map[string]interface{}{ @@ -371,7 +380,6 @@ func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interf func (s *BicepVisitor) VisitArgumentList(ctx *parser.ArgumentListContext) interface{} { var argumentList []interface{} for _, val := range ctx.AllExpression() { - fmt.Println("VisitArgumentList") argument := val.Accept(s) argumentList = append(argumentList, argument) } From 84d382cbff259e92692408df0c8f8bdcfbda8f77 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 4 Apr 2024 09:56:07 +0100 Subject: [PATCH 010/130] small adjustments in return values and linting problems --- pkg/parser/bicep/parser.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index b6e4c22773c..eff0c2486c0 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -50,8 +50,8 @@ func (p *Parser) Parse(file string, _ []byte) ([]model.Document, []int, error) { tokenStream := antlr.NewCommonTokenStream(lexer, antlr.TokenDefaultChannel) bicepParser := parser.NewbicepParser(tokenStream) - // bicepParser.RemoveErrorListeners() - // bicepParser.AddErrorListener(antlr.NewDiagnosticErrorListener(true)) + bicepParser.RemoveErrorListeners() + bicepParser.AddErrorListener(antlr.NewDiagnosticErrorListener(true)) bicepParser.Program().Accept(bicepVisitor) fmt.Println("\nParameters: ", bicepVisitor.paramList) @@ -173,7 +173,7 @@ func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{ if ctx.Identifier() != nil { identifier := ctx.Identifier().Accept(s) exp := ctx.Expression(0).Accept(s) - fmt.Println(exp) + fmt.Println("Visit Expression value: ", exp) if ctx.DOT() != nil { return identifier.(string) } @@ -348,7 +348,7 @@ func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{ if (ctx.BOOL()) != nil { return ctx.BOOL().GetText() } - return "" + return nil } func (s *BicepVisitor) VisitParenthesizedExpression(ctx *parser.ParenthesizedExpressionContext) interface{} { From c410d6be69eb16647e0980a99123067e86fb7608 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 4 Apr 2024 11:29:45 +0100 Subject: [PATCH 011/130] fix types from literal value --- pkg/parser/bicep/parser.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index eff0c2486c0..9e4c5b1a6f5 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "strings" + "strconv" "github.com/Checkmarx/kics/pkg/model" "github.com/Checkmarx/kics/pkg/parser/bicep/antlr/parser" @@ -218,16 +219,17 @@ func (s *BicepVisitor) VisitPrimaryExpression(ctx *parser.PrimaryExpressionConte func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interface{} { if ctx.NUMBER() != nil { - return ctx.NUMBER().GetText() + number, _ := strconv.ParseFloat(ctx.NUMBER().GetText(), 32) + return number } if ctx.TRUE() != nil { - return ctx.TRUE().GetText() + return true } if ctx.FALSE() != nil { - return ctx.FALSE().GetText() + return false } if ctx.NULL() != nil { - return ctx.NULL().GetText() + return nil } if ctx.Identifier() != nil { return ctx.Identifier().Accept(s) @@ -274,7 +276,9 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf return str } - return ctx.STRING_COMPLETE().GetText() + unformattedString := ctx.STRING_COMPLETE().GetText() + finalString := strings.ReplaceAll(unformattedString, "'", "") + return finalString } func (s *BicepVisitor) VisitArray(ctx *parser.ArrayContext) interface{} { From ba8f644c7d7e09b8d8764bdb42dd44de1885062c Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 4 Apr 2024 16:42:02 +0100 Subject: [PATCH 012/130] changes to grammar for secure decorator --- pkg/parser/bicep/antlr/bicep.g4 | 7 +- pkg/parser/bicep/antlr/parser/bicep.interp | 4 +- pkg/parser/bicep/antlr/parser/bicep.tokens | 36 +- .../bicep/antlr/parser/bicepLexer.interp | 5 +- .../bicep/antlr/parser/bicepLexer.tokens | 36 +- pkg/parser/bicep/antlr/parser/bicep_lexer.go | 241 +++++----- pkg/parser/bicep/antlr/parser/bicep_parser.go | 434 ++++++++---------- 7 files changed, 357 insertions(+), 406 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index 9c092031873..38ea1bba6de 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -55,7 +55,7 @@ primaryExpression: parenthesizedExpression: OPAR NL? expression NL? CPAR; // typeExpression -> singularTypeExpression ("|" singularTypeExpression)* -typeExpression: type = identifier (PIPE type = identifier)*; +typeExpression: type = identifier; // literalValue -> NUMBER | "true" | "false" | "null" literalValue: NUMBER | TRUE | FALSE | NULL | identifier; @@ -94,7 +94,8 @@ identifier: | NULL | STRING | INT - | BOOL; + | BOOL + | OBJECT; // multilineString -> "'''" + MULTILINESTRINGCHAR+ + "'''" MULTILINE_STRING: '\'\'\'' .*? '\'\'\''; @@ -133,6 +134,8 @@ FALSE: 'false'; NULL: 'null'; +OBJECT: 'object'; + RESOURCE: 'resource'; // stringLeftPiece -> "'" STRINGCHAR* "${" diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index 4eefca1180c..fcd3a3b520a 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -18,6 +18,7 @@ null 'true' 'false' 'null' +'object' 'resource' null null @@ -52,6 +53,7 @@ VAR TRUE FALSE NULL +OBJECT RESOURCE STRING_LEFT_PIECE STRING_MIDDLE_PIECE @@ -91,4 +93,4 @@ identifier atn: -[4, 1, 31, 263, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 55, 8, 1, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 67, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 72, 8, 2, 3, 2, 74, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 94, 8, 5, 10, 5, 12, 5, 97, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 119, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 147, 8, 8, 1, 9, 1, 9, 3, 9, 151, 8, 9, 1, 9, 1, 9, 3, 9, 155, 8, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 172, 8, 11, 1, 12, 1, 12, 4, 12, 176, 8, 12, 11, 12, 12, 12, 177, 1, 12, 1, 12, 4, 12, 182, 8, 12, 11, 12, 12, 12, 183, 5, 12, 186, 8, 12, 10, 12, 12, 12, 189, 9, 12, 3, 12, 191, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 197, 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 204, 8, 14, 10, 14, 12, 14, 207, 9, 14, 1, 14, 5, 14, 210, 8, 14, 10, 14, 12, 14, 213, 9, 14, 1, 14, 1, 14, 1, 15, 1, 15, 4, 15, 219, 8, 15, 11, 15, 12, 15, 220, 1, 15, 3, 15, 224, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 235, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 240, 8, 18, 1, 18, 3, 18, 243, 8, 18, 1, 18, 3, 18, 246, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 3, 19, 253, 8, 19, 1, 19, 5, 19, 256, 8, 19, 10, 19, 12, 19, 259, 9, 19, 1, 20, 1, 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 285, 0, 45, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, 1, 0, 0, 0, 22, 171, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 196, 1, 0, 0, 0, 28, 201, 1, 0, 0, 0, 30, 216, 1, 0, 0, 0, 32, 225, 1, 0, 0, 0, 34, 234, 1, 0, 0, 0, 36, 236, 1, 0, 0, 0, 38, 249, 1, 0, 0, 0, 40, 260, 1, 0, 0, 0, 42, 44, 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, 5, 0, 53, 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 19, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 29, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 29, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, 5, 22, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 23, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 147, 3, 22, 11, 0, 140, 147, 3, 36, 18, 0, 141, 147, 3, 12, 6, 0, 142, 147, 5, 1, 0, 0, 143, 147, 3, 28, 14, 0, 144, 147, 3, 24, 12, 0, 145, 147, 3, 18, 9, 0, 146, 139, 1, 0, 0, 0, 146, 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0, 146, 143, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 145, 1, 0, 0, 0, 147, 17, 1, 0, 0, 0, 148, 150, 5, 6, 0, 0, 149, 151, 5, 29, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 3, 14, 7, 0, 153, 155, 5, 29, 0, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 7, 0, 0, 157, 19, 1, 0, 0, 0, 158, 163, 3, 40, 20, 0, 159, 160, 5, 9, 0, 0, 160, 162, 3, 40, 20, 0, 161, 159, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 21, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 172, 5, 28, 0, 0, 167, 172, 5, 16, 0, 0, 168, 172, 5, 17, 0, 0, 169, 172, 5, 18, 0, 0, 170, 172, 3, 40, 20, 0, 171, 166, 1, 0, 0, 0, 171, 167, 1, 0, 0, 0, 171, 168, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 170, 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, 173, 190, 5, 12, 0, 0, 174, 176, 5, 29, 0, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 187, 1, 0, 0, 0, 179, 181, 3, 26, 13, 0, 180, 182, 5, 29, 0, 0, 181, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 179, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 175, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 13, 0, 0, 193, 25, 1, 0, 0, 0, 194, 197, 3, 40, 20, 0, 195, 197, 3, 12, 6, 0, 196, 194, 1, 0, 0, 0, 196, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 5, 10, 0, 0, 199, 200, 3, 14, 7, 0, 200, 27, 1, 0, 0, 0, 201, 205, 5, 4, 0, 0, 202, 204, 5, 29, 0, 0, 203, 202, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 211, 1, 0, 0, 0, 207, 205, 1, 0, 0, 0, 208, 210, 3, 30, 15, 0, 209, 208, 1, 0, 0, 0, 210, 213, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 214, 1, 0, 0, 0, 213, 211, 1, 0, 0, 0, 214, 215, 5, 5, 0, 0, 215, 29, 1, 0, 0, 0, 216, 223, 3, 14, 7, 0, 217, 219, 5, 29, 0, 0, 218, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 224, 5, 3, 0, 0, 223, 218, 1, 0, 0, 0, 223, 222, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 31, 1, 0, 0, 0, 225, 226, 5, 2, 0, 0, 226, 227, 3, 34, 17, 0, 227, 228, 5, 29, 0, 0, 228, 33, 1, 0, 0, 0, 229, 235, 3, 36, 18, 0, 230, 231, 3, 14, 7, 0, 231, 232, 5, 8, 0, 0, 232, 233, 3, 36, 18, 0, 233, 235, 1, 0, 0, 0, 234, 229, 1, 0, 0, 0, 234, 230, 1, 0, 0, 0, 235, 35, 1, 0, 0, 0, 236, 237, 3, 40, 20, 0, 237, 242, 5, 6, 0, 0, 238, 240, 5, 29, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 3, 38, 19, 0, 242, 239, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 245, 1, 0, 0, 0, 244, 246, 5, 29, 0, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 5, 7, 0, 0, 248, 37, 1, 0, 0, 0, 249, 257, 3, 14, 7, 0, 250, 252, 5, 3, 0, 0, 251, 253, 5, 29, 0, 0, 252, 251, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 3, 14, 7, 0, 255, 250, 1, 0, 0, 0, 256, 259, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 39, 1, 0, 0, 0, 259, 257, 1, 0, 0, 0, 260, 261, 7, 0, 0, 0, 261, 41, 1, 0, 0, 0, 32, 45, 54, 59, 66, 71, 73, 83, 95, 111, 118, 134, 136, 146, 150, 154, 163, 171, 177, 183, 187, 190, 196, 205, 211, 220, 223, 234, 239, 242, 245, 252, 257] \ No newline at end of file +[4, 1, 32, 257, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 55, 8, 1, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 67, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 72, 8, 2, 3, 2, 74, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 94, 8, 5, 10, 5, 12, 5, 97, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 119, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 147, 8, 8, 1, 9, 1, 9, 3, 9, 151, 8, 9, 1, 9, 1, 9, 3, 9, 155, 8, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 166, 8, 11, 1, 12, 1, 12, 4, 12, 170, 8, 12, 11, 12, 12, 12, 171, 1, 12, 1, 12, 4, 12, 176, 8, 12, 11, 12, 12, 12, 177, 5, 12, 180, 8, 12, 10, 12, 12, 12, 183, 9, 12, 3, 12, 185, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 191, 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 198, 8, 14, 10, 14, 12, 14, 201, 9, 14, 1, 14, 5, 14, 204, 8, 14, 10, 14, 12, 14, 207, 9, 14, 1, 14, 1, 14, 1, 15, 1, 15, 4, 15, 213, 8, 15, 11, 15, 12, 15, 214, 1, 15, 3, 15, 218, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 229, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 234, 8, 18, 1, 18, 3, 18, 237, 8, 18, 1, 18, 3, 18, 240, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 3, 19, 247, 8, 19, 1, 19, 5, 19, 250, 8, 19, 10, 19, 12, 19, 253, 9, 19, 1, 20, 1, 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 20, 25, 28, 278, 0, 45, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, 1, 0, 0, 0, 22, 165, 1, 0, 0, 0, 24, 167, 1, 0, 0, 0, 26, 190, 1, 0, 0, 0, 28, 195, 1, 0, 0, 0, 30, 210, 1, 0, 0, 0, 32, 219, 1, 0, 0, 0, 34, 228, 1, 0, 0, 0, 36, 230, 1, 0, 0, 0, 38, 243, 1, 0, 0, 0, 40, 254, 1, 0, 0, 0, 42, 44, 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, 5, 0, 53, 55, 5, 30, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 20, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 30, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 30, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 20, 0, 0, 99, 100, 3, 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 30, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 21, 0, 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 22, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, 5, 23, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 24, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 147, 3, 22, 11, 0, 140, 147, 3, 36, 18, 0, 141, 147, 3, 12, 6, 0, 142, 147, 5, 1, 0, 0, 143, 147, 3, 28, 14, 0, 144, 147, 3, 24, 12, 0, 145, 147, 3, 18, 9, 0, 146, 139, 1, 0, 0, 0, 146, 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0, 146, 143, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 145, 1, 0, 0, 0, 147, 17, 1, 0, 0, 0, 148, 150, 5, 6, 0, 0, 149, 151, 5, 30, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 3, 14, 7, 0, 153, 155, 5, 30, 0, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 7, 0, 0, 157, 19, 1, 0, 0, 0, 158, 159, 3, 40, 20, 0, 159, 21, 1, 0, 0, 0, 160, 166, 5, 29, 0, 0, 161, 166, 5, 16, 0, 0, 162, 166, 5, 17, 0, 0, 163, 166, 5, 18, 0, 0, 164, 166, 3, 40, 20, 0, 165, 160, 1, 0, 0, 0, 165, 161, 1, 0, 0, 0, 165, 162, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 164, 1, 0, 0, 0, 166, 23, 1, 0, 0, 0, 167, 184, 5, 12, 0, 0, 168, 170, 5, 30, 0, 0, 169, 168, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 181, 1, 0, 0, 0, 173, 175, 3, 26, 13, 0, 174, 176, 5, 30, 0, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 180, 1, 0, 0, 0, 179, 173, 1, 0, 0, 0, 180, 183, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 184, 169, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 187, 5, 13, 0, 0, 187, 25, 1, 0, 0, 0, 188, 191, 3, 40, 20, 0, 189, 191, 3, 12, 6, 0, 190, 188, 1, 0, 0, 0, 190, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 10, 0, 0, 193, 194, 3, 14, 7, 0, 194, 27, 1, 0, 0, 0, 195, 199, 5, 4, 0, 0, 196, 198, 5, 30, 0, 0, 197, 196, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 205, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 204, 3, 30, 15, 0, 203, 202, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 208, 1, 0, 0, 0, 207, 205, 1, 0, 0, 0, 208, 209, 5, 5, 0, 0, 209, 29, 1, 0, 0, 0, 210, 217, 3, 14, 7, 0, 211, 213, 5, 30, 0, 0, 212, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 218, 1, 0, 0, 0, 216, 218, 5, 3, 0, 0, 217, 212, 1, 0, 0, 0, 217, 216, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 31, 1, 0, 0, 0, 219, 220, 5, 2, 0, 0, 220, 221, 3, 34, 17, 0, 221, 222, 5, 30, 0, 0, 222, 33, 1, 0, 0, 0, 223, 229, 3, 36, 18, 0, 224, 225, 3, 14, 7, 0, 225, 226, 5, 8, 0, 0, 226, 227, 3, 36, 18, 0, 227, 229, 1, 0, 0, 0, 228, 223, 1, 0, 0, 0, 228, 224, 1, 0, 0, 0, 229, 35, 1, 0, 0, 0, 230, 231, 3, 40, 20, 0, 231, 236, 5, 6, 0, 0, 232, 234, 5, 30, 0, 0, 233, 232, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 237, 3, 38, 19, 0, 236, 233, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 239, 1, 0, 0, 0, 238, 240, 5, 30, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 5, 7, 0, 0, 242, 37, 1, 0, 0, 0, 243, 251, 3, 14, 7, 0, 244, 246, 5, 3, 0, 0, 245, 247, 5, 30, 0, 0, 246, 245, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 250, 3, 14, 7, 0, 249, 244, 1, 0, 0, 0, 250, 253, 1, 0, 0, 0, 251, 249, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 39, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, 254, 255, 7, 0, 0, 0, 255, 41, 1, 0, 0, 0, 31, 45, 54, 59, 66, 71, 73, 83, 95, 111, 118, 134, 136, 146, 150, 154, 165, 171, 177, 181, 184, 190, 199, 205, 214, 217, 228, 233, 236, 239, 246, 251] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep.tokens b/pkg/parser/bicep/antlr/parser/bicep.tokens index 04a820d5969..7a1cd2ad76d 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.tokens +++ b/pkg/parser/bicep/antlr/parser/bicep.tokens @@ -16,19 +16,20 @@ VAR=15 TRUE=16 FALSE=17 NULL=18 -RESOURCE=19 -STRING_LEFT_PIECE=20 -STRING_MIDDLE_PIECE=21 -STRING_RIGHT_PIECE=22 -STRING_COMPLETE=23 -STRING=24 -INT=25 -BOOL=26 -IDENTIFIER=27 -NUMBER=28 -NL=29 -SPACES=30 -UNKNOWN=31 +OBJECT=19 +RESOURCE=20 +STRING_LEFT_PIECE=21 +STRING_MIDDLE_PIECE=22 +STRING_RIGHT_PIECE=23 +STRING_COMPLETE=24 +STRING=25 +INT=26 +BOOL=27 +IDENTIFIER=28 +NUMBER=29 +NL=30 +SPACES=31 +UNKNOWN=32 '@'=2 ','=3 '['=4 @@ -46,7 +47,8 @@ UNKNOWN=31 'true'=16 'false'=17 'null'=18 -'resource'=19 -'string'=24 -'int'=25 -'bool'=26 +'object'=19 +'resource'=20 +'string'=25 +'int'=26 +'bool'=27 diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.interp b/pkg/parser/bicep/antlr/parser/bicepLexer.interp index 00a4f8969f1..b00ab7bfbb8 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.interp +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.interp @@ -18,6 +18,7 @@ null 'true' 'false' 'null' +'object' 'resource' null null @@ -52,6 +53,7 @@ VAR TRUE FALSE NULL +OBJECT RESOURCE STRING_LEFT_PIECE STRING_MIDDLE_PIECE @@ -85,6 +87,7 @@ VAR TRUE FALSE NULL +OBJECT RESOURCE STRING_LEFT_PIECE STRING_MIDDLE_PIECE @@ -110,4 +113,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 31, 250, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 75, 8, 0, 10, 0, 12, 0, 78, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 145, 8, 19, 10, 19, 12, 19, 148, 9, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 155, 8, 20, 10, 20, 12, 20, 158, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 165, 8, 21, 10, 21, 12, 21, 168, 9, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 174, 8, 22, 10, 22, 12, 22, 177, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 5, 26, 199, 8, 26, 10, 26, 12, 26, 202, 9, 26, 1, 27, 4, 27, 205, 8, 27, 11, 27, 12, 27, 206, 1, 27, 1, 27, 4, 27, 211, 8, 27, 11, 27, 12, 27, 212, 3, 27, 215, 8, 27, 1, 28, 4, 28, 218, 8, 28, 11, 28, 12, 28, 219, 1, 29, 4, 29, 223, 8, 29, 11, 29, 12, 29, 224, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 233, 8, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 4, 32, 241, 8, 32, 11, 32, 12, 32, 242, 1, 32, 1, 32, 3, 32, 247, 8, 32, 1, 33, 1, 33, 1, 76, 0, 34, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 0, 65, 0, 67, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 260, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 1, 69, 1, 0, 0, 0, 3, 83, 1, 0, 0, 0, 5, 85, 1, 0, 0, 0, 7, 87, 1, 0, 0, 0, 9, 89, 1, 0, 0, 0, 11, 91, 1, 0, 0, 0, 13, 93, 1, 0, 0, 0, 15, 95, 1, 0, 0, 0, 17, 97, 1, 0, 0, 0, 19, 99, 1, 0, 0, 0, 21, 101, 1, 0, 0, 0, 23, 103, 1, 0, 0, 0, 25, 105, 1, 0, 0, 0, 27, 107, 1, 0, 0, 0, 29, 113, 1, 0, 0, 0, 31, 117, 1, 0, 0, 0, 33, 122, 1, 0, 0, 0, 35, 128, 1, 0, 0, 0, 37, 133, 1, 0, 0, 0, 39, 142, 1, 0, 0, 0, 41, 152, 1, 0, 0, 0, 43, 162, 1, 0, 0, 0, 45, 171, 1, 0, 0, 0, 47, 180, 1, 0, 0, 0, 49, 187, 1, 0, 0, 0, 51, 191, 1, 0, 0, 0, 53, 196, 1, 0, 0, 0, 55, 204, 1, 0, 0, 0, 57, 217, 1, 0, 0, 0, 59, 222, 1, 0, 0, 0, 61, 228, 1, 0, 0, 0, 63, 232, 1, 0, 0, 0, 65, 234, 1, 0, 0, 0, 67, 248, 1, 0, 0, 0, 69, 70, 5, 39, 0, 0, 70, 71, 5, 39, 0, 0, 71, 72, 5, 39, 0, 0, 72, 76, 1, 0, 0, 0, 73, 75, 9, 0, 0, 0, 74, 73, 1, 0, 0, 0, 75, 78, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 77, 79, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 79, 80, 5, 39, 0, 0, 80, 81, 5, 39, 0, 0, 81, 82, 5, 39, 0, 0, 82, 2, 1, 0, 0, 0, 83, 84, 5, 64, 0, 0, 84, 4, 1, 0, 0, 0, 85, 86, 5, 44, 0, 0, 86, 6, 1, 0, 0, 0, 87, 88, 5, 91, 0, 0, 88, 8, 1, 0, 0, 0, 89, 90, 5, 93, 0, 0, 90, 10, 1, 0, 0, 0, 91, 92, 5, 40, 0, 0, 92, 12, 1, 0, 0, 0, 93, 94, 5, 41, 0, 0, 94, 14, 1, 0, 0, 0, 95, 96, 5, 46, 0, 0, 96, 16, 1, 0, 0, 0, 97, 98, 5, 124, 0, 0, 98, 18, 1, 0, 0, 0, 99, 100, 5, 58, 0, 0, 100, 20, 1, 0, 0, 0, 101, 102, 5, 61, 0, 0, 102, 22, 1, 0, 0, 0, 103, 104, 5, 123, 0, 0, 104, 24, 1, 0, 0, 0, 105, 106, 5, 125, 0, 0, 106, 26, 1, 0, 0, 0, 107, 108, 5, 112, 0, 0, 108, 109, 5, 97, 0, 0, 109, 110, 5, 114, 0, 0, 110, 111, 5, 97, 0, 0, 111, 112, 5, 109, 0, 0, 112, 28, 1, 0, 0, 0, 113, 114, 5, 118, 0, 0, 114, 115, 5, 97, 0, 0, 115, 116, 5, 114, 0, 0, 116, 30, 1, 0, 0, 0, 117, 118, 5, 116, 0, 0, 118, 119, 5, 114, 0, 0, 119, 120, 5, 117, 0, 0, 120, 121, 5, 101, 0, 0, 121, 32, 1, 0, 0, 0, 122, 123, 5, 102, 0, 0, 123, 124, 5, 97, 0, 0, 124, 125, 5, 108, 0, 0, 125, 126, 5, 115, 0, 0, 126, 127, 5, 101, 0, 0, 127, 34, 1, 0, 0, 0, 128, 129, 5, 110, 0, 0, 129, 130, 5, 117, 0, 0, 130, 131, 5, 108, 0, 0, 131, 132, 5, 108, 0, 0, 132, 36, 1, 0, 0, 0, 133, 134, 5, 114, 0, 0, 134, 135, 5, 101, 0, 0, 135, 136, 5, 115, 0, 0, 136, 137, 5, 111, 0, 0, 137, 138, 5, 117, 0, 0, 138, 139, 5, 114, 0, 0, 139, 140, 5, 99, 0, 0, 140, 141, 5, 101, 0, 0, 141, 38, 1, 0, 0, 0, 142, 146, 5, 39, 0, 0, 143, 145, 3, 63, 31, 0, 144, 143, 1, 0, 0, 0, 145, 148, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 149, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 149, 150, 5, 36, 0, 0, 150, 151, 5, 123, 0, 0, 151, 40, 1, 0, 0, 0, 152, 156, 5, 125, 0, 0, 153, 155, 3, 63, 31, 0, 154, 153, 1, 0, 0, 0, 155, 158, 1, 0, 0, 0, 156, 154, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 159, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 159, 160, 5, 36, 0, 0, 160, 161, 5, 123, 0, 0, 161, 42, 1, 0, 0, 0, 162, 166, 5, 125, 0, 0, 163, 165, 3, 63, 31, 0, 164, 163, 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 169, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 170, 5, 39, 0, 0, 170, 44, 1, 0, 0, 0, 171, 175, 5, 39, 0, 0, 172, 174, 3, 63, 31, 0, 173, 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 39, 0, 0, 179, 46, 1, 0, 0, 0, 180, 181, 5, 115, 0, 0, 181, 182, 5, 116, 0, 0, 182, 183, 5, 114, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 110, 0, 0, 185, 186, 5, 103, 0, 0, 186, 48, 1, 0, 0, 0, 187, 188, 5, 105, 0, 0, 188, 189, 5, 110, 0, 0, 189, 190, 5, 116, 0, 0, 190, 50, 1, 0, 0, 0, 191, 192, 5, 98, 0, 0, 192, 193, 5, 111, 0, 0, 193, 194, 5, 111, 0, 0, 194, 195, 5, 108, 0, 0, 195, 52, 1, 0, 0, 0, 196, 200, 7, 0, 0, 0, 197, 199, 7, 1, 0, 0, 198, 197, 1, 0, 0, 0, 199, 202, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 54, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 203, 205, 7, 2, 0, 0, 204, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 214, 1, 0, 0, 0, 208, 210, 5, 46, 0, 0, 209, 211, 7, 2, 0, 0, 210, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 215, 1, 0, 0, 0, 214, 208, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 56, 1, 0, 0, 0, 216, 218, 7, 3, 0, 0, 217, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 58, 1, 0, 0, 0, 221, 223, 7, 4, 0, 0, 222, 221, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 227, 6, 29, 0, 0, 227, 60, 1, 0, 0, 0, 228, 229, 9, 0, 0, 0, 229, 62, 1, 0, 0, 0, 230, 233, 8, 5, 0, 0, 231, 233, 3, 65, 32, 0, 232, 230, 1, 0, 0, 0, 232, 231, 1, 0, 0, 0, 233, 64, 1, 0, 0, 0, 234, 246, 5, 92, 0, 0, 235, 247, 7, 6, 0, 0, 236, 237, 5, 117, 0, 0, 237, 238, 5, 123, 0, 0, 238, 240, 1, 0, 0, 0, 239, 241, 3, 67, 33, 0, 240, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 5, 125, 0, 0, 245, 247, 1, 0, 0, 0, 246, 235, 1, 0, 0, 0, 246, 236, 1, 0, 0, 0, 247, 66, 1, 0, 0, 0, 248, 249, 7, 7, 0, 0, 249, 68, 1, 0, 0, 0, 15, 0, 76, 146, 156, 166, 175, 200, 206, 212, 214, 219, 224, 232, 242, 246, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 32, 259, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 77, 8, 0, 10, 0, 12, 0, 80, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 154, 8, 20, 10, 20, 12, 20, 157, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 164, 8, 21, 10, 21, 12, 21, 167, 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 174, 8, 22, 10, 22, 12, 22, 177, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 183, 8, 23, 10, 23, 12, 23, 186, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 5, 27, 208, 8, 27, 10, 27, 12, 27, 211, 9, 27, 1, 28, 4, 28, 214, 8, 28, 11, 28, 12, 28, 215, 1, 28, 1, 28, 4, 28, 220, 8, 28, 11, 28, 12, 28, 221, 3, 28, 224, 8, 28, 1, 29, 4, 29, 227, 8, 29, 11, 29, 12, 29, 228, 1, 30, 4, 30, 232, 8, 30, 11, 30, 12, 30, 233, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 3, 32, 242, 8, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 4, 33, 250, 8, 33, 11, 33, 12, 33, 251, 1, 33, 1, 33, 3, 33, 256, 8, 33, 1, 34, 1, 34, 1, 78, 0, 35, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 0, 67, 0, 69, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 269, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 1, 71, 1, 0, 0, 0, 3, 85, 1, 0, 0, 0, 5, 87, 1, 0, 0, 0, 7, 89, 1, 0, 0, 0, 9, 91, 1, 0, 0, 0, 11, 93, 1, 0, 0, 0, 13, 95, 1, 0, 0, 0, 15, 97, 1, 0, 0, 0, 17, 99, 1, 0, 0, 0, 19, 101, 1, 0, 0, 0, 21, 103, 1, 0, 0, 0, 23, 105, 1, 0, 0, 0, 25, 107, 1, 0, 0, 0, 27, 109, 1, 0, 0, 0, 29, 115, 1, 0, 0, 0, 31, 119, 1, 0, 0, 0, 33, 124, 1, 0, 0, 0, 35, 130, 1, 0, 0, 0, 37, 135, 1, 0, 0, 0, 39, 142, 1, 0, 0, 0, 41, 151, 1, 0, 0, 0, 43, 161, 1, 0, 0, 0, 45, 171, 1, 0, 0, 0, 47, 180, 1, 0, 0, 0, 49, 189, 1, 0, 0, 0, 51, 196, 1, 0, 0, 0, 53, 200, 1, 0, 0, 0, 55, 205, 1, 0, 0, 0, 57, 213, 1, 0, 0, 0, 59, 226, 1, 0, 0, 0, 61, 231, 1, 0, 0, 0, 63, 237, 1, 0, 0, 0, 65, 241, 1, 0, 0, 0, 67, 243, 1, 0, 0, 0, 69, 257, 1, 0, 0, 0, 71, 72, 5, 39, 0, 0, 72, 73, 5, 39, 0, 0, 73, 74, 5, 39, 0, 0, 74, 78, 1, 0, 0, 0, 75, 77, 9, 0, 0, 0, 76, 75, 1, 0, 0, 0, 77, 80, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 79, 81, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 81, 82, 5, 39, 0, 0, 82, 83, 5, 39, 0, 0, 83, 84, 5, 39, 0, 0, 84, 2, 1, 0, 0, 0, 85, 86, 5, 64, 0, 0, 86, 4, 1, 0, 0, 0, 87, 88, 5, 44, 0, 0, 88, 6, 1, 0, 0, 0, 89, 90, 5, 91, 0, 0, 90, 8, 1, 0, 0, 0, 91, 92, 5, 93, 0, 0, 92, 10, 1, 0, 0, 0, 93, 94, 5, 40, 0, 0, 94, 12, 1, 0, 0, 0, 95, 96, 5, 41, 0, 0, 96, 14, 1, 0, 0, 0, 97, 98, 5, 46, 0, 0, 98, 16, 1, 0, 0, 0, 99, 100, 5, 124, 0, 0, 100, 18, 1, 0, 0, 0, 101, 102, 5, 58, 0, 0, 102, 20, 1, 0, 0, 0, 103, 104, 5, 61, 0, 0, 104, 22, 1, 0, 0, 0, 105, 106, 5, 123, 0, 0, 106, 24, 1, 0, 0, 0, 107, 108, 5, 125, 0, 0, 108, 26, 1, 0, 0, 0, 109, 110, 5, 112, 0, 0, 110, 111, 5, 97, 0, 0, 111, 112, 5, 114, 0, 0, 112, 113, 5, 97, 0, 0, 113, 114, 5, 109, 0, 0, 114, 28, 1, 0, 0, 0, 115, 116, 5, 118, 0, 0, 116, 117, 5, 97, 0, 0, 117, 118, 5, 114, 0, 0, 118, 30, 1, 0, 0, 0, 119, 120, 5, 116, 0, 0, 120, 121, 5, 114, 0, 0, 121, 122, 5, 117, 0, 0, 122, 123, 5, 101, 0, 0, 123, 32, 1, 0, 0, 0, 124, 125, 5, 102, 0, 0, 125, 126, 5, 97, 0, 0, 126, 127, 5, 108, 0, 0, 127, 128, 5, 115, 0, 0, 128, 129, 5, 101, 0, 0, 129, 34, 1, 0, 0, 0, 130, 131, 5, 110, 0, 0, 131, 132, 5, 117, 0, 0, 132, 133, 5, 108, 0, 0, 133, 134, 5, 108, 0, 0, 134, 36, 1, 0, 0, 0, 135, 136, 5, 111, 0, 0, 136, 137, 5, 98, 0, 0, 137, 138, 5, 106, 0, 0, 138, 139, 5, 101, 0, 0, 139, 140, 5, 99, 0, 0, 140, 141, 5, 116, 0, 0, 141, 38, 1, 0, 0, 0, 142, 143, 5, 114, 0, 0, 143, 144, 5, 101, 0, 0, 144, 145, 5, 115, 0, 0, 145, 146, 5, 111, 0, 0, 146, 147, 5, 117, 0, 0, 147, 148, 5, 114, 0, 0, 148, 149, 5, 99, 0, 0, 149, 150, 5, 101, 0, 0, 150, 40, 1, 0, 0, 0, 151, 155, 5, 39, 0, 0, 152, 154, 3, 65, 32, 0, 153, 152, 1, 0, 0, 0, 154, 157, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 158, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 158, 159, 5, 36, 0, 0, 159, 160, 5, 123, 0, 0, 160, 42, 1, 0, 0, 0, 161, 165, 5, 125, 0, 0, 162, 164, 3, 65, 32, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 36, 0, 0, 169, 170, 5, 123, 0, 0, 170, 44, 1, 0, 0, 0, 171, 175, 5, 125, 0, 0, 172, 174, 3, 65, 32, 0, 173, 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 39, 0, 0, 179, 46, 1, 0, 0, 0, 180, 184, 5, 39, 0, 0, 181, 183, 3, 65, 32, 0, 182, 181, 1, 0, 0, 0, 183, 186, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 187, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 187, 188, 5, 39, 0, 0, 188, 48, 1, 0, 0, 0, 189, 190, 5, 115, 0, 0, 190, 191, 5, 116, 0, 0, 191, 192, 5, 114, 0, 0, 192, 193, 5, 105, 0, 0, 193, 194, 5, 110, 0, 0, 194, 195, 5, 103, 0, 0, 195, 50, 1, 0, 0, 0, 196, 197, 5, 105, 0, 0, 197, 198, 5, 110, 0, 0, 198, 199, 5, 116, 0, 0, 199, 52, 1, 0, 0, 0, 200, 201, 5, 98, 0, 0, 201, 202, 5, 111, 0, 0, 202, 203, 5, 111, 0, 0, 203, 204, 5, 108, 0, 0, 204, 54, 1, 0, 0, 0, 205, 209, 7, 0, 0, 0, 206, 208, 7, 1, 0, 0, 207, 206, 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 56, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 212, 214, 7, 2, 0, 0, 213, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 223, 1, 0, 0, 0, 217, 219, 5, 46, 0, 0, 218, 220, 7, 2, 0, 0, 219, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 224, 1, 0, 0, 0, 223, 217, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 58, 1, 0, 0, 0, 225, 227, 7, 3, 0, 0, 226, 225, 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 60, 1, 0, 0, 0, 230, 232, 7, 4, 0, 0, 231, 230, 1, 0, 0, 0, 232, 233, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 236, 6, 30, 0, 0, 236, 62, 1, 0, 0, 0, 237, 238, 9, 0, 0, 0, 238, 64, 1, 0, 0, 0, 239, 242, 8, 5, 0, 0, 240, 242, 3, 67, 33, 0, 241, 239, 1, 0, 0, 0, 241, 240, 1, 0, 0, 0, 242, 66, 1, 0, 0, 0, 243, 255, 5, 92, 0, 0, 244, 256, 7, 6, 0, 0, 245, 246, 5, 117, 0, 0, 246, 247, 5, 123, 0, 0, 247, 249, 1, 0, 0, 0, 248, 250, 3, 69, 34, 0, 249, 248, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 249, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 254, 5, 125, 0, 0, 254, 256, 1, 0, 0, 0, 255, 244, 1, 0, 0, 0, 255, 245, 1, 0, 0, 0, 256, 68, 1, 0, 0, 0, 257, 258, 7, 7, 0, 0, 258, 70, 1, 0, 0, 0, 15, 0, 78, 155, 165, 175, 184, 209, 215, 221, 223, 228, 233, 241, 251, 255, 1, 6, 0, 0] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens index 04a820d5969..7a1cd2ad76d 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens @@ -16,19 +16,20 @@ VAR=15 TRUE=16 FALSE=17 NULL=18 -RESOURCE=19 -STRING_LEFT_PIECE=20 -STRING_MIDDLE_PIECE=21 -STRING_RIGHT_PIECE=22 -STRING_COMPLETE=23 -STRING=24 -INT=25 -BOOL=26 -IDENTIFIER=27 -NUMBER=28 -NL=29 -SPACES=30 -UNKNOWN=31 +OBJECT=19 +RESOURCE=20 +STRING_LEFT_PIECE=21 +STRING_MIDDLE_PIECE=22 +STRING_RIGHT_PIECE=23 +STRING_COMPLETE=24 +STRING=25 +INT=26 +BOOL=27 +IDENTIFIER=28 +NUMBER=29 +NL=30 +SPACES=31 +UNKNOWN=32 '@'=2 ','=3 '['=4 @@ -46,7 +47,8 @@ UNKNOWN=31 'true'=16 'false'=17 'null'=18 -'resource'=19 -'string'=24 -'int'=25 -'bool'=26 +'object'=19 +'resource'=20 +'string'=25 +'int'=26 +'bool'=27 diff --git a/pkg/parser/bicep/antlr/parser/bicep_lexer.go b/pkg/parser/bicep/antlr/parser/bicep_lexer.go index 196dd99a884..1c55541aab4 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_lexer.go +++ b/pkg/parser/bicep/antlr/parser/bicep_lexer.go @@ -45,58 +45,60 @@ func biceplexerLexerInit() { staticData.LiteralNames = []string{ "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", - "'resource'", "", "", "", "", "'string'", "'int'", "'bool'", + "'object'", "'resource'", "", "", "", "", "'string'", "'int'", "'bool'", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", - "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IDENTIFIER", - "NUMBER", "NL", "SPACES", "UNKNOWN", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", + "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", + "INT", "BOOL", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", } staticData.RuleNames = []string{ "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", - "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IDENTIFIER", - "NUMBER", "NL", "SPACES", "UNKNOWN", "STRINGCHAR", "ESCAPE", "HEX", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", + "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", + "INT", "BOOL", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "STRINGCHAR", + "ESCAPE", "HEX", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 31, 250, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 32, 259, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, - 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, - 0, 75, 8, 0, 10, 0, 12, 0, 78, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, - 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, - 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, - 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, - 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, - 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 145, 8, 19, 10, 19, 12, 19, 148, - 9, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 155, 8, 20, 10, 20, 12, - 20, 158, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 165, 8, 21, 10, - 21, 12, 21, 168, 9, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 174, 8, 22, - 10, 22, 12, 22, 177, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, - 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, - 1, 25, 1, 26, 1, 26, 5, 26, 199, 8, 26, 10, 26, 12, 26, 202, 9, 26, 1, - 27, 4, 27, 205, 8, 27, 11, 27, 12, 27, 206, 1, 27, 1, 27, 4, 27, 211, 8, - 27, 11, 27, 12, 27, 212, 3, 27, 215, 8, 27, 1, 28, 4, 28, 218, 8, 28, 11, - 28, 12, 28, 219, 1, 29, 4, 29, 223, 8, 29, 11, 29, 12, 29, 224, 1, 29, - 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 233, 8, 31, 1, 32, 1, 32, 1, - 32, 1, 32, 1, 32, 1, 32, 4, 32, 241, 8, 32, 11, 32, 12, 32, 242, 1, 32, - 1, 32, 3, 32, 247, 8, 32, 1, 33, 1, 33, 1, 76, 0, 34, 1, 1, 3, 2, 5, 3, - 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, - 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, - 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, - 63, 0, 65, 0, 67, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, + 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 5, 0, 77, 8, 0, 10, 0, 12, 0, 80, 9, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, + 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, + 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, + 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, + 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, + 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, + 1, 19, 1, 20, 1, 20, 5, 20, 154, 8, 20, 10, 20, 12, 20, 157, 9, 20, 1, + 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 164, 8, 21, 10, 21, 12, 21, 167, + 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 174, 8, 22, 10, 22, 12, + 22, 177, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 183, 8, 23, 10, 23, + 12, 23, 186, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, + 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, + 1, 27, 1, 27, 5, 27, 208, 8, 27, 10, 27, 12, 27, 211, 9, 27, 1, 28, 4, + 28, 214, 8, 28, 11, 28, 12, 28, 215, 1, 28, 1, 28, 4, 28, 220, 8, 28, 11, + 28, 12, 28, 221, 3, 28, 224, 8, 28, 1, 29, 4, 29, 227, 8, 29, 11, 29, 12, + 29, 228, 1, 30, 4, 30, 232, 8, 30, 11, 30, 12, 30, 233, 1, 30, 1, 30, 1, + 31, 1, 31, 1, 32, 1, 32, 3, 32, 242, 8, 32, 1, 33, 1, 33, 1, 33, 1, 33, + 1, 33, 1, 33, 4, 33, 250, 8, 33, 11, 33, 12, 33, 251, 1, 33, 1, 33, 3, + 33, 256, 8, 33, 1, 34, 1, 34, 1, 78, 0, 35, 1, 1, 3, 2, 5, 3, 7, 4, 9, + 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, + 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, + 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, + 65, 0, 67, 0, 69, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, - 102, 260, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, + 102, 269, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, @@ -104,78 +106,80 @@ func biceplexerLexerInit() { 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, - 1, 0, 0, 0, 1, 69, 1, 0, 0, 0, 3, 83, 1, 0, 0, 0, 5, 85, 1, 0, 0, 0, 7, - 87, 1, 0, 0, 0, 9, 89, 1, 0, 0, 0, 11, 91, 1, 0, 0, 0, 13, 93, 1, 0, 0, - 0, 15, 95, 1, 0, 0, 0, 17, 97, 1, 0, 0, 0, 19, 99, 1, 0, 0, 0, 21, 101, - 1, 0, 0, 0, 23, 103, 1, 0, 0, 0, 25, 105, 1, 0, 0, 0, 27, 107, 1, 0, 0, - 0, 29, 113, 1, 0, 0, 0, 31, 117, 1, 0, 0, 0, 33, 122, 1, 0, 0, 0, 35, 128, - 1, 0, 0, 0, 37, 133, 1, 0, 0, 0, 39, 142, 1, 0, 0, 0, 41, 152, 1, 0, 0, - 0, 43, 162, 1, 0, 0, 0, 45, 171, 1, 0, 0, 0, 47, 180, 1, 0, 0, 0, 49, 187, - 1, 0, 0, 0, 51, 191, 1, 0, 0, 0, 53, 196, 1, 0, 0, 0, 55, 204, 1, 0, 0, - 0, 57, 217, 1, 0, 0, 0, 59, 222, 1, 0, 0, 0, 61, 228, 1, 0, 0, 0, 63, 232, - 1, 0, 0, 0, 65, 234, 1, 0, 0, 0, 67, 248, 1, 0, 0, 0, 69, 70, 5, 39, 0, - 0, 70, 71, 5, 39, 0, 0, 71, 72, 5, 39, 0, 0, 72, 76, 1, 0, 0, 0, 73, 75, - 9, 0, 0, 0, 74, 73, 1, 0, 0, 0, 75, 78, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, - 76, 74, 1, 0, 0, 0, 77, 79, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 79, 80, 5, - 39, 0, 0, 80, 81, 5, 39, 0, 0, 81, 82, 5, 39, 0, 0, 82, 2, 1, 0, 0, 0, - 83, 84, 5, 64, 0, 0, 84, 4, 1, 0, 0, 0, 85, 86, 5, 44, 0, 0, 86, 6, 1, - 0, 0, 0, 87, 88, 5, 91, 0, 0, 88, 8, 1, 0, 0, 0, 89, 90, 5, 93, 0, 0, 90, - 10, 1, 0, 0, 0, 91, 92, 5, 40, 0, 0, 92, 12, 1, 0, 0, 0, 93, 94, 5, 41, - 0, 0, 94, 14, 1, 0, 0, 0, 95, 96, 5, 46, 0, 0, 96, 16, 1, 0, 0, 0, 97, - 98, 5, 124, 0, 0, 98, 18, 1, 0, 0, 0, 99, 100, 5, 58, 0, 0, 100, 20, 1, - 0, 0, 0, 101, 102, 5, 61, 0, 0, 102, 22, 1, 0, 0, 0, 103, 104, 5, 123, - 0, 0, 104, 24, 1, 0, 0, 0, 105, 106, 5, 125, 0, 0, 106, 26, 1, 0, 0, 0, - 107, 108, 5, 112, 0, 0, 108, 109, 5, 97, 0, 0, 109, 110, 5, 114, 0, 0, - 110, 111, 5, 97, 0, 0, 111, 112, 5, 109, 0, 0, 112, 28, 1, 0, 0, 0, 113, - 114, 5, 118, 0, 0, 114, 115, 5, 97, 0, 0, 115, 116, 5, 114, 0, 0, 116, - 30, 1, 0, 0, 0, 117, 118, 5, 116, 0, 0, 118, 119, 5, 114, 0, 0, 119, 120, - 5, 117, 0, 0, 120, 121, 5, 101, 0, 0, 121, 32, 1, 0, 0, 0, 122, 123, 5, - 102, 0, 0, 123, 124, 5, 97, 0, 0, 124, 125, 5, 108, 0, 0, 125, 126, 5, - 115, 0, 0, 126, 127, 5, 101, 0, 0, 127, 34, 1, 0, 0, 0, 128, 129, 5, 110, - 0, 0, 129, 130, 5, 117, 0, 0, 130, 131, 5, 108, 0, 0, 131, 132, 5, 108, - 0, 0, 132, 36, 1, 0, 0, 0, 133, 134, 5, 114, 0, 0, 134, 135, 5, 101, 0, - 0, 135, 136, 5, 115, 0, 0, 136, 137, 5, 111, 0, 0, 137, 138, 5, 117, 0, - 0, 138, 139, 5, 114, 0, 0, 139, 140, 5, 99, 0, 0, 140, 141, 5, 101, 0, - 0, 141, 38, 1, 0, 0, 0, 142, 146, 5, 39, 0, 0, 143, 145, 3, 63, 31, 0, - 144, 143, 1, 0, 0, 0, 145, 148, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, - 147, 1, 0, 0, 0, 147, 149, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 149, 150, - 5, 36, 0, 0, 150, 151, 5, 123, 0, 0, 151, 40, 1, 0, 0, 0, 152, 156, 5, - 125, 0, 0, 153, 155, 3, 63, 31, 0, 154, 153, 1, 0, 0, 0, 155, 158, 1, 0, - 0, 0, 156, 154, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 159, 1, 0, 0, 0, - 158, 156, 1, 0, 0, 0, 159, 160, 5, 36, 0, 0, 160, 161, 5, 123, 0, 0, 161, - 42, 1, 0, 0, 0, 162, 166, 5, 125, 0, 0, 163, 165, 3, 63, 31, 0, 164, 163, - 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, - 0, 0, 167, 169, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 170, 5, 39, 0, 0, - 170, 44, 1, 0, 0, 0, 171, 175, 5, 39, 0, 0, 172, 174, 3, 63, 31, 0, 173, - 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, - 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 39, - 0, 0, 179, 46, 1, 0, 0, 0, 180, 181, 5, 115, 0, 0, 181, 182, 5, 116, 0, - 0, 182, 183, 5, 114, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 110, 0, - 0, 185, 186, 5, 103, 0, 0, 186, 48, 1, 0, 0, 0, 187, 188, 5, 105, 0, 0, - 188, 189, 5, 110, 0, 0, 189, 190, 5, 116, 0, 0, 190, 50, 1, 0, 0, 0, 191, - 192, 5, 98, 0, 0, 192, 193, 5, 111, 0, 0, 193, 194, 5, 111, 0, 0, 194, - 195, 5, 108, 0, 0, 195, 52, 1, 0, 0, 0, 196, 200, 7, 0, 0, 0, 197, 199, - 7, 1, 0, 0, 198, 197, 1, 0, 0, 0, 199, 202, 1, 0, 0, 0, 200, 198, 1, 0, - 0, 0, 200, 201, 1, 0, 0, 0, 201, 54, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, - 203, 205, 7, 2, 0, 0, 204, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, - 204, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 214, 1, 0, 0, 0, 208, 210, - 5, 46, 0, 0, 209, 211, 7, 2, 0, 0, 210, 209, 1, 0, 0, 0, 211, 212, 1, 0, - 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 215, 1, 0, 0, 0, - 214, 208, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 56, 1, 0, 0, 0, 216, 218, - 7, 3, 0, 0, 217, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 217, 1, 0, - 0, 0, 219, 220, 1, 0, 0, 0, 220, 58, 1, 0, 0, 0, 221, 223, 7, 4, 0, 0, - 222, 221, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, - 225, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 227, 6, 29, 0, 0, 227, 60, - 1, 0, 0, 0, 228, 229, 9, 0, 0, 0, 229, 62, 1, 0, 0, 0, 230, 233, 8, 5, - 0, 0, 231, 233, 3, 65, 32, 0, 232, 230, 1, 0, 0, 0, 232, 231, 1, 0, 0, - 0, 233, 64, 1, 0, 0, 0, 234, 246, 5, 92, 0, 0, 235, 247, 7, 6, 0, 0, 236, - 237, 5, 117, 0, 0, 237, 238, 5, 123, 0, 0, 238, 240, 1, 0, 0, 0, 239, 241, - 3, 67, 33, 0, 240, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 240, 1, - 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 5, 125, - 0, 0, 245, 247, 1, 0, 0, 0, 246, 235, 1, 0, 0, 0, 246, 236, 1, 0, 0, 0, - 247, 66, 1, 0, 0, 0, 248, 249, 7, 7, 0, 0, 249, 68, 1, 0, 0, 0, 15, 0, - 76, 146, 156, 166, 175, 200, 206, 212, 214, 219, 224, 232, 242, 246, 1, - 6, 0, 0, + 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 1, 71, 1, 0, 0, 0, 3, 85, 1, 0, 0, 0, 5, + 87, 1, 0, 0, 0, 7, 89, 1, 0, 0, 0, 9, 91, 1, 0, 0, 0, 11, 93, 1, 0, 0, + 0, 13, 95, 1, 0, 0, 0, 15, 97, 1, 0, 0, 0, 17, 99, 1, 0, 0, 0, 19, 101, + 1, 0, 0, 0, 21, 103, 1, 0, 0, 0, 23, 105, 1, 0, 0, 0, 25, 107, 1, 0, 0, + 0, 27, 109, 1, 0, 0, 0, 29, 115, 1, 0, 0, 0, 31, 119, 1, 0, 0, 0, 33, 124, + 1, 0, 0, 0, 35, 130, 1, 0, 0, 0, 37, 135, 1, 0, 0, 0, 39, 142, 1, 0, 0, + 0, 41, 151, 1, 0, 0, 0, 43, 161, 1, 0, 0, 0, 45, 171, 1, 0, 0, 0, 47, 180, + 1, 0, 0, 0, 49, 189, 1, 0, 0, 0, 51, 196, 1, 0, 0, 0, 53, 200, 1, 0, 0, + 0, 55, 205, 1, 0, 0, 0, 57, 213, 1, 0, 0, 0, 59, 226, 1, 0, 0, 0, 61, 231, + 1, 0, 0, 0, 63, 237, 1, 0, 0, 0, 65, 241, 1, 0, 0, 0, 67, 243, 1, 0, 0, + 0, 69, 257, 1, 0, 0, 0, 71, 72, 5, 39, 0, 0, 72, 73, 5, 39, 0, 0, 73, 74, + 5, 39, 0, 0, 74, 78, 1, 0, 0, 0, 75, 77, 9, 0, 0, 0, 76, 75, 1, 0, 0, 0, + 77, 80, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 79, 81, 1, + 0, 0, 0, 80, 78, 1, 0, 0, 0, 81, 82, 5, 39, 0, 0, 82, 83, 5, 39, 0, 0, + 83, 84, 5, 39, 0, 0, 84, 2, 1, 0, 0, 0, 85, 86, 5, 64, 0, 0, 86, 4, 1, + 0, 0, 0, 87, 88, 5, 44, 0, 0, 88, 6, 1, 0, 0, 0, 89, 90, 5, 91, 0, 0, 90, + 8, 1, 0, 0, 0, 91, 92, 5, 93, 0, 0, 92, 10, 1, 0, 0, 0, 93, 94, 5, 40, + 0, 0, 94, 12, 1, 0, 0, 0, 95, 96, 5, 41, 0, 0, 96, 14, 1, 0, 0, 0, 97, + 98, 5, 46, 0, 0, 98, 16, 1, 0, 0, 0, 99, 100, 5, 124, 0, 0, 100, 18, 1, + 0, 0, 0, 101, 102, 5, 58, 0, 0, 102, 20, 1, 0, 0, 0, 103, 104, 5, 61, 0, + 0, 104, 22, 1, 0, 0, 0, 105, 106, 5, 123, 0, 0, 106, 24, 1, 0, 0, 0, 107, + 108, 5, 125, 0, 0, 108, 26, 1, 0, 0, 0, 109, 110, 5, 112, 0, 0, 110, 111, + 5, 97, 0, 0, 111, 112, 5, 114, 0, 0, 112, 113, 5, 97, 0, 0, 113, 114, 5, + 109, 0, 0, 114, 28, 1, 0, 0, 0, 115, 116, 5, 118, 0, 0, 116, 117, 5, 97, + 0, 0, 117, 118, 5, 114, 0, 0, 118, 30, 1, 0, 0, 0, 119, 120, 5, 116, 0, + 0, 120, 121, 5, 114, 0, 0, 121, 122, 5, 117, 0, 0, 122, 123, 5, 101, 0, + 0, 123, 32, 1, 0, 0, 0, 124, 125, 5, 102, 0, 0, 125, 126, 5, 97, 0, 0, + 126, 127, 5, 108, 0, 0, 127, 128, 5, 115, 0, 0, 128, 129, 5, 101, 0, 0, + 129, 34, 1, 0, 0, 0, 130, 131, 5, 110, 0, 0, 131, 132, 5, 117, 0, 0, 132, + 133, 5, 108, 0, 0, 133, 134, 5, 108, 0, 0, 134, 36, 1, 0, 0, 0, 135, 136, + 5, 111, 0, 0, 136, 137, 5, 98, 0, 0, 137, 138, 5, 106, 0, 0, 138, 139, + 5, 101, 0, 0, 139, 140, 5, 99, 0, 0, 140, 141, 5, 116, 0, 0, 141, 38, 1, + 0, 0, 0, 142, 143, 5, 114, 0, 0, 143, 144, 5, 101, 0, 0, 144, 145, 5, 115, + 0, 0, 145, 146, 5, 111, 0, 0, 146, 147, 5, 117, 0, 0, 147, 148, 5, 114, + 0, 0, 148, 149, 5, 99, 0, 0, 149, 150, 5, 101, 0, 0, 150, 40, 1, 0, 0, + 0, 151, 155, 5, 39, 0, 0, 152, 154, 3, 65, 32, 0, 153, 152, 1, 0, 0, 0, + 154, 157, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, + 158, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 158, 159, 5, 36, 0, 0, 159, 160, + 5, 123, 0, 0, 160, 42, 1, 0, 0, 0, 161, 165, 5, 125, 0, 0, 162, 164, 3, + 65, 32, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, + 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, + 168, 169, 5, 36, 0, 0, 169, 170, 5, 123, 0, 0, 170, 44, 1, 0, 0, 0, 171, + 175, 5, 125, 0, 0, 172, 174, 3, 65, 32, 0, 173, 172, 1, 0, 0, 0, 174, 177, + 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, + 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 39, 0, 0, 179, 46, 1, 0, 0, 0, + 180, 184, 5, 39, 0, 0, 181, 183, 3, 65, 32, 0, 182, 181, 1, 0, 0, 0, 183, + 186, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 187, + 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 187, 188, 5, 39, 0, 0, 188, 48, 1, 0, + 0, 0, 189, 190, 5, 115, 0, 0, 190, 191, 5, 116, 0, 0, 191, 192, 5, 114, + 0, 0, 192, 193, 5, 105, 0, 0, 193, 194, 5, 110, 0, 0, 194, 195, 5, 103, + 0, 0, 195, 50, 1, 0, 0, 0, 196, 197, 5, 105, 0, 0, 197, 198, 5, 110, 0, + 0, 198, 199, 5, 116, 0, 0, 199, 52, 1, 0, 0, 0, 200, 201, 5, 98, 0, 0, + 201, 202, 5, 111, 0, 0, 202, 203, 5, 111, 0, 0, 203, 204, 5, 108, 0, 0, + 204, 54, 1, 0, 0, 0, 205, 209, 7, 0, 0, 0, 206, 208, 7, 1, 0, 0, 207, 206, + 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, + 0, 0, 210, 56, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 212, 214, 7, 2, 0, 0, + 213, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, + 216, 1, 0, 0, 0, 216, 223, 1, 0, 0, 0, 217, 219, 5, 46, 0, 0, 218, 220, + 7, 2, 0, 0, 219, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 219, 1, 0, + 0, 0, 221, 222, 1, 0, 0, 0, 222, 224, 1, 0, 0, 0, 223, 217, 1, 0, 0, 0, + 223, 224, 1, 0, 0, 0, 224, 58, 1, 0, 0, 0, 225, 227, 7, 3, 0, 0, 226, 225, + 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, + 0, 0, 229, 60, 1, 0, 0, 0, 230, 232, 7, 4, 0, 0, 231, 230, 1, 0, 0, 0, + 232, 233, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, + 235, 1, 0, 0, 0, 235, 236, 6, 30, 0, 0, 236, 62, 1, 0, 0, 0, 237, 238, + 9, 0, 0, 0, 238, 64, 1, 0, 0, 0, 239, 242, 8, 5, 0, 0, 240, 242, 3, 67, + 33, 0, 241, 239, 1, 0, 0, 0, 241, 240, 1, 0, 0, 0, 242, 66, 1, 0, 0, 0, + 243, 255, 5, 92, 0, 0, 244, 256, 7, 6, 0, 0, 245, 246, 5, 117, 0, 0, 246, + 247, 5, 123, 0, 0, 247, 249, 1, 0, 0, 0, 248, 250, 3, 69, 34, 0, 249, 248, + 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 249, 1, 0, 0, 0, 251, 252, 1, 0, + 0, 0, 252, 253, 1, 0, 0, 0, 253, 254, 5, 125, 0, 0, 254, 256, 1, 0, 0, + 0, 255, 244, 1, 0, 0, 0, 255, 245, 1, 0, 0, 0, 256, 68, 1, 0, 0, 0, 257, + 258, 7, 7, 0, 0, 258, 70, 1, 0, 0, 0, 15, 0, 78, 155, 165, 175, 184, 209, + 215, 221, 223, 228, 233, 241, 251, 255, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -234,17 +238,18 @@ const ( bicepLexerTRUE = 16 bicepLexerFALSE = 17 bicepLexerNULL = 18 - bicepLexerRESOURCE = 19 - bicepLexerSTRING_LEFT_PIECE = 20 - bicepLexerSTRING_MIDDLE_PIECE = 21 - bicepLexerSTRING_RIGHT_PIECE = 22 - bicepLexerSTRING_COMPLETE = 23 - bicepLexerSTRING = 24 - bicepLexerINT = 25 - bicepLexerBOOL = 26 - bicepLexerIDENTIFIER = 27 - bicepLexerNUMBER = 28 - bicepLexerNL = 29 - bicepLexerSPACES = 30 - bicepLexerUNKNOWN = 31 + bicepLexerOBJECT = 19 + bicepLexerRESOURCE = 20 + bicepLexerSTRING_LEFT_PIECE = 21 + bicepLexerSTRING_MIDDLE_PIECE = 22 + bicepLexerSTRING_RIGHT_PIECE = 23 + bicepLexerSTRING_COMPLETE = 24 + bicepLexerSTRING = 25 + bicepLexerINT = 26 + bicepLexerBOOL = 27 + bicepLexerIDENTIFIER = 28 + bicepLexerNUMBER = 29 + bicepLexerNL = 30 + bicepLexerSPACES = 31 + bicepLexerUNKNOWN = 32 ) diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 50d17b74ad1..69587d32081 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -35,14 +35,14 @@ func bicepParserInit() { staticData.LiteralNames = []string{ "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", - "'resource'", "", "", "", "", "'string'", "'int'", "'bool'", + "'object'", "'resource'", "", "", "", "", "'string'", "'int'", "'bool'", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", - "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IDENTIFIER", - "NUMBER", "NL", "SPACES", "UNKNOWN", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", + "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", + "INT", "BOOL", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", } staticData.RuleNames = []string{ "program", "statement", "parameterDecl", "parameterDefaultValue", "variableDecl", @@ -53,7 +53,7 @@ func bicepParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 31, 263, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 32, 257, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, @@ -68,52 +68,51 @@ func bicepParserInit() { 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 147, 8, 8, 1, 9, 1, 9, 3, 9, 151, 8, 9, 1, 9, 1, 9, 3, 9, 155, 8, 9, 1, 9, 1, - 9, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, - 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 172, 8, 11, 1, 12, 1, 12, 4, - 12, 176, 8, 12, 11, 12, 12, 12, 177, 1, 12, 1, 12, 4, 12, 182, 8, 12, 11, - 12, 12, 12, 183, 5, 12, 186, 8, 12, 10, 12, 12, 12, 189, 9, 12, 3, 12, - 191, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 197, 8, 13, 1, 13, 1, 13, - 1, 13, 1, 14, 1, 14, 5, 14, 204, 8, 14, 10, 14, 12, 14, 207, 9, 14, 1, - 14, 5, 14, 210, 8, 14, 10, 14, 12, 14, 213, 9, 14, 1, 14, 1, 14, 1, 15, - 1, 15, 4, 15, 219, 8, 15, 11, 15, 12, 15, 220, 1, 15, 3, 15, 224, 8, 15, - 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 235, - 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 240, 8, 18, 1, 18, 3, 18, 243, 8, 18, - 1, 18, 3, 18, 246, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 3, 19, 253, - 8, 19, 1, 19, 5, 19, 256, 8, 19, 10, 19, 12, 19, 259, 9, 19, 1, 20, 1, - 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, - 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 19, 24, 27, 285, 0, 45, - 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, - 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, - 0, 0, 16, 146, 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, 1, 0, 0, 0, 22, - 171, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 196, 1, 0, 0, 0, 28, 201, 1, - 0, 0, 0, 30, 216, 1, 0, 0, 0, 32, 225, 1, 0, 0, 0, 34, 234, 1, 0, 0, 0, - 36, 236, 1, 0, 0, 0, 38, 249, 1, 0, 0, 0, 40, 260, 1, 0, 0, 0, 42, 44, - 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, - 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, - 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, - 55, 3, 10, 5, 0, 53, 55, 5, 29, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, - 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, - 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, - 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, - 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, - 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, - 5, 19, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, - 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, - 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 29, 0, 0, 76, 5, 1, 0, 0, 0, - 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, - 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, - 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, - 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, - 0, 90, 91, 5, 29, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, - 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, - 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 19, 0, 0, 99, 100, 3, - 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, - 12, 0, 103, 104, 5, 29, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 20, 0, - 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 21, 0, 0, 108, 110, 1, 0, 0, 0, - 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, + 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 166, 8, 11, + 1, 12, 1, 12, 4, 12, 170, 8, 12, 11, 12, 12, 12, 171, 1, 12, 1, 12, 4, + 12, 176, 8, 12, 11, 12, 12, 12, 177, 5, 12, 180, 8, 12, 10, 12, 12, 12, + 183, 9, 12, 3, 12, 185, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 191, + 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 198, 8, 14, 10, 14, 12, + 14, 201, 9, 14, 1, 14, 5, 14, 204, 8, 14, 10, 14, 12, 14, 207, 9, 14, 1, + 14, 1, 14, 1, 15, 1, 15, 4, 15, 213, 8, 15, 11, 15, 12, 15, 214, 1, 15, + 3, 15, 218, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, + 17, 1, 17, 3, 17, 229, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 234, 8, 18, 1, + 18, 3, 18, 237, 8, 18, 1, 18, 3, 18, 240, 8, 18, 1, 18, 1, 18, 1, 19, 1, + 19, 1, 19, 3, 19, 247, 8, 19, 1, 19, 5, 19, 250, 8, 19, 10, 19, 12, 19, + 253, 9, 19, 1, 20, 1, 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, + 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 20, + 25, 28, 278, 0, 45, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, + 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, + 0, 14, 120, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, + 1, 0, 0, 0, 22, 165, 1, 0, 0, 0, 24, 167, 1, 0, 0, 0, 26, 190, 1, 0, 0, + 0, 28, 195, 1, 0, 0, 0, 30, 210, 1, 0, 0, 0, 32, 219, 1, 0, 0, 0, 34, 228, + 1, 0, 0, 0, 36, 230, 1, 0, 0, 0, 38, 243, 1, 0, 0, 0, 40, 254, 1, 0, 0, + 0, 42, 44, 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, + 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, + 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, + 4, 0, 52, 55, 3, 10, 5, 0, 53, 55, 5, 30, 0, 0, 54, 50, 1, 0, 0, 0, 54, + 51, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, + 0, 56, 58, 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, + 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, + 62, 63, 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, + 3, 6, 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, + 68, 69, 5, 20, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, + 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, + 68, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 30, 0, 0, 76, 5, 1, 0, 0, + 0, 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, + 3, 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, + 0, 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, + 5, 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, + 7, 0, 90, 91, 5, 30, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, + 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, + 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 20, 0, 0, 99, 100, + 3, 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, + 24, 12, 0, 103, 104, 5, 30, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 21, + 0, 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 22, 0, 0, 108, 110, 1, 0, 0, + 0, 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, - 3, 14, 7, 0, 115, 116, 5, 22, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, - 23, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, + 3, 14, 7, 0, 115, 116, 5, 23, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, + 24, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, @@ -126,50 +125,48 @@ func bicepParserInit() { 18, 9, 0, 146, 139, 1, 0, 0, 0, 146, 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0, 146, 143, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 145, 1, 0, 0, 0, 147, 17, 1, 0, 0, 0, 148, 150, 5, 6, 0, 0, 149, 151, 5, - 29, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, - 0, 152, 154, 3, 14, 7, 0, 153, 155, 5, 29, 0, 0, 154, 153, 1, 0, 0, 0, + 30, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, + 0, 152, 154, 3, 14, 7, 0, 153, 155, 5, 30, 0, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 7, 0, 0, 157, - 19, 1, 0, 0, 0, 158, 163, 3, 40, 20, 0, 159, 160, 5, 9, 0, 0, 160, 162, - 3, 40, 20, 0, 161, 159, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, - 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 21, 1, 0, 0, 0, 165, 163, 1, 0, 0, - 0, 166, 172, 5, 28, 0, 0, 167, 172, 5, 16, 0, 0, 168, 172, 5, 17, 0, 0, - 169, 172, 5, 18, 0, 0, 170, 172, 3, 40, 20, 0, 171, 166, 1, 0, 0, 0, 171, - 167, 1, 0, 0, 0, 171, 168, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 170, - 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, 173, 190, 5, 12, 0, 0, 174, 176, 5, 29, - 0, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, - 177, 178, 1, 0, 0, 0, 178, 187, 1, 0, 0, 0, 179, 181, 3, 26, 13, 0, 180, - 182, 5, 29, 0, 0, 181, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, - 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 179, 1, 0, - 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, - 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 175, 1, 0, 0, 0, 190, - 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 13, 0, 0, 193, 25, - 1, 0, 0, 0, 194, 197, 3, 40, 20, 0, 195, 197, 3, 12, 6, 0, 196, 194, 1, - 0, 0, 0, 196, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 5, 10, 0, - 0, 199, 200, 3, 14, 7, 0, 200, 27, 1, 0, 0, 0, 201, 205, 5, 4, 0, 0, 202, - 204, 5, 29, 0, 0, 203, 202, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, - 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 211, 1, 0, 0, 0, 207, 205, 1, 0, - 0, 0, 208, 210, 3, 30, 15, 0, 209, 208, 1, 0, 0, 0, 210, 213, 1, 0, 0, - 0, 211, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 214, 1, 0, 0, 0, 213, - 211, 1, 0, 0, 0, 214, 215, 5, 5, 0, 0, 215, 29, 1, 0, 0, 0, 216, 223, 3, - 14, 7, 0, 217, 219, 5, 29, 0, 0, 218, 217, 1, 0, 0, 0, 219, 220, 1, 0, - 0, 0, 220, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, - 222, 224, 5, 3, 0, 0, 223, 218, 1, 0, 0, 0, 223, 222, 1, 0, 0, 0, 223, - 224, 1, 0, 0, 0, 224, 31, 1, 0, 0, 0, 225, 226, 5, 2, 0, 0, 226, 227, 3, - 34, 17, 0, 227, 228, 5, 29, 0, 0, 228, 33, 1, 0, 0, 0, 229, 235, 3, 36, - 18, 0, 230, 231, 3, 14, 7, 0, 231, 232, 5, 8, 0, 0, 232, 233, 3, 36, 18, - 0, 233, 235, 1, 0, 0, 0, 234, 229, 1, 0, 0, 0, 234, 230, 1, 0, 0, 0, 235, - 35, 1, 0, 0, 0, 236, 237, 3, 40, 20, 0, 237, 242, 5, 6, 0, 0, 238, 240, - 5, 29, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 241, 1, 0, - 0, 0, 241, 243, 3, 38, 19, 0, 242, 239, 1, 0, 0, 0, 242, 243, 1, 0, 0, - 0, 243, 245, 1, 0, 0, 0, 244, 246, 5, 29, 0, 0, 245, 244, 1, 0, 0, 0, 245, - 246, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 5, 7, 0, 0, 248, 37, 1, - 0, 0, 0, 249, 257, 3, 14, 7, 0, 250, 252, 5, 3, 0, 0, 251, 253, 5, 29, - 0, 0, 252, 251, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, - 254, 256, 3, 14, 7, 0, 255, 250, 1, 0, 0, 0, 256, 259, 1, 0, 0, 0, 257, - 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 39, 1, 0, 0, 0, 259, 257, 1, - 0, 0, 0, 260, 261, 7, 0, 0, 0, 261, 41, 1, 0, 0, 0, 32, 45, 54, 59, 66, - 71, 73, 83, 95, 111, 118, 134, 136, 146, 150, 154, 163, 171, 177, 183, - 187, 190, 196, 205, 211, 220, 223, 234, 239, 242, 245, 252, 257, + 19, 1, 0, 0, 0, 158, 159, 3, 40, 20, 0, 159, 21, 1, 0, 0, 0, 160, 166, + 5, 29, 0, 0, 161, 166, 5, 16, 0, 0, 162, 166, 5, 17, 0, 0, 163, 166, 5, + 18, 0, 0, 164, 166, 3, 40, 20, 0, 165, 160, 1, 0, 0, 0, 165, 161, 1, 0, + 0, 0, 165, 162, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 164, 1, 0, 0, 0, + 166, 23, 1, 0, 0, 0, 167, 184, 5, 12, 0, 0, 168, 170, 5, 30, 0, 0, 169, + 168, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 172, + 1, 0, 0, 0, 172, 181, 1, 0, 0, 0, 173, 175, 3, 26, 13, 0, 174, 176, 5, + 30, 0, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, + 0, 177, 178, 1, 0, 0, 0, 178, 180, 1, 0, 0, 0, 179, 173, 1, 0, 0, 0, 180, + 183, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 185, + 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 184, 169, 1, 0, 0, 0, 184, 185, 1, 0, + 0, 0, 185, 186, 1, 0, 0, 0, 186, 187, 5, 13, 0, 0, 187, 25, 1, 0, 0, 0, + 188, 191, 3, 40, 20, 0, 189, 191, 3, 12, 6, 0, 190, 188, 1, 0, 0, 0, 190, + 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 10, 0, 0, 193, 194, + 3, 14, 7, 0, 194, 27, 1, 0, 0, 0, 195, 199, 5, 4, 0, 0, 196, 198, 5, 30, + 0, 0, 197, 196, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, + 199, 200, 1, 0, 0, 0, 200, 205, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, + 204, 3, 30, 15, 0, 203, 202, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, + 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 208, 1, 0, 0, 0, 207, 205, 1, 0, + 0, 0, 208, 209, 5, 5, 0, 0, 209, 29, 1, 0, 0, 0, 210, 217, 3, 14, 7, 0, + 211, 213, 5, 30, 0, 0, 212, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, + 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 218, 1, 0, 0, 0, 216, 218, + 5, 3, 0, 0, 217, 212, 1, 0, 0, 0, 217, 216, 1, 0, 0, 0, 217, 218, 1, 0, + 0, 0, 218, 31, 1, 0, 0, 0, 219, 220, 5, 2, 0, 0, 220, 221, 3, 34, 17, 0, + 221, 222, 5, 30, 0, 0, 222, 33, 1, 0, 0, 0, 223, 229, 3, 36, 18, 0, 224, + 225, 3, 14, 7, 0, 225, 226, 5, 8, 0, 0, 226, 227, 3, 36, 18, 0, 227, 229, + 1, 0, 0, 0, 228, 223, 1, 0, 0, 0, 228, 224, 1, 0, 0, 0, 229, 35, 1, 0, + 0, 0, 230, 231, 3, 40, 20, 0, 231, 236, 5, 6, 0, 0, 232, 234, 5, 30, 0, + 0, 233, 232, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, + 237, 3, 38, 19, 0, 236, 233, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 239, + 1, 0, 0, 0, 238, 240, 5, 30, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, + 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 5, 7, 0, 0, 242, 37, 1, 0, 0, 0, + 243, 251, 3, 14, 7, 0, 244, 246, 5, 3, 0, 0, 245, 247, 5, 30, 0, 0, 246, + 245, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 250, + 3, 14, 7, 0, 249, 244, 1, 0, 0, 0, 250, 253, 1, 0, 0, 0, 251, 249, 1, 0, + 0, 0, 251, 252, 1, 0, 0, 0, 252, 39, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, + 254, 255, 7, 0, 0, 0, 255, 41, 1, 0, 0, 0, 31, 45, 54, 59, 66, 71, 73, + 83, 95, 111, 118, 134, 136, 146, 150, 154, 165, 171, 177, 181, 184, 190, + 199, 205, 214, 217, 228, 233, 236, 239, 246, 251, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -226,19 +223,20 @@ const ( bicepParserTRUE = 16 bicepParserFALSE = 17 bicepParserNULL = 18 - bicepParserRESOURCE = 19 - bicepParserSTRING_LEFT_PIECE = 20 - bicepParserSTRING_MIDDLE_PIECE = 21 - bicepParserSTRING_RIGHT_PIECE = 22 - bicepParserSTRING_COMPLETE = 23 - bicepParserSTRING = 24 - bicepParserINT = 25 - bicepParserBOOL = 26 - bicepParserIDENTIFIER = 27 - bicepParserNUMBER = 28 - bicepParserNL = 29 - bicepParserSPACES = 30 - bicepParserUNKNOWN = 31 + bicepParserOBJECT = 19 + bicepParserRESOURCE = 20 + bicepParserSTRING_LEFT_PIECE = 21 + bicepParserSTRING_MIDDLE_PIECE = 22 + bicepParserSTRING_RIGHT_PIECE = 23 + bicepParserSTRING_COMPLETE = 24 + bicepParserSTRING = 25 + bicepParserINT = 26 + bicepParserBOOL = 27 + bicepParserIDENTIFIER = 28 + bicepParserNUMBER = 29 + bicepParserNL = 30 + bicepParserSPACES = 31 + bicepParserUNKNOWN = 32 ) // bicepParser rules. @@ -390,7 +388,7 @@ func (p *bicepParser) Program() (localctx IProgramContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&537444356) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1074839556) != 0 { { p.SetState(42) p.Statement() @@ -2577,10 +2575,7 @@ type ITypeExpressionContext interface { SetType_(IIdentifierContext) // Getter signatures - AllIdentifier() []IIdentifierContext - Identifier(i int) IIdentifierContext - AllPIPE() []antlr.TerminalNode - PIPE(i int) antlr.TerminalNode + Identifier() IIdentifierContext // IsTypeExpressionContext differentiates from other interfaces. IsTypeExpressionContext() @@ -2623,37 +2618,12 @@ func (s *TypeExpressionContext) GetType_() IIdentifierContext { return s.type_ } func (s *TypeExpressionContext) SetType_(v IIdentifierContext) { s.type_ = v } -func (s *TypeExpressionContext) AllIdentifier() []IIdentifierContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IIdentifierContext); ok { - len++ - } - } - - tst := make([]IIdentifierContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IIdentifierContext); ok { - tst[i] = t.(IIdentifierContext) - i++ - } - } - - return tst -} - -func (s *TypeExpressionContext) Identifier(i int) IIdentifierContext { +func (s *TypeExpressionContext) Identifier() IIdentifierContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IIdentifierContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + t = ctx.(antlr.RuleContext) + break } } @@ -2664,14 +2634,6 @@ func (s *TypeExpressionContext) Identifier(i int) IIdentifierContext { return t.(IIdentifierContext) } -func (s *TypeExpressionContext) AllPIPE() []antlr.TerminalNode { - return s.GetTokens(bicepParserPIPE) -} - -func (s *TypeExpressionContext) PIPE(i int) antlr.TerminalNode { - return s.GetToken(bicepParserPIPE, i) -} - func (s *TypeExpressionContext) GetRuleContext() antlr.RuleContext { return s } @@ -2693,8 +2655,6 @@ func (s *TypeExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { localctx = NewTypeExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 20, bicepParserRULE_typeExpression) - var _la int - p.EnterOuterAlt(localctx, 1) { p.SetState(158) @@ -2703,37 +2663,6 @@ func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { localctx.(*TypeExpressionContext).type_ = _x } - p.SetState(163) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == bicepParserPIPE { - { - p.SetState(159) - p.Match(bicepParserPIPE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(160) - - var _x = p.Identifier() - - localctx.(*TypeExpressionContext).type_ = _x - } - - p.SetState(165) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } errorExit: if p.HasError() { @@ -2851,17 +2780,17 @@ func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { localctx = NewLiteralValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 22, bicepParserRULE_literalValue) - p.SetState(171) + p.SetState(165) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(166) + p.SetState(160) p.Match(bicepParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -2872,7 +2801,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(167) + p.SetState(161) p.Match(bicepParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -2883,7 +2812,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(168) + p.SetState(162) p.Match(bicepParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -2894,7 +2823,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(169) + p.SetState(163) p.Match(bicepParserNULL) if p.HasError() { // Recognition error - abort rule @@ -2905,7 +2834,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(170) + p.SetState(164) p.Identifier() } @@ -3059,14 +2988,14 @@ func (p *bicepParser) Object() (localctx IObjectContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(173) + p.SetState(167) p.Match(bicepParserOBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(190) + p.SetState(184) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3074,7 +3003,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) if _la == bicepParserNL { - p.SetState(175) + p.SetState(169) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3083,7 +3012,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(174) + p.SetState(168) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3091,26 +3020,26 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(177) + p.SetState(171) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(187) + p.SetState(181) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&262127616) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&524271616) != 0 { { - p.SetState(179) + p.SetState(173) p.ObjectProperty() } - p.SetState(181) + p.SetState(175) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3119,7 +3048,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(180) + p.SetState(174) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3127,7 +3056,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(183) + p.SetState(177) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3135,7 +3064,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) } - p.SetState(189) + p.SetState(183) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3145,7 +3074,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } { - p.SetState(192) + p.SetState(186) p.Match(bicepParserCBRACE) if p.HasError() { // Recognition error - abort rule @@ -3300,16 +3229,16 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { localctx = NewObjectPropertyContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 26, bicepParserRULE_objectProperty) p.EnterOuterAlt(localctx, 1) - p.SetState(196) + p.SetState(190) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { - case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: + case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: { - p.SetState(194) + p.SetState(188) var _x = p.Identifier() @@ -3318,7 +3247,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: { - p.SetState(195) + p.SetState(189) p.InterpString() } @@ -3327,7 +3256,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { goto errorExit } { - p.SetState(198) + p.SetState(192) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3335,7 +3264,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } } { - p.SetState(199) + p.SetState(193) p.expression(0) } @@ -3485,14 +3414,14 @@ func (p *bicepParser) Array() (localctx IArrayContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(201) + p.SetState(195) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(205) + p.SetState(199) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3501,7 +3430,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for _la == bicepParserNL { { - p.SetState(202) + p.SetState(196) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3509,27 +3438,27 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } } - p.SetState(207) + p.SetState(201) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(211) + p.SetState(205) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&530567250) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1061146706) != 0 { { - p.SetState(208) + p.SetState(202) p.ArrayItem() } - p.SetState(213) + p.SetState(207) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3537,7 +3466,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(214) + p.SetState(208) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -3660,17 +3589,17 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(216) + p.SetState(210) p.expression(0) } - p.SetState(223) + p.SetState(217) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { case bicepParserNL: - p.SetState(218) + p.SetState(212) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3679,7 +3608,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(217) + p.SetState(211) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3687,7 +3616,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - p.SetState(220) + p.SetState(214) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3697,7 +3626,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { case bicepParserCOMMA: { - p.SetState(222) + p.SetState(216) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -3705,7 +3634,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserCBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserRESOURCE, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER, bicepParserNUMBER: + case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserCBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER, bicepParserNUMBER: default: } @@ -3818,7 +3747,7 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { p.EnterRule(localctx, 32, bicepParserRULE_decorator) p.EnterOuterAlt(localctx, 1) { - p.SetState(225) + p.SetState(219) p.Match(bicepParserAT) if p.HasError() { // Recognition error - abort rule @@ -3826,11 +3755,11 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { } } { - p.SetState(226) + p.SetState(220) p.DecoratorExpression() } { - p.SetState(227) + p.SetState(221) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3956,28 +3885,28 @@ func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, bicepParserRULE_decoratorExpression) - p.SetState(234) + p.SetState(228) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 26, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(229) + p.SetState(223) p.FunctionCall() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(230) + p.SetState(224) p.expression(0) } { - p.SetState(231) + p.SetState(225) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -3985,7 +3914,7 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex } } { - p.SetState(232) + p.SetState(226) p.FunctionCall() } @@ -4130,22 +4059,22 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(236) + p.SetState(230) p.Identifier() } { - p.SetState(237) + p.SetState(231) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(242) + p.SetState(236) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext()) == 1 { - p.SetState(239) + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext()) == 1 { + p.SetState(233) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4154,7 +4083,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(238) + p.SetState(232) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4164,14 +4093,14 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(241) + p.SetState(235) p.ArgumentList() } } else if p.HasError() { // JIM goto errorExit } - p.SetState(245) + p.SetState(239) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4180,7 +4109,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(244) + p.SetState(238) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4190,7 +4119,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(247) + p.SetState(241) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -4344,10 +4273,10 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(249) + p.SetState(243) p.expression(0) } - p.SetState(257) + p.SetState(251) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4356,14 +4285,14 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { for _la == bicepParserCOMMA { { - p.SetState(250) + p.SetState(244) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(252) + p.SetState(246) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4372,7 +4301,7 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { if _la == bicepParserNL { { - p.SetState(251) + p.SetState(245) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4382,11 +4311,11 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { } { - p.SetState(254) + p.SetState(248) p.expression(0) } - p.SetState(259) + p.SetState(253) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4425,6 +4354,7 @@ type IIdentifierContext interface { STRING() antlr.TerminalNode INT() antlr.TerminalNode BOOL() antlr.TerminalNode + OBJECT() antlr.TerminalNode // IsIdentifierContext differentiates from other interfaces. IsIdentifierContext() @@ -4502,6 +4432,10 @@ func (s *IdentifierContext) BOOL() antlr.TerminalNode { return s.GetToken(bicepParserBOOL, 0) } +func (s *IdentifierContext) OBJECT() antlr.TerminalNode { + return s.GetToken(bicepParserOBJECT, 0) +} + func (s *IdentifierContext) GetRuleContext() antlr.RuleContext { return s } @@ -4527,10 +4461,10 @@ func (p *bicepParser) Identifier() (localctx IIdentifierContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(260) + p.SetState(254) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&252690432) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&505397248) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) From c02c5106b01578bb6af2631859fc3224d056ec0c Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Thu, 4 Apr 2024 17:21:25 +0100 Subject: [PATCH 013/130] added parsing for secure decorators and function call with dot --- pkg/parser/bicep/parser.go | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 9e4c5b1a6f5..58594b9c9e0 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -3,8 +3,8 @@ package bicep import ( "encoding/json" "fmt" - "strings" "strconv" + "strings" "github.com/Checkmarx/kics/pkg/model" "github.com/Checkmarx/kics/pkg/parser/bicep/antlr/parser" @@ -113,7 +113,16 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } for _, val := range ctx.AllDecorator() { - decorators = append(decorators, val.Accept(s)) + decorator := val.Accept(s).(map[string]interface{}) + if decorator["secure"] != nil { + if param["type"] == "string" { + param["type"] = "secureString" + } else if param["type"] == "object" { + param["type"] = "secureObject" + } + } else { + decorators = append(decorators, decorator) + } } param["decorators"] = decorators s.paramList[identifier.(string)] = param @@ -176,7 +185,19 @@ func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{ exp := ctx.Expression(0).Accept(s) fmt.Println("Visit Expression value: ", exp) if ctx.DOT() != nil { - return identifier.(string) + res := "" + for key, val := range exp.(map[string]interface{}) { + res += key + "(" + for idx, arg := range val.([]interface{}) { + res += arg.(string) + if idx < len(val.([]interface{}))-1 { + res += ", " + } + + } + res += ")." + identifier.(string) + } + return res } return nil @@ -352,6 +373,9 @@ func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{ if (ctx.BOOL()) != nil { return ctx.BOOL().GetText() } + if (ctx.OBJECT()) != nil { + return ctx.OBJECT().GetText() + } return nil } @@ -391,11 +415,8 @@ func (s *BicepVisitor) VisitArgumentList(ctx *parser.ArgumentListContext) interf } func (s *BicepVisitor) VisitTypeExpression(ctx *parser.TypeExpressionContext) interface{} { - identifiers := []string{} - for _, val := range ctx.AllIdentifier() { - identifiers = append(identifiers, val.Accept(s).(string)) - } - return identifiers + + return ctx.Identifier().Accept(s) } // GetKind returns the kind of the parser From db8a355e87cc6bff74734dde527f84c9189f9db4 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Fri, 5 Apr 2024 16:45:56 +0100 Subject: [PATCH 014/130] adding variables and parameters label --- pkg/parser/bicep/parser.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 58594b9c9e0..763174bc6b8 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -344,7 +344,18 @@ func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) in func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{} { if ctx.IDENTIFIER() != nil { - return ctx.IDENTIFIER().GetText() + identifier := ctx.IDENTIFIER().GetText() + for variable := range s.varList { + if variable == identifier { + return "variables('" + identifier + "')" + } + } + for parameter := range s.paramList { + if parameter == identifier { + return "parameters('" + identifier + "')" + } + } + return identifier } if (ctx.PARAM()) != nil { return ctx.PARAM().GetText() From 3f035cfb8ca898921e86c569174ab13c76398fb8 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 8 Apr 2024 10:06:50 +0100 Subject: [PATCH 015/130] Added function to parse chained dots and function calls --- pkg/parser/bicep/parser.go | 56 +++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 763174bc6b8..e69e92b10b1 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -178,29 +178,53 @@ func (s *BicepVisitor) VisitParameterDefaultValue(ctx *parser.ParameterDefaultVa return param } +/* +Converts functioncall data (map of identifying string to slice of arguments) into a string + + Example: "FunctionName": ["arg1", 2, "arg3", map[Function2: [arg4, arg5]]] becomes + "FunctionName(arg1, 2, arg3, Function2(arg4, arg5))" +*/ +func parseFunctionCall(functionData map[string][]interface{}) string { + var stringifiedFunctionCall string = "" + + for functionName, argumentList := range functionData { + stringifiedFunctionCall += functionName + "(" + for index, argument := range argumentList { + switch argument := argument.(type) { + case string: + stringifiedFunctionCall += argument + case int: + convertedArgument := strconv.Itoa(argument) + stringifiedFunctionCall += convertedArgument + case map[string][]interface{}: + stringifiedFunctionCall += parseFunctionCall(argument) + } + + if index < len(argumentList)-1 { + stringifiedFunctionCall += ", " + } + } + } + stringifiedFunctionCall += ")" + + return stringifiedFunctionCall +} + func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{} { if ctx.GetChildCount() > 1 { if ctx.Identifier() != nil { identifier := ctx.Identifier().Accept(s) exp := ctx.Expression(0).Accept(s) - fmt.Println("Visit Expression value: ", exp) if ctx.DOT() != nil { - res := "" - for key, val := range exp.(map[string]interface{}) { - res += key + "(" - for idx, arg := range val.([]interface{}) { - res += arg.(string) - if idx < len(val.([]interface{}))-1 { - res += ", " - } - - } - res += ")." + identifier.(string) + switch exp := exp.(type) { + case map[string][]interface{}: + return parseFunctionCall(exp) + "." + identifier.(string) + case string: + return exp + "." + identifier.(string) + default: + return nil } - return res } - - return nil } else { for _, val := range ctx.AllExpression() { val.Accept(s) @@ -409,7 +433,7 @@ func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interf if ctx.ArgumentList() != nil { argumentList = ctx.ArgumentList().Accept(s).([]interface{}) } - functionCall := map[string]interface{}{ + functionCall := map[string][]interface{}{ identifier.(string): argumentList, } From a177f920ab246d07bdef243d9e19bde086093cf2 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 8 Apr 2024 11:14:55 +0100 Subject: [PATCH 016/130] fixed decorators in parameters --- pkg/parser/bicep/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index e69e92b10b1..a9573cf8357 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -113,7 +113,7 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } for _, val := range ctx.AllDecorator() { - decorator := val.Accept(s).(map[string]interface{}) + decorator := val.Accept(s).(map[string][]interface{}) if decorator["secure"] != nil { if param["type"] == "string" { param["type"] = "secureString" From 6569320ed66d5285948ce4b8e792c268304b65df Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 8 Apr 2024 12:12:14 +0100 Subject: [PATCH 017/130] changed identifier type assertions --- pkg/parser/bicep/parser.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index a9573cf8357..5f1843cc44e 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -102,7 +102,7 @@ func (s *BicepVisitor) VisitStatement(ctx *parser.StatementContext) interface{} func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) interface{} { var decorators []interface{} param := map[string]interface{}{} - identifier := ctx.Identifier().Accept(s) + identifier := ctx.Identifier().Accept(s).(string) if ctx.ParameterDefaultValue() != nil { paramVal := ctx.ParameterDefaultValue().Accept(s) param["value"] = paramVal @@ -125,7 +125,7 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } } param["decorators"] = decorators - s.paramList[identifier.(string)] = param + s.paramList[identifier] = param return nil } @@ -133,7 +133,7 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interface{} { var variable = map[string]interface{}{} var decorators []interface{} - identifier := ctx.Identifier().Accept(s) + identifier := ctx.Identifier().Accept(s).(string) expression := ctx.Expression().Accept(s) for _, val := range ctx.AllDecorator() { @@ -141,7 +141,7 @@ func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interf } variable["decorators"] = decorators variable["value"] = expression - s.varList[identifier.(string)] = variable + s.varList[identifier] = variable return nil } @@ -150,7 +150,7 @@ func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interf resource := map[string]interface{}{} var decorators []interface{} interpString := ctx.InterpString().Accept(s) - identifier := ctx.Identifier().Accept(s) + identifier := ctx.Identifier().Accept(s).(string) resourceType := strings.Split(interpString.(string), "@")[0] apiVersion := strings.Split(interpString.(string), "@")[1] resource["type"] = resourceType @@ -213,14 +213,14 @@ func parseFunctionCall(functionData map[string][]interface{}) string { func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{} { if ctx.GetChildCount() > 1 { if ctx.Identifier() != nil { - identifier := ctx.Identifier().Accept(s) + identifier := ctx.Identifier().Accept(s).(string) exp := ctx.Expression(0).Accept(s) if ctx.DOT() != nil { switch exp := exp.(type) { case map[string][]interface{}: - return parseFunctionCall(exp) + "." + identifier.(string) + return parseFunctionCall(exp) + "." + identifier case string: - return exp + "." + identifier.(string) + return exp + "." + identifier default: return nil } @@ -355,8 +355,8 @@ func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) in objectValue := ctx.Expression().Accept(s) objectProperty := map[string]interface{}{} if ctx.Identifier() != nil { - identifier := ctx.Identifier().Accept(s) - objectProperty[identifier.(string)] = ctx.Expression().Accept(s) + identifier := ctx.Identifier().Accept(s).(string) + objectProperty[identifier] = ctx.Expression().Accept(s) } if ctx.InterpString() != nil { interpString := ctx.InterpString().Accept(s) @@ -428,13 +428,13 @@ func (s *BicepVisitor) VisitDecoratorExpression(ctx *parser.DecoratorExpressionC } func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interface{} { - identifier := ctx.Identifier().Accept(s) + identifier := ctx.Identifier().Accept(s).(string) var argumentList []interface{} if ctx.ArgumentList() != nil { argumentList = ctx.ArgumentList().Accept(s).([]interface{}) } functionCall := map[string][]interface{}{ - identifier.(string): argumentList, + identifier: argumentList, } return functionCall From bda9c7705504b35aa3f0828ffe6c8a202bac401d Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 8 Apr 2024 12:15:36 +0100 Subject: [PATCH 018/130] changed interpstring type assertions --- pkg/parser/bicep/parser.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 5f1843cc44e..ace04bbdef1 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -149,10 +149,10 @@ func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interf func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interface{} { resource := map[string]interface{}{} var decorators []interface{} - interpString := ctx.InterpString().Accept(s) + interpString := ctx.InterpString().Accept(s).(string) identifier := ctx.Identifier().Accept(s).(string) - resourceType := strings.Split(interpString.(string), "@")[0] - apiVersion := strings.Split(interpString.(string), "@")[1] + resourceType := strings.Split(interpString, "@")[0] + apiVersion := strings.Split(interpString, "@")[1] resource["type"] = resourceType resource["apiVersion"] = apiVersion for _, val := range ctx.AllDecorator() { @@ -359,8 +359,8 @@ func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) in objectProperty[identifier] = ctx.Expression().Accept(s) } if ctx.InterpString() != nil { - interpString := ctx.InterpString().Accept(s) - objectProperty[interpString.(string)] = objectValue + interpString := ctx.InterpString().Accept(s).(string) + objectProperty[interpString] = objectValue } return objectProperty From 0b59e1492da4910756cf5770fee4e1110c6561e8 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 8 Apr 2024 12:25:38 +0100 Subject: [PATCH 019/130] added type assertion error checking to prevent crashes --- pkg/parser/bicep/parser.go | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index ace04bbdef1..ba2e3a58de3 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -113,7 +113,10 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } for _, val := range ctx.AllDecorator() { - decorator := val.Accept(s).(map[string][]interface{}) + decorator, ok := val.Accept(s).(map[string][]interface{}) + if !ok { + return nil + } if decorator["secure"] != nil { if param["type"] == "string" { param["type"] = "secureString" @@ -161,8 +164,11 @@ func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interf resource["decorators"] = decorators resource["name"] = identifier if ctx.Object() != nil { - object := ctx.Object().Accept(s) - for key, val := range object.(map[string]interface{}) { + object, ok := ctx.Object().Accept(s).(map[string]interface{}) + if !ok { + return nil + } + for key, val := range object { resource[key] = val } } @@ -306,7 +312,11 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf for identifier, argumentList := range v { resStr := "[" + identifier + "(" for idx, arg := range argumentList { - resStr += arg.(string) + stringArg, ok := arg.(string) + if !ok { + return "" + } + resStr += stringArg if idx < len(argumentList)-1 { resStr += ", " } @@ -342,7 +352,10 @@ func (s *BicepVisitor) VisitArrayItem(ctx *parser.ArrayItemContext) interface{} func (s *BicepVisitor) VisitObject(ctx *parser.ObjectContext) interface{} { object := map[string]interface{}{} for _, val := range ctx.AllObjectProperty() { - objectProperty := val.Accept(s).(map[string]interface{}) + objectProperty, ok := val.Accept(s).(map[string]interface{}) + if !ok { + return object + } for key, val := range objectProperty { object[key] = val } From 3959557d20bd16660760d57ca854f4af086c42ee Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 8 Apr 2024 12:35:42 +0100 Subject: [PATCH 020/130] improved type assertion error checking --- pkg/parser/bicep/parser.go | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index ba2e3a58de3..1a4cd79b7b9 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -113,7 +113,7 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } for _, val := range ctx.AllDecorator() { - decorator, ok := val.Accept(s).(map[string][]interface{}) + decorator, ok := val.Accept(s).(map[string]interface{}) if !ok { return nil } @@ -136,7 +136,10 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interface{} { var variable = map[string]interface{}{} var decorators []interface{} - identifier := ctx.Identifier().Accept(s).(string) + identifier, ok := ctx.Identifier().Accept(s).(string) + if !ok { + return nil + } expression := ctx.Expression().Accept(s) for _, val := range ctx.AllDecorator() { @@ -152,8 +155,14 @@ func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interf func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interface{} { resource := map[string]interface{}{} var decorators []interface{} - interpString := ctx.InterpString().Accept(s).(string) - identifier := ctx.Identifier().Accept(s).(string) + interpString, ok := ctx.InterpString().Accept(s).(string) + if !ok { + return nil + } + identifier, ok := ctx.Identifier().Accept(s).(string) + if !ok { + return nil + } resourceType := strings.Split(interpString, "@")[0] apiVersion := strings.Split(interpString, "@")[1] resource["type"] = resourceType @@ -219,7 +228,10 @@ func parseFunctionCall(functionData map[string][]interface{}) string { func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{} { if ctx.GetChildCount() > 1 { if ctx.Identifier() != nil { - identifier := ctx.Identifier().Accept(s).(string) + identifier, ok := ctx.Identifier().Accept(s).(string) + if !ok { + return nil + } exp := ctx.Expression(0).Accept(s) if ctx.DOT() != nil { switch exp := exp.(type) { @@ -368,7 +380,10 @@ func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) in objectValue := ctx.Expression().Accept(s) objectProperty := map[string]interface{}{} if ctx.Identifier() != nil { - identifier := ctx.Identifier().Accept(s).(string) + identifier, ok := ctx.Identifier().Accept(s).(string) + if !ok { + return map[string]interface{}{} + } objectProperty[identifier] = ctx.Expression().Accept(s) } if ctx.InterpString() != nil { From 6acb50e2ec6691dafd833d84d856d73b98af9aae Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 8 Apr 2024 12:50:23 +0100 Subject: [PATCH 021/130] improved type assertion error handling --- pkg/parser/bicep/parser.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 1a4cd79b7b9..60fb1fd9a54 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -102,7 +102,10 @@ func (s *BicepVisitor) VisitStatement(ctx *parser.StatementContext) interface{} func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) interface{} { var decorators []interface{} param := map[string]interface{}{} - identifier := ctx.Identifier().Accept(s).(string) + identifier, ok := ctx.Identifier().Accept(s).(string) + if !ok { + return nil + } if ctx.ParameterDefaultValue() != nil { paramVal := ctx.ParameterDefaultValue().Accept(s) param["value"] = paramVal @@ -387,7 +390,10 @@ func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) in objectProperty[identifier] = ctx.Expression().Accept(s) } if ctx.InterpString() != nil { - interpString := ctx.InterpString().Accept(s).(string) + interpString, ok := ctx.InterpString().Accept(s).(string) + if !ok { + return map[string]interface{}{} + } objectProperty[interpString] = objectValue } @@ -456,10 +462,16 @@ func (s *BicepVisitor) VisitDecoratorExpression(ctx *parser.DecoratorExpressionC } func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interface{} { - identifier := ctx.Identifier().Accept(s).(string) + identifier, ok := ctx.Identifier().Accept(s).(string) + if !ok { + return map[string]interface{}{} + } var argumentList []interface{} if ctx.ArgumentList() != nil { - argumentList = ctx.ArgumentList().Accept(s).([]interface{}) + argumentList, ok = ctx.ArgumentList().Accept(s).([]interface{}) + if !ok { + return map[string]interface{}{} + } } functionCall := map[string][]interface{}{ identifier: argumentList, From 3349a61241f90472ef25dead72161eb3e508cc01 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 8 Apr 2024 14:12:32 +0100 Subject: [PATCH 022/130] unit tests for parameters, variables and completed bicep file --- pkg/parser/bicep/parser.go | 2 +- pkg/parser/bicep/parser_test.go | 302 ++++++++++++++++++++++ test/fixtures/bicep_test/parameters.bicep | 12 + test/fixtures/bicep_test/resources.bicep | 97 +++++++ test/fixtures/bicep_test/variables.bicep | 5 + 5 files changed, 417 insertions(+), 1 deletion(-) create mode 100644 pkg/parser/bicep/parser_test.go create mode 100644 test/fixtures/bicep_test/parameters.bicep create mode 100644 test/fixtures/bicep_test/resources.bicep create mode 100644 test/fixtures/bicep_test/variables.bicep diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index ba2e3a58de3..5880a4b8758 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -117,7 +117,7 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte if !ok { return nil } - if decorator["secure"] != nil { + if _, ok := decorator["secure"]; ok { if param["type"] == "string" { param["type"] = "secureString" } else if param["type"] == "object" { diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go new file mode 100644 index 00000000000..a8f1d041fb8 --- /dev/null +++ b/pkg/parser/bicep/parser_test.go @@ -0,0 +1,302 @@ +package bicep + +import ( + "encoding/json" + "path/filepath" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestParseBicepFile(t *testing.T) { + parser := &Parser{} + tests := []struct { + name string + filename string + want string + wantErr bool + }{ + { + name: "Parse Bicep file with parameters", + filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "parameters.bicep"), + want: `{ + "parameters": { + "isNumber": { + "decorators": [ + { + "description": [ + "This is a test bool param declaration." + ] + } + ], + "type": "bool", + "value": true + }, + "middleString": { + "decorators": [ + { + "description": [ + "This is a test middle string param declaration." + ] + } + ], + "type": "string", + "value": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'" + }, + "numberNodes": { + "decorators": [ + { + "description": [ + "This is a test int param declaration." + ] + } + ], + "type": "int", + "value": 2 + }, + "projectName": { + "decorators": [ + { + "description": [ + "This is a test param with secure declaration." + ] + } + ], + "type": "secureString", + "value": "test" + } + }, + "resources": [], + "variables": {} + }`, + wantErr: false, + }, + { + name: "Parse Bicep file with variables", + filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "variables.bicep"), + want: `{ + "variables": { + "nicName": { + "decorators": [ + { + "description": [ + "This is a test var declaration." + ] + } + ], + "value": "myVMNic" + }, + "storageAccountName": { + "decorators": [ + { + "description": [ + "This is a test var declaration." + ] + } + ], + "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" + } + }, + "resources": [], + "parameters": {} + }`, + wantErr: false, + }, + { + name: "Parse completed Bicep file", + filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "resources.bicep"), + want: `{ + "parameters": { + "OSVersion": { + "decorators": [ + { + "description": [ + "The Windows version for the VM. This will pick a fully patched image of this given Windows version." + ] + }, + { + "allowed": [ + [ + "2008-R2-SP1", + "2012-Datacenter", + "2012-R2-Datacenter", + "2016-Nano-Server", + "2016-Datacenter-with-Containers", + "2016-Datacenter", + "2019-Datacenter", + "2019-Datacenter-Core", + "2019-Datacenter-Core-smalldisk", + "2019-Datacenter-Core-with-Containers", + "2019-Datacenter-Core-with-Containers-smalldisk", + "2019-Datacenter-smalldisk", + "2019-Datacenter-with-Containers", + "2019-Datacenter-with-Containers-smalldisk" + ] + ] + } + ], + "type": "string", + "value": "2019-Datacenter" + }, + "adminPassword": { + "decorators": [ + { + "description": [ + "Password for the Virtual Machine." + ] + }, + { + "minLength": [ + 12 + ] + } + ], + "type": "secureString" + }, + "adminUsername": { + "decorators": [ + { + "description": [ + "Username for the Virtual Machine." + ] + } + ], + "type": "string" + }, + "location": { + "decorators": [ + { + "description": [ + "Location for all resources." + ] + } + ], + "type": "string", + "value": "resourceGroup().location" + }, + "vmName": { + "decorators": [ + { + "description": [ + "Name of the virtual machine." + ] + } + ], + "type": "string", + "value": "simple-vm" + }, + "vmSize": { + "decorators": [ + { + "description": [ + "Size of the virtual machine." + ] + } + ], + "type": "string", + "value": "Standard_D2_v3" + } + }, + "resources": [ + { + "apiVersion": "2021-03-01", + "decorators": null, + "dependsOn": [ + { + "resourceId": [ + "Microsoft.Network/networkInterfaces", + "variables('nicName')" + ] + }, + { + "resourceId": [ + "Microsoft.Storage/storageAccounts", + "variables('storageAccountName')" + ] + } + ], + "name": "parameters('vmName')", + "parameters('location')": "parameters('location')", + "properties": { + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": true, + "storageUri": "reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob" + } + }, + "hardwareProfile": { + "parameters('vmSize')": "parameters('vmSize')" + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": { + "resourceId": [ + "Microsoft.Network/networkInterfaces", + "variables('nicName')" + ] + } + } + ] + }, + "osProfile": { + "computerName": "parameters('vmName')", + "parameters('adminPassword')": "parameters('adminPassword')", + "parameters('adminUsername')": "parameters('adminUsername')" + }, + "storageProfile": { + "dataDisks": [ + { + "createOption": "Empty", + "diskSizeGB": 1023, + "lun": 0 + } + ], + "imageReference": { + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "parameters('OSVersion')", + "version": "latest" + }, + "osDisk": { + "createOption": "FromImage", + "managedDisk": { + "storageAccountType": "StandardSSD_LRS" + } + } + } + }, + "type": "Microsoft.Compute/virtualMachines" + } + ], + "variables": { + "nicName": { + "decorators": null, + "value": "myVMNic" + }, + "storageAccountName": { + "decorators": null, + "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" + } + } + }`, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + document, _, err := parser.Parse(tt.filename, nil) + if (err != nil) != tt.wantErr { + t.Errorf("Parser.Parse() error = %v, wantErr %v", err, tt.wantErr) + return + } + require.Len(t, document, 1) + //get first element of parsed file + parsedDoc := document[0] + fileString, err := json.Marshal(parsedDoc) + require.NoError(t, err) + require.JSONEq(t, tt.want, string(fileString)) + }) + } +} diff --git a/test/fixtures/bicep_test/parameters.bicep b/test/fixtures/bicep_test/parameters.bicep new file mode 100644 index 00000000000..159f0962a0a --- /dev/null +++ b/test/fixtures/bicep_test/parameters.bicep @@ -0,0 +1,12 @@ +@description('This is a test param with secure declaration.') +@secure() +param projectName string = 'test' + +@description('This is a test int param declaration.') +param numberNodes int = 2 + +@description('This is a test bool param declaration.') +param isNumber bool = true + +@description('This is a test middle string param declaration.') +param middleString string = 'teste-${numberNodes}${isNumber}-teste' diff --git a/test/fixtures/bicep_test/resources.bicep b/test/fixtures/bicep_test/resources.bicep new file mode 100644 index 00000000000..2243e011c26 --- /dev/null +++ b/test/fixtures/bicep_test/resources.bicep @@ -0,0 +1,97 @@ +@description('Username for the Virtual Machine.') +param adminUsername string + +@description('Password for the Virtual Machine.') +@minLength(12) +@secure() +param adminPassword string + +@description( + 'The Windows version for the VM. This will pick a fully patched image of this given Windows version.' +) +@allowed( + [ + '2008-R2-SP1' + '2012-Datacenter' + '2012-R2-Datacenter' + '2016-Nano-Server' + '2016-Datacenter-with-Containers' + '2016-Datacenter' + '2019-Datacenter' + '2019-Datacenter-Core' + '2019-Datacenter-Core-smalldisk' + '2019-Datacenter-Core-with-Containers' + '2019-Datacenter-Core-with-Containers-smalldisk' + '2019-Datacenter-smalldisk' + '2019-Datacenter-with-Containers' + '2019-Datacenter-with-Containers-smalldisk' + ] +) +param OSVersion string = '2019-Datacenter' + +@description('Size of the virtual machine.') +param vmSize string = 'Standard_D2_v3' + +@description('Location for all resources.') +param location string = resourceGroup().location + +@description('Name of the virtual machine.') +param vmName string = 'simple-vm' + +var storageAccountName = 'bootdiags${uniqueString(resourceGroup().id)}' +var nicName = 'myVMNic' + +resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { + name: vmName + location: location + properties: { + hardwareProfile: { + vmSize: vmSize + } + osProfile: { + computerName: vmName + adminUsername: adminUsername + adminPassword: adminPassword + } + storageProfile: { + imageReference: { + publisher: 'MicrosoftWindowsServer' + offer: 'WindowsServer' + sku: OSVersion + version: 'latest' + } + osDisk: { + createOption: 'FromImage' + managedDisk: { + storageAccountType: 'StandardSSD_LRS' + } + } + dataDisks: [ + { + diskSizeGB: 1023 + lun: 0 + createOption: 'Empty' + } + ] + } + networkProfile: { + networkInterfaces: [ + { + id: resourceId('Microsoft.Network/networkInterfaces', nicName) + } + ] + } + diagnosticsProfile: { + bootDiagnostics: { + enabled: true + storageUri: reference( + resourceId('Microsoft.Storage/storageAccounts', storageAccountName) + ).primaryEndpoints.blob + } + } + } + dependsOn: [ + resourceId('Microsoft.Network/networkInterfaces', nicName) + resourceId('Microsoft.Storage/storageAccounts', storageAccountName) + ] +} diff --git a/test/fixtures/bicep_test/variables.bicep b/test/fixtures/bicep_test/variables.bicep new file mode 100644 index 00000000000..45014c1cb5e --- /dev/null +++ b/test/fixtures/bicep_test/variables.bicep @@ -0,0 +1,5 @@ +@description('This is a test var declaration.') +var storageAccountName = 'bootdiags${uniqueString(resourceGroup().id)}' + +@description('This is a test var declaration.') +var nicName = 'myVMNic' From 8661c6341f1adefb5b4369e3a40d30aae2418b1b Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 8 Apr 2024 14:19:49 +0100 Subject: [PATCH 023/130] added go get antlr4 to go.mod --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 7682f992c45..fb882d7d117 100644 --- a/go.mod +++ b/go.mod @@ -21,6 +21,7 @@ require ( github.com/agnivade/levenshtein v1.1.1 github.com/alexmullins/zip v0.0.0-20180717182244-4affb64b04d0 github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df + github.com/antlr4-go/antlr/v4 v4.13.0 github.com/aws/aws-sdk-go v1.44.295 github.com/bigkevmcd/go-configparser v0.0.0-20230427073640-c6b631f70126 github.com/cheggaaa/pb/v3 v3.1.2 From d95f72778efc1c9fdda9fc6c5e232f8e3ba1198f Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 8 Apr 2024 17:14:03 +0100 Subject: [PATCH 024/130] added some more unit tests for go coverage --- pkg/parser/bicep/parser_test.go | 139 +++++++++++++++++++++----------- 1 file changed, 92 insertions(+), 47 deletions(-) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index a8f1d041fb8..32f44ae9a96 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -3,11 +3,56 @@ package bicep import ( "encoding/json" "path/filepath" + "reflect" "testing" + "github.com/Checkmarx/kics/pkg/model" "github.com/stretchr/testify/require" ) +func TestParser_GetKind(t *testing.T) { + p := &Parser{} + require.Equal(t, model.KindBICEP, p.GetKind()) +} + +func TestParser_SupportedTypes(t *testing.T) { + p := &Parser{} + require.Equal(t, map[string]bool{"bicep": true, "azureresourcemanager": true}, p.SupportedTypes()) +} + +func TestParser_SupportedExtensions(t *testing.T) { + p := &Parser{} + require.Equal(t, []string{".bicep"}, p.SupportedExtensions()) +} + +func Test_Resolve(t *testing.T) { + parser := &Parser{} + param := `param vmName string = 'simple-vm'` + resolved, err := parser.Resolve([]byte(param), "test.bicep", true) + require.NoError(t, err) + require.Equal(t, []byte(param), resolved) +} + +func TestParser_GetResolvedFiles(t *testing.T) { + tests := []struct { + name string + want map[string]model.ResolvedFile + }{ + { + name: "Should test getting empty resolved files", + want: map[string]model.ResolvedFile{}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + p := &Parser{} + if got := p.GetResolvedFiles(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetResolvedFiles() = %v, want %v", got, tt.want) + } + }) + } +} + func TestParseBicepFile(t *testing.T) { parser := &Parser{} tests := []struct { @@ -20,54 +65,54 @@ func TestParseBicepFile(t *testing.T) { name: "Parse Bicep file with parameters", filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "parameters.bicep"), want: `{ - "parameters": { - "isNumber": { - "decorators": [ - { - "description": [ - "This is a test bool param declaration." - ] - } - ], - "type": "bool", - "value": true - }, - "middleString": { - "decorators": [ - { - "description": [ - "This is a test middle string param declaration." - ] - } - ], - "type": "string", - "value": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'" - }, - "numberNodes": { - "decorators": [ - { - "description": [ - "This is a test int param declaration." - ] - } - ], - "type": "int", - "value": 2 - }, - "projectName": { - "decorators": [ - { - "description": [ - "This is a test param with secure declaration." - ] - } - ], - "type": "secureString", - "value": "test" - } + "parameters": { + "isNumber": { + "decorators": [ + { + "description": [ + "This is a test bool param declaration." + ] + } + ], + "type": "bool", + "value": true + }, + "middleString": { + "decorators": [ + { + "description": [ + "This is a test middle string param declaration." + ] + } + ], + "type": "string", + "value": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'" }, - "resources": [], - "variables": {} + "numberNodes": { + "decorators": [ + { + "description": [ + "This is a test int param declaration." + ] + } + ], + "type": "int", + "value": 2 + }, + "projectName": { + "decorators": [ + { + "description": [ + "This is a test param with secure declaration." + ] + } + ], + "type": "secureString", + "value": "test" + } + }, + "resources": [], + "variables": {} }`, wantErr: false, }, From 9828092dcc1eea609c37adaa88e039ebb437d5f4 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 8 Apr 2024 17:27:43 +0100 Subject: [PATCH 025/130] fix parameters parser and delete comments --- pkg/parser/bicep/parser.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 37f9f4a350b..911cb1f8c40 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -2,7 +2,6 @@ package bicep import ( "encoding/json" - "fmt" "strconv" "strings" @@ -44,7 +43,6 @@ func convertVisitorToJSONBicep(visitor *BicepVisitor) *JSONBicep { // Parse - parses bicep to BicepVisitor template (json file) func (p *Parser) Parse(file string, _ []byte) ([]model.Document, []int, error) { - fmt.Println(file) bicepVisitor := NewBicepVisitor() stream, _ := antlr.NewFileStream(file) lexer := parser.NewbicepLexer(stream) @@ -55,9 +53,6 @@ func (p *Parser) Parse(file string, _ []byte) ([]model.Document, []int, error) { bicepParser.AddErrorListener(antlr.NewDiagnosticErrorListener(true)) bicepParser.Program().Accept(bicepVisitor) - fmt.Println("\nParameters: ", bicepVisitor.paramList) - fmt.Println("\nVariables: ", bicepVisitor.varList) - fmt.Println("\nResources: ", bicepVisitor.resourceList) var doc model.Document @@ -98,7 +93,6 @@ func (s *BicepVisitor) VisitStatement(ctx *parser.StatementContext) interface{} return nil } -// VisitParameterDecl is called when production paramDecl is visited. func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) interface{} { var decorators []interface{} param := map[string]interface{}{} @@ -116,7 +110,7 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } for _, val := range ctx.AllDecorator() { - decorator, ok := val.Accept(s).(map[string]interface{}) + decorator, ok := val.Accept(s).(map[string][]interface{}) if !ok { return nil } @@ -135,7 +129,6 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte return nil } -// VisitParameterDecl is called when production paramDecl is visited. func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interface{} { var variable = map[string]interface{}{} var decorators []interface{} @@ -190,7 +183,6 @@ func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interf return nil } -// VisitParameterDefaultValue is called when production paramDecl is visited. func (s *BicepVisitor) VisitParameterDefaultValue(ctx *parser.ParameterDefaultValueContext) interface{} { param := ctx.Expression().Accept(s) return param @@ -256,7 +248,6 @@ func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{ return ctx.PrimaryExpression().Accept(s) } -// VisitPrimaryExpression is called when production primaryExpression is visited. func (s *BicepVisitor) VisitPrimaryExpression(ctx *parser.PrimaryExpressionContext) interface{} { if ctx.LiteralValue() != nil { return ctx.LiteralValue().Accept(s) @@ -304,7 +295,6 @@ func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interf return nil } -// VisitInterpString is called when production interpString is visited. func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interface{} { if ctx.GetChildCount() > 1 { interpString := []interface{}{} From 71ce7cf58ceead10761d443215b32e0771251df3 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 9 Apr 2024 11:43:41 +0100 Subject: [PATCH 026/130] fixed crash when object expression is null --- pkg/parser/bicep/parser.go | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 37f9f4a350b..5e9be05539c 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -253,7 +253,11 @@ func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{ } } - return ctx.PrimaryExpression().Accept(s) + if ctx.PrimaryExpression() != nil { + return ctx.PrimaryExpression().Accept(s) + } + + return nil } // VisitPrimaryExpression is called when production primaryExpression is visited. @@ -380,21 +384,23 @@ func (s *BicepVisitor) VisitObject(ctx *parser.ObjectContext) interface{} { } func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) interface{} { - objectValue := ctx.Expression().Accept(s) objectProperty := map[string]interface{}{} - if ctx.Identifier() != nil { - identifier, ok := ctx.Identifier().Accept(s).(string) - if !ok { - return map[string]interface{}{} + if ctx.Expression() != nil { + objectValue := ctx.Expression().Accept(s) + if ctx.Identifier() != nil { + identifier, ok := ctx.Identifier().Accept(s).(string) + if !ok { + return map[string]interface{}{} + } + objectProperty[identifier] = ctx.Expression().Accept(s) } - objectProperty[identifier] = ctx.Expression().Accept(s) - } - if ctx.InterpString() != nil { - interpString, ok := ctx.InterpString().Accept(s).(string) - if !ok { - return map[string]interface{}{} + if ctx.InterpString() != nil { + interpString, ok := ctx.InterpString().Accept(s).(string) + if !ok { + return map[string]interface{}{} + } + objectProperty[interpString] = objectValue } - objectProperty[interpString] = objectValue } return objectProperty From 24ddfb4828bae3b7879b89b45577c28e2a613921 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 9 Apr 2024 11:50:38 +0100 Subject: [PATCH 027/130] changed visitexpression default return value --- pkg/parser/bicep/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index e47a1586f72..2f04114b414 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -249,7 +249,7 @@ func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{ return ctx.PrimaryExpression().Accept(s) } - return nil + return "" } func (s *BicepVisitor) VisitPrimaryExpression(ctx *parser.PrimaryExpressionContext) interface{} { From 4e8ccf6a7fb1aa30aba85aaae384702d4e7fac32 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 9 Apr 2024 17:25:50 +0100 Subject: [PATCH 028/130] params changes --- pkg/parser/bicep/parser.go | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 2f04114b414..8c77029f889 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -102,7 +102,7 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } if ctx.ParameterDefaultValue() != nil { paramVal := ctx.ParameterDefaultValue().Accept(s) - param["value"] = paramVal + param["defaultValue"] = paramVal } if ctx.TypeExpression() != nil { typeExpression := ctx.TypeExpression().Accept(s) @@ -121,7 +121,13 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte param["type"] = "secureObject" } } else { - decorators = append(decorators, decorator) + if _, ok := decorator["allowed"]; ok { + newDecorator := map[string][]interface{}{} + newDecorator["allowedValues"] = decorator["allowed"] + decorators = append(decorators, newDecorator) + } else { + decorators = append(decorators, decorator) + } } } param["decorators"] = decorators @@ -373,16 +379,38 @@ func (s *BicepVisitor) VisitObject(ctx *parser.ObjectContext) interface{} { return object } +func isParameter(expression interface{}) bool { + exp, ok := expression.(string) + if !ok { + return false + } + + return strings.Contains(exp, "parameters(") || strings.Contains(exp, "variables(") +} + +func isDotFunction(expression interface{}) bool { + exp, ok := expression.(string) + if !ok { + return false + } + + return strings.Contains(exp, ").") +} + func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) interface{} { objectProperty := map[string]interface{}{} if ctx.Expression() != nil { objectValue := ctx.Expression().Accept(s) + if isParameter(objectValue) || isDotFunction(objectValue) { + objectValue = "[" + objectValue.(string) + "]" + } + if ctx.Identifier() != nil { identifier, ok := ctx.Identifier().Accept(s).(string) if !ok { return map[string]interface{}{} } - objectProperty[identifier] = ctx.Expression().Accept(s) + objectProperty[identifier] = objectValue } if ctx.InterpString() != nil { interpString, ok := ctx.InterpString().Accept(s).(string) From fb1c7860e2eec67e24a283c2824c865e47ad6276 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Tue, 9 Apr 2024 17:44:13 +0100 Subject: [PATCH 029/130] fix property naming --- pkg/parser/bicep/parser.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 8c77029f889..36b1a0892c1 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -233,6 +233,16 @@ func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{ if !ok { return nil } + for variable := range s.varList { + if variable == identifier { + identifier = "variables('" + identifier + "')" + } + } + for parameter := range s.paramList { + if parameter == identifier { + identifier = "parameters('" + identifier + "')" + } + } exp := ctx.Expression(0).Accept(s) if ctx.DOT() != nil { switch exp := exp.(type) { @@ -427,16 +437,6 @@ func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) in func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{} { if ctx.IDENTIFIER() != nil { identifier := ctx.IDENTIFIER().GetText() - for variable := range s.varList { - if variable == identifier { - return "variables('" + identifier + "')" - } - } - for parameter := range s.paramList { - if parameter == identifier { - return "parameters('" + identifier + "')" - } - } return identifier } if (ctx.PARAM()) != nil { From 2730eabaedc7a6ecc4e16f9ba8d8ff3cb9b777a7 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Tue, 9 Apr 2024 18:09:32 +0100 Subject: [PATCH 030/130] fix more property naming --- pkg/parser/bicep/parser.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 36b1a0892c1..7f4cc357fc2 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -309,7 +309,21 @@ func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interf return nil } if ctx.Identifier() != nil { - return ctx.Identifier().Accept(s) + identifier, ok := ctx.Identifier().Accept(s).(string) + if !ok { + return nil + } + for variable := range s.varList { + if variable == identifier { + identifier = "variables('" + identifier + "')" + } + } + for parameter := range s.paramList { + if parameter == identifier { + identifier = "parameters('" + identifier + "')" + } + } + return identifier } return nil From 9da4bd39cdf7c516e2dc2770cd06f856140acb52 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 10 Apr 2024 12:28:22 +0100 Subject: [PATCH 031/130] fixed brackets in arrays --- pkg/parser/bicep/parser.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 7f4cc357fc2..58c9b6fa56c 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -379,6 +379,9 @@ func (s *BicepVisitor) VisitArray(ctx *parser.ArrayContext) interface{} { array := []interface{}{} for _, val := range ctx.AllArrayItem() { expression := val.Accept(s) + if isParameter(expression) || isDotFunction(expression) { + expression = "[" + expression.(string) + "]" + } array = append(array, expression) } return array From 799f191526ab7cc98b37f3a57ba562888529e68b Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 10 Apr 2024 15:32:58 +0100 Subject: [PATCH 032/130] fixed functions in parameters --- go.sum | 2 ++ pkg/parser/bicep/parser.go | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/go.sum b/go.sum index 2b8717347b5..3e5188678ec 100644 --- a/go.sum +++ b/go.sum @@ -228,6 +228,8 @@ github.com/alexmullins/zip v0.0.0-20180717182244-4affb64b04d0/go.mod h1:FDIQmoMN github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= +github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= +github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 58c9b6fa56c..fc1dbd914bd 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -102,7 +102,26 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } if ctx.ParameterDefaultValue() != nil { paramVal := ctx.ParameterDefaultValue().Accept(s) - param["defaultValue"] = paramVal + switch paramVal.(type) { + case string: + param["defaultValue"] = paramVal + case map[string][]interface{}: + args := "" + for funcName, arguments := range paramVal.(map[string][]interface{}) { + for index, argument := range arguments { + arg, ok := argument.(string) + if ok { + args += arg + if index < len(arguments)-1 { + args += ", " + } + } + } + param["defaultValue"] = "[" + funcName + "(" + args + ")]" + } + default: + param["defaultValue"] = nil + } } if ctx.TypeExpression() != nil { typeExpression := ctx.TypeExpression().Accept(s) From 98efc5fc000bd95bb7f8de77c7ff5d37f254ceec Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 10 Apr 2024 15:57:37 +0100 Subject: [PATCH 033/130] replaced slices with new function --- pkg/scan/scan.go | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/pkg/scan/scan.go b/pkg/scan/scan.go index d3d4fb5e3ad..6eeefbb4002 100644 --- a/pkg/scan/scan.go +++ b/pkg/scan/scan.go @@ -4,7 +4,6 @@ package scan import ( "context" "os" - "slices" "github.com/Checkmarx/kics/assets" "github.com/Checkmarx/kics/pkg/engine" @@ -57,14 +56,12 @@ func (c *Client) initScan(ctx context.Context) (*executeScanParameters, error) { return nil, nil } - platform := c.ScanParams.Platform - if slices.Contains(platform, "bicep") && !slices.Contains(platform, "azureresourcemanager") { - platform = append(platform, "azureresourcemanager") - } + paramsPlatforms := c.ScanParams.Platform + useDifferentPlatformQueries(¶msPlatforms) querySource := source.NewFilesystemSource( c.ScanParams.QueriesPath, - platform, + paramsPlatforms, c.ScanParams.CloudProvider, c.ScanParams.LibrariesPath, c.ScanParams.ExperimentalQueries) @@ -176,6 +173,26 @@ func (c *Client) executeScan(ctx context.Context) (*Results, error) { }, nil } +func useDifferentPlatformQueries(platforms *[]string) { + hasBicep := false + hasARM := false + for _, platform := range *platforms { + if platform == "bicep" { + hasBicep = true + } + if platform == "azureresourcemanager" { + hasARM = true + } + if hasARM && hasBicep { + break + } + } + + if hasBicep && !hasARM { + *platforms = append(*platforms, "azureresourcemanager") + } +} + func getExcludeResultsMap(excludeResults []string) map[string]bool { excludeResultsMap := make(map[string]bool) for _, er := range excludeResults { From 825720730a7a155ec2396e935ee4e52a734c3ad0 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 10 Apr 2024 16:25:08 +0100 Subject: [PATCH 034/130] fix unit tests and dotFunction in parameters --- pkg/parser/bicep/parser.go | 22 +++++++-------------- pkg/parser/bicep/parser_test.go | 34 ++++++++++++++++----------------- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index fc1dbd914bd..d7d78b562c2 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -102,23 +102,15 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } if ctx.ParameterDefaultValue() != nil { paramVal := ctx.ParameterDefaultValue().Accept(s) - switch paramVal.(type) { - case string: - param["defaultValue"] = paramVal + switch paramVal := paramVal.(type) { case map[string][]interface{}: - args := "" - for funcName, arguments := range paramVal.(map[string][]interface{}) { - for index, argument := range arguments { - arg, ok := argument.(string) - if ok { - args += arg - if index < len(arguments)-1 { - args += ", " - } - } - } - param["defaultValue"] = "[" + funcName + "(" + args + ")]" + stringifiedFunction := parseFunctionCall(paramVal) + param["defaultValue"] = "[" + stringifiedFunction + "]" + case interface{}: + if isDotFunction(paramVal) { + paramVal = "[" + paramVal.(string) + "]" } + param["defaultValue"] = paramVal default: param["defaultValue"] = nil } diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 32f44ae9a96..d059c80b410 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -75,7 +75,7 @@ func TestParseBicepFile(t *testing.T) { } ], "type": "bool", - "value": true + "defaultValue": true }, "middleString": { "decorators": [ @@ -86,7 +86,7 @@ func TestParseBicepFile(t *testing.T) { } ], "type": "string", - "value": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'" + "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'" }, "numberNodes": { "decorators": [ @@ -97,7 +97,7 @@ func TestParseBicepFile(t *testing.T) { } ], "type": "int", - "value": 2 + "defaultValue": 2 }, "projectName": { "decorators": [ @@ -108,7 +108,7 @@ func TestParseBicepFile(t *testing.T) { } ], "type": "secureString", - "value": "test" + "defaultValue": "test" } }, "resources": [], @@ -160,7 +160,7 @@ func TestParseBicepFile(t *testing.T) { ] }, { - "allowed": [ + "allowedValues": [ [ "2008-R2-SP1", "2012-Datacenter", @@ -181,7 +181,7 @@ func TestParseBicepFile(t *testing.T) { } ], "type": "string", - "value": "2019-Datacenter" + "defaultValue": "2019-Datacenter" }, "adminPassword": { "decorators": [ @@ -217,7 +217,7 @@ func TestParseBicepFile(t *testing.T) { } ], "type": "string", - "value": "resourceGroup().location" + "defaultValue": "[resourceGroup().location]" }, "vmName": { "decorators": [ @@ -228,7 +228,7 @@ func TestParseBicepFile(t *testing.T) { } ], "type": "string", - "value": "simple-vm" + "defaultValue": "simple-vm" }, "vmSize": { "decorators": [ @@ -239,7 +239,7 @@ func TestParseBicepFile(t *testing.T) { } ], "type": "string", - "value": "Standard_D2_v3" + "defaultValue": "Standard_D2_v3" } }, "resources": [ @@ -260,17 +260,17 @@ func TestParseBicepFile(t *testing.T) { ] } ], - "name": "parameters('vmName')", - "parameters('location')": "parameters('location')", + "name": "[parameters('vmName')]", + "location": "[parameters('location')]", "properties": { "diagnosticsProfile": { "bootDiagnostics": { "enabled": true, - "storageUri": "reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob" + "storageUri": "[reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob]" } }, "hardwareProfile": { - "parameters('vmSize')": "parameters('vmSize')" + "vmSize": "[parameters('vmSize')]" }, "networkProfile": { "networkInterfaces": [ @@ -285,9 +285,9 @@ func TestParseBicepFile(t *testing.T) { ] }, "osProfile": { - "computerName": "parameters('vmName')", - "parameters('adminPassword')": "parameters('adminPassword')", - "parameters('adminUsername')": "parameters('adminUsername')" + "computerName": "[parameters('vmName')]", + "adminPassword": "[parameters('adminPassword')]", + "adminUsername": "[parameters('adminUsername')]" }, "storageProfile": { "dataDisks": [ @@ -300,7 +300,7 @@ func TestParseBicepFile(t *testing.T) { "imageReference": { "offer": "WindowsServer", "publisher": "MicrosoftWindowsServer", - "sku": "parameters('OSVersion')", + "sku": "[parameters('OSVersion')]", "version": "latest" }, "osDisk": { From 04c8f2b36398dfcd842a086673b541f0773123e4 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 10 Apr 2024 16:44:19 +0100 Subject: [PATCH 035/130] fix unit tests and added more use cases --- pkg/parser/bicep/parser.go | 4 +++- pkg/parser/bicep/parser_test.go | 5 +++++ test/fixtures/bicep_test/resources.bicep | 10 ++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index d7d78b562c2..d246eb4ed45 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -290,7 +290,9 @@ func (s *BicepVisitor) VisitPrimaryExpression(ctx *parser.PrimaryExpressionConte return ctx.InterpString().Accept(s) } if ctx.MULTILINE_STRING() != nil { - return ctx.MULTILINE_STRING().GetText() + finalString := strings.ReplaceAll(ctx.MULTILINE_STRING().GetText(), "'''", "") + finalString = strings.ReplaceAll(finalString, "\r\n", "") + return finalString } if ctx.Array() != nil { return ctx.Array().Accept(s) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index d059c80b410..0115c55241d 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -219,6 +219,11 @@ func TestParseBicepFile(t *testing.T) { "type": "string", "defaultValue": "[resourceGroup().location]" }, + "parenthesis": { + "decorators": null, + "defaultValue": "simple-vm", + "type": "string" + }, "vmName": { "decorators": [ { diff --git a/test/fixtures/bicep_test/resources.bicep b/test/fixtures/bicep_test/resources.bicep index 2243e011c26..dc13d963d65 100644 --- a/test/fixtures/bicep_test/resources.bicep +++ b/test/fixtures/bicep_test/resources.bicep @@ -1,4 +1,6 @@ -@description('Username for the Virtual Machine.') +@description( + 'Username for the Virtual Machine.' +) param adminUsername string @description('Password for the Virtual Machine.') @@ -6,8 +8,10 @@ param adminUsername string @secure() param adminPassword string + @description( - 'The Windows version for the VM. This will pick a fully patched image of this given Windows version.' + '''The Windows version for the VM. + This will pick a fully patched image of this given Windows version.''' ) @allowed( [ @@ -38,6 +42,8 @@ param location string = resourceGroup().location @description('Name of the virtual machine.') param vmName string = 'simple-vm' +param parenthesis string = ('simple-vm') + var storageAccountName = 'bootdiags${uniqueString(resourceGroup().id)}' var nicName = 'myVMNic' From 3bccb1ab109e26df20801a836377736a04c62964 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 10 Apr 2024 16:49:29 +0100 Subject: [PATCH 036/130] lint fixes --- pkg/parser/bicep/parser.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index fc1dbd914bd..628fdbcc411 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -79,7 +79,6 @@ func (v *BicepVisitor) VisitProgram(ctx *parser.ProgramContext) interface{} { } func (s *BicepVisitor) VisitStatement(ctx *parser.StatementContext) interface{} { - if ctx.ParameterDecl() != nil { return ctx.ParameterDecl().Accept(s) } @@ -364,9 +363,9 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf str := "" for _, v := range interpString { switch v := v.(type) { - case (string): - str = str + v - case (map[string][]interface{}): + case string: + str += v + case map[string][]interface{}: for identifier, argumentList := range v { resStr := "[" + identifier + "(" for idx, arg := range argumentList { @@ -384,7 +383,6 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf str += resStr } } - } return str } From 53ece3a936c7291e043b52ff58adbfe81f0116b8 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 10 Apr 2024 16:57:33 +0100 Subject: [PATCH 037/130] lint fixes --- pkg/parser/bicep/parser.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index f24a806b09d..65690e57b90 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -211,7 +211,7 @@ Converts functioncall data (map of identifying string to slice of arguments) int "FunctionName(arg1, 2, arg3, Function2(arg4, arg5))" */ func parseFunctionCall(functionData map[string][]interface{}) string { - var stringifiedFunctionCall string = "" + stringifiedFunctionCall := "" for functionName, argumentList := range functionData { stringifiedFunctionCall += functionName + "(" @@ -347,8 +347,7 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf interpString = append(interpString, ctx.STRING_LEFT_PIECE().GetText()) if ctx.AllSTRING_MIDDLE_PIECE() != nil && (len(ctx.AllSTRING_MIDDLE_PIECE()) > 0) { for idx, val := range ctx.AllSTRING_MIDDLE_PIECE() { - interpString = append(interpString, ctx.Expression(idx).Accept(s)) - interpString = append(interpString, val.GetText()) + interpString = append(interpString, ctx.Expression(idx).Accept(s), val.GetText()) } } // Last expression with string right piece @@ -542,7 +541,6 @@ func (s *BicepVisitor) VisitArgumentList(ctx *parser.ArgumentListContext) interf } func (s *BicepVisitor) VisitTypeExpression(ctx *parser.TypeExpressionContext) interface{} { - return ctx.Identifier().Accept(s) } From 2aaaa9d22d5028cab221bada72e0ce49f635696f Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 10 Apr 2024 17:02:31 +0100 Subject: [PATCH 038/130] lint fix --- pkg/parser/bicep/parser.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 65690e57b90..deee6fb915c 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -351,8 +351,9 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf } } // Last expression with string right piece - interpString = append(interpString, ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())).Accept(s)) - interpString = append(interpString, ctx.STRING_RIGHT_PIECE().GetText()) + interpString = append(interpString, + ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())).Accept(s), + ctx.STRING_RIGHT_PIECE().GetText()) str := "" for _, v := range interpString { switch v := v.(type) { From d247454849125f40caf8b9a3d15f0a11d8401b4d Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 10 Apr 2024 17:04:12 +0100 Subject: [PATCH 039/130] fix linting problems --- pkg/analyzer/analyzer.go | 12 ++++++------ pkg/parser/bicep/parser.go | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/analyzer/analyzer.go b/pkg/analyzer/analyzer.go index 3b282fa2b84..c84518df920 100644 --- a/pkg/analyzer/analyzer.go +++ b/pkg/analyzer/analyzer.go @@ -396,12 +396,12 @@ func (a *analyzerInfo) worker(results, unwanted chan<- string, locCount chan<- i results <- terraform locCount <- linesCount } - // Bicep - case ".bicep": - if a.isAvailableType(bicep) { - results <- bicep - locCount <- linesCount - } + // Bicep + case ".bicep": + if a.isAvailableType(bicep) { + results <- bicep + locCount <- linesCount + } // GRPC case ".proto": if a.isAvailableType(grpc) { diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index deee6fb915c..771128c4b80 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -70,9 +70,9 @@ func (p *Parser) Parse(file string, _ []byte) ([]model.Document, []int, error) { return []model.Document{doc}, nil, nil } -func (v *BicepVisitor) VisitProgram(ctx *parser.ProgramContext) interface{} { +func (s *BicepVisitor) VisitProgram(ctx *parser.ProgramContext) interface{} { for _, val := range ctx.AllStatement() { - val.Accept(v) + val.Accept(s) } return nil From 8375b0c29c4e397367b0e74b580108b4c9797724 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 10 Apr 2024 17:37:44 +0100 Subject: [PATCH 040/130] fix gocyclo linting and constant parenthesis addition --- pkg/analyzer/analyzer.go | 2 +- pkg/parser/bicep/parser.go | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pkg/analyzer/analyzer.go b/pkg/analyzer/analyzer.go index c84518df920..58eeedd54e8 100644 --- a/pkg/analyzer/analyzer.go +++ b/pkg/analyzer/analyzer.go @@ -368,7 +368,7 @@ func Analyze(a *Analyzer) (model.AnalyzedPaths, error) { // worker determines the type of the file by ext (dockerfile and terraform)/content and // writes the answer to the results channel // if no types were found, the worker will write the path of the file in the unwanted channel -func (a *analyzerInfo) worker(results, unwanted chan<- string, locCount chan<- int, wg *sync.WaitGroup) { +func (a *analyzerInfo) worker(results, unwanted chan<- string, locCount chan<- int, wg *sync.WaitGroup) { //nolint: gocyclo defer wg.Done() ext, errExt := utils.GetExtension(a.filePath) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 771128c4b80..af4b092a5d0 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -26,6 +26,8 @@ type JSONBicep struct { Resources []interface{} `json:"resources"` } +const CLOSE_PARENTHESIS = "')" + func NewBicepVisitor() *BicepVisitor { paramList := map[string]interface{}{} varList := map[string]interface{}{} @@ -245,12 +247,12 @@ func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{ } for variable := range s.varList { if variable == identifier { - identifier = "variables('" + identifier + "')" + identifier = "variables('" + identifier + CLOSE_PARENTHESIS } } for parameter := range s.paramList { if parameter == identifier { - identifier = "parameters('" + identifier + "')" + identifier = "parameters('" + identifier + CLOSE_PARENTHESIS } } exp := ctx.Expression(0).Accept(s) @@ -290,7 +292,8 @@ func (s *BicepVisitor) VisitPrimaryExpression(ctx *parser.PrimaryExpressionConte } if ctx.MULTILINE_STRING() != nil { finalString := strings.ReplaceAll(ctx.MULTILINE_STRING().GetText(), "'''", "") - finalString = strings.ReplaceAll(finalString, "\r\n", "") + finalString = strings.ReplaceAll(finalString, "\r", "") + finalString = strings.ReplaceAll(finalString, "\n", "") return finalString } if ctx.Array() != nil { @@ -327,12 +330,12 @@ func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interf } for variable := range s.varList { if variable == identifier { - identifier = "variables('" + identifier + "')" + identifier = "variables('" + identifier + CLOSE_PARENTHESIS } } for parameter := range s.paramList { if parameter == identifier { - identifier = "parameters('" + identifier + "')" + identifier = "parameters('" + identifier + CLOSE_PARENTHESIS } } return identifier From 537f32bec5608494374b3f9eb24878c7fe066a39 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 10 Apr 2024 17:41:37 +0100 Subject: [PATCH 041/130] fix naming const variable to camel case --- pkg/parser/bicep/parser.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index af4b092a5d0..cbc86db3e20 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -26,7 +26,7 @@ type JSONBicep struct { Resources []interface{} `json:"resources"` } -const CLOSE_PARENTHESIS = "')" +const CloseParenthesis = "')" func NewBicepVisitor() *BicepVisitor { paramList := map[string]interface{}{} @@ -247,12 +247,12 @@ func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{ } for variable := range s.varList { if variable == identifier { - identifier = "variables('" + identifier + CLOSE_PARENTHESIS + identifier = "variables('" + identifier + CloseParenthesis } } for parameter := range s.paramList { if parameter == identifier { - identifier = "parameters('" + identifier + CLOSE_PARENTHESIS + identifier = "parameters('" + identifier + CloseParenthesis } } exp := ctx.Expression(0).Accept(s) @@ -330,12 +330,12 @@ func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interf } for variable := range s.varList { if variable == identifier { - identifier = "variables('" + identifier + CLOSE_PARENTHESIS + identifier = "variables('" + identifier + CloseParenthesis } } for parameter := range s.paramList { if parameter == identifier { - identifier = "parameters('" + identifier + CLOSE_PARENTHESIS + identifier = "parameters('" + identifier + CloseParenthesis } } return identifier From 27592fc1b6ff6b56f3aa4bb142c3b9b56e7de7e7 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 11 Apr 2024 14:52:19 +0100 Subject: [PATCH 042/130] fix decorator parsing and unit tests --- pkg/parser/bicep/parser.go | 71 +++++++---- pkg/parser/bicep/parser_test.go | 204 ++++++++++++-------------------- 2 files changed, 118 insertions(+), 157 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index cbc86db3e20..1c7cbde348f 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -21,9 +21,10 @@ type BicepVisitor struct { } type JSONBicep struct { - Parameters map[string]interface{} `json:"parameters"` - Variables map[string]interface{} `json:"variables"` - Resources []interface{} `json:"resources"` + Parameters map[string]interface{} `json:"parameters"` + Variables map[string]interface{} `json:"variables"` + Resources []interface{} `json:"resources"` + Lines map[string]model.LineObject `json:"_kics_lines"` } const CloseParenthesis = "')" @@ -32,6 +33,7 @@ func NewBicepVisitor() *BicepVisitor { paramList := map[string]interface{}{} varList := map[string]interface{}{} resourceList := []interface{}{} + return &BicepVisitor{paramList: paramList, varList: varList, resourceList: resourceList} } @@ -40,6 +42,7 @@ func convertVisitorToJSONBicep(visitor *BicepVisitor) *JSONBicep { Parameters: visitor.paramList, Variables: visitor.varList, Resources: visitor.resourceList, + Lines: make(map[string]model.LineObject), } } @@ -94,8 +97,31 @@ func (s *BicepVisitor) VisitStatement(ctx *parser.StatementContext) interface{} return nil } +func parseDecorators(decorators []parser.IDecoratorContext, s *BicepVisitor) map[string]interface{} { + decoratorsMap := map[string]interface{}{} + + for _, val := range decorators { + decorator, ok := val.Accept(s).(map[string][]interface{}) + if !ok { + return nil + } + for name, values := range decorator { + if name == "description" { + metadata := map[string]interface{}{} + metadata["description"] = values[0] + decoratorsMap["metadata"] = metadata + } else if name == "maxLength" || name == "minLength" || name == "minValue" || name == "maxValue" { + decoratorsMap[name] = values[0] + } else { + decoratorsMap[name] = values + } + } + } + + return decoratorsMap +} + func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) interface{} { - var decorators []interface{} param := map[string]interface{}{} identifier, ok := ctx.Identifier().Accept(s).(string) if !ok { @@ -120,46 +146,39 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte typeExpression := ctx.TypeExpression().Accept(s) param["type"] = typeExpression } - - for _, val := range ctx.AllDecorator() { - decorator, ok := val.Accept(s).(map[string][]interface{}) - if !ok { - return nil - } - if _, ok := decorator["secure"]; ok { + decoratorsMap := parseDecorators(ctx.AllDecorator(), s) + for name, values := range decoratorsMap { + if name == "secure" { if param["type"] == "string" { param["type"] = "secureString" } else if param["type"] == "object" { param["type"] = "secureObject" } } else { - if _, ok := decorator["allowed"]; ok { - newDecorator := map[string][]interface{}{} - newDecorator["allowedValues"] = decorator["allowed"] - decorators = append(decorators, newDecorator) + if name == "allowed" { + param["allowedValues"] = decoratorsMap["allowed"] } else { - decorators = append(decorators, decorator) + param[name] = values } } } - param["decorators"] = decorators + s.paramList[identifier] = param return nil } func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interface{} { var variable = map[string]interface{}{} - var decorators []interface{} identifier, ok := ctx.Identifier().Accept(s).(string) if !ok { return nil } expression := ctx.Expression().Accept(s) - - for _, val := range ctx.AllDecorator() { - decorators = append(decorators, val.Accept(s)) + decoratorsMap := parseDecorators(ctx.AllDecorator(), s) + for name, values := range decoratorsMap { + variable[name] = values } - variable["decorators"] = decorators + variable["value"] = expression s.varList[identifier] = variable @@ -168,7 +187,6 @@ func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interf func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interface{} { resource := map[string]interface{}{} - var decorators []interface{} interpString, ok := ctx.InterpString().Accept(s).(string) if !ok { return nil @@ -181,10 +199,11 @@ func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interf apiVersion := strings.Split(interpString, "@")[1] resource["type"] = resourceType resource["apiVersion"] = apiVersion - for _, val := range ctx.AllDecorator() { - decorators = append(decorators, val.Accept(s)) + decoratorsMap := parseDecorators(ctx.AllDecorator(), s) + for name, values := range decoratorsMap { + resource[name] = values } - resource["decorators"] = decorators + resource["name"] = identifier if ctx.Object() != nil { object, ok := ctx.Object().Accept(s).(map[string]interface{}) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 0115c55241d..4a341b0ac5f 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -67,48 +67,32 @@ func TestParseBicepFile(t *testing.T) { want: `{ "parameters": { "isNumber": { - "decorators": [ - { - "description": [ - "This is a test bool param declaration." - ] - } - ], - "type": "bool", - "defaultValue": true + "defaultValue": true, + "metadata": { + "description": "This is a test bool param declaration." + }, + "type": "bool" }, "middleString": { - "decorators": [ - { - "description": [ - "This is a test middle string param declaration." - ] - } - ], - "type": "string", - "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'" + "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'", + "metadata": { + "description": "This is a test middle string param declaration." + }, + "type": "string" }, "numberNodes": { - "decorators": [ - { - "description": [ - "This is a test int param declaration." - ] - } - ], - "type": "int", - "defaultValue": 2 + "defaultValue": 2, + "metadata": { + "description": "This is a test int param declaration." + }, + "type": "int" }, "projectName": { - "decorators": [ - { - "description": [ - "This is a test param with secure declaration." - ] - } - ], - "type": "secureString", - "defaultValue": "test" + "defaultValue": "test", + "metadata": { + "description": "This is a test param with secure declaration." + }, + "type": "secureString" } }, "resources": [], @@ -122,23 +106,15 @@ func TestParseBicepFile(t *testing.T) { want: `{ "variables": { "nicName": { - "decorators": [ - { - "description": [ - "This is a test var declaration." - ] - } - ], + "metadata": { + "description": "This is a test var declaration." + }, "value": "myVMNic" }, "storageAccountName": { - "decorators": [ - { - "description": [ - "This is a test var declaration." - ] - } - ], + "metadata": { + "description": "This is a test var declaration." + }, "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" } }, @@ -153,104 +129,72 @@ func TestParseBicepFile(t *testing.T) { want: `{ "parameters": { "OSVersion": { - "decorators": [ - { - "description": [ - "The Windows version for the VM. This will pick a fully patched image of this given Windows version." - ] - }, - { - "allowedValues": [ - [ - "2008-R2-SP1", - "2012-Datacenter", - "2012-R2-Datacenter", - "2016-Nano-Server", - "2016-Datacenter-with-Containers", - "2016-Datacenter", - "2019-Datacenter", - "2019-Datacenter-Core", - "2019-Datacenter-Core-smalldisk", - "2019-Datacenter-Core-with-Containers", - "2019-Datacenter-Core-with-Containers-smalldisk", - "2019-Datacenter-smalldisk", - "2019-Datacenter-with-Containers", - "2019-Datacenter-with-Containers-smalldisk" - ] - ] - } + "allowedValues": [ + [ + "2008-R2-SP1", + "2012-Datacenter", + "2012-R2-Datacenter", + "2016-Nano-Server", + "2016-Datacenter-with-Containers", + "2016-Datacenter", + "2019-Datacenter", + "2019-Datacenter-Core", + "2019-Datacenter-Core-smalldisk", + "2019-Datacenter-Core-with-Containers", + "2019-Datacenter-Core-with-Containers-smalldisk", + "2019-Datacenter-smalldisk", + "2019-Datacenter-with-Containers", + "2019-Datacenter-with-Containers-smalldisk" + ] ], - "type": "string", - "defaultValue": "2019-Datacenter" + "defaultValue": "2019-Datacenter", + "metadata": { + "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version." + }, + "type": "string" }, "adminPassword": { - "decorators": [ - { - "description": [ - "Password for the Virtual Machine." - ] - }, - { - "minLength": [ - 12 - ] - } - ], + "metadata": { + "description": "Password for the Virtual Machine." + }, + "minLength": 12, "type": "secureString" }, "adminUsername": { - "decorators": [ - { - "description": [ - "Username for the Virtual Machine." - ] - } - ], + "metadata": { + "description": "Username for the Virtual Machine." + }, "type": "string" }, "location": { - "decorators": [ - { - "description": [ - "Location for all resources." - ] - } - ], - "type": "string", - "defaultValue": "[resourceGroup().location]" + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location for all resources." + }, + "type": "string" }, "parenthesis": { - "decorators": null, "defaultValue": "simple-vm", "type": "string" }, "vmName": { - "decorators": [ - { - "description": [ - "Name of the virtual machine." - ] - } - ], - "type": "string", - "defaultValue": "simple-vm" + "defaultValue": "simple-vm", + "metadata": { + "description": "Name of the virtual machine." + }, + "type": "string" }, "vmSize": { - "decorators": [ - { - "description": [ - "Size of the virtual machine." - ] - } - ], - "type": "string", - "defaultValue": "Standard_D2_v3" + "defaultValue": "Standard_D2_v3", + "metadata": { + "description": "Size of the virtual machine." + }, + "type": "string" } }, "resources": [ { "apiVersion": "2021-03-01", - "decorators": null, "dependsOn": [ { "resourceId": [ @@ -265,8 +209,8 @@ func TestParseBicepFile(t *testing.T) { ] } ], - "name": "[parameters('vmName')]", "location": "[parameters('location')]", + "name": "[parameters('vmName')]", "properties": { "diagnosticsProfile": { "bootDiagnostics": { @@ -290,9 +234,9 @@ func TestParseBicepFile(t *testing.T) { ] }, "osProfile": { - "computerName": "[parameters('vmName')]", "adminPassword": "[parameters('adminPassword')]", - "adminUsername": "[parameters('adminUsername')]" + "adminUsername": "[parameters('adminUsername')]", + "computerName": "[parameters('vmName')]" }, "storageProfile": { "dataDisks": [ @@ -321,11 +265,9 @@ func TestParseBicepFile(t *testing.T) { ], "variables": { "nicName": { - "decorators": null, "value": "myVMNic" }, "storageAccountName": { - "decorators": null, "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" } } From 1b49631854c4e3fe7d418c6a149321217737e31b Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 11 Apr 2024 17:00:14 +0100 Subject: [PATCH 043/130] grammar update to ignore fors --- pkg/parser/bicep/antlr/bicep.g4 | 70 +- pkg/parser/bicep/antlr/parser/bicep.interp | 27 +- pkg/parser/bicep/antlr/parser/bicep.tokens | 30 +- .../bicep/antlr/parser/bicepLexer.interp | 32 +- .../bicep/antlr/parser/bicepLexer.tokens | 30 +- .../bicep/antlr/parser/bicep_base_visitor.go | 20 + pkg/parser/bicep/antlr/parser/bicep_lexer.go | 269 +-- pkg/parser/bicep/antlr/parser/bicep_parser.go | 1833 +++++++++++++---- .../bicep/antlr/parser/bicep_visitor.go | 15 + pkg/parser/bicep/parser.go | 11 +- 10 files changed, 1854 insertions(+), 483 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index 38ea1bba6de..fabfcdaa895 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -24,9 +24,32 @@ variableDecl: // resourceDecl -> decorator* "resource" IDENTIFIER(name) interpString(type) "existing"? "=" (ifCondition | object | forExpression) NL resourceDecl: decorator* RESOURCE name = identifier type = interpString ASSIGN ( - object + ifCondition + | object + | forExpression ) NL; +// ifCondition -> "if" parenthesizedExpression object +ifCondition + : IF parenthesizedExpression object + ; + +// forExpression -> "[" "for" (IDENTIFIER(item) | forVariableBlock) "in" expression ":" forBody "]" +forExpression + : OBRACK NL* FOR (item = identifier | forVariableBlock) IN expression COL forBody NL* CBRACK + ; + +// forVariableBlock -> "(" IDENTIFIER(item) "," IDENTIFIER(index) ")" +forVariableBlock + : OPAR item = identifier COMMA index = identifier CPAR + ; + +// forBody -> expression(body) | ifCondition +forBody + : body = expression + | ifCondition + ; + // interpString -> stringLeftPiece ( expression stringMiddlePiece )* expression stringRightPiece | stringComplete interpString: STRING_LEFT_PIECE (expression STRING_MIDDLE_PIECE)* expression STRING_RIGHT_PIECE @@ -36,10 +59,14 @@ interpString: // ":" IDENTIFIER(name) expression: expression OBRACK expression CBRACK + | expression QMARK expression COL expression | expression DOT property = identifier | expression COL name = identifier + | expression logicCharacter expression | primaryExpression; +logicCharacter: (GT | GTE | LT | LTE | EQ | NEQ); + // primaryExpression -> literalValue | interpString | multilineString | array | object | // parenthesizedExpression primaryExpression: @@ -49,6 +76,7 @@ primaryExpression: | MULTILINE_STRING | array | object + | forExpression | parenthesizedExpression; // parenthesizedExpression -> "(" expression ")" @@ -156,6 +184,46 @@ INT: 'int'; BOOL: 'bool'; +IF + : 'if' + ; + +FOR + : 'for' + ; + +IN + : 'in' + ; + +QMARK + : '?' + ; + +GT + : '>' + ; + +GTE + : '>=' + ; + +LT + : '<' + ; + +LTE + : '<=' + ; + +EQ + : '==' + ; + +NEQ + : '!=' + ; + IDENTIFIER: [a-zA-Z_] [a-zA-Z_0-9]*; NUMBER: [0-9]+ ('.' [0-9]+)?; diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index fcd3a3b520a..e8ffc34c57a 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -27,6 +27,16 @@ null 'string' 'int' 'bool' +'if' +'for' +'in' +'?' +'>' +'>=' +'<' +'<=' +'==' +'!=' null null null @@ -62,6 +72,16 @@ STRING_COMPLETE STRING INT BOOL +IF +FOR +IN +QMARK +GT +GTE +LT +LTE +EQ +NEQ IDENTIFIER NUMBER NL @@ -75,8 +95,13 @@ parameterDecl parameterDefaultValue variableDecl resourceDecl +ifCondition +forExpression +forVariableBlock +forBody interpString expression +logicCharacter primaryExpression parenthesizedExpression typeExpression @@ -93,4 +118,4 @@ identifier atn: -[4, 1, 32, 257, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 55, 8, 1, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 67, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 72, 8, 2, 3, 2, 74, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 82, 8, 4, 10, 4, 12, 4, 85, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 94, 8, 5, 10, 5, 12, 5, 97, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 119, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 147, 8, 8, 1, 9, 1, 9, 3, 9, 151, 8, 9, 1, 9, 1, 9, 3, 9, 155, 8, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 166, 8, 11, 1, 12, 1, 12, 4, 12, 170, 8, 12, 11, 12, 12, 12, 171, 1, 12, 1, 12, 4, 12, 176, 8, 12, 11, 12, 12, 12, 177, 5, 12, 180, 8, 12, 10, 12, 12, 12, 183, 9, 12, 3, 12, 185, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 191, 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 198, 8, 14, 10, 14, 12, 14, 201, 9, 14, 1, 14, 5, 14, 204, 8, 14, 10, 14, 12, 14, 207, 9, 14, 1, 14, 1, 14, 1, 15, 1, 15, 4, 15, 213, 8, 15, 11, 15, 12, 15, 214, 1, 15, 3, 15, 218, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 229, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 234, 8, 18, 1, 18, 3, 18, 237, 8, 18, 1, 18, 3, 18, 240, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 3, 19, 247, 8, 19, 1, 19, 5, 19, 250, 8, 19, 10, 19, 12, 19, 253, 9, 19, 1, 20, 1, 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 20, 25, 28, 278, 0, 45, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, 0, 14, 120, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, 1, 0, 0, 0, 22, 165, 1, 0, 0, 0, 24, 167, 1, 0, 0, 0, 26, 190, 1, 0, 0, 0, 28, 195, 1, 0, 0, 0, 30, 210, 1, 0, 0, 0, 32, 219, 1, 0, 0, 0, 34, 228, 1, 0, 0, 0, 36, 230, 1, 0, 0, 0, 38, 243, 1, 0, 0, 0, 40, 254, 1, 0, 0, 0, 42, 44, 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, 4, 0, 52, 55, 3, 10, 5, 0, 53, 55, 5, 30, 0, 0, 54, 50, 1, 0, 0, 0, 54, 51, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, 0, 56, 58, 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 63, 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, 3, 6, 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, 68, 69, 5, 20, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, 68, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 30, 0, 0, 76, 5, 1, 0, 0, 0, 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, 3, 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, 7, 0, 90, 91, 5, 30, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 20, 0, 0, 99, 100, 3, 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 30, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 21, 0, 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 22, 0, 0, 108, 110, 1, 0, 0, 0, 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 3, 14, 7, 0, 115, 116, 5, 23, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, 24, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 121, 6, 7, -1, 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, 123, 124, 10, 4, 0, 0, 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 147, 3, 22, 11, 0, 140, 147, 3, 36, 18, 0, 141, 147, 3, 12, 6, 0, 142, 147, 5, 1, 0, 0, 143, 147, 3, 28, 14, 0, 144, 147, 3, 24, 12, 0, 145, 147, 3, 18, 9, 0, 146, 139, 1, 0, 0, 0, 146, 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0, 146, 143, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 145, 1, 0, 0, 0, 147, 17, 1, 0, 0, 0, 148, 150, 5, 6, 0, 0, 149, 151, 5, 30, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 3, 14, 7, 0, 153, 155, 5, 30, 0, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 7, 0, 0, 157, 19, 1, 0, 0, 0, 158, 159, 3, 40, 20, 0, 159, 21, 1, 0, 0, 0, 160, 166, 5, 29, 0, 0, 161, 166, 5, 16, 0, 0, 162, 166, 5, 17, 0, 0, 163, 166, 5, 18, 0, 0, 164, 166, 3, 40, 20, 0, 165, 160, 1, 0, 0, 0, 165, 161, 1, 0, 0, 0, 165, 162, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 164, 1, 0, 0, 0, 166, 23, 1, 0, 0, 0, 167, 184, 5, 12, 0, 0, 168, 170, 5, 30, 0, 0, 169, 168, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 181, 1, 0, 0, 0, 173, 175, 3, 26, 13, 0, 174, 176, 5, 30, 0, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 180, 1, 0, 0, 0, 179, 173, 1, 0, 0, 0, 180, 183, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 184, 169, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 187, 5, 13, 0, 0, 187, 25, 1, 0, 0, 0, 188, 191, 3, 40, 20, 0, 189, 191, 3, 12, 6, 0, 190, 188, 1, 0, 0, 0, 190, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 10, 0, 0, 193, 194, 3, 14, 7, 0, 194, 27, 1, 0, 0, 0, 195, 199, 5, 4, 0, 0, 196, 198, 5, 30, 0, 0, 197, 196, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 205, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 204, 3, 30, 15, 0, 203, 202, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 208, 1, 0, 0, 0, 207, 205, 1, 0, 0, 0, 208, 209, 5, 5, 0, 0, 209, 29, 1, 0, 0, 0, 210, 217, 3, 14, 7, 0, 211, 213, 5, 30, 0, 0, 212, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 218, 1, 0, 0, 0, 216, 218, 5, 3, 0, 0, 217, 212, 1, 0, 0, 0, 217, 216, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 31, 1, 0, 0, 0, 219, 220, 5, 2, 0, 0, 220, 221, 3, 34, 17, 0, 221, 222, 5, 30, 0, 0, 222, 33, 1, 0, 0, 0, 223, 229, 3, 36, 18, 0, 224, 225, 3, 14, 7, 0, 225, 226, 5, 8, 0, 0, 226, 227, 3, 36, 18, 0, 227, 229, 1, 0, 0, 0, 228, 223, 1, 0, 0, 0, 228, 224, 1, 0, 0, 0, 229, 35, 1, 0, 0, 0, 230, 231, 3, 40, 20, 0, 231, 236, 5, 6, 0, 0, 232, 234, 5, 30, 0, 0, 233, 232, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 237, 3, 38, 19, 0, 236, 233, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 239, 1, 0, 0, 0, 238, 240, 5, 30, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 5, 7, 0, 0, 242, 37, 1, 0, 0, 0, 243, 251, 3, 14, 7, 0, 244, 246, 5, 3, 0, 0, 245, 247, 5, 30, 0, 0, 246, 245, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 250, 3, 14, 7, 0, 249, 244, 1, 0, 0, 0, 250, 253, 1, 0, 0, 0, 251, 249, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 39, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, 254, 255, 7, 0, 0, 0, 255, 41, 1, 0, 0, 0, 31, 45, 54, 59, 66, 71, 73, 83, 95, 111, 118, 134, 136, 146, 150, 154, 165, 171, 177, 181, 184, 190, 199, 205, 214, 217, 228, 233, 236, 239, 246, 251] \ No newline at end of file +[4, 1, 42, 322, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 1, 0, 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 65, 8, 1, 1, 2, 5, 2, 68, 8, 2, 10, 2, 12, 2, 71, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 77, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 82, 8, 2, 3, 2, 84, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 92, 8, 4, 10, 4, 12, 4, 95, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 104, 8, 5, 10, 5, 12, 5, 107, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 5, 7, 126, 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 7, 1, 7, 1, 7, 3, 7, 134, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 141, 8, 7, 10, 7, 12, 7, 144, 9, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 156, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 171, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 197, 8, 11, 10, 11, 12, 11, 200, 9, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 212, 8, 13, 1, 14, 1, 14, 3, 14, 216, 8, 14, 1, 14, 1, 14, 3, 14, 220, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 231, 8, 16, 1, 17, 1, 17, 4, 17, 235, 8, 17, 11, 17, 12, 17, 236, 1, 17, 1, 17, 4, 17, 241, 8, 17, 11, 17, 12, 17, 242, 5, 17, 245, 8, 17, 10, 17, 12, 17, 248, 9, 17, 3, 17, 250, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 256, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 263, 8, 19, 10, 19, 12, 19, 266, 9, 19, 1, 19, 5, 19, 269, 8, 19, 10, 19, 12, 19, 272, 9, 19, 1, 19, 1, 19, 1, 20, 1, 20, 4, 20, 278, 8, 20, 11, 20, 12, 20, 279, 1, 20, 3, 20, 283, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 294, 8, 22, 1, 23, 1, 23, 1, 23, 3, 23, 299, 8, 23, 1, 23, 3, 23, 302, 8, 23, 1, 23, 3, 23, 305, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 3, 24, 312, 8, 24, 1, 24, 5, 24, 315, 8, 24, 10, 24, 12, 24, 318, 9, 24, 1, 25, 1, 25, 1, 25, 0, 1, 22, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, 2, 1, 0, 32, 37, 3, 0, 14, 20, 25, 27, 38, 38, 347, 0, 55, 1, 0, 0, 0, 2, 64, 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, 87, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 105, 1, 0, 0, 0, 12, 119, 1, 0, 0, 0, 14, 123, 1, 0, 0, 0, 16, 147, 1, 0, 0, 0, 18, 155, 1, 0, 0, 0, 20, 170, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 201, 1, 0, 0, 0, 26, 211, 1, 0, 0, 0, 28, 213, 1, 0, 0, 0, 30, 223, 1, 0, 0, 0, 32, 230, 1, 0, 0, 0, 34, 232, 1, 0, 0, 0, 36, 255, 1, 0, 0, 0, 38, 260, 1, 0, 0, 0, 40, 275, 1, 0, 0, 0, 42, 284, 1, 0, 0, 0, 44, 293, 1, 0, 0, 0, 46, 295, 1, 0, 0, 0, 48, 308, 1, 0, 0, 0, 50, 319, 1, 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 58, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 0, 0, 1, 59, 1, 1, 0, 0, 0, 60, 65, 3, 4, 2, 0, 61, 65, 3, 8, 4, 0, 62, 65, 3, 10, 5, 0, 63, 65, 5, 40, 0, 0, 64, 60, 1, 0, 0, 0, 64, 61, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 63, 1, 0, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 42, 21, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 14, 0, 0, 73, 83, 3, 50, 25, 0, 74, 76, 3, 30, 15, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 84, 1, 0, 0, 0, 78, 79, 5, 20, 0, 0, 79, 81, 3, 20, 10, 0, 80, 82, 3, 6, 3, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 74, 1, 0, 0, 0, 83, 78, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 5, 40, 0, 0, 86, 5, 1, 0, 0, 0, 87, 88, 5, 11, 0, 0, 88, 89, 3, 22, 11, 0, 89, 7, 1, 0, 0, 0, 90, 92, 3, 42, 21, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 15, 0, 0, 97, 98, 3, 50, 25, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 22, 11, 0, 100, 101, 5, 40, 0, 0, 101, 9, 1, 0, 0, 0, 102, 104, 3, 42, 21, 0, 103, 102, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 5, 20, 0, 0, 109, 110, 3, 50, 25, 0, 110, 111, 3, 20, 10, 0, 111, 115, 5, 11, 0, 0, 112, 116, 3, 12, 6, 0, 113, 116, 3, 34, 17, 0, 114, 116, 3, 14, 7, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 11, 1, 0, 0, 0, 119, 120, 5, 28, 0, 0, 120, 121, 3, 28, 14, 0, 121, 122, 3, 34, 17, 0, 122, 13, 1, 0, 0, 0, 123, 127, 5, 4, 0, 0, 124, 126, 5, 40, 0, 0, 125, 124, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 133, 5, 29, 0, 0, 131, 134, 3, 50, 25, 0, 132, 134, 3, 16, 8, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 30, 0, 0, 136, 137, 3, 22, 11, 0, 137, 138, 5, 10, 0, 0, 138, 142, 3, 18, 9, 0, 139, 141, 5, 40, 0, 0, 140, 139, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 5, 5, 0, 0, 146, 15, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, 3, 50, 25, 0, 149, 150, 5, 3, 0, 0, 150, 151, 3, 50, 25, 0, 151, 152, 5, 7, 0, 0, 152, 17, 1, 0, 0, 0, 153, 156, 3, 22, 11, 0, 154, 156, 3, 12, 6, 0, 155, 153, 1, 0, 0, 0, 155, 154, 1, 0, 0, 0, 156, 19, 1, 0, 0, 0, 157, 163, 5, 21, 0, 0, 158, 159, 3, 22, 11, 0, 159, 160, 5, 22, 0, 0, 160, 162, 1, 0, 0, 0, 161, 158, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 167, 3, 22, 11, 0, 167, 168, 5, 23, 0, 0, 168, 171, 1, 0, 0, 0, 169, 171, 5, 24, 0, 0, 170, 157, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, 21, 1, 0, 0, 0, 172, 173, 6, 11, -1, 0, 173, 174, 3, 26, 13, 0, 174, 198, 1, 0, 0, 0, 175, 176, 10, 5, 0, 0, 176, 177, 5, 31, 0, 0, 177, 178, 3, 22, 11, 0, 178, 179, 5, 10, 0, 0, 179, 180, 3, 22, 11, 6, 180, 197, 1, 0, 0, 0, 181, 182, 10, 2, 0, 0, 182, 183, 3, 24, 12, 0, 183, 184, 3, 22, 11, 3, 184, 197, 1, 0, 0, 0, 185, 186, 10, 6, 0, 0, 186, 187, 5, 4, 0, 0, 187, 188, 3, 22, 11, 0, 188, 189, 5, 5, 0, 0, 189, 197, 1, 0, 0, 0, 190, 191, 10, 4, 0, 0, 191, 192, 5, 8, 0, 0, 192, 197, 3, 50, 25, 0, 193, 194, 10, 3, 0, 0, 194, 195, 5, 10, 0, 0, 195, 197, 3, 50, 25, 0, 196, 175, 1, 0, 0, 0, 196, 181, 1, 0, 0, 0, 196, 185, 1, 0, 0, 0, 196, 190, 1, 0, 0, 0, 196, 193, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 23, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 202, 7, 0, 0, 0, 202, 25, 1, 0, 0, 0, 203, 212, 3, 32, 16, 0, 204, 212, 3, 46, 23, 0, 205, 212, 3, 20, 10, 0, 206, 212, 5, 1, 0, 0, 207, 212, 3, 38, 19, 0, 208, 212, 3, 34, 17, 0, 209, 212, 3, 14, 7, 0, 210, 212, 3, 28, 14, 0, 211, 203, 1, 0, 0, 0, 211, 204, 1, 0, 0, 0, 211, 205, 1, 0, 0, 0, 211, 206, 1, 0, 0, 0, 211, 207, 1, 0, 0, 0, 211, 208, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 211, 210, 1, 0, 0, 0, 212, 27, 1, 0, 0, 0, 213, 215, 5, 6, 0, 0, 214, 216, 5, 40, 0, 0, 215, 214, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 219, 3, 22, 11, 0, 218, 220, 5, 40, 0, 0, 219, 218, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, 5, 7, 0, 0, 222, 29, 1, 0, 0, 0, 223, 224, 3, 50, 25, 0, 224, 31, 1, 0, 0, 0, 225, 231, 5, 39, 0, 0, 226, 231, 5, 16, 0, 0, 227, 231, 5, 17, 0, 0, 228, 231, 5, 18, 0, 0, 229, 231, 3, 50, 25, 0, 230, 225, 1, 0, 0, 0, 230, 226, 1, 0, 0, 0, 230, 227, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, 229, 1, 0, 0, 0, 231, 33, 1, 0, 0, 0, 232, 249, 5, 12, 0, 0, 233, 235, 5, 40, 0, 0, 234, 233, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 234, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 246, 1, 0, 0, 0, 238, 240, 3, 36, 18, 0, 239, 241, 5, 40, 0, 0, 240, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 245, 1, 0, 0, 0, 244, 238, 1, 0, 0, 0, 245, 248, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 250, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 249, 234, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 5, 13, 0, 0, 252, 35, 1, 0, 0, 0, 253, 256, 3, 50, 25, 0, 254, 256, 3, 20, 10, 0, 255, 253, 1, 0, 0, 0, 255, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 258, 5, 10, 0, 0, 258, 259, 3, 22, 11, 0, 259, 37, 1, 0, 0, 0, 260, 264, 5, 4, 0, 0, 261, 263, 5, 40, 0, 0, 262, 261, 1, 0, 0, 0, 263, 266, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 270, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 267, 269, 3, 40, 20, 0, 268, 267, 1, 0, 0, 0, 269, 272, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 273, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 273, 274, 5, 5, 0, 0, 274, 39, 1, 0, 0, 0, 275, 282, 3, 22, 11, 0, 276, 278, 5, 40, 0, 0, 277, 276, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 283, 5, 3, 0, 0, 282, 277, 1, 0, 0, 0, 282, 281, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 41, 1, 0, 0, 0, 284, 285, 5, 2, 0, 0, 285, 286, 3, 44, 22, 0, 286, 287, 5, 40, 0, 0, 287, 43, 1, 0, 0, 0, 288, 294, 3, 46, 23, 0, 289, 290, 3, 22, 11, 0, 290, 291, 5, 8, 0, 0, 291, 292, 3, 46, 23, 0, 292, 294, 1, 0, 0, 0, 293, 288, 1, 0, 0, 0, 293, 289, 1, 0, 0, 0, 294, 45, 1, 0, 0, 0, 295, 296, 3, 50, 25, 0, 296, 301, 5, 6, 0, 0, 297, 299, 5, 40, 0, 0, 298, 297, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 302, 3, 48, 24, 0, 301, 298, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 304, 1, 0, 0, 0, 303, 305, 5, 40, 0, 0, 304, 303, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 5, 7, 0, 0, 307, 47, 1, 0, 0, 0, 308, 316, 3, 22, 11, 0, 309, 311, 5, 3, 0, 0, 310, 312, 5, 40, 0, 0, 311, 310, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 315, 3, 22, 11, 0, 314, 309, 1, 0, 0, 0, 315, 318, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 49, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 319, 320, 7, 1, 0, 0, 320, 51, 1, 0, 0, 0, 36, 55, 64, 69, 76, 81, 83, 93, 105, 115, 127, 133, 142, 155, 163, 170, 196, 198, 211, 215, 219, 230, 236, 242, 246, 249, 255, 264, 270, 279, 282, 293, 298, 301, 304, 311, 316] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep.tokens b/pkg/parser/bicep/antlr/parser/bicep.tokens index 7a1cd2ad76d..c1bbbeed110 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.tokens +++ b/pkg/parser/bicep/antlr/parser/bicep.tokens @@ -25,11 +25,21 @@ STRING_COMPLETE=24 STRING=25 INT=26 BOOL=27 -IDENTIFIER=28 -NUMBER=29 -NL=30 -SPACES=31 -UNKNOWN=32 +IF=28 +FOR=29 +IN=30 +QMARK=31 +GT=32 +GTE=33 +LT=34 +LTE=35 +EQ=36 +NEQ=37 +IDENTIFIER=38 +NUMBER=39 +NL=40 +SPACES=41 +UNKNOWN=42 '@'=2 ','=3 '['=4 @@ -52,3 +62,13 @@ UNKNOWN=32 'string'=25 'int'=26 'bool'=27 +'if'=28 +'for'=29 +'in'=30 +'?'=31 +'>'=32 +'>='=33 +'<'=34 +'<='=35 +'=='=36 +'!='=37 diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.interp b/pkg/parser/bicep/antlr/parser/bicepLexer.interp index b00ab7bfbb8..b945dd0e350 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.interp +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.interp @@ -27,6 +27,16 @@ null 'string' 'int' 'bool' +'if' +'for' +'in' +'?' +'>' +'>=' +'<' +'<=' +'==' +'!=' null null null @@ -62,6 +72,16 @@ STRING_COMPLETE STRING INT BOOL +IF +FOR +IN +QMARK +GT +GTE +LT +LTE +EQ +NEQ IDENTIFIER NUMBER NL @@ -96,6 +116,16 @@ STRING_COMPLETE STRING INT BOOL +IF +FOR +IN +QMARK +GT +GTE +LT +LTE +EQ +NEQ IDENTIFIER NUMBER NL @@ -113,4 +143,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 32, 259, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 77, 8, 0, 10, 0, 12, 0, 80, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 154, 8, 20, 10, 20, 12, 20, 157, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 164, 8, 21, 10, 21, 12, 21, 167, 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 174, 8, 22, 10, 22, 12, 22, 177, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 183, 8, 23, 10, 23, 12, 23, 186, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 5, 27, 208, 8, 27, 10, 27, 12, 27, 211, 9, 27, 1, 28, 4, 28, 214, 8, 28, 11, 28, 12, 28, 215, 1, 28, 1, 28, 4, 28, 220, 8, 28, 11, 28, 12, 28, 221, 3, 28, 224, 8, 28, 1, 29, 4, 29, 227, 8, 29, 11, 29, 12, 29, 228, 1, 30, 4, 30, 232, 8, 30, 11, 30, 12, 30, 233, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 3, 32, 242, 8, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 4, 33, 250, 8, 33, 11, 33, 12, 33, 251, 1, 33, 1, 33, 3, 33, 256, 8, 33, 1, 34, 1, 34, 1, 78, 0, 35, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 0, 67, 0, 69, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 269, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 1, 71, 1, 0, 0, 0, 3, 85, 1, 0, 0, 0, 5, 87, 1, 0, 0, 0, 7, 89, 1, 0, 0, 0, 9, 91, 1, 0, 0, 0, 11, 93, 1, 0, 0, 0, 13, 95, 1, 0, 0, 0, 15, 97, 1, 0, 0, 0, 17, 99, 1, 0, 0, 0, 19, 101, 1, 0, 0, 0, 21, 103, 1, 0, 0, 0, 23, 105, 1, 0, 0, 0, 25, 107, 1, 0, 0, 0, 27, 109, 1, 0, 0, 0, 29, 115, 1, 0, 0, 0, 31, 119, 1, 0, 0, 0, 33, 124, 1, 0, 0, 0, 35, 130, 1, 0, 0, 0, 37, 135, 1, 0, 0, 0, 39, 142, 1, 0, 0, 0, 41, 151, 1, 0, 0, 0, 43, 161, 1, 0, 0, 0, 45, 171, 1, 0, 0, 0, 47, 180, 1, 0, 0, 0, 49, 189, 1, 0, 0, 0, 51, 196, 1, 0, 0, 0, 53, 200, 1, 0, 0, 0, 55, 205, 1, 0, 0, 0, 57, 213, 1, 0, 0, 0, 59, 226, 1, 0, 0, 0, 61, 231, 1, 0, 0, 0, 63, 237, 1, 0, 0, 0, 65, 241, 1, 0, 0, 0, 67, 243, 1, 0, 0, 0, 69, 257, 1, 0, 0, 0, 71, 72, 5, 39, 0, 0, 72, 73, 5, 39, 0, 0, 73, 74, 5, 39, 0, 0, 74, 78, 1, 0, 0, 0, 75, 77, 9, 0, 0, 0, 76, 75, 1, 0, 0, 0, 77, 80, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 79, 81, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 81, 82, 5, 39, 0, 0, 82, 83, 5, 39, 0, 0, 83, 84, 5, 39, 0, 0, 84, 2, 1, 0, 0, 0, 85, 86, 5, 64, 0, 0, 86, 4, 1, 0, 0, 0, 87, 88, 5, 44, 0, 0, 88, 6, 1, 0, 0, 0, 89, 90, 5, 91, 0, 0, 90, 8, 1, 0, 0, 0, 91, 92, 5, 93, 0, 0, 92, 10, 1, 0, 0, 0, 93, 94, 5, 40, 0, 0, 94, 12, 1, 0, 0, 0, 95, 96, 5, 41, 0, 0, 96, 14, 1, 0, 0, 0, 97, 98, 5, 46, 0, 0, 98, 16, 1, 0, 0, 0, 99, 100, 5, 124, 0, 0, 100, 18, 1, 0, 0, 0, 101, 102, 5, 58, 0, 0, 102, 20, 1, 0, 0, 0, 103, 104, 5, 61, 0, 0, 104, 22, 1, 0, 0, 0, 105, 106, 5, 123, 0, 0, 106, 24, 1, 0, 0, 0, 107, 108, 5, 125, 0, 0, 108, 26, 1, 0, 0, 0, 109, 110, 5, 112, 0, 0, 110, 111, 5, 97, 0, 0, 111, 112, 5, 114, 0, 0, 112, 113, 5, 97, 0, 0, 113, 114, 5, 109, 0, 0, 114, 28, 1, 0, 0, 0, 115, 116, 5, 118, 0, 0, 116, 117, 5, 97, 0, 0, 117, 118, 5, 114, 0, 0, 118, 30, 1, 0, 0, 0, 119, 120, 5, 116, 0, 0, 120, 121, 5, 114, 0, 0, 121, 122, 5, 117, 0, 0, 122, 123, 5, 101, 0, 0, 123, 32, 1, 0, 0, 0, 124, 125, 5, 102, 0, 0, 125, 126, 5, 97, 0, 0, 126, 127, 5, 108, 0, 0, 127, 128, 5, 115, 0, 0, 128, 129, 5, 101, 0, 0, 129, 34, 1, 0, 0, 0, 130, 131, 5, 110, 0, 0, 131, 132, 5, 117, 0, 0, 132, 133, 5, 108, 0, 0, 133, 134, 5, 108, 0, 0, 134, 36, 1, 0, 0, 0, 135, 136, 5, 111, 0, 0, 136, 137, 5, 98, 0, 0, 137, 138, 5, 106, 0, 0, 138, 139, 5, 101, 0, 0, 139, 140, 5, 99, 0, 0, 140, 141, 5, 116, 0, 0, 141, 38, 1, 0, 0, 0, 142, 143, 5, 114, 0, 0, 143, 144, 5, 101, 0, 0, 144, 145, 5, 115, 0, 0, 145, 146, 5, 111, 0, 0, 146, 147, 5, 117, 0, 0, 147, 148, 5, 114, 0, 0, 148, 149, 5, 99, 0, 0, 149, 150, 5, 101, 0, 0, 150, 40, 1, 0, 0, 0, 151, 155, 5, 39, 0, 0, 152, 154, 3, 65, 32, 0, 153, 152, 1, 0, 0, 0, 154, 157, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 158, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 158, 159, 5, 36, 0, 0, 159, 160, 5, 123, 0, 0, 160, 42, 1, 0, 0, 0, 161, 165, 5, 125, 0, 0, 162, 164, 3, 65, 32, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 36, 0, 0, 169, 170, 5, 123, 0, 0, 170, 44, 1, 0, 0, 0, 171, 175, 5, 125, 0, 0, 172, 174, 3, 65, 32, 0, 173, 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 39, 0, 0, 179, 46, 1, 0, 0, 0, 180, 184, 5, 39, 0, 0, 181, 183, 3, 65, 32, 0, 182, 181, 1, 0, 0, 0, 183, 186, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 187, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 187, 188, 5, 39, 0, 0, 188, 48, 1, 0, 0, 0, 189, 190, 5, 115, 0, 0, 190, 191, 5, 116, 0, 0, 191, 192, 5, 114, 0, 0, 192, 193, 5, 105, 0, 0, 193, 194, 5, 110, 0, 0, 194, 195, 5, 103, 0, 0, 195, 50, 1, 0, 0, 0, 196, 197, 5, 105, 0, 0, 197, 198, 5, 110, 0, 0, 198, 199, 5, 116, 0, 0, 199, 52, 1, 0, 0, 0, 200, 201, 5, 98, 0, 0, 201, 202, 5, 111, 0, 0, 202, 203, 5, 111, 0, 0, 203, 204, 5, 108, 0, 0, 204, 54, 1, 0, 0, 0, 205, 209, 7, 0, 0, 0, 206, 208, 7, 1, 0, 0, 207, 206, 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 56, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 212, 214, 7, 2, 0, 0, 213, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 223, 1, 0, 0, 0, 217, 219, 5, 46, 0, 0, 218, 220, 7, 2, 0, 0, 219, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 224, 1, 0, 0, 0, 223, 217, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 58, 1, 0, 0, 0, 225, 227, 7, 3, 0, 0, 226, 225, 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 60, 1, 0, 0, 0, 230, 232, 7, 4, 0, 0, 231, 230, 1, 0, 0, 0, 232, 233, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 236, 6, 30, 0, 0, 236, 62, 1, 0, 0, 0, 237, 238, 9, 0, 0, 0, 238, 64, 1, 0, 0, 0, 239, 242, 8, 5, 0, 0, 240, 242, 3, 67, 33, 0, 241, 239, 1, 0, 0, 0, 241, 240, 1, 0, 0, 0, 242, 66, 1, 0, 0, 0, 243, 255, 5, 92, 0, 0, 244, 256, 7, 6, 0, 0, 245, 246, 5, 117, 0, 0, 246, 247, 5, 123, 0, 0, 247, 249, 1, 0, 0, 0, 248, 250, 3, 69, 34, 0, 249, 248, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 249, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 254, 5, 125, 0, 0, 254, 256, 1, 0, 0, 0, 255, 244, 1, 0, 0, 0, 255, 245, 1, 0, 0, 0, 256, 68, 1, 0, 0, 0, 257, 258, 7, 7, 0, 0, 258, 70, 1, 0, 0, 0, 15, 0, 78, 155, 165, 175, 184, 209, 215, 221, 223, 228, 233, 241, 251, 255, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 42, 307, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 97, 8, 0, 10, 0, 12, 0, 100, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 174, 8, 20, 10, 20, 12, 20, 177, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 184, 8, 21, 10, 21, 12, 21, 187, 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 194, 8, 22, 10, 22, 12, 22, 197, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 203, 8, 23, 10, 23, 12, 23, 206, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 5, 37, 256, 8, 37, 10, 37, 12, 37, 259, 9, 37, 1, 38, 4, 38, 262, 8, 38, 11, 38, 12, 38, 263, 1, 38, 1, 38, 4, 38, 268, 8, 38, 11, 38, 12, 38, 269, 3, 38, 272, 8, 38, 1, 39, 4, 39, 275, 8, 39, 11, 39, 12, 39, 276, 1, 40, 4, 40, 280, 8, 40, 11, 40, 12, 40, 281, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 3, 42, 290, 8, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 298, 8, 43, 11, 43, 12, 43, 299, 1, 43, 1, 43, 3, 43, 304, 8, 43, 1, 44, 1, 44, 1, 98, 0, 45, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 0, 87, 0, 89, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 317, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 1, 91, 1, 0, 0, 0, 3, 105, 1, 0, 0, 0, 5, 107, 1, 0, 0, 0, 7, 109, 1, 0, 0, 0, 9, 111, 1, 0, 0, 0, 11, 113, 1, 0, 0, 0, 13, 115, 1, 0, 0, 0, 15, 117, 1, 0, 0, 0, 17, 119, 1, 0, 0, 0, 19, 121, 1, 0, 0, 0, 21, 123, 1, 0, 0, 0, 23, 125, 1, 0, 0, 0, 25, 127, 1, 0, 0, 0, 27, 129, 1, 0, 0, 0, 29, 135, 1, 0, 0, 0, 31, 139, 1, 0, 0, 0, 33, 144, 1, 0, 0, 0, 35, 150, 1, 0, 0, 0, 37, 155, 1, 0, 0, 0, 39, 162, 1, 0, 0, 0, 41, 171, 1, 0, 0, 0, 43, 181, 1, 0, 0, 0, 45, 191, 1, 0, 0, 0, 47, 200, 1, 0, 0, 0, 49, 209, 1, 0, 0, 0, 51, 216, 1, 0, 0, 0, 53, 220, 1, 0, 0, 0, 55, 225, 1, 0, 0, 0, 57, 228, 1, 0, 0, 0, 59, 232, 1, 0, 0, 0, 61, 235, 1, 0, 0, 0, 63, 237, 1, 0, 0, 0, 65, 239, 1, 0, 0, 0, 67, 242, 1, 0, 0, 0, 69, 244, 1, 0, 0, 0, 71, 247, 1, 0, 0, 0, 73, 250, 1, 0, 0, 0, 75, 253, 1, 0, 0, 0, 77, 261, 1, 0, 0, 0, 79, 274, 1, 0, 0, 0, 81, 279, 1, 0, 0, 0, 83, 285, 1, 0, 0, 0, 85, 289, 1, 0, 0, 0, 87, 291, 1, 0, 0, 0, 89, 305, 1, 0, 0, 0, 91, 92, 5, 39, 0, 0, 92, 93, 5, 39, 0, 0, 93, 94, 5, 39, 0, 0, 94, 98, 1, 0, 0, 0, 95, 97, 9, 0, 0, 0, 96, 95, 1, 0, 0, 0, 97, 100, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, 102, 5, 39, 0, 0, 102, 103, 5, 39, 0, 0, 103, 104, 5, 39, 0, 0, 104, 2, 1, 0, 0, 0, 105, 106, 5, 64, 0, 0, 106, 4, 1, 0, 0, 0, 107, 108, 5, 44, 0, 0, 108, 6, 1, 0, 0, 0, 109, 110, 5, 91, 0, 0, 110, 8, 1, 0, 0, 0, 111, 112, 5, 93, 0, 0, 112, 10, 1, 0, 0, 0, 113, 114, 5, 40, 0, 0, 114, 12, 1, 0, 0, 0, 115, 116, 5, 41, 0, 0, 116, 14, 1, 0, 0, 0, 117, 118, 5, 46, 0, 0, 118, 16, 1, 0, 0, 0, 119, 120, 5, 124, 0, 0, 120, 18, 1, 0, 0, 0, 121, 122, 5, 58, 0, 0, 122, 20, 1, 0, 0, 0, 123, 124, 5, 61, 0, 0, 124, 22, 1, 0, 0, 0, 125, 126, 5, 123, 0, 0, 126, 24, 1, 0, 0, 0, 127, 128, 5, 125, 0, 0, 128, 26, 1, 0, 0, 0, 129, 130, 5, 112, 0, 0, 130, 131, 5, 97, 0, 0, 131, 132, 5, 114, 0, 0, 132, 133, 5, 97, 0, 0, 133, 134, 5, 109, 0, 0, 134, 28, 1, 0, 0, 0, 135, 136, 5, 118, 0, 0, 136, 137, 5, 97, 0, 0, 137, 138, 5, 114, 0, 0, 138, 30, 1, 0, 0, 0, 139, 140, 5, 116, 0, 0, 140, 141, 5, 114, 0, 0, 141, 142, 5, 117, 0, 0, 142, 143, 5, 101, 0, 0, 143, 32, 1, 0, 0, 0, 144, 145, 5, 102, 0, 0, 145, 146, 5, 97, 0, 0, 146, 147, 5, 108, 0, 0, 147, 148, 5, 115, 0, 0, 148, 149, 5, 101, 0, 0, 149, 34, 1, 0, 0, 0, 150, 151, 5, 110, 0, 0, 151, 152, 5, 117, 0, 0, 152, 153, 5, 108, 0, 0, 153, 154, 5, 108, 0, 0, 154, 36, 1, 0, 0, 0, 155, 156, 5, 111, 0, 0, 156, 157, 5, 98, 0, 0, 157, 158, 5, 106, 0, 0, 158, 159, 5, 101, 0, 0, 159, 160, 5, 99, 0, 0, 160, 161, 5, 116, 0, 0, 161, 38, 1, 0, 0, 0, 162, 163, 5, 114, 0, 0, 163, 164, 5, 101, 0, 0, 164, 165, 5, 115, 0, 0, 165, 166, 5, 111, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, 5, 114, 0, 0, 168, 169, 5, 99, 0, 0, 169, 170, 5, 101, 0, 0, 170, 40, 1, 0, 0, 0, 171, 175, 5, 39, 0, 0, 172, 174, 3, 85, 42, 0, 173, 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 36, 0, 0, 179, 180, 5, 123, 0, 0, 180, 42, 1, 0, 0, 0, 181, 185, 5, 125, 0, 0, 182, 184, 3, 85, 42, 0, 183, 182, 1, 0, 0, 0, 184, 187, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 188, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 188, 189, 5, 36, 0, 0, 189, 190, 5, 123, 0, 0, 190, 44, 1, 0, 0, 0, 191, 195, 5, 125, 0, 0, 192, 194, 3, 85, 42, 0, 193, 192, 1, 0, 0, 0, 194, 197, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 198, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 199, 5, 39, 0, 0, 199, 46, 1, 0, 0, 0, 200, 204, 5, 39, 0, 0, 201, 203, 3, 85, 42, 0, 202, 201, 1, 0, 0, 0, 203, 206, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 207, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 207, 208, 5, 39, 0, 0, 208, 48, 1, 0, 0, 0, 209, 210, 5, 115, 0, 0, 210, 211, 5, 116, 0, 0, 211, 212, 5, 114, 0, 0, 212, 213, 5, 105, 0, 0, 213, 214, 5, 110, 0, 0, 214, 215, 5, 103, 0, 0, 215, 50, 1, 0, 0, 0, 216, 217, 5, 105, 0, 0, 217, 218, 5, 110, 0, 0, 218, 219, 5, 116, 0, 0, 219, 52, 1, 0, 0, 0, 220, 221, 5, 98, 0, 0, 221, 222, 5, 111, 0, 0, 222, 223, 5, 111, 0, 0, 223, 224, 5, 108, 0, 0, 224, 54, 1, 0, 0, 0, 225, 226, 5, 105, 0, 0, 226, 227, 5, 102, 0, 0, 227, 56, 1, 0, 0, 0, 228, 229, 5, 102, 0, 0, 229, 230, 5, 111, 0, 0, 230, 231, 5, 114, 0, 0, 231, 58, 1, 0, 0, 0, 232, 233, 5, 105, 0, 0, 233, 234, 5, 110, 0, 0, 234, 60, 1, 0, 0, 0, 235, 236, 5, 63, 0, 0, 236, 62, 1, 0, 0, 0, 237, 238, 5, 62, 0, 0, 238, 64, 1, 0, 0, 0, 239, 240, 5, 62, 0, 0, 240, 241, 5, 61, 0, 0, 241, 66, 1, 0, 0, 0, 242, 243, 5, 60, 0, 0, 243, 68, 1, 0, 0, 0, 244, 245, 5, 60, 0, 0, 245, 246, 5, 61, 0, 0, 246, 70, 1, 0, 0, 0, 247, 248, 5, 61, 0, 0, 248, 249, 5, 61, 0, 0, 249, 72, 1, 0, 0, 0, 250, 251, 5, 33, 0, 0, 251, 252, 5, 61, 0, 0, 252, 74, 1, 0, 0, 0, 253, 257, 7, 0, 0, 0, 254, 256, 7, 1, 0, 0, 255, 254, 1, 0, 0, 0, 256, 259, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 76, 1, 0, 0, 0, 259, 257, 1, 0, 0, 0, 260, 262, 7, 2, 0, 0, 261, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 271, 1, 0, 0, 0, 265, 267, 5, 46, 0, 0, 266, 268, 7, 2, 0, 0, 267, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 272, 1, 0, 0, 0, 271, 265, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 78, 1, 0, 0, 0, 273, 275, 7, 3, 0, 0, 274, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 80, 1, 0, 0, 0, 278, 280, 7, 4, 0, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, 6, 40, 0, 0, 284, 82, 1, 0, 0, 0, 285, 286, 9, 0, 0, 0, 286, 84, 1, 0, 0, 0, 287, 290, 8, 5, 0, 0, 288, 290, 3, 87, 43, 0, 289, 287, 1, 0, 0, 0, 289, 288, 1, 0, 0, 0, 290, 86, 1, 0, 0, 0, 291, 303, 5, 92, 0, 0, 292, 304, 7, 6, 0, 0, 293, 294, 5, 117, 0, 0, 294, 295, 5, 123, 0, 0, 295, 297, 1, 0, 0, 0, 296, 298, 3, 89, 44, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 302, 5, 125, 0, 0, 302, 304, 1, 0, 0, 0, 303, 292, 1, 0, 0, 0, 303, 293, 1, 0, 0, 0, 304, 88, 1, 0, 0, 0, 305, 306, 7, 7, 0, 0, 306, 90, 1, 0, 0, 0, 15, 0, 98, 175, 185, 195, 204, 257, 263, 269, 271, 276, 281, 289, 299, 303, 1, 6, 0, 0] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens index 7a1cd2ad76d..c1bbbeed110 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens @@ -25,11 +25,21 @@ STRING_COMPLETE=24 STRING=25 INT=26 BOOL=27 -IDENTIFIER=28 -NUMBER=29 -NL=30 -SPACES=31 -UNKNOWN=32 +IF=28 +FOR=29 +IN=30 +QMARK=31 +GT=32 +GTE=33 +LT=34 +LTE=35 +EQ=36 +NEQ=37 +IDENTIFIER=38 +NUMBER=39 +NL=40 +SPACES=41 +UNKNOWN=42 '@'=2 ','=3 '['=4 @@ -52,3 +62,13 @@ UNKNOWN=32 'string'=25 'int'=26 'bool'=27 +'if'=28 +'for'=29 +'in'=30 +'?'=31 +'>'=32 +'>='=33 +'<'=34 +'<='=35 +'=='=36 +'!='=37 diff --git a/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go index 06eb42a8b6e..b344a2aaa6e 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go +++ b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go @@ -32,6 +32,22 @@ func (v *BasebicepVisitor) VisitResourceDecl(ctx *ResourceDeclContext) interface return v.VisitChildren(ctx) } +func (v *BasebicepVisitor) VisitIfCondition(ctx *IfConditionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitForExpression(ctx *ForExpressionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitForVariableBlock(ctx *ForVariableBlockContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitForBody(ctx *ForBodyContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BasebicepVisitor) VisitInterpString(ctx *InterpStringContext) interface{} { return v.VisitChildren(ctx) } @@ -40,6 +56,10 @@ func (v *BasebicepVisitor) VisitExpression(ctx *ExpressionContext) interface{} { return v.VisitChildren(ctx) } +func (v *BasebicepVisitor) VisitLogicCharacter(ctx *LogicCharacterContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BasebicepVisitor) VisitPrimaryExpression(ctx *PrimaryExpressionContext) interface{} { return v.VisitChildren(ctx) } diff --git a/pkg/parser/bicep/antlr/parser/bicep_lexer.go b/pkg/parser/bicep/antlr/parser/bicep_lexer.go index 1c55541aab4..622bb84b36b 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_lexer.go +++ b/pkg/parser/bicep/antlr/parser/bicep_lexer.go @@ -46,140 +46,165 @@ func biceplexerLexerInit() { "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", "'object'", "'resource'", "", "", "", "", "'string'", "'int'", "'bool'", + "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", "'=='", + "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", - "INT", "BOOL", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", + "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", + "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", } staticData.RuleNames = []string{ "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", - "INT", "BOOL", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "STRINGCHAR", + "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", + "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "STRINGCHAR", "ESCAPE", "HEX", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 32, 259, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 42, 307, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, - 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 5, 0, 77, 8, 0, 10, 0, 12, 0, 80, 9, 0, 1, 0, 1, 0, 1, 0, 1, - 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, - 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, - 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, - 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, - 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, - 1, 19, 1, 20, 1, 20, 5, 20, 154, 8, 20, 10, 20, 12, 20, 157, 9, 20, 1, - 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 164, 8, 21, 10, 21, 12, 21, 167, - 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 174, 8, 22, 10, 22, 12, - 22, 177, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 183, 8, 23, 10, 23, - 12, 23, 186, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, - 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, - 1, 27, 1, 27, 5, 27, 208, 8, 27, 10, 27, 12, 27, 211, 9, 27, 1, 28, 4, - 28, 214, 8, 28, 11, 28, 12, 28, 215, 1, 28, 1, 28, 4, 28, 220, 8, 28, 11, - 28, 12, 28, 221, 3, 28, 224, 8, 28, 1, 29, 4, 29, 227, 8, 29, 11, 29, 12, - 29, 228, 1, 30, 4, 30, 232, 8, 30, 11, 30, 12, 30, 233, 1, 30, 1, 30, 1, - 31, 1, 31, 1, 32, 1, 32, 3, 32, 242, 8, 32, 1, 33, 1, 33, 1, 33, 1, 33, - 1, 33, 1, 33, 4, 33, 250, 8, 33, 11, 33, 12, 33, 251, 1, 33, 1, 33, 3, - 33, 256, 8, 33, 1, 34, 1, 34, 1, 78, 0, 35, 1, 1, 3, 2, 5, 3, 7, 4, 9, - 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, - 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, - 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, - 65, 0, 67, 0, 69, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, - 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, - 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, - 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, - 102, 269, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, - 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, - 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, - 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, - 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, - 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, - 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, - 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, - 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 1, 71, 1, 0, 0, 0, 3, 85, 1, 0, 0, 0, 5, - 87, 1, 0, 0, 0, 7, 89, 1, 0, 0, 0, 9, 91, 1, 0, 0, 0, 11, 93, 1, 0, 0, - 0, 13, 95, 1, 0, 0, 0, 15, 97, 1, 0, 0, 0, 17, 99, 1, 0, 0, 0, 19, 101, - 1, 0, 0, 0, 21, 103, 1, 0, 0, 0, 23, 105, 1, 0, 0, 0, 25, 107, 1, 0, 0, - 0, 27, 109, 1, 0, 0, 0, 29, 115, 1, 0, 0, 0, 31, 119, 1, 0, 0, 0, 33, 124, - 1, 0, 0, 0, 35, 130, 1, 0, 0, 0, 37, 135, 1, 0, 0, 0, 39, 142, 1, 0, 0, - 0, 41, 151, 1, 0, 0, 0, 43, 161, 1, 0, 0, 0, 45, 171, 1, 0, 0, 0, 47, 180, - 1, 0, 0, 0, 49, 189, 1, 0, 0, 0, 51, 196, 1, 0, 0, 0, 53, 200, 1, 0, 0, - 0, 55, 205, 1, 0, 0, 0, 57, 213, 1, 0, 0, 0, 59, 226, 1, 0, 0, 0, 61, 231, - 1, 0, 0, 0, 63, 237, 1, 0, 0, 0, 65, 241, 1, 0, 0, 0, 67, 243, 1, 0, 0, - 0, 69, 257, 1, 0, 0, 0, 71, 72, 5, 39, 0, 0, 72, 73, 5, 39, 0, 0, 73, 74, - 5, 39, 0, 0, 74, 78, 1, 0, 0, 0, 75, 77, 9, 0, 0, 0, 76, 75, 1, 0, 0, 0, - 77, 80, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 79, 81, 1, - 0, 0, 0, 80, 78, 1, 0, 0, 0, 81, 82, 5, 39, 0, 0, 82, 83, 5, 39, 0, 0, - 83, 84, 5, 39, 0, 0, 84, 2, 1, 0, 0, 0, 85, 86, 5, 64, 0, 0, 86, 4, 1, - 0, 0, 0, 87, 88, 5, 44, 0, 0, 88, 6, 1, 0, 0, 0, 89, 90, 5, 91, 0, 0, 90, - 8, 1, 0, 0, 0, 91, 92, 5, 93, 0, 0, 92, 10, 1, 0, 0, 0, 93, 94, 5, 40, - 0, 0, 94, 12, 1, 0, 0, 0, 95, 96, 5, 41, 0, 0, 96, 14, 1, 0, 0, 0, 97, - 98, 5, 46, 0, 0, 98, 16, 1, 0, 0, 0, 99, 100, 5, 124, 0, 0, 100, 18, 1, - 0, 0, 0, 101, 102, 5, 58, 0, 0, 102, 20, 1, 0, 0, 0, 103, 104, 5, 61, 0, - 0, 104, 22, 1, 0, 0, 0, 105, 106, 5, 123, 0, 0, 106, 24, 1, 0, 0, 0, 107, - 108, 5, 125, 0, 0, 108, 26, 1, 0, 0, 0, 109, 110, 5, 112, 0, 0, 110, 111, - 5, 97, 0, 0, 111, 112, 5, 114, 0, 0, 112, 113, 5, 97, 0, 0, 113, 114, 5, - 109, 0, 0, 114, 28, 1, 0, 0, 0, 115, 116, 5, 118, 0, 0, 116, 117, 5, 97, - 0, 0, 117, 118, 5, 114, 0, 0, 118, 30, 1, 0, 0, 0, 119, 120, 5, 116, 0, - 0, 120, 121, 5, 114, 0, 0, 121, 122, 5, 117, 0, 0, 122, 123, 5, 101, 0, - 0, 123, 32, 1, 0, 0, 0, 124, 125, 5, 102, 0, 0, 125, 126, 5, 97, 0, 0, - 126, 127, 5, 108, 0, 0, 127, 128, 5, 115, 0, 0, 128, 129, 5, 101, 0, 0, - 129, 34, 1, 0, 0, 0, 130, 131, 5, 110, 0, 0, 131, 132, 5, 117, 0, 0, 132, - 133, 5, 108, 0, 0, 133, 134, 5, 108, 0, 0, 134, 36, 1, 0, 0, 0, 135, 136, - 5, 111, 0, 0, 136, 137, 5, 98, 0, 0, 137, 138, 5, 106, 0, 0, 138, 139, - 5, 101, 0, 0, 139, 140, 5, 99, 0, 0, 140, 141, 5, 116, 0, 0, 141, 38, 1, - 0, 0, 0, 142, 143, 5, 114, 0, 0, 143, 144, 5, 101, 0, 0, 144, 145, 5, 115, - 0, 0, 145, 146, 5, 111, 0, 0, 146, 147, 5, 117, 0, 0, 147, 148, 5, 114, - 0, 0, 148, 149, 5, 99, 0, 0, 149, 150, 5, 101, 0, 0, 150, 40, 1, 0, 0, - 0, 151, 155, 5, 39, 0, 0, 152, 154, 3, 65, 32, 0, 153, 152, 1, 0, 0, 0, - 154, 157, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, - 158, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 158, 159, 5, 36, 0, 0, 159, 160, - 5, 123, 0, 0, 160, 42, 1, 0, 0, 0, 161, 165, 5, 125, 0, 0, 162, 164, 3, - 65, 32, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, - 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, - 168, 169, 5, 36, 0, 0, 169, 170, 5, 123, 0, 0, 170, 44, 1, 0, 0, 0, 171, - 175, 5, 125, 0, 0, 172, 174, 3, 65, 32, 0, 173, 172, 1, 0, 0, 0, 174, 177, + 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, + 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, + 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 5, 0, 97, 8, 0, 10, 0, 12, 0, 100, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, + 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, + 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, + 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, + 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, + 19, 1, 20, 1, 20, 5, 20, 174, 8, 20, 10, 20, 12, 20, 177, 9, 20, 1, 20, + 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 184, 8, 21, 10, 21, 12, 21, 187, 9, + 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 194, 8, 22, 10, 22, 12, 22, + 197, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 203, 8, 23, 10, 23, 12, + 23, 206, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, + 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, + 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, + 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, + 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 5, 37, 256, + 8, 37, 10, 37, 12, 37, 259, 9, 37, 1, 38, 4, 38, 262, 8, 38, 11, 38, 12, + 38, 263, 1, 38, 1, 38, 4, 38, 268, 8, 38, 11, 38, 12, 38, 269, 3, 38, 272, + 8, 38, 1, 39, 4, 39, 275, 8, 39, 11, 39, 12, 39, 276, 1, 40, 4, 40, 280, + 8, 40, 11, 40, 12, 40, 281, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 3, + 42, 290, 8, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 298, 8, + 43, 11, 43, 12, 43, 299, 1, 43, 1, 43, 3, 43, 304, 8, 43, 1, 44, 1, 44, + 1, 98, 0, 45, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, + 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, + 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, + 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, + 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 0, 87, 0, 89, 0, 1, + 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, + 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, + 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, + 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 317, 0, 1, 1, 0, 0, + 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, + 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, + 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, + 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, + 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, + 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, + 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, + 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, + 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, + 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, + 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 1, 91, 1, 0, 0, 0, 3, + 105, 1, 0, 0, 0, 5, 107, 1, 0, 0, 0, 7, 109, 1, 0, 0, 0, 9, 111, 1, 0, + 0, 0, 11, 113, 1, 0, 0, 0, 13, 115, 1, 0, 0, 0, 15, 117, 1, 0, 0, 0, 17, + 119, 1, 0, 0, 0, 19, 121, 1, 0, 0, 0, 21, 123, 1, 0, 0, 0, 23, 125, 1, + 0, 0, 0, 25, 127, 1, 0, 0, 0, 27, 129, 1, 0, 0, 0, 29, 135, 1, 0, 0, 0, + 31, 139, 1, 0, 0, 0, 33, 144, 1, 0, 0, 0, 35, 150, 1, 0, 0, 0, 37, 155, + 1, 0, 0, 0, 39, 162, 1, 0, 0, 0, 41, 171, 1, 0, 0, 0, 43, 181, 1, 0, 0, + 0, 45, 191, 1, 0, 0, 0, 47, 200, 1, 0, 0, 0, 49, 209, 1, 0, 0, 0, 51, 216, + 1, 0, 0, 0, 53, 220, 1, 0, 0, 0, 55, 225, 1, 0, 0, 0, 57, 228, 1, 0, 0, + 0, 59, 232, 1, 0, 0, 0, 61, 235, 1, 0, 0, 0, 63, 237, 1, 0, 0, 0, 65, 239, + 1, 0, 0, 0, 67, 242, 1, 0, 0, 0, 69, 244, 1, 0, 0, 0, 71, 247, 1, 0, 0, + 0, 73, 250, 1, 0, 0, 0, 75, 253, 1, 0, 0, 0, 77, 261, 1, 0, 0, 0, 79, 274, + 1, 0, 0, 0, 81, 279, 1, 0, 0, 0, 83, 285, 1, 0, 0, 0, 85, 289, 1, 0, 0, + 0, 87, 291, 1, 0, 0, 0, 89, 305, 1, 0, 0, 0, 91, 92, 5, 39, 0, 0, 92, 93, + 5, 39, 0, 0, 93, 94, 5, 39, 0, 0, 94, 98, 1, 0, 0, 0, 95, 97, 9, 0, 0, + 0, 96, 95, 1, 0, 0, 0, 97, 100, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 98, 96, + 1, 0, 0, 0, 99, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, 102, 5, 39, + 0, 0, 102, 103, 5, 39, 0, 0, 103, 104, 5, 39, 0, 0, 104, 2, 1, 0, 0, 0, + 105, 106, 5, 64, 0, 0, 106, 4, 1, 0, 0, 0, 107, 108, 5, 44, 0, 0, 108, + 6, 1, 0, 0, 0, 109, 110, 5, 91, 0, 0, 110, 8, 1, 0, 0, 0, 111, 112, 5, + 93, 0, 0, 112, 10, 1, 0, 0, 0, 113, 114, 5, 40, 0, 0, 114, 12, 1, 0, 0, + 0, 115, 116, 5, 41, 0, 0, 116, 14, 1, 0, 0, 0, 117, 118, 5, 46, 0, 0, 118, + 16, 1, 0, 0, 0, 119, 120, 5, 124, 0, 0, 120, 18, 1, 0, 0, 0, 121, 122, + 5, 58, 0, 0, 122, 20, 1, 0, 0, 0, 123, 124, 5, 61, 0, 0, 124, 22, 1, 0, + 0, 0, 125, 126, 5, 123, 0, 0, 126, 24, 1, 0, 0, 0, 127, 128, 5, 125, 0, + 0, 128, 26, 1, 0, 0, 0, 129, 130, 5, 112, 0, 0, 130, 131, 5, 97, 0, 0, + 131, 132, 5, 114, 0, 0, 132, 133, 5, 97, 0, 0, 133, 134, 5, 109, 0, 0, + 134, 28, 1, 0, 0, 0, 135, 136, 5, 118, 0, 0, 136, 137, 5, 97, 0, 0, 137, + 138, 5, 114, 0, 0, 138, 30, 1, 0, 0, 0, 139, 140, 5, 116, 0, 0, 140, 141, + 5, 114, 0, 0, 141, 142, 5, 117, 0, 0, 142, 143, 5, 101, 0, 0, 143, 32, + 1, 0, 0, 0, 144, 145, 5, 102, 0, 0, 145, 146, 5, 97, 0, 0, 146, 147, 5, + 108, 0, 0, 147, 148, 5, 115, 0, 0, 148, 149, 5, 101, 0, 0, 149, 34, 1, + 0, 0, 0, 150, 151, 5, 110, 0, 0, 151, 152, 5, 117, 0, 0, 152, 153, 5, 108, + 0, 0, 153, 154, 5, 108, 0, 0, 154, 36, 1, 0, 0, 0, 155, 156, 5, 111, 0, + 0, 156, 157, 5, 98, 0, 0, 157, 158, 5, 106, 0, 0, 158, 159, 5, 101, 0, + 0, 159, 160, 5, 99, 0, 0, 160, 161, 5, 116, 0, 0, 161, 38, 1, 0, 0, 0, + 162, 163, 5, 114, 0, 0, 163, 164, 5, 101, 0, 0, 164, 165, 5, 115, 0, 0, + 165, 166, 5, 111, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, 5, 114, 0, 0, + 168, 169, 5, 99, 0, 0, 169, 170, 5, 101, 0, 0, 170, 40, 1, 0, 0, 0, 171, + 175, 5, 39, 0, 0, 172, 174, 3, 85, 42, 0, 173, 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, - 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 39, 0, 0, 179, 46, 1, 0, 0, 0, - 180, 184, 5, 39, 0, 0, 181, 183, 3, 65, 32, 0, 182, 181, 1, 0, 0, 0, 183, - 186, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 187, - 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 187, 188, 5, 39, 0, 0, 188, 48, 1, 0, - 0, 0, 189, 190, 5, 115, 0, 0, 190, 191, 5, 116, 0, 0, 191, 192, 5, 114, - 0, 0, 192, 193, 5, 105, 0, 0, 193, 194, 5, 110, 0, 0, 194, 195, 5, 103, - 0, 0, 195, 50, 1, 0, 0, 0, 196, 197, 5, 105, 0, 0, 197, 198, 5, 110, 0, - 0, 198, 199, 5, 116, 0, 0, 199, 52, 1, 0, 0, 0, 200, 201, 5, 98, 0, 0, - 201, 202, 5, 111, 0, 0, 202, 203, 5, 111, 0, 0, 203, 204, 5, 108, 0, 0, - 204, 54, 1, 0, 0, 0, 205, 209, 7, 0, 0, 0, 206, 208, 7, 1, 0, 0, 207, 206, - 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, - 0, 0, 210, 56, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 212, 214, 7, 2, 0, 0, - 213, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, - 216, 1, 0, 0, 0, 216, 223, 1, 0, 0, 0, 217, 219, 5, 46, 0, 0, 218, 220, - 7, 2, 0, 0, 219, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 219, 1, 0, - 0, 0, 221, 222, 1, 0, 0, 0, 222, 224, 1, 0, 0, 0, 223, 217, 1, 0, 0, 0, - 223, 224, 1, 0, 0, 0, 224, 58, 1, 0, 0, 0, 225, 227, 7, 3, 0, 0, 226, 225, - 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, - 0, 0, 229, 60, 1, 0, 0, 0, 230, 232, 7, 4, 0, 0, 231, 230, 1, 0, 0, 0, - 232, 233, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, - 235, 1, 0, 0, 0, 235, 236, 6, 30, 0, 0, 236, 62, 1, 0, 0, 0, 237, 238, - 9, 0, 0, 0, 238, 64, 1, 0, 0, 0, 239, 242, 8, 5, 0, 0, 240, 242, 3, 67, - 33, 0, 241, 239, 1, 0, 0, 0, 241, 240, 1, 0, 0, 0, 242, 66, 1, 0, 0, 0, - 243, 255, 5, 92, 0, 0, 244, 256, 7, 6, 0, 0, 245, 246, 5, 117, 0, 0, 246, - 247, 5, 123, 0, 0, 247, 249, 1, 0, 0, 0, 248, 250, 3, 69, 34, 0, 249, 248, - 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 249, 1, 0, 0, 0, 251, 252, 1, 0, - 0, 0, 252, 253, 1, 0, 0, 0, 253, 254, 5, 125, 0, 0, 254, 256, 1, 0, 0, - 0, 255, 244, 1, 0, 0, 0, 255, 245, 1, 0, 0, 0, 256, 68, 1, 0, 0, 0, 257, - 258, 7, 7, 0, 0, 258, 70, 1, 0, 0, 0, 15, 0, 78, 155, 165, 175, 184, 209, - 215, 221, 223, 228, 233, 241, 251, 255, 1, 6, 0, 0, + 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 36, 0, 0, 179, 180, 5, 123, 0, + 0, 180, 42, 1, 0, 0, 0, 181, 185, 5, 125, 0, 0, 182, 184, 3, 85, 42, 0, + 183, 182, 1, 0, 0, 0, 184, 187, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 185, + 186, 1, 0, 0, 0, 186, 188, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 188, 189, + 5, 36, 0, 0, 189, 190, 5, 123, 0, 0, 190, 44, 1, 0, 0, 0, 191, 195, 5, + 125, 0, 0, 192, 194, 3, 85, 42, 0, 193, 192, 1, 0, 0, 0, 194, 197, 1, 0, + 0, 0, 195, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 198, 1, 0, 0, 0, + 197, 195, 1, 0, 0, 0, 198, 199, 5, 39, 0, 0, 199, 46, 1, 0, 0, 0, 200, + 204, 5, 39, 0, 0, 201, 203, 3, 85, 42, 0, 202, 201, 1, 0, 0, 0, 203, 206, + 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 207, 1, 0, + 0, 0, 206, 204, 1, 0, 0, 0, 207, 208, 5, 39, 0, 0, 208, 48, 1, 0, 0, 0, + 209, 210, 5, 115, 0, 0, 210, 211, 5, 116, 0, 0, 211, 212, 5, 114, 0, 0, + 212, 213, 5, 105, 0, 0, 213, 214, 5, 110, 0, 0, 214, 215, 5, 103, 0, 0, + 215, 50, 1, 0, 0, 0, 216, 217, 5, 105, 0, 0, 217, 218, 5, 110, 0, 0, 218, + 219, 5, 116, 0, 0, 219, 52, 1, 0, 0, 0, 220, 221, 5, 98, 0, 0, 221, 222, + 5, 111, 0, 0, 222, 223, 5, 111, 0, 0, 223, 224, 5, 108, 0, 0, 224, 54, + 1, 0, 0, 0, 225, 226, 5, 105, 0, 0, 226, 227, 5, 102, 0, 0, 227, 56, 1, + 0, 0, 0, 228, 229, 5, 102, 0, 0, 229, 230, 5, 111, 0, 0, 230, 231, 5, 114, + 0, 0, 231, 58, 1, 0, 0, 0, 232, 233, 5, 105, 0, 0, 233, 234, 5, 110, 0, + 0, 234, 60, 1, 0, 0, 0, 235, 236, 5, 63, 0, 0, 236, 62, 1, 0, 0, 0, 237, + 238, 5, 62, 0, 0, 238, 64, 1, 0, 0, 0, 239, 240, 5, 62, 0, 0, 240, 241, + 5, 61, 0, 0, 241, 66, 1, 0, 0, 0, 242, 243, 5, 60, 0, 0, 243, 68, 1, 0, + 0, 0, 244, 245, 5, 60, 0, 0, 245, 246, 5, 61, 0, 0, 246, 70, 1, 0, 0, 0, + 247, 248, 5, 61, 0, 0, 248, 249, 5, 61, 0, 0, 249, 72, 1, 0, 0, 0, 250, + 251, 5, 33, 0, 0, 251, 252, 5, 61, 0, 0, 252, 74, 1, 0, 0, 0, 253, 257, + 7, 0, 0, 0, 254, 256, 7, 1, 0, 0, 255, 254, 1, 0, 0, 0, 256, 259, 1, 0, + 0, 0, 257, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 76, 1, 0, 0, 0, + 259, 257, 1, 0, 0, 0, 260, 262, 7, 2, 0, 0, 261, 260, 1, 0, 0, 0, 262, + 263, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 271, + 1, 0, 0, 0, 265, 267, 5, 46, 0, 0, 266, 268, 7, 2, 0, 0, 267, 266, 1, 0, + 0, 0, 268, 269, 1, 0, 0, 0, 269, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, + 270, 272, 1, 0, 0, 0, 271, 265, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, + 78, 1, 0, 0, 0, 273, 275, 7, 3, 0, 0, 274, 273, 1, 0, 0, 0, 275, 276, 1, + 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 80, 1, 0, 0, + 0, 278, 280, 7, 4, 0, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, + 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, + 6, 40, 0, 0, 284, 82, 1, 0, 0, 0, 285, 286, 9, 0, 0, 0, 286, 84, 1, 0, + 0, 0, 287, 290, 8, 5, 0, 0, 288, 290, 3, 87, 43, 0, 289, 287, 1, 0, 0, + 0, 289, 288, 1, 0, 0, 0, 290, 86, 1, 0, 0, 0, 291, 303, 5, 92, 0, 0, 292, + 304, 7, 6, 0, 0, 293, 294, 5, 117, 0, 0, 294, 295, 5, 123, 0, 0, 295, 297, + 1, 0, 0, 0, 296, 298, 3, 89, 44, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, + 0, 0, 0, 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 301, 1, 0, 0, + 0, 301, 302, 5, 125, 0, 0, 302, 304, 1, 0, 0, 0, 303, 292, 1, 0, 0, 0, + 303, 293, 1, 0, 0, 0, 304, 88, 1, 0, 0, 0, 305, 306, 7, 7, 0, 0, 306, 90, + 1, 0, 0, 0, 15, 0, 98, 175, 185, 195, 204, 257, 263, 269, 271, 276, 281, + 289, 299, 303, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -247,9 +272,19 @@ const ( bicepLexerSTRING = 25 bicepLexerINT = 26 bicepLexerBOOL = 27 - bicepLexerIDENTIFIER = 28 - bicepLexerNUMBER = 29 - bicepLexerNL = 30 - bicepLexerSPACES = 31 - bicepLexerUNKNOWN = 32 + bicepLexerIF = 28 + bicepLexerFOR = 29 + bicepLexerIN = 30 + bicepLexerQMARK = 31 + bicepLexerGT = 32 + bicepLexerGTE = 33 + bicepLexerLT = 34 + bicepLexerLTE = 35 + bicepLexerEQ = 36 + bicepLexerNEQ = 37 + bicepLexerIDENTIFIER = 38 + bicepLexerNUMBER = 39 + bicepLexerNL = 40 + bicepLexerSPACES = 41 + bicepLexerUNKNOWN = 42 ) diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 69587d32081..6a63fc20302 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -36,137 +36,171 @@ func bicepParserInit() { "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", "'object'", "'resource'", "", "", "", "", "'string'", "'int'", "'bool'", + "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", "'=='", + "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", - "INT", "BOOL", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", + "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", + "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", } staticData.RuleNames = []string{ "program", "statement", "parameterDecl", "parameterDefaultValue", "variableDecl", - "resourceDecl", "interpString", "expression", "primaryExpression", "parenthesizedExpression", - "typeExpression", "literalValue", "object", "objectProperty", "array", - "arrayItem", "decorator", "decoratorExpression", "functionCall", "argumentList", - "identifier", + "resourceDecl", "ifCondition", "forExpression", "forVariableBlock", + "forBody", "interpString", "expression", "logicCharacter", "primaryExpression", + "parenthesizedExpression", "typeExpression", "literalValue", "object", + "objectProperty", "array", "arrayItem", "decorator", "decoratorExpression", + "functionCall", "argumentList", "identifier", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 32, 257, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 42, 322, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, - 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, - 0, 5, 0, 44, 8, 0, 10, 0, 12, 0, 47, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 55, 8, 1, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, - 2, 1, 2, 1, 2, 1, 2, 3, 2, 67, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 72, 8, 2, - 3, 2, 74, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 82, 8, 4, 10, - 4, 12, 4, 85, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 94, - 8, 5, 10, 5, 12, 5, 97, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, - 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 110, 8, 6, 10, 6, 12, 6, 113, 9, 6, 1, 6, - 1, 6, 1, 6, 1, 6, 3, 6, 119, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, - 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 135, 8, 7, 10, 7, - 12, 7, 138, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 147, - 8, 8, 1, 9, 1, 9, 3, 9, 151, 8, 9, 1, 9, 1, 9, 3, 9, 155, 8, 9, 1, 9, 1, - 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 166, 8, 11, - 1, 12, 1, 12, 4, 12, 170, 8, 12, 11, 12, 12, 12, 171, 1, 12, 1, 12, 4, - 12, 176, 8, 12, 11, 12, 12, 12, 177, 5, 12, 180, 8, 12, 10, 12, 12, 12, - 183, 9, 12, 3, 12, 185, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 191, - 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 198, 8, 14, 10, 14, 12, - 14, 201, 9, 14, 1, 14, 5, 14, 204, 8, 14, 10, 14, 12, 14, 207, 9, 14, 1, - 14, 1, 14, 1, 15, 1, 15, 4, 15, 213, 8, 15, 11, 15, 12, 15, 214, 1, 15, - 3, 15, 218, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, - 17, 1, 17, 3, 17, 229, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 234, 8, 18, 1, - 18, 3, 18, 237, 8, 18, 1, 18, 3, 18, 240, 8, 18, 1, 18, 1, 18, 1, 19, 1, - 19, 1, 19, 3, 19, 247, 8, 19, 1, 19, 5, 19, 250, 8, 19, 10, 19, 12, 19, - 253, 9, 19, 1, 20, 1, 20, 1, 20, 0, 1, 14, 21, 0, 2, 4, 6, 8, 10, 12, 14, - 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0, 1, 2, 0, 14, 20, - 25, 28, 278, 0, 45, 1, 0, 0, 0, 2, 54, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, - 77, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 118, 1, 0, 0, - 0, 14, 120, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 148, 1, 0, 0, 0, 20, 158, - 1, 0, 0, 0, 22, 165, 1, 0, 0, 0, 24, 167, 1, 0, 0, 0, 26, 190, 1, 0, 0, - 0, 28, 195, 1, 0, 0, 0, 30, 210, 1, 0, 0, 0, 32, 219, 1, 0, 0, 0, 34, 228, - 1, 0, 0, 0, 36, 230, 1, 0, 0, 0, 38, 243, 1, 0, 0, 0, 40, 254, 1, 0, 0, - 0, 42, 44, 3, 2, 1, 0, 43, 42, 1, 0, 0, 0, 44, 47, 1, 0, 0, 0, 45, 43, - 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 48, 1, 0, 0, 0, 47, 45, 1, 0, 0, 0, - 48, 49, 5, 0, 0, 1, 49, 1, 1, 0, 0, 0, 50, 55, 3, 4, 2, 0, 51, 55, 3, 8, - 4, 0, 52, 55, 3, 10, 5, 0, 53, 55, 5, 30, 0, 0, 54, 50, 1, 0, 0, 0, 54, - 51, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 54, 53, 1, 0, 0, 0, 55, 3, 1, 0, 0, - 0, 56, 58, 3, 32, 16, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, - 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 62, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, - 62, 63, 5, 14, 0, 0, 63, 73, 3, 40, 20, 0, 64, 66, 3, 20, 10, 0, 65, 67, - 3, 6, 3, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 74, 1, 0, 0, 0, - 68, 69, 5, 20, 0, 0, 69, 71, 3, 12, 6, 0, 70, 72, 3, 6, 3, 0, 71, 70, 1, - 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 64, 1, 0, 0, 0, 73, - 68, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 30, 0, 0, 76, 5, 1, 0, 0, - 0, 77, 78, 5, 11, 0, 0, 78, 79, 3, 14, 7, 0, 79, 7, 1, 0, 0, 0, 80, 82, - 3, 32, 16, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, - 0, 83, 84, 1, 0, 0, 0, 84, 86, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, - 5, 15, 0, 0, 87, 88, 3, 40, 20, 0, 88, 89, 5, 11, 0, 0, 89, 90, 3, 14, - 7, 0, 90, 91, 5, 30, 0, 0, 91, 9, 1, 0, 0, 0, 92, 94, 3, 32, 16, 0, 93, - 92, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, - 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 20, 0, 0, 99, 100, - 3, 40, 20, 0, 100, 101, 3, 12, 6, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, - 24, 12, 0, 103, 104, 5, 30, 0, 0, 104, 11, 1, 0, 0, 0, 105, 111, 5, 21, - 0, 0, 106, 107, 3, 14, 7, 0, 107, 108, 5, 22, 0, 0, 108, 110, 1, 0, 0, - 0, 109, 106, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, - 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, - 3, 14, 7, 0, 115, 116, 5, 23, 0, 0, 116, 119, 1, 0, 0, 0, 117, 119, 5, - 24, 0, 0, 118, 105, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 13, 1, 0, 0, - 0, 120, 121, 6, 7, -1, 0, 121, 122, 3, 16, 8, 0, 122, 136, 1, 0, 0, 0, - 123, 124, 10, 4, 0, 0, 124, 125, 5, 4, 0, 0, 125, 126, 3, 14, 7, 0, 126, - 127, 5, 5, 0, 0, 127, 135, 1, 0, 0, 0, 128, 129, 10, 3, 0, 0, 129, 130, - 5, 8, 0, 0, 130, 135, 3, 40, 20, 0, 131, 132, 10, 2, 0, 0, 132, 133, 5, - 10, 0, 0, 133, 135, 3, 40, 20, 0, 134, 123, 1, 0, 0, 0, 134, 128, 1, 0, - 0, 0, 134, 131, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, - 136, 137, 1, 0, 0, 0, 137, 15, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 147, - 3, 22, 11, 0, 140, 147, 3, 36, 18, 0, 141, 147, 3, 12, 6, 0, 142, 147, - 5, 1, 0, 0, 143, 147, 3, 28, 14, 0, 144, 147, 3, 24, 12, 0, 145, 147, 3, - 18, 9, 0, 146, 139, 1, 0, 0, 0, 146, 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, - 0, 146, 142, 1, 0, 0, 0, 146, 143, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, - 145, 1, 0, 0, 0, 147, 17, 1, 0, 0, 0, 148, 150, 5, 6, 0, 0, 149, 151, 5, - 30, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, - 0, 152, 154, 3, 14, 7, 0, 153, 155, 5, 30, 0, 0, 154, 153, 1, 0, 0, 0, - 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 7, 0, 0, 157, - 19, 1, 0, 0, 0, 158, 159, 3, 40, 20, 0, 159, 21, 1, 0, 0, 0, 160, 166, - 5, 29, 0, 0, 161, 166, 5, 16, 0, 0, 162, 166, 5, 17, 0, 0, 163, 166, 5, - 18, 0, 0, 164, 166, 3, 40, 20, 0, 165, 160, 1, 0, 0, 0, 165, 161, 1, 0, - 0, 0, 165, 162, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 164, 1, 0, 0, 0, - 166, 23, 1, 0, 0, 0, 167, 184, 5, 12, 0, 0, 168, 170, 5, 30, 0, 0, 169, - 168, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 172, - 1, 0, 0, 0, 172, 181, 1, 0, 0, 0, 173, 175, 3, 26, 13, 0, 174, 176, 5, - 30, 0, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, - 0, 177, 178, 1, 0, 0, 0, 178, 180, 1, 0, 0, 0, 179, 173, 1, 0, 0, 0, 180, - 183, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 185, - 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 184, 169, 1, 0, 0, 0, 184, 185, 1, 0, - 0, 0, 185, 186, 1, 0, 0, 0, 186, 187, 5, 13, 0, 0, 187, 25, 1, 0, 0, 0, - 188, 191, 3, 40, 20, 0, 189, 191, 3, 12, 6, 0, 190, 188, 1, 0, 0, 0, 190, - 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 10, 0, 0, 193, 194, - 3, 14, 7, 0, 194, 27, 1, 0, 0, 0, 195, 199, 5, 4, 0, 0, 196, 198, 5, 30, - 0, 0, 197, 196, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, - 199, 200, 1, 0, 0, 0, 200, 205, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, - 204, 3, 30, 15, 0, 203, 202, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, - 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 208, 1, 0, 0, 0, 207, 205, 1, 0, - 0, 0, 208, 209, 5, 5, 0, 0, 209, 29, 1, 0, 0, 0, 210, 217, 3, 14, 7, 0, - 211, 213, 5, 30, 0, 0, 212, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, - 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 218, 1, 0, 0, 0, 216, 218, - 5, 3, 0, 0, 217, 212, 1, 0, 0, 0, 217, 216, 1, 0, 0, 0, 217, 218, 1, 0, - 0, 0, 218, 31, 1, 0, 0, 0, 219, 220, 5, 2, 0, 0, 220, 221, 3, 34, 17, 0, - 221, 222, 5, 30, 0, 0, 222, 33, 1, 0, 0, 0, 223, 229, 3, 36, 18, 0, 224, - 225, 3, 14, 7, 0, 225, 226, 5, 8, 0, 0, 226, 227, 3, 36, 18, 0, 227, 229, - 1, 0, 0, 0, 228, 223, 1, 0, 0, 0, 228, 224, 1, 0, 0, 0, 229, 35, 1, 0, - 0, 0, 230, 231, 3, 40, 20, 0, 231, 236, 5, 6, 0, 0, 232, 234, 5, 30, 0, - 0, 233, 232, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, - 237, 3, 38, 19, 0, 236, 233, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 239, - 1, 0, 0, 0, 238, 240, 5, 30, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, - 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 5, 7, 0, 0, 242, 37, 1, 0, 0, 0, - 243, 251, 3, 14, 7, 0, 244, 246, 5, 3, 0, 0, 245, 247, 5, 30, 0, 0, 246, - 245, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 250, - 3, 14, 7, 0, 249, 244, 1, 0, 0, 0, 250, 253, 1, 0, 0, 0, 251, 249, 1, 0, - 0, 0, 251, 252, 1, 0, 0, 0, 252, 39, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, - 254, 255, 7, 0, 0, 0, 255, 41, 1, 0, 0, 0, 31, 45, 54, 59, 66, 71, 73, - 83, 95, 111, 118, 134, 136, 146, 150, 154, 165, 171, 177, 181, 184, 190, - 199, 205, 214, 217, 228, 233, 236, 239, 246, 251, + 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, + 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 1, 0, + 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 65, 8, 1, 1, 2, 5, 2, 68, 8, 2, 10, 2, 12, 2, 71, 9, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 3, 2, 77, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 82, 8, 2, 3, + 2, 84, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 92, 8, 4, 10, 4, + 12, 4, 95, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 104, 8, + 5, 10, 5, 12, 5, 107, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, + 5, 116, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 5, 7, 126, + 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 7, 1, 7, 1, 7, 3, 7, 134, 8, 7, 1, 7, + 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 141, 8, 7, 10, 7, 12, 7, 144, 9, 7, 1, 7, + 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 156, 8, 9, + 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, + 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 171, 8, 10, 1, 11, 1, 11, 1, 11, + 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, + 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, + 5, 11, 197, 8, 11, 10, 11, 12, 11, 200, 9, 11, 1, 12, 1, 12, 1, 13, 1, + 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 212, 8, 13, 1, 14, + 1, 14, 3, 14, 216, 8, 14, 1, 14, 1, 14, 3, 14, 220, 8, 14, 1, 14, 1, 14, + 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 231, 8, 16, 1, + 17, 1, 17, 4, 17, 235, 8, 17, 11, 17, 12, 17, 236, 1, 17, 1, 17, 4, 17, + 241, 8, 17, 11, 17, 12, 17, 242, 5, 17, 245, 8, 17, 10, 17, 12, 17, 248, + 9, 17, 3, 17, 250, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 256, 8, 18, + 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 263, 8, 19, 10, 19, 12, 19, 266, + 9, 19, 1, 19, 5, 19, 269, 8, 19, 10, 19, 12, 19, 272, 9, 19, 1, 19, 1, + 19, 1, 20, 1, 20, 4, 20, 278, 8, 20, 11, 20, 12, 20, 279, 1, 20, 3, 20, + 283, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, + 22, 3, 22, 294, 8, 22, 1, 23, 1, 23, 1, 23, 3, 23, 299, 8, 23, 1, 23, 3, + 23, 302, 8, 23, 1, 23, 3, 23, 305, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, + 24, 3, 24, 312, 8, 24, 1, 24, 5, 24, 315, 8, 24, 10, 24, 12, 24, 318, 9, + 24, 1, 25, 1, 25, 1, 25, 0, 1, 22, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, 2, 1, + 0, 32, 37, 3, 0, 14, 20, 25, 27, 38, 38, 347, 0, 55, 1, 0, 0, 0, 2, 64, + 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, 87, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, + 105, 1, 0, 0, 0, 12, 119, 1, 0, 0, 0, 14, 123, 1, 0, 0, 0, 16, 147, 1, + 0, 0, 0, 18, 155, 1, 0, 0, 0, 20, 170, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, + 24, 201, 1, 0, 0, 0, 26, 211, 1, 0, 0, 0, 28, 213, 1, 0, 0, 0, 30, 223, + 1, 0, 0, 0, 32, 230, 1, 0, 0, 0, 34, 232, 1, 0, 0, 0, 36, 255, 1, 0, 0, + 0, 38, 260, 1, 0, 0, 0, 40, 275, 1, 0, 0, 0, 42, 284, 1, 0, 0, 0, 44, 293, + 1, 0, 0, 0, 46, 295, 1, 0, 0, 0, 48, 308, 1, 0, 0, 0, 50, 319, 1, 0, 0, + 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, + 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 58, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, + 58, 59, 5, 0, 0, 1, 59, 1, 1, 0, 0, 0, 60, 65, 3, 4, 2, 0, 61, 65, 3, 8, + 4, 0, 62, 65, 3, 10, 5, 0, 63, 65, 5, 40, 0, 0, 64, 60, 1, 0, 0, 0, 64, + 61, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 63, 1, 0, 0, 0, 65, 3, 1, 0, 0, + 0, 66, 68, 3, 42, 21, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, + 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, + 72, 73, 5, 14, 0, 0, 73, 83, 3, 50, 25, 0, 74, 76, 3, 30, 15, 0, 75, 77, + 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 84, 1, 0, 0, 0, + 78, 79, 5, 20, 0, 0, 79, 81, 3, 20, 10, 0, 80, 82, 3, 6, 3, 0, 81, 80, + 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 74, 1, 0, 0, 0, + 83, 78, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 5, 40, 0, 0, 86, 5, 1, + 0, 0, 0, 87, 88, 5, 11, 0, 0, 88, 89, 3, 22, 11, 0, 89, 7, 1, 0, 0, 0, + 90, 92, 3, 42, 21, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, + 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, + 97, 5, 15, 0, 0, 97, 98, 3, 50, 25, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, + 22, 11, 0, 100, 101, 5, 40, 0, 0, 101, 9, 1, 0, 0, 0, 102, 104, 3, 42, + 21, 0, 103, 102, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, + 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, + 109, 5, 20, 0, 0, 109, 110, 3, 50, 25, 0, 110, 111, 3, 20, 10, 0, 111, + 115, 5, 11, 0, 0, 112, 116, 3, 12, 6, 0, 113, 116, 3, 34, 17, 0, 114, 116, + 3, 14, 7, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, + 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 11, 1, 0, 0, 0, + 119, 120, 5, 28, 0, 0, 120, 121, 3, 28, 14, 0, 121, 122, 3, 34, 17, 0, + 122, 13, 1, 0, 0, 0, 123, 127, 5, 4, 0, 0, 124, 126, 5, 40, 0, 0, 125, + 124, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, + 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 133, 5, 29, + 0, 0, 131, 134, 3, 50, 25, 0, 132, 134, 3, 16, 8, 0, 133, 131, 1, 0, 0, + 0, 133, 132, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 30, 0, 0, 136, + 137, 3, 22, 11, 0, 137, 138, 5, 10, 0, 0, 138, 142, 3, 18, 9, 0, 139, 141, + 5, 40, 0, 0, 140, 139, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, + 0, 0, 142, 143, 1, 0, 0, 0, 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, + 145, 146, 5, 5, 0, 0, 146, 15, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, + 3, 50, 25, 0, 149, 150, 5, 3, 0, 0, 150, 151, 3, 50, 25, 0, 151, 152, 5, + 7, 0, 0, 152, 17, 1, 0, 0, 0, 153, 156, 3, 22, 11, 0, 154, 156, 3, 12, + 6, 0, 155, 153, 1, 0, 0, 0, 155, 154, 1, 0, 0, 0, 156, 19, 1, 0, 0, 0, + 157, 163, 5, 21, 0, 0, 158, 159, 3, 22, 11, 0, 159, 160, 5, 22, 0, 0, 160, + 162, 1, 0, 0, 0, 161, 158, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, + 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, + 0, 0, 166, 167, 3, 22, 11, 0, 167, 168, 5, 23, 0, 0, 168, 171, 1, 0, 0, + 0, 169, 171, 5, 24, 0, 0, 170, 157, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, + 21, 1, 0, 0, 0, 172, 173, 6, 11, -1, 0, 173, 174, 3, 26, 13, 0, 174, 198, + 1, 0, 0, 0, 175, 176, 10, 5, 0, 0, 176, 177, 5, 31, 0, 0, 177, 178, 3, + 22, 11, 0, 178, 179, 5, 10, 0, 0, 179, 180, 3, 22, 11, 6, 180, 197, 1, + 0, 0, 0, 181, 182, 10, 2, 0, 0, 182, 183, 3, 24, 12, 0, 183, 184, 3, 22, + 11, 3, 184, 197, 1, 0, 0, 0, 185, 186, 10, 6, 0, 0, 186, 187, 5, 4, 0, + 0, 187, 188, 3, 22, 11, 0, 188, 189, 5, 5, 0, 0, 189, 197, 1, 0, 0, 0, + 190, 191, 10, 4, 0, 0, 191, 192, 5, 8, 0, 0, 192, 197, 3, 50, 25, 0, 193, + 194, 10, 3, 0, 0, 194, 195, 5, 10, 0, 0, 195, 197, 3, 50, 25, 0, 196, 175, + 1, 0, 0, 0, 196, 181, 1, 0, 0, 0, 196, 185, 1, 0, 0, 0, 196, 190, 1, 0, + 0, 0, 196, 193, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, + 198, 199, 1, 0, 0, 0, 199, 23, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 202, + 7, 0, 0, 0, 202, 25, 1, 0, 0, 0, 203, 212, 3, 32, 16, 0, 204, 212, 3, 46, + 23, 0, 205, 212, 3, 20, 10, 0, 206, 212, 5, 1, 0, 0, 207, 212, 3, 38, 19, + 0, 208, 212, 3, 34, 17, 0, 209, 212, 3, 14, 7, 0, 210, 212, 3, 28, 14, + 0, 211, 203, 1, 0, 0, 0, 211, 204, 1, 0, 0, 0, 211, 205, 1, 0, 0, 0, 211, + 206, 1, 0, 0, 0, 211, 207, 1, 0, 0, 0, 211, 208, 1, 0, 0, 0, 211, 209, + 1, 0, 0, 0, 211, 210, 1, 0, 0, 0, 212, 27, 1, 0, 0, 0, 213, 215, 5, 6, + 0, 0, 214, 216, 5, 40, 0, 0, 215, 214, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, + 216, 217, 1, 0, 0, 0, 217, 219, 3, 22, 11, 0, 218, 220, 5, 40, 0, 0, 219, + 218, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, + 5, 7, 0, 0, 222, 29, 1, 0, 0, 0, 223, 224, 3, 50, 25, 0, 224, 31, 1, 0, + 0, 0, 225, 231, 5, 39, 0, 0, 226, 231, 5, 16, 0, 0, 227, 231, 5, 17, 0, + 0, 228, 231, 5, 18, 0, 0, 229, 231, 3, 50, 25, 0, 230, 225, 1, 0, 0, 0, + 230, 226, 1, 0, 0, 0, 230, 227, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, + 229, 1, 0, 0, 0, 231, 33, 1, 0, 0, 0, 232, 249, 5, 12, 0, 0, 233, 235, + 5, 40, 0, 0, 234, 233, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 234, 1, 0, + 0, 0, 236, 237, 1, 0, 0, 0, 237, 246, 1, 0, 0, 0, 238, 240, 3, 36, 18, + 0, 239, 241, 5, 40, 0, 0, 240, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, + 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 245, 1, 0, 0, 0, 244, 238, + 1, 0, 0, 0, 245, 248, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 247, 1, 0, + 0, 0, 247, 250, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 249, 234, 1, 0, 0, 0, + 249, 250, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 5, 13, 0, 0, 252, + 35, 1, 0, 0, 0, 253, 256, 3, 50, 25, 0, 254, 256, 3, 20, 10, 0, 255, 253, + 1, 0, 0, 0, 255, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 258, 5, 10, + 0, 0, 258, 259, 3, 22, 11, 0, 259, 37, 1, 0, 0, 0, 260, 264, 5, 4, 0, 0, + 261, 263, 5, 40, 0, 0, 262, 261, 1, 0, 0, 0, 263, 266, 1, 0, 0, 0, 264, + 262, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 270, 1, 0, 0, 0, 266, 264, + 1, 0, 0, 0, 267, 269, 3, 40, 20, 0, 268, 267, 1, 0, 0, 0, 269, 272, 1, + 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 273, 1, 0, 0, + 0, 272, 270, 1, 0, 0, 0, 273, 274, 5, 5, 0, 0, 274, 39, 1, 0, 0, 0, 275, + 282, 3, 22, 11, 0, 276, 278, 5, 40, 0, 0, 277, 276, 1, 0, 0, 0, 278, 279, + 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 283, 1, 0, + 0, 0, 281, 283, 5, 3, 0, 0, 282, 277, 1, 0, 0, 0, 282, 281, 1, 0, 0, 0, + 282, 283, 1, 0, 0, 0, 283, 41, 1, 0, 0, 0, 284, 285, 5, 2, 0, 0, 285, 286, + 3, 44, 22, 0, 286, 287, 5, 40, 0, 0, 287, 43, 1, 0, 0, 0, 288, 294, 3, + 46, 23, 0, 289, 290, 3, 22, 11, 0, 290, 291, 5, 8, 0, 0, 291, 292, 3, 46, + 23, 0, 292, 294, 1, 0, 0, 0, 293, 288, 1, 0, 0, 0, 293, 289, 1, 0, 0, 0, + 294, 45, 1, 0, 0, 0, 295, 296, 3, 50, 25, 0, 296, 301, 5, 6, 0, 0, 297, + 299, 5, 40, 0, 0, 298, 297, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, + 1, 0, 0, 0, 300, 302, 3, 48, 24, 0, 301, 298, 1, 0, 0, 0, 301, 302, 1, + 0, 0, 0, 302, 304, 1, 0, 0, 0, 303, 305, 5, 40, 0, 0, 304, 303, 1, 0, 0, + 0, 304, 305, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 5, 7, 0, 0, 307, + 47, 1, 0, 0, 0, 308, 316, 3, 22, 11, 0, 309, 311, 5, 3, 0, 0, 310, 312, + 5, 40, 0, 0, 311, 310, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 313, 1, 0, + 0, 0, 313, 315, 3, 22, 11, 0, 314, 309, 1, 0, 0, 0, 315, 318, 1, 0, 0, + 0, 316, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 49, 1, 0, 0, 0, 318, + 316, 1, 0, 0, 0, 319, 320, 7, 1, 0, 0, 320, 51, 1, 0, 0, 0, 36, 55, 64, + 69, 76, 81, 83, 93, 105, 115, 127, 133, 142, 155, 163, 170, 196, 198, 211, + 215, 219, 230, 236, 242, 246, 249, 255, 264, 270, 279, 282, 293, 298, 301, + 304, 311, 316, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -232,11 +266,21 @@ const ( bicepParserSTRING = 25 bicepParserINT = 26 bicepParserBOOL = 27 - bicepParserIDENTIFIER = 28 - bicepParserNUMBER = 29 - bicepParserNL = 30 - bicepParserSPACES = 31 - bicepParserUNKNOWN = 32 + bicepParserIF = 28 + bicepParserFOR = 29 + bicepParserIN = 30 + bicepParserQMARK = 31 + bicepParserGT = 32 + bicepParserGTE = 33 + bicepParserLT = 34 + bicepParserLTE = 35 + bicepParserEQ = 36 + bicepParserNEQ = 37 + bicepParserIDENTIFIER = 38 + bicepParserNUMBER = 39 + bicepParserNL = 40 + bicepParserSPACES = 41 + bicepParserUNKNOWN = 42 ) // bicepParser rules. @@ -247,21 +291,26 @@ const ( bicepParserRULE_parameterDefaultValue = 3 bicepParserRULE_variableDecl = 4 bicepParserRULE_resourceDecl = 5 - bicepParserRULE_interpString = 6 - bicepParserRULE_expression = 7 - bicepParserRULE_primaryExpression = 8 - bicepParserRULE_parenthesizedExpression = 9 - bicepParserRULE_typeExpression = 10 - bicepParserRULE_literalValue = 11 - bicepParserRULE_object = 12 - bicepParserRULE_objectProperty = 13 - bicepParserRULE_array = 14 - bicepParserRULE_arrayItem = 15 - bicepParserRULE_decorator = 16 - bicepParserRULE_decoratorExpression = 17 - bicepParserRULE_functionCall = 18 - bicepParserRULE_argumentList = 19 - bicepParserRULE_identifier = 20 + bicepParserRULE_ifCondition = 6 + bicepParserRULE_forExpression = 7 + bicepParserRULE_forVariableBlock = 8 + bicepParserRULE_forBody = 9 + bicepParserRULE_interpString = 10 + bicepParserRULE_expression = 11 + bicepParserRULE_logicCharacter = 12 + bicepParserRULE_primaryExpression = 13 + bicepParserRULE_parenthesizedExpression = 14 + bicepParserRULE_typeExpression = 15 + bicepParserRULE_literalValue = 16 + bicepParserRULE_object = 17 + bicepParserRULE_objectProperty = 18 + bicepParserRULE_array = 19 + bicepParserRULE_arrayItem = 20 + bicepParserRULE_decorator = 21 + bicepParserRULE_decoratorExpression = 22 + bicepParserRULE_functionCall = 23 + bicepParserRULE_argumentList = 24 + bicepParserRULE_identifier = 25 ) // IProgramContext is an interface to support dynamic dispatch. @@ -381,20 +430,20 @@ func (p *bicepParser) Program() (localctx IProgramContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(45) + p.SetState(55) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1074839556) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1099512725508) != 0 { { - p.SetState(42) + p.SetState(52) p.Statement() } - p.SetState(47) + p.SetState(57) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -402,7 +451,7 @@ func (p *bicepParser) Program() (localctx IProgramContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(48) + p.SetState(58) p.Match(bicepParserEOF) if p.HasError() { // Recognition error - abort rule @@ -545,7 +594,7 @@ func (s *StatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 2, bicepParserRULE_statement) - p.SetState(54) + p.SetState(64) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -555,28 +604,28 @@ func (p *bicepParser) Statement() (localctx IStatementContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(50) + p.SetState(60) p.ParameterDecl() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(51) + p.SetState(61) p.VariableDecl() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(52) + p.SetState(62) p.ResourceDecl() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(53) + p.SetState(63) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -818,7 +867,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(59) + p.SetState(69) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -827,11 +876,11 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { for _la == bicepParserAT { { - p.SetState(56) + p.SetState(66) p.Decorator() } - p.SetState(61) + p.SetState(71) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -839,7 +888,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(62) + p.SetState(72) p.Match(bicepParserPARAM) if p.HasError() { // Recognition error - abort rule @@ -847,13 +896,13 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { } } { - p.SetState(63) + p.SetState(73) var _x = p.Identifier() localctx.(*ParameterDeclContext).name = _x } - p.SetState(73) + p.SetState(83) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -862,10 +911,10 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext()) { case 1: { - p.SetState(64) + p.SetState(74) p.TypeExpression() } - p.SetState(66) + p.SetState(76) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -874,7 +923,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { if _la == bicepParserASSIGN { { - p.SetState(65) + p.SetState(75) p.ParameterDefaultValue() } @@ -882,7 +931,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { case 2: { - p.SetState(68) + p.SetState(78) p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule @@ -890,13 +939,13 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { } } { - p.SetState(69) + p.SetState(79) var _x = p.InterpString() localctx.(*ParameterDeclContext).type_ = _x } - p.SetState(71) + p.SetState(81) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -905,7 +954,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { if _la == bicepParserASSIGN { { - p.SetState(70) + p.SetState(80) p.ParameterDefaultValue() } @@ -915,7 +964,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { goto errorExit } { - p.SetState(75) + p.SetState(85) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1026,7 +1075,7 @@ func (p *bicepParser) ParameterDefaultValue() (localctx IParameterDefaultValueCo p.EnterRule(localctx, 6, bicepParserRULE_parameterDefaultValue) p.EnterOuterAlt(localctx, 1) { - p.SetState(77) + p.SetState(87) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -1034,7 +1083,7 @@ func (p *bicepParser) ParameterDefaultValue() (localctx IParameterDefaultValueCo } } { - p.SetState(78) + p.SetState(88) p.expression(0) } @@ -1223,7 +1272,7 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(83) + p.SetState(93) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1232,11 +1281,11 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { for _la == bicepParserAT { { - p.SetState(80) + p.SetState(90) p.Decorator() } - p.SetState(85) + p.SetState(95) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1244,7 +1293,7 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(86) + p.SetState(96) p.Match(bicepParserVAR) if p.HasError() { // Recognition error - abort rule @@ -1252,14 +1301,14 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { } } { - p.SetState(87) + p.SetState(97) var _x = p.Identifier() localctx.(*VariableDeclContext).name = _x } { - p.SetState(88) + p.SetState(98) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -1267,11 +1316,11 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { } } { - p.SetState(89) + p.SetState(99) p.expression(0) } { - p.SetState(90) + p.SetState(100) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1317,7 +1366,9 @@ type IResourceDeclContext interface { NL() antlr.TerminalNode Identifier() IIdentifierContext InterpString() IInterpStringContext + IfCondition() IIfConditionContext Object() IObjectContext + ForExpression() IForExpressionContext AllDecorator() []IDecoratorContext Decorator(i int) IDecoratorContext @@ -1411,6 +1462,22 @@ func (s *ResourceDeclContext) InterpString() IInterpStringContext { return t.(IInterpStringContext) } +func (s *ResourceDeclContext) IfCondition() IIfConditionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIfConditionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIfConditionContext) +} + func (s *ResourceDeclContext) Object() IObjectContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { @@ -1427,6 +1494,22 @@ func (s *ResourceDeclContext) Object() IObjectContext { return t.(IObjectContext) } +func (s *ResourceDeclContext) ForExpression() IForExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IForExpressionContext) +} + func (s *ResourceDeclContext) AllDecorator() []IDecoratorContext { children := s.GetChildren() len := 0 @@ -1492,7 +1575,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(95) + p.SetState(105) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1501,11 +1584,11 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { for _la == bicepParserAT { { - p.SetState(92) + p.SetState(102) p.Decorator() } - p.SetState(97) + p.SetState(107) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1513,7 +1596,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(98) + p.SetState(108) p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule @@ -1521,40 +1604,870 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { } } { - p.SetState(99) + p.SetState(109) + + var _x = p.Identifier() + + localctx.(*ResourceDeclContext).name = _x + } + { + p.SetState(110) + + var _x = p.InterpString() + + localctx.(*ResourceDeclContext).type_ = _x + } + { + p.SetState(111) + p.Match(bicepParserASSIGN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(115) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case bicepParserIF: + { + p.SetState(112) + p.IfCondition() + } + + case bicepParserOBRACE: + { + p.SetState(113) + p.Object() + } + + case bicepParserOBRACK: + { + p.SetState(114) + p.ForExpression() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + { + p.SetState(117) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IIfConditionContext is an interface to support dynamic dispatch. +type IIfConditionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + IF() antlr.TerminalNode + ParenthesizedExpression() IParenthesizedExpressionContext + Object() IObjectContext + + // IsIfConditionContext differentiates from other interfaces. + IsIfConditionContext() +} + +type IfConditionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIfConditionContext() *IfConditionContext { + var p = new(IfConditionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_ifCondition + return p +} + +func InitEmptyIfConditionContext(p *IfConditionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_ifCondition +} + +func (*IfConditionContext) IsIfConditionContext() {} + +func NewIfConditionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfConditionContext { + var p = new(IfConditionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_ifCondition + + return p +} + +func (s *IfConditionContext) GetParser() antlr.Parser { return s.parser } + +func (s *IfConditionContext) IF() antlr.TerminalNode { + return s.GetToken(bicepParserIF, 0) +} + +func (s *IfConditionContext) ParenthesizedExpression() IParenthesizedExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IParenthesizedExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IParenthesizedExpressionContext) +} + +func (s *IfConditionContext) Object() IObjectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IObjectContext) +} + +func (s *IfConditionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IfConditionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IfConditionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitIfCondition(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) IfCondition() (localctx IIfConditionContext) { + localctx = NewIfConditionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 12, bicepParserRULE_ifCondition) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(119) + p.Match(bicepParserIF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(120) + p.ParenthesizedExpression() + } + { + p.SetState(121) + p.Object() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IForExpressionContext is an interface to support dynamic dispatch. +type IForExpressionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetItem returns the item rule contexts. + GetItem() IIdentifierContext + + // SetItem sets the item rule contexts. + SetItem(IIdentifierContext) + + // Getter signatures + OBRACK() antlr.TerminalNode + FOR() antlr.TerminalNode + IN() antlr.TerminalNode + Expression() IExpressionContext + COL() antlr.TerminalNode + ForBody() IForBodyContext + CBRACK() antlr.TerminalNode + ForVariableBlock() IForVariableBlockContext + AllNL() []antlr.TerminalNode + NL(i int) antlr.TerminalNode + Identifier() IIdentifierContext + + // IsForExpressionContext differentiates from other interfaces. + IsForExpressionContext() +} + +type ForExpressionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + item IIdentifierContext +} + +func NewEmptyForExpressionContext() *ForExpressionContext { + var p = new(ForExpressionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_forExpression + return p +} + +func InitEmptyForExpressionContext(p *ForExpressionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_forExpression +} + +func (*ForExpressionContext) IsForExpressionContext() {} + +func NewForExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ForExpressionContext { + var p = new(ForExpressionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_forExpression + + return p +} + +func (s *ForExpressionContext) GetParser() antlr.Parser { return s.parser } + +func (s *ForExpressionContext) GetItem() IIdentifierContext { return s.item } + +func (s *ForExpressionContext) SetItem(v IIdentifierContext) { s.item = v } + +func (s *ForExpressionContext) OBRACK() antlr.TerminalNode { + return s.GetToken(bicepParserOBRACK, 0) +} + +func (s *ForExpressionContext) FOR() antlr.TerminalNode { + return s.GetToken(bicepParserFOR, 0) +} + +func (s *ForExpressionContext) IN() antlr.TerminalNode { + return s.GetToken(bicepParserIN, 0) +} + +func (s *ForExpressionContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *ForExpressionContext) COL() antlr.TerminalNode { + return s.GetToken(bicepParserCOL, 0) +} + +func (s *ForExpressionContext) ForBody() IForBodyContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForBodyContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IForBodyContext) +} + +func (s *ForExpressionContext) CBRACK() antlr.TerminalNode { + return s.GetToken(bicepParserCBRACK, 0) +} + +func (s *ForExpressionContext) ForVariableBlock() IForVariableBlockContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForVariableBlockContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IForVariableBlockContext) +} + +func (s *ForExpressionContext) AllNL() []antlr.TerminalNode { + return s.GetTokens(bicepParserNL) +} + +func (s *ForExpressionContext) NL(i int) antlr.TerminalNode { + return s.GetToken(bicepParserNL, i) +} + +func (s *ForExpressionContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *ForExpressionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ForExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ForExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitForExpression(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { + localctx = NewForExpressionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 14, bicepParserRULE_forExpression) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(123) + p.Match(bicepParserOBRACK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(127) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserNL { + { + p.SetState(124) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(129) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(130) + p.Match(bicepParserFOR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(133) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: + { + p.SetState(131) + + var _x = p.Identifier() + + localctx.(*ForExpressionContext).item = _x + } + + case bicepParserOPAR: + { + p.SetState(132) + p.ForVariableBlock() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + { + p.SetState(135) + p.Match(bicepParserIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(136) + p.expression(0) + } + { + p.SetState(137) + p.Match(bicepParserCOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(138) + p.ForBody() + } + p.SetState(142) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserNL { + { + p.SetState(139) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(144) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(145) + p.Match(bicepParserCBRACK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IForVariableBlockContext is an interface to support dynamic dispatch. +type IForVariableBlockContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetItem returns the item rule contexts. + GetItem() IIdentifierContext + + // GetIndex returns the index rule contexts. + GetIndex() IIdentifierContext + + // SetItem sets the item rule contexts. + SetItem(IIdentifierContext) + + // SetIndex sets the index rule contexts. + SetIndex(IIdentifierContext) + + // Getter signatures + OPAR() antlr.TerminalNode + COMMA() antlr.TerminalNode + CPAR() antlr.TerminalNode + AllIdentifier() []IIdentifierContext + Identifier(i int) IIdentifierContext + + // IsForVariableBlockContext differentiates from other interfaces. + IsForVariableBlockContext() +} + +type ForVariableBlockContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + item IIdentifierContext + index IIdentifierContext +} + +func NewEmptyForVariableBlockContext() *ForVariableBlockContext { + var p = new(ForVariableBlockContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_forVariableBlock + return p +} + +func InitEmptyForVariableBlockContext(p *ForVariableBlockContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_forVariableBlock +} + +func (*ForVariableBlockContext) IsForVariableBlockContext() {} + +func NewForVariableBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ForVariableBlockContext { + var p = new(ForVariableBlockContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_forVariableBlock + + return p +} + +func (s *ForVariableBlockContext) GetParser() antlr.Parser { return s.parser } + +func (s *ForVariableBlockContext) GetItem() IIdentifierContext { return s.item } + +func (s *ForVariableBlockContext) GetIndex() IIdentifierContext { return s.index } + +func (s *ForVariableBlockContext) SetItem(v IIdentifierContext) { s.item = v } + +func (s *ForVariableBlockContext) SetIndex(v IIdentifierContext) { s.index = v } + +func (s *ForVariableBlockContext) OPAR() antlr.TerminalNode { + return s.GetToken(bicepParserOPAR, 0) +} + +func (s *ForVariableBlockContext) COMMA() antlr.TerminalNode { + return s.GetToken(bicepParserCOMMA, 0) +} + +func (s *ForVariableBlockContext) CPAR() antlr.TerminalNode { + return s.GetToken(bicepParserCPAR, 0) +} + +func (s *ForVariableBlockContext) AllIdentifier() []IIdentifierContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IIdentifierContext); ok { + len++ + } + } + + tst := make([]IIdentifierContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IIdentifierContext); ok { + tst[i] = t.(IIdentifierContext) + i++ + } + } + + return tst +} + +func (s *ForVariableBlockContext) Identifier(i int) IIdentifierContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *ForVariableBlockContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ForVariableBlockContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ForVariableBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitForVariableBlock(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { + localctx = NewForVariableBlockContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 16, bicepParserRULE_forVariableBlock) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(147) + p.Match(bicepParserOPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(148) + + var _x = p.Identifier() + + localctx.(*ForVariableBlockContext).item = _x + } + { + p.SetState(149) + p.Match(bicepParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(150) + + var _x = p.Identifier() + + localctx.(*ForVariableBlockContext).index = _x + } + { + p.SetState(151) + p.Match(bicepParserCPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IForBodyContext is an interface to support dynamic dispatch. +type IForBodyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetBody returns the body rule contexts. + GetBody() IExpressionContext + + // SetBody sets the body rule contexts. + SetBody(IExpressionContext) + + // Getter signatures + Expression() IExpressionContext + IfCondition() IIfConditionContext + + // IsForBodyContext differentiates from other interfaces. + IsForBodyContext() +} + +type ForBodyContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + body IExpressionContext +} + +func NewEmptyForBodyContext() *ForBodyContext { + var p = new(ForBodyContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_forBody + return p +} + +func InitEmptyForBodyContext(p *ForBodyContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_forBody +} + +func (*ForBodyContext) IsForBodyContext() {} + +func NewForBodyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ForBodyContext { + var p = new(ForBodyContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_forBody + + return p +} + +func (s *ForBodyContext) GetParser() antlr.Parser { return s.parser } + +func (s *ForBodyContext) GetBody() IExpressionContext { return s.body } + +func (s *ForBodyContext) SetBody(v IExpressionContext) { s.body = v } + +func (s *ForBodyContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *ForBodyContext) IfCondition() IIfConditionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIfConditionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIfConditionContext) +} - var _x = p.Identifier() +func (s *ForBodyContext) GetRuleContext() antlr.RuleContext { + return s +} - localctx.(*ResourceDeclContext).name = _x - } - { - p.SetState(100) +func (s *ForBodyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} - var _x = p.InterpString() +func (s *ForBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitForBody(s) - localctx.(*ResourceDeclContext).type_ = _x - } - { - p.SetState(101) - p.Match(bicepParserASSIGN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + default: + return t.VisitChildren(s) } +} - { - p.SetState(102) - p.Object() +func (p *bicepParser) ForBody() (localctx IForBodyContext) { + localctx = NewForBodyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, bicepParserRULE_forBody) + p.SetState(155) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit } - { - p.SetState(103) - p.Match(bicepParserNL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + switch p.GetTokenStream().LA(1) { + case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER, bicepParserNUMBER: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(153) + + var _x = p.expression(0) + + localctx.(*ForBodyContext).body = _x } + + case bicepParserIF: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(154) + p.IfCondition() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } errorExit: @@ -1703,10 +2616,10 @@ func (s *InterpStringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) InterpString() (localctx IInterpStringContext) { localctx = NewInterpStringContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 12, bicepParserRULE_interpString) + p.EnterRule(localctx, 20, bicepParserRULE_interpString) var _alt int - p.SetState(118) + p.SetState(170) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1716,30 +2629,30 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_LEFT_PIECE: p.EnterOuterAlt(localctx, 1) { - p.SetState(105) + p.SetState(157) p.Match(bicepParserSTRING_LEFT_PIECE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(111) + p.SetState(163) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(106) + p.SetState(158) p.expression(0) } { - p.SetState(107) + p.SetState(159) p.Match(bicepParserSTRING_MIDDLE_PIECE) if p.HasError() { // Recognition error - abort rule @@ -1748,22 +2661,22 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { } } - p.SetState(113) + p.SetState(165) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } { - p.SetState(114) + p.SetState(166) p.expression(0) } { - p.SetState(115) + p.SetState(167) p.Match(bicepParserSTRING_RIGHT_PIECE) if p.HasError() { // Recognition error - abort rule @@ -1774,7 +2687,7 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_COMPLETE: p.EnterOuterAlt(localctx, 2) { - p.SetState(117) + p.SetState(169) p.Match(bicepParserSTRING_COMPLETE) if p.HasError() { // Recognition error - abort rule @@ -1823,11 +2736,13 @@ type IExpressionContext interface { PrimaryExpression() IPrimaryExpressionContext AllExpression() []IExpressionContext Expression(i int) IExpressionContext + QMARK() antlr.TerminalNode + COL() antlr.TerminalNode + LogicCharacter() ILogicCharacterContext OBRACK() antlr.TerminalNode CBRACK() antlr.TerminalNode DOT() antlr.TerminalNode Identifier() IIdentifierContext - COL() antlr.TerminalNode // IsExpressionContext differentiates from other interfaces. IsExpressionContext() @@ -1932,6 +2847,30 @@ func (s *ExpressionContext) Expression(i int) IExpressionContext { return t.(IExpressionContext) } +func (s *ExpressionContext) QMARK() antlr.TerminalNode { + return s.GetToken(bicepParserQMARK, 0) +} + +func (s *ExpressionContext) COL() antlr.TerminalNode { + return s.GetToken(bicepParserCOL, 0) +} + +func (s *ExpressionContext) LogicCharacter() ILogicCharacterContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILogicCharacterContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ILogicCharacterContext) +} + func (s *ExpressionContext) OBRACK() antlr.TerminalNode { return s.GetToken(bicepParserOBRACK, 0) } @@ -1960,10 +2899,6 @@ func (s *ExpressionContext) Identifier() IIdentifierContext { return t.(IIdentifierContext) } -func (s *ExpressionContext) COL() antlr.TerminalNode { - return s.GetToken(bicepParserCOL, 0) -} - func (s *ExpressionContext) GetRuleContext() antlr.RuleContext { return s } @@ -1993,23 +2928,23 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { localctx = NewExpressionContext(p, p.GetParserRuleContext(), _parentState) var _prevctx IExpressionContext = localctx var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. - _startState := 14 - p.EnterRecursionRule(localctx, 14, bicepParserRULE_expression, _p) + _startState := 22 + p.EnterRecursionRule(localctx, 22, bicepParserRULE_expression, _p) var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(121) + p.SetState(173) p.PrimaryExpression() } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(136) + p.SetState(198) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -2019,24 +2954,76 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(134) + p.SetState(196) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 10, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) { case 1: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(123) + p.SetState(175) - if !(p.Precpred(p.GetParserRuleContext(), 4)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 5)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) + goto errorExit + } + { + p.SetState(176) + p.Match(bicepParserQMARK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(177) + p.expression(0) + } + { + p.SetState(178) + p.Match(bicepParserCOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(179) + p.expression(6) + } + + case 2: + localctx = NewExpressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) + p.SetState(181) + + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + goto errorExit + } + { + p.SetState(182) + p.LogicCharacter() + } + { + p.SetState(183) + p.expression(3) + } + + case 3: + localctx = NewExpressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) + p.SetState(185) + + if !(p.Precpred(p.GetParserRuleContext(), 6)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) goto errorExit } { - p.SetState(124) + p.SetState(186) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule @@ -2044,11 +3031,11 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(125) + p.SetState(187) p.expression(0) } { - p.SetState(126) + p.SetState(188) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -2056,17 +3043,17 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } - case 2: + case 4: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(128) + p.SetState(190) - if !(p.Precpred(p.GetParserRuleContext(), 3)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 4)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) goto errorExit } { - p.SetState(129) + p.SetState(191) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -2074,24 +3061,24 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(130) + p.SetState(192) var _x = p.Identifier() localctx.(*ExpressionContext).property = _x } - case 3: + case 5: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(131) + p.SetState(193) - if !(p.Precpred(p.GetParserRuleContext(), 2)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 3)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(132) + p.SetState(194) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -2099,7 +3086,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(133) + p.SetState(195) var _x = p.Identifier() @@ -2111,12 +3098,12 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } - p.SetState(138) + p.SetState(200) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -2135,6 +3122,130 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } +// ILogicCharacterContext is an interface to support dynamic dispatch. +type ILogicCharacterContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + GT() antlr.TerminalNode + GTE() antlr.TerminalNode + LT() antlr.TerminalNode + LTE() antlr.TerminalNode + EQ() antlr.TerminalNode + NEQ() antlr.TerminalNode + + // IsLogicCharacterContext differentiates from other interfaces. + IsLogicCharacterContext() +} + +type LogicCharacterContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyLogicCharacterContext() *LogicCharacterContext { + var p = new(LogicCharacterContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_logicCharacter + return p +} + +func InitEmptyLogicCharacterContext(p *LogicCharacterContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_logicCharacter +} + +func (*LogicCharacterContext) IsLogicCharacterContext() {} + +func NewLogicCharacterContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LogicCharacterContext { + var p = new(LogicCharacterContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_logicCharacter + + return p +} + +func (s *LogicCharacterContext) GetParser() antlr.Parser { return s.parser } + +func (s *LogicCharacterContext) GT() antlr.TerminalNode { + return s.GetToken(bicepParserGT, 0) +} + +func (s *LogicCharacterContext) GTE() antlr.TerminalNode { + return s.GetToken(bicepParserGTE, 0) +} + +func (s *LogicCharacterContext) LT() antlr.TerminalNode { + return s.GetToken(bicepParserLT, 0) +} + +func (s *LogicCharacterContext) LTE() antlr.TerminalNode { + return s.GetToken(bicepParserLTE, 0) +} + +func (s *LogicCharacterContext) EQ() antlr.TerminalNode { + return s.GetToken(bicepParserEQ, 0) +} + +func (s *LogicCharacterContext) NEQ() antlr.TerminalNode { + return s.GetToken(bicepParserNEQ, 0) +} + +func (s *LogicCharacterContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LogicCharacterContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LogicCharacterContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitLogicCharacter(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) LogicCharacter() (localctx ILogicCharacterContext) { + localctx = NewLogicCharacterContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 24, bicepParserRULE_logicCharacter) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(201) + _la = p.GetTokenStream().LA(1) + + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&270582939648) != 0) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + // IPrimaryExpressionContext is an interface to support dynamic dispatch. type IPrimaryExpressionContext interface { antlr.ParserRuleContext @@ -2149,6 +3260,7 @@ type IPrimaryExpressionContext interface { MULTILINE_STRING() antlr.TerminalNode Array() IArrayContext Object() IObjectContext + ForExpression() IForExpressionContext ParenthesizedExpression() IParenthesizedExpressionContext // IsPrimaryExpressionContext differentiates from other interfaces. @@ -2271,6 +3383,22 @@ func (s *PrimaryExpressionContext) Object() IObjectContext { return t.(IObjectContext) } +func (s *PrimaryExpressionContext) ForExpression() IForExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IForExpressionContext) +} + func (s *PrimaryExpressionContext) ParenthesizedExpression() IParenthesizedExpressionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { @@ -2307,39 +3435,39 @@ func (s *PrimaryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interf func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { localctx = NewPrimaryExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 16, bicepParserRULE_primaryExpression) - p.SetState(146) + p.EnterRule(localctx, 26, bicepParserRULE_primaryExpression) + p.SetState(211) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 12, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(139) + p.SetState(203) p.LiteralValue() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(140) + p.SetState(204) p.FunctionCall() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(141) + p.SetState(205) p.InterpString() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(142) + p.SetState(206) p.Match(bicepParserMULTILINE_STRING) if p.HasError() { // Recognition error - abort rule @@ -2350,21 +3478,28 @@ func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(143) + p.SetState(207) p.Array() } case 6: p.EnterOuterAlt(localctx, 6) { - p.SetState(144) + p.SetState(208) p.Object() } case 7: p.EnterOuterAlt(localctx, 7) { - p.SetState(145) + p.SetState(209) + p.ForExpression() + } + + case 8: + p.EnterOuterAlt(localctx, 8) + { + p.SetState(210) p.ParenthesizedExpression() } @@ -2487,19 +3622,19 @@ func (s *ParenthesizedExpressionContext) Accept(visitor antlr.ParseTreeVisitor) func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressionContext) { localctx = NewParenthesizedExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 18, bicepParserRULE_parenthesizedExpression) + p.EnterRule(localctx, 28, bicepParserRULE_parenthesizedExpression) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(148) + p.SetState(213) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(150) + p.SetState(215) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2508,7 +3643,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(149) + p.SetState(214) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2518,10 +3653,10 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(152) + p.SetState(217) p.expression(0) } - p.SetState(154) + p.SetState(219) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2530,7 +3665,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(153) + p.SetState(218) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2540,7 +3675,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(156) + p.SetState(221) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -2654,10 +3789,10 @@ func (s *TypeExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { localctx = NewTypeExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 20, bicepParserRULE_typeExpression) + p.EnterRule(localctx, 30, bicepParserRULE_typeExpression) p.EnterOuterAlt(localctx, 1) { - p.SetState(158) + p.SetState(223) var _x = p.Identifier() @@ -2779,18 +3914,18 @@ func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { localctx = NewLiteralValueContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 22, bicepParserRULE_literalValue) - p.SetState(165) + p.EnterRule(localctx, 32, bicepParserRULE_literalValue) + p.SetState(230) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 20, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(160) + p.SetState(225) p.Match(bicepParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -2801,7 +3936,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(161) + p.SetState(226) p.Match(bicepParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -2812,7 +3947,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(162) + p.SetState(227) p.Match(bicepParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -2823,7 +3958,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(163) + p.SetState(228) p.Match(bicepParserNULL) if p.HasError() { // Recognition error - abort rule @@ -2834,7 +3969,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(164) + p.SetState(229) p.Identifier() } @@ -2983,19 +4118,19 @@ func (s *ObjectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Object() (localctx IObjectContext) { localctx = NewObjectContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 24, bicepParserRULE_object) + p.EnterRule(localctx, 34, bicepParserRULE_object) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(167) + p.SetState(232) p.Match(bicepParserOBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(184) + p.SetState(249) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3003,7 +4138,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) if _la == bicepParserNL { - p.SetState(169) + p.SetState(234) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3012,7 +4147,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(168) + p.SetState(233) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3020,26 +4155,26 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(171) + p.SetState(236) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(181) + p.SetState(246) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&524271616) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&275133743104) != 0 { { - p.SetState(173) + p.SetState(238) p.ObjectProperty() } - p.SetState(175) + p.SetState(240) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3048,7 +4183,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(174) + p.SetState(239) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3056,7 +4191,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(177) + p.SetState(242) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3064,7 +4199,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) } - p.SetState(183) + p.SetState(248) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3074,7 +4209,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } { - p.SetState(186) + p.SetState(251) p.Match(bicepParserCBRACE) if p.HasError() { // Recognition error - abort rule @@ -3227,9 +4362,9 @@ func (s *ObjectPropertyContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { localctx = NewObjectPropertyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 26, bicepParserRULE_objectProperty) + p.EnterRule(localctx, 36, bicepParserRULE_objectProperty) p.EnterOuterAlt(localctx, 1) - p.SetState(190) + p.SetState(255) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3238,7 +4373,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: { - p.SetState(188) + p.SetState(253) var _x = p.Identifier() @@ -3247,7 +4382,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: { - p.SetState(189) + p.SetState(254) p.InterpString() } @@ -3256,7 +4391,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { goto errorExit } { - p.SetState(192) + p.SetState(257) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3264,7 +4399,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } } { - p.SetState(193) + p.SetState(258) p.expression(0) } @@ -3409,19 +4544,19 @@ func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Array() (localctx IArrayContext) { localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 28, bicepParserRULE_array) + p.EnterRule(localctx, 38, bicepParserRULE_array) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(195) + p.SetState(260) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(199) + p.SetState(264) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3430,7 +4565,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for _la == bicepParserNL { { - p.SetState(196) + p.SetState(261) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3438,27 +4573,27 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } } - p.SetState(201) + p.SetState(266) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(205) + p.SetState(270) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1061146706) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&824889561170) != 0 { { - p.SetState(202) + p.SetState(267) p.ArrayItem() } - p.SetState(207) + p.SetState(272) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3466,7 +4601,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(208) + p.SetState(273) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -3584,22 +4719,22 @@ func (s *ArrayItemContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { localctx = NewArrayItemContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 30, bicepParserRULE_arrayItem) + p.EnterRule(localctx, 40, bicepParserRULE_arrayItem) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(210) + p.SetState(275) p.expression(0) } - p.SetState(217) + p.SetState(282) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { case bicepParserNL: - p.SetState(212) + p.SetState(277) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3608,7 +4743,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(211) + p.SetState(276) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3616,7 +4751,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - p.SetState(214) + p.SetState(279) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3626,7 +4761,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { case bicepParserCOMMA: { - p.SetState(216) + p.SetState(281) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -3744,10 +4879,10 @@ func (s *DecoratorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Decorator() (localctx IDecoratorContext) { localctx = NewDecoratorContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 32, bicepParserRULE_decorator) + p.EnterRule(localctx, 42, bicepParserRULE_decorator) p.EnterOuterAlt(localctx, 1) { - p.SetState(219) + p.SetState(284) p.Match(bicepParserAT) if p.HasError() { // Recognition error - abort rule @@ -3755,11 +4890,11 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { } } { - p.SetState(220) + p.SetState(285) p.DecoratorExpression() } { - p.SetState(221) + p.SetState(286) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3884,29 +5019,29 @@ func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 34, bicepParserRULE_decoratorExpression) - p.SetState(228) + p.EnterRule(localctx, 44, bicepParserRULE_decoratorExpression) + p.SetState(293) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(223) + p.SetState(288) p.FunctionCall() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(224) + p.SetState(289) p.expression(0) } { - p.SetState(225) + p.SetState(290) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -3914,7 +5049,7 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex } } { - p.SetState(226) + p.SetState(291) p.FunctionCall() } @@ -4054,27 +5189,27 @@ func (s *FunctionCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { localctx = NewFunctionCallContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 36, bicepParserRULE_functionCall) + p.EnterRule(localctx, 46, bicepParserRULE_functionCall) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(230) + p.SetState(295) p.Identifier() } { - p.SetState(231) + p.SetState(296) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(236) + p.SetState(301) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext()) == 1 { - p.SetState(233) + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 32, p.GetParserRuleContext()) == 1 { + p.SetState(298) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4083,7 +5218,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(232) + p.SetState(297) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4093,14 +5228,14 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(235) + p.SetState(300) p.ArgumentList() } } else if p.HasError() { // JIM goto errorExit } - p.SetState(239) + p.SetState(304) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4109,7 +5244,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(238) + p.SetState(303) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4119,7 +5254,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(241) + p.SetState(306) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -4268,15 +5403,15 @@ func (s *ArgumentListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { localctx = NewArgumentListContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 38, bicepParserRULE_argumentList) + p.EnterRule(localctx, 48, bicepParserRULE_argumentList) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(243) + p.SetState(308) p.expression(0) } - p.SetState(251) + p.SetState(316) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4285,14 +5420,14 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { for _la == bicepParserCOMMA { { - p.SetState(244) + p.SetState(309) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(246) + p.SetState(311) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4301,7 +5436,7 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { if _la == bicepParserNL { { - p.SetState(245) + p.SetState(310) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4311,11 +5446,11 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { } { - p.SetState(248) + p.SetState(313) p.expression(0) } - p.SetState(253) + p.SetState(318) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4456,15 +5591,15 @@ func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Identifier() (localctx IIdentifierContext) { localctx = NewIdentifierContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 40, bicepParserRULE_identifier) + p.EnterRule(localctx, 50, bicepParserRULE_identifier) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(254) + p.SetState(319) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&505397248) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&275114868736) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -4487,7 +5622,7 @@ errorExit: func (p *bicepParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { switch ruleIndex { - case 7: + case 11: var t *ExpressionContext = nil if localctx != nil { t = localctx.(*ExpressionContext) @@ -4502,13 +5637,19 @@ func (p *bicepParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex i func (p *bicepParser) Expression_Sempred(localctx antlr.RuleContext, predIndex int) bool { switch predIndex { case 0: - return p.Precpred(p.GetParserRuleContext(), 4) + return p.Precpred(p.GetParserRuleContext(), 5) case 1: - return p.Precpred(p.GetParserRuleContext(), 3) + return p.Precpred(p.GetParserRuleContext(), 2) case 2: - return p.Precpred(p.GetParserRuleContext(), 2) + return p.Precpred(p.GetParserRuleContext(), 6) + + case 3: + return p.Precpred(p.GetParserRuleContext(), 4) + + case 4: + return p.Precpred(p.GetParserRuleContext(), 3) default: panic("No predicate with index: " + fmt.Sprint(predIndex)) diff --git a/pkg/parser/bicep/antlr/parser/bicep_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_visitor.go index 5dfbaa2a70b..7b0ba415ce6 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_visitor.go +++ b/pkg/parser/bicep/antlr/parser/bicep_visitor.go @@ -26,12 +26,27 @@ type bicepVisitor interface { // Visit a parse tree produced by bicepParser#resourceDecl. VisitResourceDecl(ctx *ResourceDeclContext) interface{} + // Visit a parse tree produced by bicepParser#ifCondition. + VisitIfCondition(ctx *IfConditionContext) interface{} + + // Visit a parse tree produced by bicepParser#forExpression. + VisitForExpression(ctx *ForExpressionContext) interface{} + + // Visit a parse tree produced by bicepParser#forVariableBlock. + VisitForVariableBlock(ctx *ForVariableBlockContext) interface{} + + // Visit a parse tree produced by bicepParser#forBody. + VisitForBody(ctx *ForBodyContext) interface{} + // Visit a parse tree produced by bicepParser#interpString. VisitInterpString(ctx *InterpStringContext) interface{} // Visit a parse tree produced by bicepParser#expression. VisitExpression(ctx *ExpressionContext) interface{} + // Visit a parse tree produced by bicepParser#logicCharacter. + VisitLogicCharacter(ctx *LogicCharacterContext) interface{} + // Visit a parse tree produced by bicepParser#primaryExpression. VisitPrimaryExpression(ctx *PrimaryExpressionContext) interface{} diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 1c7cbde348f..37045df1716 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -21,10 +21,9 @@ type BicepVisitor struct { } type JSONBicep struct { - Parameters map[string]interface{} `json:"parameters"` - Variables map[string]interface{} `json:"variables"` - Resources []interface{} `json:"resources"` - Lines map[string]model.LineObject `json:"_kics_lines"` + Parameters map[string]interface{} `json:"parameters"` + Variables map[string]interface{} `json:"variables"` + Resources []interface{} `json:"resources"` } const CloseParenthesis = "')" @@ -33,7 +32,6 @@ func NewBicepVisitor() *BicepVisitor { paramList := map[string]interface{}{} varList := map[string]interface{}{} resourceList := []interface{}{} - return &BicepVisitor{paramList: paramList, varList: varList, resourceList: resourceList} } @@ -42,7 +40,6 @@ func convertVisitorToJSONBicep(visitor *BicepVisitor) *JSONBicep { Parameters: visitor.paramList, Variables: visitor.varList, Resources: visitor.resourceList, - Lines: make(map[string]model.LineObject), } } @@ -285,7 +282,7 @@ func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{ return nil } } - } else { + } else if ctx.LogicCharacter() == nil { for _, val := range ctx.AllExpression() { val.Accept(s) } From ddb2652da61d6d20028b2ec2e78f24428d11a070 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Fri, 12 Apr 2024 18:14:29 +0100 Subject: [PATCH 044/130] added documentation for bicep support --- docs/future_improvements.md | 32 ++++++++++++++++++++++++++++++++ docs/platforms.md | 16 +++++++++++++++- mkdocs.yml | 1 + 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 docs/future_improvements.md diff --git a/docs/future_improvements.md b/docs/future_improvements.md new file mode 100644 index 00000000000..09637022fb5 --- /dev/null +++ b/docs/future_improvements.md @@ -0,0 +1,32 @@ +## Introduction + +We're dedicated to improving detection capabilities, addressing limitations, and incorporating user feedback to deliver a more robust scanning solution. As technology evolves and user needs evolve, we are committed to continually improving KICS to provide greater value, efficiency, and security for our users. + +Here, you'll find information on upcoming enhancements, planned features, and areas of focus for future releases. + +--- + +## Bicep + +### Logic and Cycle Operators + +Currently, KICS does not analyze logic and cycle operators. This means that expressions within constructs such as for and if statements are ignored during the scanning process. As a result, any security issues or vulnerabilities present within these constructs will not be detected by KICS. + +### Module Support + +KICS does not currently support the analysis of modules within Bicep files. Due to our current scanning methodology, which involves processing each file independently, we are unable to scan other files referenced within modules. Therefore, any security issues or vulnerabilities contained within modules will not be identified by KICS. + +### Passwords and Secrets Query + +Due to the nature of regex-based pattern matching, the passwords and secrets query may generate false positives when applied to Bicep files. Bicep files have a different syntax and structure compared to other file formats which can affect the accuracy of the query. + +To mitigate the potential for false positives and ensure a more accurate scanning process for Bicep files, we recommend users consider disabling the passwords and secrets query when scanning Bicep files. This can be achieved by using the "--disable-queries" flag. + +Note: Disabling the passwords and secrets query may reduce the overall coverage of security checks performed by KICS. Therefore, users should consider the trade-offs and implications based on their specific use case and security requirements. More information about this query can be found on the [Password and Secrets documentation](https://github.com/Checkmarx/kics/blob/master/docs/secrets.md). + +--- + +## Contribution + +If you'd like to contribute or provide insightfull feedback regarding KICS' capabilities and limitations, please don't hesitate to contact [our team](https://github.com/Checkmarx/kics/issues/). +We appreciate your patience and understanding as we strive to deliver a more robust scanning solution. \ No newline at end of file diff --git a/docs/platforms.md b/docs/platforms.md index 84296a8c415..ddcfe29e3b0 100644 --- a/docs/platforms.md +++ b/docs/platforms.md @@ -9,14 +9,28 @@ KICS supports scanning Ansible files with `.yaml` extension. KICS can decrypt Ansible Vault files on the fly. For that, you need to define the environment variable `ANSIBLE_VAULT_PASSWORD_FILE`. ## Ansible Config + KICS supports scanning Ansible Configuration files with `.cfg` or `.conf` extension. ## Ansible Inventory + KICS supports scanning Ansible Inventory files with `.ini`, `.json` or `.yaml` extension. ## Azure Resource Manager -KICS supports scanning Azure Resource Manager (ARM) templates with `.json` extension. To build ARM JSON templates from Bicep code check the [official ARM documentation](https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-cli#build) and [here](https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/compare-template-syntax) to understand the differences between ARM JSON templates and Bicep. +KICS supports scanning Azure Resource Manager (ARM) templates with `.json` extension. + +## Bicep + +KICS supports scanning Bicep files with `.bicep` extension. + +To build ARM JSON templates from Bicep code or vice-versa, check the [official ARM documentation](https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-cli#build). + +To understand the differences between ARM JSON templates and Bicep check [this official syntax comparison](https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/compare-template-syntax). + +Note that KICS recognizes this technology as Azure Resource Manager (for queries purpose). + +[Future Improvements](future_improvements.md) ## CDK diff --git a/mkdocs.yml b/mkdocs.yml index 0d5ebea0b33..f2da55dd4da 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -38,6 +38,7 @@ nav: - Architecture: architecture.md - Auto Remediation : kics_auto_remediation.md - Certifications: certifications.md + - Future Improvements: future_improvements.md - Changes in v1.3.0: changes.md - Changes in v1.6.0: changes1_6.md - Changes in v1.7.0: changes1_7.md From 83d6c7fe2ba66109d8e85853c5c1a411e0b7fc80 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 15 Apr 2024 09:45:46 +0100 Subject: [PATCH 045/130] improvements to platforms documentation regarding bicep --- docs/platforms.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms.md b/docs/platforms.md index ddcfe29e3b0..d98445d45aa 100644 --- a/docs/platforms.md +++ b/docs/platforms.md @@ -30,7 +30,7 @@ To understand the differences between ARM JSON templates and Bicep check [this o Note that KICS recognizes this technology as Azure Resource Manager (for queries purpose). -[Future Improvements](future_improvements.md) +Explore our ongoing enhancements and planed features on our [Future Improvements](future_improvements.md) page. ## CDK From 99b4bc3bbd502324e24a2cd3c3a28200da4e0f56 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 15 Apr 2024 10:00:39 +0100 Subject: [PATCH 046/130] Fix phrase construction on documentation --- docs/platforms.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/platforms.md b/docs/platforms.md index d98445d45aa..47d96dbfa9f 100644 --- a/docs/platforms.md +++ b/docs/platforms.md @@ -24,9 +24,7 @@ KICS supports scanning Azure Resource Manager (ARM) templates with `.json` exten KICS supports scanning Bicep files with `.bicep` extension. -To build ARM JSON templates from Bicep code or vice-versa, check the [official ARM documentation](https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-cli#build). - -To understand the differences between ARM JSON templates and Bicep check [this official syntax comparison](https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/compare-template-syntax). +For instructions on converting between ARM JSON templates and Bicep code, refer to the [official ARM documentation](https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-cli#build). To understand the distinctions between the two, explore the [official syntax comparison](https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/compare-template-syntax). Note that KICS recognizes this technology as Azure Resource Manager (for queries purpose). From 66b316f4049d4e150dc12d04007f6e7e6aefc1f1 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 15 Apr 2024 15:06:54 +0100 Subject: [PATCH 047/130] fix typo on flag usage --- docs/future_improvements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/future_improvements.md b/docs/future_improvements.md index 09637022fb5..bba4510d51e 100644 --- a/docs/future_improvements.md +++ b/docs/future_improvements.md @@ -20,7 +20,7 @@ KICS does not currently support the analysis of modules within Bicep files. Due Due to the nature of regex-based pattern matching, the passwords and secrets query may generate false positives when applied to Bicep files. Bicep files have a different syntax and structure compared to other file formats which can affect the accuracy of the query. -To mitigate the potential for false positives and ensure a more accurate scanning process for Bicep files, we recommend users consider disabling the passwords and secrets query when scanning Bicep files. This can be achieved by using the "--disable-queries" flag. +To mitigate the potential for false positives and ensure a more accurate scanning process for Bicep files, we recommend users consider disabling the passwords and secrets query when scanning Bicep files. This can be achieved by using the "--disable-secrets" flag. Note: Disabling the passwords and secrets query may reduce the overall coverage of security checks performed by KICS. Therefore, users should consider the trade-offs and implications based on their specific use case and security requirements. More information about this query can be found on the [Password and Secrets documentation](https://github.com/Checkmarx/kics/blob/master/docs/secrets.md). From f1f6e7c7b1a770288460b1e77595142ee2faa246 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 17 Apr 2024 16:18:17 +0100 Subject: [PATCH 048/130] add generated files from antlr to coverageignore --- .github/scripts/coverage/.coverageignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/coverage/.coverageignore b/.github/scripts/coverage/.coverageignore index fdc4ff8fd89..1a2ca3703ab 100644 --- a/.github/scripts/coverage/.coverageignore +++ b/.github/scripts/coverage/.coverageignore @@ -3,4 +3,5 @@ pkg/engine/mock/*.go */**/*_test.go **/*_mock.go pkg/parser/jsonfilter/parser/jsonfilter* +pkg/parser/bicep/antlr/parser/bicep* internal/sentry From 85e91d2203374e5b244c2c21757211022833c797 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Thu, 18 Apr 2024 10:42:11 +0100 Subject: [PATCH 049/130] added bicep line detection --- pkg/parser/bicep/parser.go | 62 +++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 37045df1716..b5bfc604b1e 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -13,6 +13,13 @@ import ( type Parser struct { } +const kicsPrefix = "_kics_" +const kicsLine = kicsPrefix + "line" +const kicsLines = kicsPrefix + "lines" +const kicsArray = kicsPrefix + "arr" + +const CloseParenthesis = "')" + type BicepVisitor struct { parser.BasebicepVisitor paramList map[string]interface{} @@ -26,7 +33,10 @@ type JSONBicep struct { Resources []interface{} `json:"resources"` } -const CloseParenthesis = "')" +type KicsObjectProperty struct { + objectProperty map[string]interface{} + line int +} func NewBicepVisitor() *BicepVisitor { paramList := map[string]interface{}{} @@ -160,6 +170,14 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } } + line := map[string]int{kicsLine: ctx.GetStop().GetLine() + 1} + lines := map[string]map[string]int{ + kicsPrefix + "defaultValue": line, + kicsPrefix + "type": line, + } + + param[kicsLines] = lines + s.paramList[identifier] = param return nil } @@ -201,7 +219,7 @@ func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interf resource[name] = values } - resource["name"] = identifier + resource["identifier"] = identifier if ctx.Object() != nil { object, ok := ctx.Object().Accept(s).(map[string]interface{}) if !ok { @@ -212,6 +230,17 @@ func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interf } } + lines, ok := resource[kicsLines].(map[string]interface{}) + if !ok { + lines = map[string]interface{}{} + } + + line := map[string]int{kicsLine: ctx.GetStart().GetLine()} + lines[kicsPrefix+"apiVersion"] = line + + line = map[string]int{kicsLine: ctx.GetStart().GetLine()} + lines[kicsPrefix+"type"] = line + s.resourceList = append(s.resourceList, resource) return nil @@ -423,16 +452,35 @@ func (s *BicepVisitor) VisitArrayItem(ctx *parser.ArrayItemContext) interface{} func (s *BicepVisitor) VisitObject(ctx *parser.ObjectContext) interface{} { object := map[string]interface{}{} + propertiesLines := map[string]interface{}{} for _, val := range ctx.AllObjectProperty() { - objectProperty, ok := val.Accept(s).(map[string]interface{}) + objectProperty, ok := val.Accept(s).(KicsObjectProperty) if !ok { return object } - for key, val := range objectProperty { + for key, val := range objectProperty.objectProperty { object[key] = val + line := map[string]interface{}{kicsLine: objectProperty.line} + + arr, isArray := val.([]interface{}) + if isArray { + for range arr { + arrLine := map[string]int{kicsLine: objectProperty.line} + kicsDefault := map[string]interface{}{kicsPrefix + "_default": arrLine} + kicsArr := []interface{}{kicsDefault} + line[kicsArray] = kicsArr + } + + } + propertiesLines[kicsPrefix+key] = line } } + defaultLine := map[string]int{kicsLine: ctx.GetStart().GetLine()} + propertiesLines[kicsPrefix+"_default"] = defaultLine + + object[kicsLines] = propertiesLines + return object } @@ -465,20 +513,20 @@ func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) in if ctx.Identifier() != nil { identifier, ok := ctx.Identifier().Accept(s).(string) if !ok { - return map[string]interface{}{} + return KicsObjectProperty{objectProperty: map[string]interface{}{}, line: 0} } objectProperty[identifier] = objectValue } if ctx.InterpString() != nil { interpString, ok := ctx.InterpString().Accept(s).(string) if !ok { - return map[string]interface{}{} + return KicsObjectProperty{objectProperty: map[string]interface{}{}, line: 0} } objectProperty[interpString] = objectValue } } - return objectProperty + return KicsObjectProperty{objectProperty: objectProperty, line: ctx.GetStart().GetLine()} } func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{} { From 68122a2831318494c0c5a59eea551a99669f7d49 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Thu, 18 Apr 2024 10:51:11 +0100 Subject: [PATCH 050/130] lint fixes --- pkg/parser/bicep/parser.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index b5bfc604b1e..d926e417f4d 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -202,10 +202,7 @@ func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interf func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interface{} { resource := map[string]interface{}{} - interpString, ok := ctx.InterpString().Accept(s).(string) - if !ok { - return nil - } + interpString := ctx.InterpString().Accept(s).(string) identifier, ok := ctx.Identifier().Accept(s).(string) if !ok { return nil @@ -470,7 +467,6 @@ func (s *BicepVisitor) VisitObject(ctx *parser.ObjectContext) interface{} { kicsArr := []interface{}{kicsDefault} line[kicsArray] = kicsArr } - } propertiesLines[kicsPrefix+key] = line } From cfdddffd04c4089cde54c69b554f652b02d7aa27 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Thu, 18 Apr 2024 11:15:02 +0100 Subject: [PATCH 051/130] lint fixes --- pkg/parser/bicep/parser.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index d926e417f4d..a2580a41001 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -203,10 +203,7 @@ func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interf func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interface{} { resource := map[string]interface{}{} interpString := ctx.InterpString().Accept(s).(string) - identifier, ok := ctx.Identifier().Accept(s).(string) - if !ok { - return nil - } + identifier := ctx.Identifier().Accept(s).(string) resourceType := strings.Split(interpString, "@")[0] apiVersion := strings.Split(interpString, "@")[1] resource["type"] = resourceType From edb9c7f3f5f07f458af76a86ba4d66cc54410c9d Mon Sep 17 00:00:00 2001 From: cxMiguelSilva Date: Thu, 18 Apr 2024 12:10:36 +0100 Subject: [PATCH 052/130] update antlr make dkr-build-antlr --- Makefile | 2 +- docker/Dockerfile.antlr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8a72fa68f98..b586d0c4264 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,7 @@ dkr-compose: ## build docker image and runs docker-compose up .PHONY: dkr-build-antlr dkr-build-antlr: ## build ANTLRv4 docker image and generate parser based on given grammar @docker build -t antlr4-generator:dev -f ./docker/Dockerfile.antlr . - @docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) -v $(pwd)/pkg/parser/jsonfilter/:/work -it antlr4-generator:dev + @docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) -v $(pwd)/pkg/parser:/work -it antlr4-generator:dev .PHONY: release release: ## goreleaser --rm-dist diff --git a/docker/Dockerfile.antlr b/docker/Dockerfile.antlr index b6a3773a185..59dfd91819a 100644 --- a/docker/Dockerfile.antlr +++ b/docker/Dockerfile.antlr @@ -32,4 +32,4 @@ RUN adduser \ COPY --from=builder /opt/antlr4/antlr4/antlr4-tool.jar /usr/local/lib/ WORKDIR /work ENTRYPOINT ["java", "-Xmx500M", "-cp", "/usr/local/lib/antlr4-tool.jar", "org.antlr.v4.Tool"] -CMD [ "-Dlanguage=Go", "-visitor", "-no-listener", "-o", "parser", "JSONFilter.g4" ] +CMD [ "-Dlanguage=Go", "-visitor", "-no-listener", "-o", "parser", "jsonfilter/JSONFilter.g4", "-Dlanguage=Go", "-visitor", "-no-listener", "-o", "parser", "bicep/antlr/bicep.g4"] From 589913166aae48c64a0ebbea8616aeaaad9685ea Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 18 Apr 2024 12:20:46 +0100 Subject: [PATCH 053/130] update .golangci to skip bicep directory --- .golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yml b/.golangci.yml index a062ac63ada..913f6ab6f21 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -137,3 +137,4 @@ run: - docs - vendor - pkg/parser/jsonfilter/parser + - pkg/parser/bicep/antlr From b8c21f153f5e51b6788c868e81ad29d441dd9206 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 18 Apr 2024 12:43:50 +0100 Subject: [PATCH 054/130] added unit test for kics lines --- pkg/parser/bicep/parser_test.go | 276 +++++++++++++++++++++++++++++++- 1 file changed, 275 insertions(+), 1 deletion(-) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 4a341b0ac5f..9b181965e43 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -67,6 +67,14 @@ func TestParseBicepFile(t *testing.T) { want: `{ "parameters": { "isNumber": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 10 + }, + "_kics_type": { + "_kics_line": 10 + } + }, "defaultValue": true, "metadata": { "description": "This is a test bool param declaration." @@ -74,6 +82,14 @@ func TestParseBicepFile(t *testing.T) { "type": "bool" }, "middleString": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 13 + }, + "_kics_type": { + "_kics_line": 13 + } + }, "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'", "metadata": { "description": "This is a test middle string param declaration." @@ -81,6 +97,14 @@ func TestParseBicepFile(t *testing.T) { "type": "string" }, "numberNodes": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 7 + }, + "_kics_type": { + "_kics_line": 7 + } + }, "defaultValue": 2, "metadata": { "description": "This is a test int param declaration." @@ -88,6 +112,14 @@ func TestParseBicepFile(t *testing.T) { "type": "int" }, "projectName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 4 + }, + "_kics_type": { + "_kics_line": 4 + } + }, "defaultValue": "test", "metadata": { "description": "This is a test param with secure declaration." @@ -97,7 +129,7 @@ func TestParseBicepFile(t *testing.T) { }, "resources": [], "variables": {} - }`, + }`, wantErr: false, }, { @@ -129,6 +161,14 @@ func TestParseBicepFile(t *testing.T) { want: `{ "parameters": { "OSVersion": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 35 + }, + "_kics_type": { + "_kics_line": 35 + } + }, "allowedValues": [ [ "2008-R2-SP1", @@ -154,6 +194,14 @@ func TestParseBicepFile(t *testing.T) { "type": "string" }, "adminPassword": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 10 + }, + "_kics_type": { + "_kics_line": 10 + } + }, "metadata": { "description": "Password for the Virtual Machine." }, @@ -161,12 +209,28 @@ func TestParseBicepFile(t *testing.T) { "type": "secureString" }, "adminUsername": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 5 + }, + "_kics_type": { + "_kics_line": 5 + } + }, "metadata": { "description": "Username for the Virtual Machine." }, "type": "string" }, "location": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 41 + }, + "_kics_type": { + "_kics_line": 41 + } + }, "defaultValue": "[resourceGroup().location]", "metadata": { "description": "Location for all resources." @@ -174,10 +238,26 @@ func TestParseBicepFile(t *testing.T) { "type": "string" }, "parenthesis": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 46 + }, + "_kics_type": { + "_kics_line": 46 + } + }, "defaultValue": "simple-vm", "type": "string" }, "vmName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 44 + }, + "_kics_type": { + "_kics_line": 44 + } + }, "defaultValue": "simple-vm", "metadata": { "description": "Name of the virtual machine." @@ -185,6 +265,14 @@ func TestParseBicepFile(t *testing.T) { "type": "string" }, "vmSize": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 38 + }, + "_kics_type": { + "_kics_line": 38 + } + }, "defaultValue": "Standard_D2_v3", "metadata": { "description": "Size of the virtual machine." @@ -194,6 +282,36 @@ func TestParseBicepFile(t *testing.T) { }, "resources": [ { + "_kics_lines": { + "_kics__default": { + "_kics_line": 50 + }, + "_kics_apiVersion": { + "_kics_line": 50 + }, + "_kics_dependsOn": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 99 + } + } + ], + "_kics_line": 99 + }, + "_kics_location": { + "_kics_line": 52 + }, + "_kics_name": { + "_kics_line": 51 + }, + "_kics_properties": { + "_kics_line": 53 + }, + "_kics_type": { + "_kics_line": 50 + } + }, "apiVersion": "2021-03-01", "dependsOn": [ { @@ -209,21 +327,92 @@ func TestParseBicepFile(t *testing.T) { ] } ], + "identifier": "vm", "location": "[parameters('location')]", "name": "[parameters('vmName')]", "properties": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 53 + }, + "_kics_diagnosticsProfile": { + "_kics_line": 90 + }, + "_kics_hardwareProfile": { + "_kics_line": 54 + }, + "_kics_networkProfile": { + "_kics_line": 83 + }, + "_kics_osProfile": { + "_kics_line": 57 + }, + "_kics_storageProfile": { + "_kics_line": 62 + } + }, "diagnosticsProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 90 + }, + "_kics_bootDiagnostics": { + "_kics_line": 91 + } + }, "bootDiagnostics": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 91 + }, + "_kics_enabled": { + "_kics_line": 92 + }, + "_kics_storageUri": { + "_kics_line": 93 + } + }, "enabled": true, "storageUri": "[reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob]" } }, "hardwareProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 54 + }, + "_kics_vmSize": { + "_kics_line": 55 + } + }, "vmSize": "[parameters('vmSize')]" }, "networkProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 83 + }, + "_kics_networkInterfaces": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 84 + } + } + ], + "_kics_line": 84 + } + }, "networkInterfaces": [ { + "_kics_lines": { + "_kics__default": { + "_kics_line": 85 + }, + "_kics_id": { + "_kics_line": 86 + } + }, "id": { "resourceId": [ "Microsoft.Network/networkInterfaces", @@ -234,27 +423,112 @@ func TestParseBicepFile(t *testing.T) { ] }, "osProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 57 + }, + "_kics_adminPassword": { + "_kics_line": 60 + }, + "_kics_adminUsername": { + "_kics_line": 59 + }, + "_kics_computerName": { + "_kics_line": 58 + } + }, "adminPassword": "[parameters('adminPassword')]", "adminUsername": "[parameters('adminUsername')]", "computerName": "[parameters('vmName')]" }, "storageProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 62 + }, + "_kics_dataDisks": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 75 + } + } + ], + "_kics_line": 75 + }, + "_kics_imageReference": { + "_kics_line": 63 + }, + "_kics_osDisk": { + "_kics_line": 69 + } + }, "dataDisks": [ { + "_kics_lines": { + "_kics__default": { + "_kics_line": 76 + }, + "_kics_createOption": { + "_kics_line": 79 + }, + "_kics_diskSizeGB": { + "_kics_line": 77 + }, + "_kics_lun": { + "_kics_line": 78 + } + }, "createOption": "Empty", "diskSizeGB": 1023, "lun": 0 } ], "imageReference": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 63 + }, + "_kics_offer": { + "_kics_line": 65 + }, + "_kics_publisher": { + "_kics_line": 64 + }, + "_kics_sku": { + "_kics_line": 66 + }, + "_kics_version": { + "_kics_line": 67 + } + }, "offer": "WindowsServer", "publisher": "MicrosoftWindowsServer", "sku": "[parameters('OSVersion')]", "version": "latest" }, "osDisk": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 69 + }, + "_kics_createOption": { + "_kics_line": 70 + }, + "_kics_managedDisk": { + "_kics_line": 71 + } + }, "createOption": "FromImage", "managedDisk": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 71 + }, + "_kics_storageAccountType": { + "_kics_line": 72 + } + }, "storageAccountType": "StandardSSD_LRS" } } From 5fec549f4192f6df42a49525cecc85acfc98893c Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Thu, 18 Apr 2024 16:09:18 +0100 Subject: [PATCH 055/130] fixing lines not working on some queries --- pkg/detector/default_detect.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/detector/default_detect.go b/pkg/detector/default_detect.go index 0605bda4e6b..0f6ca5b54da 100644 --- a/pkg/detector/default_detect.go +++ b/pkg/detector/default_detect.go @@ -46,6 +46,13 @@ func (d defaultDetectLine) DetectLine(file *model.FileMetadata, searchKey string for _, key := range splitSanitized { substr1, substr2 := GenerateSubstrings(key, extractedString) + // BICEP-specific tweaks in order to make bicep files compatible with ARM queries + if file.Kind == "BICEP" { + substr1 = strings.ReplaceAll(substr1, "resources", "resource") + substr1 = strings.ReplaceAll(substr1, "parameters", "param") + substr1 = strings.ReplaceAll(substr1, "variables", "variable") + } + detector, lines = detector.DetectCurrentLine(substr1, substr2, 0, lines) if detector.IsBreak { From 07fa9e5c151617a3fbca544f59a5150881a17de8 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 18 Apr 2024 18:05:58 +0100 Subject: [PATCH 056/130] remove unnecessary verifications --- pkg/parser/bicep/parser.go | 59 +++++++------------------------------- 1 file changed, 10 insertions(+), 49 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index a2580a41001..e35e645080f 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -130,12 +130,10 @@ func parseDecorators(decorators []parser.IDecoratorContext, s *BicepVisitor) map func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) interface{} { param := map[string]interface{}{} - identifier, ok := ctx.Identifier().Accept(s).(string) - if !ok { - return nil - } + identifier := ctx.Identifier().Accept(s).(string) if ctx.ParameterDefaultValue() != nil { paramVal := ctx.ParameterDefaultValue().Accept(s) + param["defaultValue"] = nil switch paramVal := paramVal.(type) { case map[string][]interface{}: stringifiedFunction := parseFunctionCall(paramVal) @@ -145,8 +143,6 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte paramVal = "[" + paramVal.(string) + "]" } param["defaultValue"] = paramVal - default: - param["defaultValue"] = nil } } if ctx.TypeExpression() != nil { @@ -184,10 +180,7 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interface{} { var variable = map[string]interface{}{} - identifier, ok := ctx.Identifier().Accept(s).(string) - if !ok { - return nil - } + identifier := ctx.Identifier().Accept(s).(string) expression := ctx.Expression().Accept(s) decoratorsMap := parseDecorators(ctx.AllDecorator(), s) for name, values := range decoratorsMap { @@ -280,10 +273,7 @@ func parseFunctionCall(functionData map[string][]interface{}) string { func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{} { if ctx.GetChildCount() > 1 { if ctx.Identifier() != nil { - identifier, ok := ctx.Identifier().Accept(s).(string) - if !ok { - return nil - } + identifier := ctx.Identifier().Accept(s).(string) for variable := range s.varList { if variable == identifier { identifier = "variables('" + identifier + CloseParenthesis @@ -359,14 +349,8 @@ func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interf if ctx.FALSE() != nil { return false } - if ctx.NULL() != nil { - return nil - } if ctx.Identifier() != nil { - identifier, ok := ctx.Identifier().Accept(s).(string) - if !ok { - return nil - } + identifier := ctx.Identifier().Accept(s).(string) for variable := range s.varList { if variable == identifier { identifier = "variables('" + identifier + CloseParenthesis @@ -504,17 +488,11 @@ func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) in } if ctx.Identifier() != nil { - identifier, ok := ctx.Identifier().Accept(s).(string) - if !ok { - return KicsObjectProperty{objectProperty: map[string]interface{}{}, line: 0} - } + identifier := ctx.Identifier().Accept(s).(string) objectProperty[identifier] = objectValue } if ctx.InterpString() != nil { - interpString, ok := ctx.InterpString().Accept(s).(string) - if !ok { - return KicsObjectProperty{objectProperty: map[string]interface{}{}, line: 0} - } + interpString := ctx.InterpString().Accept(s).(string) objectProperty[interpString] = objectValue } } @@ -527,21 +505,6 @@ func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{ identifier := ctx.IDENTIFIER().GetText() return identifier } - if (ctx.PARAM()) != nil { - return ctx.PARAM().GetText() - } - if (ctx.RESOURCE()) != nil { - return ctx.RESOURCE().GetText() - } - if (ctx.VAR()) != nil { - return ctx.VAR().GetText() - } - if (ctx.TRUE()) != nil { - return ctx.TRUE().GetText() - } - if (ctx.FALSE()) != nil { - return ctx.FALSE().GetText() - } if (ctx.NULL()) != nil { return ctx.NULL().GetText() } @@ -557,7 +520,7 @@ func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{ if (ctx.OBJECT()) != nil { return ctx.OBJECT().GetText() } - return nil + return "" } func (s *BicepVisitor) VisitParenthesizedExpression(ctx *parser.ParenthesizedExpressionContext) interface{} { @@ -574,11 +537,9 @@ func (s *BicepVisitor) VisitDecoratorExpression(ctx *parser.DecoratorExpressionC } func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interface{} { - identifier, ok := ctx.Identifier().Accept(s).(string) - if !ok { - return map[string]interface{}{} - } + identifier := ctx.Identifier().Accept(s).(string) var argumentList []interface{} + var ok bool if ctx.ArgumentList() != nil { argumentList, ok = ctx.ArgumentList().Accept(s).([]interface{}) if !ok { From 7a7305d23e6feb02eccc5c22b9c5b4596aac385d Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 18 Apr 2024 18:06:41 +0100 Subject: [PATCH 057/130] increase unit tests coverage --- pkg/parser/bicep/parser_test.go | 805 ++++++++++++---------- test/fixtures/bicep_test/parameters.bicep | 9 +- test/fixtures/bicep_test/resources.bicep | 14 +- 3 files changed, 455 insertions(+), 373 deletions(-) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 9b181965e43..7731c857dfe 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -65,71 +65,109 @@ func TestParseBicepFile(t *testing.T) { name: "Parse Bicep file with parameters", filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "parameters.bicep"), want: `{ - "parameters": { - "isNumber": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 10 - }, - "_kics_type": { - "_kics_line": 10 - } + "parameters": { + "array": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 18 }, - "defaultValue": true, - "metadata": { - "description": "This is a test bool param declaration." - }, - "type": "bool" + "_kics_type": { + "_kics_line": 18 + } }, - "middleString": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 13 - }, - "_kics_type": { - "_kics_line": 13 - } - }, - "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'", - "metadata": { - "description": "This is a test middle string param declaration." + "defaultValue": [ + "string" + ], + "type": "string" + }, + "isNumber": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 10 }, - "type": "string" + "_kics_type": { + "_kics_line": 10 + } }, - "numberNodes": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 7 - }, - "_kics_type": { - "_kics_line": 7 - } + "defaultValue": true, + "metadata": { + "description": "This is a test bool param declaration." + }, + "type": "bool" + }, + "middleString": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 13 }, - "defaultValue": 2, - "metadata": { - "description": "This is a test int param declaration." + "_kics_type": { + "_kics_line": 13 + } + }, + "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'", + "metadata": { + "description": "This is a test middle string param declaration." + }, + "type": "string" + }, + "null": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 20 }, - "type": "int" + "_kics_type": { + "_kics_line": 20 + } }, - "projectName": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 4 - }, - "_kics_type": { - "_kics_line": 4 - } + "defaultValue": null, + "type": "string" + }, + "numberNodes": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 7 }, - "defaultValue": "test", - "metadata": { - "description": "This is a test param with secure declaration." + "_kics_type": { + "_kics_line": 7 + } + }, + "defaultValue": 2, + "metadata": { + "description": "This is a test int param declaration." + }, + "type": "int" + }, + "projectName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 4 }, - "type": "secureString" - } + "_kics_type": { + "_kics_line": 4 + } + }, + "defaultValue": "[newGuid()]", + "metadata": { + "description": "This is a test param with secure declaration." + }, + "type": "secureString" }, - "resources": [], - "variables": {} - }`, + "secObj": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 16 + }, + "_kics_type": { + "_kics_line": 16 + } + }, + "defaultValue": false, + "type": "secureObject" + } + }, + "resources": [], + "variables": {} + }`, wantErr: false, }, { @@ -159,393 +197,420 @@ func TestParseBicepFile(t *testing.T) { name: "Parse completed Bicep file", filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "resources.bicep"), want: `{ - "parameters": { - "OSVersion": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 35 - }, - "_kics_type": { - "_kics_line": 35 - } - }, - "allowedValues": [ - [ - "2008-R2-SP1", - "2012-Datacenter", - "2012-R2-Datacenter", - "2016-Nano-Server", - "2016-Datacenter-with-Containers", - "2016-Datacenter", - "2019-Datacenter", - "2019-Datacenter-Core", - "2019-Datacenter-Core-smalldisk", - "2019-Datacenter-Core-with-Containers", - "2019-Datacenter-Core-with-Containers-smalldisk", - "2019-Datacenter-smalldisk", - "2019-Datacenter-with-Containers", - "2019-Datacenter-with-Containers-smalldisk" - ] - ], - "defaultValue": "2019-Datacenter", - "metadata": { - "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version." + "parameters": { + "OSVersion": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 35 }, - "type": "string" + "_kics_type": { + "_kics_line": 35 + } }, - "adminPassword": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 10 - }, - "_kics_type": { - "_kics_line": 10 - } - }, - "metadata": { - "description": "Password for the Virtual Machine." + "allowedValues": [ + [ + "2008-R2-SP1", + "2012-Datacenter", + "2012-R2-Datacenter", + "2016-Nano-Server", + "2016-Datacenter-with-Containers", + "2016-Datacenter", + "2019-Datacenter", + "2019-Datacenter-Core", + "2019-Datacenter-Core-smalldisk", + "2019-Datacenter-Core-with-Containers", + "2019-Datacenter-Core-with-Containers-smalldisk", + "2019-Datacenter-smalldisk", + "2019-Datacenter-with-Containers", + "2019-Datacenter-with-Containers-smalldisk" + ] + ], + "defaultValue": "2019-Datacenter", + "metadata": { + "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version." + }, + "type": "string" + }, + "adminPassword": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 10 }, - "minLength": 12, - "type": "secureString" + "_kics_type": { + "_kics_line": 10 + } }, - "adminUsername": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 5 - }, - "_kics_type": { - "_kics_line": 5 - } + "metadata": { + "description": "Password for the Virtual Machine." + }, + "minLength": 12, + "type": "secureString" + }, + "adminUsername": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 5 }, - "metadata": { - "description": "Username for the Virtual Machine." + "_kics_type": { + "_kics_line": 5 + } + }, + "metadata": { + "description": "Username for the Virtual Machine." + }, + "type": "string" + }, + "location": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 41 }, - "type": "string" + "_kics_type": { + "_kics_line": 41 + } }, - "location": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 41 - }, - "_kics_type": { - "_kics_line": 41 - } + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location for all resources." + }, + "type": "string" + }, + "parenthesis": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 46 }, - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." + "_kics_type": { + "_kics_line": 46 + } + }, + "defaultValue": "simple-vm", + "type": "string" + }, + "vmName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 44 }, - "type": "string" + "_kics_type": { + "_kics_line": 44 + } }, - "parenthesis": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 46 - }, - "_kics_type": { - "_kics_line": 46 - } + "defaultValue": "simple-vm", + "metadata": { + "description": "Name of the virtual machine." + }, + "type": "string" + }, + "vmSize": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 38 }, - "defaultValue": "simple-vm", - "type": "string" + "_kics_type": { + "_kics_line": 38 + } }, - "vmName": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 44 - }, - "_kics_type": { - "_kics_line": 44 - } + "defaultValue": "Standard_D2_v3", + "metadata": { + "description": "Size of the virtual machine." + }, + "type": "string" + } + }, + "resources": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 51 }, - "defaultValue": "simple-vm", - "metadata": { - "description": "Name of the virtual machine." + "_kics_apiVersion": { + "_kics_line": 50 }, - "type": "string" - }, - "vmSize": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 38 - }, - "_kics_type": { - "_kics_line": 38 - } + "_kics_dependsOn": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 100 + } + } + ], + "_kics_line": 100 }, - "defaultValue": "Standard_D2_v3", - "metadata": { - "description": "Size of the virtual machine." + "_kics_location": { + "_kics_line": 53 }, - "type": "string" - } - }, - "resources": [ - { + "_kics_name": { + "_kics_line": 52 + }, + "_kics_properties": { + "_kics_line": 54 + }, + "_kics_type": { + "_kics_line": 50 + } + }, + "apiVersion": "2021-03-01", + "dependsOn": [ + { + "resourceId": [ + "Microsoft.Network/networkInterfaces", + "variables('nicName')" + ] + }, + { + "resourceId": [ + "Microsoft.Storage/storageAccounts", + "variables('storageAccountName')" + ] + } + ], + "identifier": "vm", + "location": "[parameters('location')]", + "metadata": { + "description": "This is a test description for resources" + }, + "name": "[parameters('vmName')]", + "properties": { "_kics_lines": { "_kics__default": { - "_kics_line": 50 - }, - "_kics_apiVersion": { - "_kics_line": 50 + "_kics_line": 54 }, - "_kics_dependsOn": { - "_kics_arr": [ - { - "_kics__default": { - "_kics_line": 99 - } - } - ], - "_kics_line": 99 + "_kics_diagnosticsProfile": { + "_kics_line": 91 }, - "_kics_location": { - "_kics_line": 52 + "_kics_hardwareProfile": { + "_kics_line": 55 }, - "_kics_name": { - "_kics_line": 51 + "_kics_networkProfile": { + "_kics_line": 84 }, - "_kics_properties": { - "_kics_line": 53 + "_kics_osProfile": { + "_kics_line": 58 }, - "_kics_type": { - "_kics_line": 50 + "_kics_storageProfile": { + "_kics_line": 63 } }, - "apiVersion": "2021-03-01", - "dependsOn": [ - { - "resourceId": [ - "Microsoft.Network/networkInterfaces", - "variables('nicName')" - ] - }, - { - "resourceId": [ - "Microsoft.Storage/storageAccounts", - "variables('storageAccountName')" - ] - } - ], - "identifier": "vm", - "location": "[parameters('location')]", - "name": "[parameters('vmName')]", - "properties": { + "diagnosticsProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 53 - }, - "_kics_diagnosticsProfile": { - "_kics_line": 90 - }, - "_kics_hardwareProfile": { - "_kics_line": 54 - }, - "_kics_networkProfile": { - "_kics_line": 83 + "_kics_line": 91 }, - "_kics_osProfile": { - "_kics_line": 57 - }, - "_kics_storageProfile": { - "_kics_line": 62 + "_kics_bootDiagnostics": { + "_kics_line": 92 } }, - "diagnosticsProfile": { + "bootDiagnostics": { "_kics_lines": { "_kics__default": { - "_kics_line": 90 + "_kics_line": 92 + }, + "_kics_enabled": { + "_kics_line": 93 }, - "_kics_bootDiagnostics": { - "_kics_line": 91 + "_kics_storageUri": { + "_kics_line": 94 } }, - "bootDiagnostics": { + "enabled": true, + "storageUri": "[reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob]" + } + }, + "hardwareProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 55 + }, + "_kics_vmSize": { + "_kics_line": 56 + } + }, + "vmSize": "[parameters('vmSize')]" + }, + "networkProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 84 + }, + "_kics_networkInterfaces": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 85 + } + } + ], + "_kics_line": 85 + } + }, + "networkInterfaces": [ + { "_kics_lines": { "_kics__default": { - "_kics_line": 91 - }, - "_kics_enabled": { - "_kics_line": 92 + "_kics_line": 86 }, - "_kics_storageUri": { - "_kics_line": 93 + "_kics_id": { + "_kics_line": 87 } }, - "enabled": true, - "storageUri": "[reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob]" - } - }, - "hardwareProfile": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 54 - }, - "_kics_vmSize": { - "_kics_line": 55 + "id": { + "resourceId": [ + "Microsoft.Network/networkInterfaces", + "nick.variables('nicName')" + ] } + } + ] + }, + "osProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 58 + }, + "_kics_adminPassword": { + "_kics_line": 61 }, - "vmSize": "[parameters('vmSize')]" + "_kics_adminUsername": { + "_kics_line": 60 + }, + "_kics_computerName": { + "_kics_line": 59 + } }, - "networkProfile": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 83 - }, - "_kics_networkInterfaces": { - "_kics_arr": [ - { - "_kics__default": { - "_kics_line": 84 - } - } - ], - "_kics_line": 84 - } + "adminPassword": "[parameters('adminPassword')]", + "adminUsername": "[parameters('adminUsername')]", + "computerName": "[computer.parameters('vmName')]" + }, + "storageProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 63 }, - "networkInterfaces": [ - { - "_kics_lines": { + "_kics_dataDisks": { + "_kics_arr": [ + { "_kics__default": { - "_kics_line": 85 - }, - "_kics_id": { - "_kics_line": 86 + "_kics_line": 76 } - }, - "id": { - "resourceId": [ - "Microsoft.Network/networkInterfaces", - "variables('nicName')" - ] } - } - ] + ], + "_kics_line": 76 + }, + "_kics_imageReference": { + "_kics_line": 64 + }, + "_kics_osDisk": { + "_kics_line": 70 + } }, - "osProfile": { + "dataDisks": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 77 + }, + "_kics_createOption": { + "_kics_line": 80 + }, + "_kics_diskSizeGB": { + "_kics_line": 78 + }, + "_kics_lun": { + "_kics_line": 79 + } + }, + "createOption": "Empty", + "diskSizeGB": 1023, + "lun": 0 + } + ], + "imageReference": { "_kics_lines": { "_kics__default": { - "_kics_line": 57 + "_kics_line": 64 + }, + "_kics_offer": { + "_kics_line": 66 }, - "_kics_adminPassword": { - "_kics_line": 60 + "_kics_publisher": { + "_kics_line": 65 }, - "_kics_adminUsername": { - "_kics_line": 59 + "_kics_sku": { + "_kics_line": 67 }, - "_kics_computerName": { - "_kics_line": 58 + "_kics_version": { + "_kics_line": 68 } }, - "adminPassword": "[parameters('adminPassword')]", - "adminUsername": "[parameters('adminUsername')]", - "computerName": "[parameters('vmName')]" + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "[parameters('OSVersion')]", + "version": "latest" }, - "storageProfile": { + "osDisk": { "_kics_lines": { "_kics__default": { - "_kics_line": 62 + "_kics_line": 70 }, - "_kics_dataDisks": { - "_kics_arr": [ - { - "_kics__default": { - "_kics_line": 75 - } - } - ], - "_kics_line": 75 + "_kics_createOption": { + "_kics_line": 71 }, - "_kics_imageReference": { - "_kics_line": 63 - }, - "_kics_osDisk": { - "_kics_line": 69 + "_kics_managedDisk": { + "_kics_line": 72 } }, - "dataDisks": [ - { - "_kics_lines": { - "_kics__default": { - "_kics_line": 76 - }, - "_kics_createOption": { - "_kics_line": 79 - }, - "_kics_diskSizeGB": { - "_kics_line": 77 - }, - "_kics_lun": { - "_kics_line": 78 - } - }, - "createOption": "Empty", - "diskSizeGB": 1023, - "lun": 0 - } - ], - "imageReference": { + "createOption": "FromImage", + "managedDisk": { "_kics_lines": { "_kics__default": { - "_kics_line": 63 + "_kics_line": 72 }, - "_kics_offer": { - "_kics_line": 65 - }, - "_kics_publisher": { - "_kics_line": 64 - }, - "_kics_sku": { - "_kics_line": 66 - }, - "_kics_version": { - "_kics_line": 67 + "_kics_storageAccountType": { + "_kics_line": 73 } }, - "offer": "WindowsServer", - "publisher": "MicrosoftWindowsServer", - "sku": "[parameters('OSVersion')]", - "version": "latest" - }, - "osDisk": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 69 - }, - "_kics_createOption": { - "_kics_line": 70 - }, - "_kics_managedDisk": { - "_kics_line": 71 - } - }, - "createOption": "FromImage", - "managedDisk": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 71 - }, - "_kics_storageAccountType": { - "_kics_line": 72 - } - }, - "storageAccountType": "StandardSSD_LRS" - } + "storageAccountType": "StandardSSD_LRS" } } + } + }, + "type": "Microsoft.Compute/virtualMachines" + }, + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 106 }, - "type": "Microsoft.Compute/virtualMachines" - } - ], - "variables": { - "nicName": { - "value": "myVMNic" + "_kics_apiVersion": { + "_kics_line": 106 + }, + "_kics_location": { + "_kics_line": 108 + }, + "_kics_name": { + "_kics_line": 107 + }, + "_kics_type": { + "_kics_line": 106 + } }, - "storageAccountName": { - "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" - } + "apiVersion": "2021-03-01", + "identifier": "nic", + "location": null, + "name": "", + "type": "Microsoft.Network/networkInterfaces" } - }`, + ], + "variables": { + "nicName": { + "value": "myVMNic" + }, + "storageAccountName": { + "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" + } + } + }`, wantErr: false, }, } diff --git a/test/fixtures/bicep_test/parameters.bicep b/test/fixtures/bicep_test/parameters.bicep index 159f0962a0a..42924f5998e 100644 --- a/test/fixtures/bicep_test/parameters.bicep +++ b/test/fixtures/bicep_test/parameters.bicep @@ -1,6 +1,6 @@ @description('This is a test param with secure declaration.') @secure() -param projectName string = 'test' +param projectName string = newGuid() @description('This is a test int param declaration.') param numberNodes int = 2 @@ -10,3 +10,10 @@ param isNumber bool = true @description('This is a test middle string param declaration.') param middleString string = 'teste-${numberNodes}${isNumber}-teste' + +@secure() +param secObj object = false + +param array string = ['string'] + +param null string = null diff --git a/test/fixtures/bicep_test/resources.bicep b/test/fixtures/bicep_test/resources.bicep index dc13d963d65..547f3333f1a 100644 --- a/test/fixtures/bicep_test/resources.bicep +++ b/test/fixtures/bicep_test/resources.bicep @@ -47,6 +47,7 @@ param parenthesis string = ('simple-vm') var storageAccountName = 'bootdiags${uniqueString(resourceGroup().id)}' var nicName = 'myVMNic' +@sys.description('This is a test description for resources') resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { name: vmName location: location @@ -55,7 +56,7 @@ resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { vmSize: vmSize } osProfile: { - computerName: vmName + computerName: 'computer'.vmName adminUsername: adminUsername adminPassword: adminPassword } @@ -83,7 +84,7 @@ resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { networkProfile: { networkInterfaces: [ { - id: resourceId('Microsoft.Network/networkInterfaces', nicName) + id: resourceId('Microsoft.Network/networkInterfaces', 'nick'.nicName) } ] } @@ -101,3 +102,12 @@ resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { resourceId('Microsoft.Storage/storageAccounts', storageAccountName) ] } + +resource nic 'Microsoft.Network/networkInterfaces@2021-03-01' = { + name: nicName[0] + location: [ + for i in name: { + name: nicName + } + ] +} From 1db2483e103df9613f04acf129ba414b6faa406d Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Fri, 19 Apr 2024 10:22:11 +0100 Subject: [PATCH 058/130] increasing test coverage in unit tests --- pkg/parser/bicep/parser_test.go | 934 ++++++++++++----------- test/fixtures/bicep_test/resources.bicep | 4 + 2 files changed, 509 insertions(+), 429 deletions(-) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 7731c857dfe..4d66cb44792 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -53,6 +53,49 @@ func TestParser_GetResolvedFiles(t *testing.T) { } } +// TestParser_StringifyContent tests the StringifyContent function +func TestParser_StringifyContent(t *testing.T) { + type args struct { + content []byte + } + tests := []struct { + name string + p *Parser + args args + want string + wantErr bool + }{ + { + name: "Bicep stringify content", + p: &Parser{}, + args: args{ + content: []byte(`param vmName string = 'simple-vm'`), + }, + want: `param vmName string = 'simple-vm'`, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + p := &Parser{} + got, err := p.StringifyContent(tt.args.content) + if (err != nil) != tt.wantErr { + t.Errorf("Parser.StringifyContent() error = %v, wantErr %v", err, tt.wantErr) + return + } + if got != tt.want { + t.Errorf("Parser.StringifyContent() = %v, want %v", got, tt.want) + } + }) + } +} + +// Test_GetCommentToken must get the token that represents a comment +func Test_GetCommentToken(t *testing.T) { + parser := &Parser{} + require.Equal(t, "//", parser.GetCommentToken()) +} + func TestParseBicepFile(t *testing.T) { parser := &Parser{} tests := []struct { @@ -65,109 +108,109 @@ func TestParseBicepFile(t *testing.T) { name: "Parse Bicep file with parameters", filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "parameters.bicep"), want: `{ - "parameters": { - "array": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 18 + "parameters": { + "array": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 18 + }, + "_kics_type": { + "_kics_line": 18 + } }, - "_kics_type": { - "_kics_line": 18 - } + "defaultValue": [ + "string" + ], + "type": "string" }, - "defaultValue": [ - "string" - ], - "type": "string" - }, - "isNumber": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 10 + "isNumber": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 10 + }, + "_kics_type": { + "_kics_line": 10 + } }, - "_kics_type": { - "_kics_line": 10 - } - }, - "defaultValue": true, - "metadata": { - "description": "This is a test bool param declaration." - }, - "type": "bool" - }, - "middleString": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 13 + "defaultValue": true, + "metadata": { + "description": "This is a test bool param declaration." }, - "_kics_type": { - "_kics_line": 13 - } - }, - "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'", - "metadata": { - "description": "This is a test middle string param declaration." + "type": "bool" }, - "type": "string" - }, - "null": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 20 + "middleString": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 13 + }, + "_kics_type": { + "_kics_line": 13 + } }, - "_kics_type": { - "_kics_line": 20 - } - }, - "defaultValue": null, - "type": "string" - }, - "numberNodes": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 7 + "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'", + "metadata": { + "description": "This is a test middle string param declaration." }, - "_kics_type": { - "_kics_line": 7 - } + "type": "string" }, - "defaultValue": 2, - "metadata": { - "description": "This is a test int param declaration." - }, - "type": "int" - }, - "projectName": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 4 + "null": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 20 + }, + "_kics_type": { + "_kics_line": 20 + } }, - "_kics_type": { - "_kics_line": 4 - } + "defaultValue": null, + "type": "string" }, - "defaultValue": "[newGuid()]", - "metadata": { - "description": "This is a test param with secure declaration." + "numberNodes": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 7 + }, + "_kics_type": { + "_kics_line": 7 + } + }, + "defaultValue": 2, + "metadata": { + "description": "This is a test int param declaration." + }, + "type": "int" }, - "type": "secureString" - }, - "secObj": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 16 + "projectName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 4 + }, + "_kics_type": { + "_kics_line": 4 + } }, - "_kics_type": { - "_kics_line": 16 - } + "defaultValue": "[newGuid()]", + "metadata": { + "description": "This is a test param with secure declaration." + }, + "type": "secureString" }, - "defaultValue": false, - "type": "secureObject" - } - }, - "resources": [], - "variables": {} - }`, + "secObj": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 16 + }, + "_kics_type": { + "_kics_line": 16 + } + }, + "defaultValue": false, + "type": "secureObject" + } + }, + "resources": [], + "variables": {} + }`, wantErr: false, }, { @@ -197,420 +240,453 @@ func TestParseBicepFile(t *testing.T) { name: "Parse completed Bicep file", filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "resources.bicep"), want: `{ - "parameters": { - "OSVersion": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 35 - }, - "_kics_type": { - "_kics_line": 35 - } - }, - "allowedValues": [ - [ - "2008-R2-SP1", - "2012-Datacenter", - "2012-R2-Datacenter", - "2016-Nano-Server", - "2016-Datacenter-with-Containers", - "2016-Datacenter", - "2019-Datacenter", - "2019-Datacenter-Core", - "2019-Datacenter-Core-smalldisk", - "2019-Datacenter-Core-with-Containers", - "2019-Datacenter-Core-with-Containers-smalldisk", - "2019-Datacenter-smalldisk", - "2019-Datacenter-with-Containers", - "2019-Datacenter-with-Containers-smalldisk" - ] - ], - "defaultValue": "2019-Datacenter", - "metadata": { - "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version." - }, - "type": "string" - }, - "adminPassword": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 10 + "parameters": { + "OSVersion": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 35 + }, + "_kics_type": { + "_kics_line": 35 + } }, - "_kics_type": { - "_kics_line": 10 - } - }, - "metadata": { - "description": "Password for the Virtual Machine." - }, - "minLength": 12, - "type": "secureString" - }, - "adminUsername": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 5 + "allowedValues": [ + [ + "2008-R2-SP1", + "2012-Datacenter", + "2012-R2-Datacenter", + "2016-Nano-Server", + "2016-Datacenter-with-Containers", + "2016-Datacenter", + "2019-Datacenter", + "2019-Datacenter-Core", + "2019-Datacenter-Core-smalldisk", + "2019-Datacenter-Core-with-Containers", + "2019-Datacenter-Core-with-Containers-smalldisk", + "2019-Datacenter-smalldisk", + "2019-Datacenter-with-Containers", + "2019-Datacenter-with-Containers-smalldisk" + ] + ], + "defaultValue": "2019-Datacenter", + "metadata": { + "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version." }, - "_kics_type": { - "_kics_line": 5 - } - }, - "metadata": { - "description": "Username for the Virtual Machine." + "type": "string" }, - "type": "string" - }, - "location": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 41 + "adminPassword": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 10 + }, + "_kics_type": { + "_kics_line": 10 + } }, - "_kics_type": { - "_kics_line": 41 - } - }, - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - }, - "type": "string" - }, - "parenthesis": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 46 + "metadata": { + "description": "Password for the Virtual Machine." }, - "_kics_type": { - "_kics_line": 46 - } + "minLength": 12, + "type": "secureString" }, - "defaultValue": "simple-vm", - "type": "string" - }, - "vmName": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 44 + "adminUsername": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 5 + }, + "_kics_type": { + "_kics_line": 5 + } }, - "_kics_type": { - "_kics_line": 44 - } - }, - "defaultValue": "simple-vm", - "metadata": { - "description": "Name of the virtual machine." - }, - "type": "string" - }, - "vmSize": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 38 + "metadata": { + "description": "Username for the Virtual Machine." }, - "_kics_type": { - "_kics_line": 38 - } - }, - "defaultValue": "Standard_D2_v3", - "metadata": { - "description": "Size of the virtual machine." + "type": "string" }, - "type": "string" - } - }, - "resources": [ - { - "_kics_lines": { - "_kics__default": { - "_kics_line": 51 - }, - "_kics_apiVersion": { - "_kics_line": 50 + "location": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 41 + }, + "_kics_type": { + "_kics_line": 41 + } }, - "_kics_dependsOn": { - "_kics_arr": [ - { - "_kics__default": { - "_kics_line": 100 - } - } - ], - "_kics_line": 100 + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location for all resources." }, - "_kics_location": { - "_kics_line": 53 + "type": "string" + }, + "parenthesis": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 46 + }, + "_kics_type": { + "_kics_line": 46 + } }, - "_kics_name": { - "_kics_line": 52 + "defaultValue": "simple-vm", + "type": "string" + }, + "vmName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 44 + }, + "_kics_type": { + "_kics_line": 44 + } }, - "_kics_properties": { - "_kics_line": 54 + "defaultValue": "simple-vm", + "metadata": { + "description": "Name of the virtual machine." }, - "_kics_type": { - "_kics_line": 50 - } + "type": "string" }, - "apiVersion": "2021-03-01", - "dependsOn": [ - { - "resourceId": [ - "Microsoft.Network/networkInterfaces", - "variables('nicName')" - ] + "vmSize": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 38 + }, + "_kics_type": { + "_kics_line": 38 + } }, - { - "resourceId": [ - "Microsoft.Storage/storageAccounts", - "variables('storageAccountName')" - ] - } - ], - "identifier": "vm", - "location": "[parameters('location')]", - "metadata": { - "description": "This is a test description for resources" - }, - "name": "[parameters('vmName')]", - "properties": { + "defaultValue": "Standard_D2_v3", + "metadata": { + "description": "Size of the virtual machine." + }, + "type": "string" + } + }, + "resources": [ + { "_kics_lines": { "_kics__default": { - "_kics_line": 54 + "_kics_line": 51 }, - "_kics_diagnosticsProfile": { - "_kics_line": 91 + "_kics_apiVersion": { + "_kics_line": 50 }, - "_kics_hardwareProfile": { - "_kics_line": 55 + "_kics_dependsOn": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 100 + } + } + ], + "_kics_line": 100 }, - "_kics_networkProfile": { - "_kics_line": 84 + "_kics_location": { + "_kics_line": 53 }, - "_kics_osProfile": { - "_kics_line": 58 + "_kics_name": { + "_kics_line": 52 }, - "_kics_storageProfile": { - "_kics_line": 63 + "_kics_properties": { + "_kics_line": 54 + }, + "_kics_type": { + "_kics_line": 50 } }, - "diagnosticsProfile": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 91 - }, - "_kics_bootDiagnostics": { - "_kics_line": 92 - } + "apiVersion": "2021-03-01", + "dependsOn": [ + { + "resourceId": [ + "Microsoft.Network/networkInterfaces", + "variables('nicName')" + ] }, - "bootDiagnostics": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 92 - }, - "_kics_enabled": { - "_kics_line": 93 - }, - "_kics_storageUri": { - "_kics_line": 94 - } - }, - "enabled": true, - "storageUri": "[reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob]" + { + "resourceId": [ + "Microsoft.Storage/storageAccounts", + "variables('storageAccountName')" + ] } + ], + "identifier": "vm", + "location": "[parameters('location')]", + "metadata": { + "description": "This is a test description for resources" }, - "hardwareProfile": { + "name": "[parameters('vmName')]", + "properties": { "_kics_lines": { "_kics__default": { + "_kics_line": 54 + }, + "_kics_diagnosticsProfile": { + "_kics_line": 91 + }, + "_kics_hardwareProfile": { "_kics_line": 55 }, - "_kics_vmSize": { - "_kics_line": 56 - } - }, - "vmSize": "[parameters('vmSize')]" - }, - "networkProfile": { - "_kics_lines": { - "_kics__default": { + "_kics_networkProfile": { "_kics_line": 84 }, - "_kics_networkInterfaces": { - "_kics_arr": [ - { - "_kics__default": { - "_kics_line": 85 - } - } - ], - "_kics_line": 85 + "_kics_osProfile": { + "_kics_line": 58 + }, + "_kics_storageProfile": { + "_kics_line": 63 } }, - "networkInterfaces": [ - { + "diagnosticsProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 91 + }, + "_kics_bootDiagnostics": { + "_kics_line": 92 + } + }, + "bootDiagnostics": { "_kics_lines": { "_kics__default": { - "_kics_line": 86 + "_kics_line": 92 + }, + "_kics_enabled": { + "_kics_line": 93 }, - "_kics_id": { - "_kics_line": 87 + "_kics_storageUri": { + "_kics_line": 94 } }, - "id": { - "resourceId": [ - "Microsoft.Network/networkInterfaces", - "nick.variables('nicName')" - ] - } + "enabled": true, + "storageUri": "[reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob]" } - ] - }, - "osProfile": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 58 - }, - "_kics_adminPassword": { - "_kics_line": 61 - }, - "_kics_adminUsername": { - "_kics_line": 60 + }, + "hardwareProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 55 + }, + "_kics_vmSize": { + "_kics_line": 56 + } }, - "_kics_computerName": { - "_kics_line": 59 - } + "vmSize": "[parameters('vmSize')]" }, - "adminPassword": "[parameters('adminPassword')]", - "adminUsername": "[parameters('adminUsername')]", - "computerName": "[computer.parameters('vmName')]" - }, - "storageProfile": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 63 + "networkProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 84 + }, + "_kics_networkInterfaces": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 85 + } + } + ], + "_kics_line": 85 + } }, - "_kics_dataDisks": { - "_kics_arr": [ - { + "networkInterfaces": [ + { + "_kics_lines": { "_kics__default": { - "_kics_line": 76 + "_kics_line": 86 + }, + "_kics_id": { + "_kics_line": 87 } - } - ], - "_kics_line": 76 - }, - "_kics_imageReference": { - "_kics_line": 64 - }, - "_kics_osDisk": { - "_kics_line": 70 - } - }, - "dataDisks": [ - { - "_kics_lines": { - "_kics__default": { - "_kics_line": 77 - }, - "_kics_createOption": { - "_kics_line": 80 - }, - "_kics_diskSizeGB": { - "_kics_line": 78 }, - "_kics_lun": { - "_kics_line": 79 + "id": { + "resourceId": [ + "Microsoft.Network/networkInterfaces", + "nick.variables('nicName')" + ] } - }, - "createOption": "Empty", - "diskSizeGB": 1023, - "lun": 0 - } - ], - "imageReference": { + } + ] + }, + "osProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 64 + "_kics_line": 58 }, - "_kics_offer": { - "_kics_line": 66 + "_kics_adminPassword": { + "_kics_line": 61 }, - "_kics_publisher": { - "_kics_line": 65 + "_kics_adminUsername": { + "_kics_line": 60 }, - "_kics_sku": { - "_kics_line": 67 - }, - "_kics_version": { - "_kics_line": 68 + "_kics_computerName": { + "_kics_line": 59 } }, - "offer": "WindowsServer", - "publisher": "MicrosoftWindowsServer", - "sku": "[parameters('OSVersion')]", - "version": "latest" + "adminPassword": "[parameters('adminPassword')]", + "adminUsername": "[parameters('adminUsername')]", + "computerName": "[computer.parameters('vmName')]" }, - "osDisk": { + "storageProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 70 + "_kics_line": 63 + }, + "_kics_dataDisks": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 76 + } + } + ], + "_kics_line": 76 }, - "_kics_createOption": { - "_kics_line": 71 + "_kics_imageReference": { + "_kics_line": 64 }, - "_kics_managedDisk": { - "_kics_line": 72 + "_kics_osDisk": { + "_kics_line": 70 } }, - "createOption": "FromImage", - "managedDisk": { + "dataDisks": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 77 + }, + "_kics_createOption": { + "_kics_line": 80 + }, + "_kics_diskSizeGB": { + "_kics_line": 78 + }, + "_kics_lun": { + "_kics_line": 79 + } + }, + "createOption": "Empty", + "diskSizeGB": 1023, + "lun": 0 + } + ], + "imageReference": { "_kics_lines": { "_kics__default": { - "_kics_line": 72 + "_kics_line": 64 + }, + "_kics_offer": { + "_kics_line": 66 + }, + "_kics_publisher": { + "_kics_line": 65 }, - "_kics_storageAccountType": { - "_kics_line": 73 + "_kics_sku": { + "_kics_line": 67 + }, + "_kics_version": { + "_kics_line": 68 } }, - "storageAccountType": "StandardSSD_LRS" + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "[parameters('OSVersion')]", + "version": "latest" + }, + "osDisk": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 70 + }, + "_kics_createOption": { + "_kics_line": 71 + }, + "_kics_managedDisk": { + "_kics_line": 72 + } + }, + "createOption": "FromImage", + "managedDisk": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 72 + }, + "_kics_storageAccountType": { + "_kics_line": 73 + } + }, + "storageAccountType": "StandardSSD_LRS" + } } } - } - }, - "type": "Microsoft.Compute/virtualMachines" - }, - { - "_kics_lines": { - "_kics__default": { - "_kics_line": 106 }, - "_kics_apiVersion": { - "_kics_line": 106 - }, - "_kics_location": { - "_kics_line": 108 - }, - "_kics_name": { - "_kics_line": 107 + "type": "Microsoft.Compute/virtualMachines" + }, + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 106 + }, + "_kics_apiVersion": { + "_kics_line": 106 + }, + "_kics_assignableScopes": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 116 + } + } + ], + "_kics_line": 116 + }, + "_kics_location": { + "_kics_line": 108 + }, + "_kics_name": { + "_kics_line": 107 + }, + "_kics_type": { + "_kics_line": 106 + }, + "_kics_userAssignedIdentities": { + "_kics_line": 113 + } }, - "_kics_type": { - "_kics_line": 106 + "apiVersion": "2021-03-01", + "assignableScopes": [ + "[subscription().id]" + ], + "identifier": "nic", + "location": null, + "name": "", + "type": "Microsoft.Network/networkInterfaces", + "userAssignedIdentities": { + "'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 114 + } + } + }, + "_kics_lines": { + "_kics_'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { + "_kics_line": 114 + }, + "_kics__default": { + "_kics_line": 113 + } + } } + } + ], + "variables": { + "nicName": { + "value": "myVMNic" }, - "apiVersion": "2021-03-01", - "identifier": "nic", - "location": null, - "name": "", - "type": "Microsoft.Network/networkInterfaces" - } - ], - "variables": { - "nicName": { - "value": "myVMNic" - }, - "storageAccountName": { - "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" + "storageAccountName": { + "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" + } } - } - }`, + }`, wantErr: false, }, } diff --git a/test/fixtures/bicep_test/resources.bicep b/test/fixtures/bicep_test/resources.bicep index 547f3333f1a..c0372c3ff2a 100644 --- a/test/fixtures/bicep_test/resources.bicep +++ b/test/fixtures/bicep_test/resources.bicep @@ -110,4 +110,8 @@ resource nic 'Microsoft.Network/networkInterfaces@2021-03-01' = { name: nicName } ] + userAssignedIdentities: { + '${resourceId('Microsoft.ManagedIdentity/userAssignedIdentities',nicName)}': {} + } + assignableScopes: [subscription().id] } From 84d3319954fe2a4f8c150b250f729fec2f2986cf Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 22 Apr 2024 15:09:58 +0100 Subject: [PATCH 059/130] added bicep query tests --- .../test/negative1.bicep | 9 + .../test/negative2.bicep | 9 + .../test/positive1.bicep | 9 + .../test/positive2.bicep | 8 + .../test/positive3.bicep | 9 + .../test/positive4.bicep | 8 + .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 34 +++ .../test/negative2.bicep | 34 +++ .../test/positive1.bicep | 31 ++ .../test/positive2.bicep | 34 +++ .../test/positive3.bicep | 31 ++ .../test/positive4.bicep | 34 +++ .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 32 ++ .../test/negative2.bicep | 32 ++ .../test/positive1.bicep | 31 ++ .../test/positive2.bicep | 32 ++ .../test/positive3.bicep | 31 ++ .../test/positive4.bicep | 32 ++ .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 39 +++ .../test/negative2.bicep | 39 +++ .../test/negative3.bicep | 34 +++ .../test/negative4.bicep | 34 +++ .../test/positive1.bicep | 39 +++ .../test/positive2.bicep | 39 +++ .../test/positive_expected_result.json | 12 + .../test/negative1.bicep | 39 +++ .../test/negative2.bicep | 39 +++ .../test/positive1.bicep | 39 +++ .../test/positive2.bicep | 34 +++ .../test/positive3.bicep | 39 +++ .../test/positive4.bicep | 34 +++ .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 34 +++ .../test/negative2.bicep | 32 ++ .../test/negative3.bicep | 34 +++ .../test/negative4.bicep | 32 ++ .../test/positive1.bicep | 31 ++ .../test/positive10.bicep | 34 +++ .../test/positive2.bicep | 31 ++ .../test/positive3.bicep | 32 ++ .../test/positive4.bicep | 31 ++ .../test/positive5.bicep | 34 +++ .../test/positive6.bicep | 31 ++ .../test/positive7.bicep | 31 ++ .../test/positive8.bicep | 32 ++ .../test/positive9.bicep | 31 ++ .../test/positive_expected_result.json | 60 ++++ .../test/negative1.bicep | 68 +++++ .../test/negative2.bicep | 97 ++++++ .../test/negative3.bicep | 68 +++++ .../test/negative4.bicep | 97 ++++++ .../test/negative5.bicep | 289 ++++++++++++++++++ .../test/positive1.bicep | 55 ++++ .../test/positive2.bicep | 52 ++++ .../test/positive3.bicep | 55 ++++ .../test/positive4.bicep | 52 ++++ .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 31 ++ .../test/negative2.bicep | 31 ++ .../test/positive1.bicep | 31 ++ .../test/positive2.bicep | 18 ++ .../test/positive3.bicep | 31 ++ .../test/positive4.bicep | 18 ++ .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 17 ++ .../test/negative2.bicep | 19 ++ .../test/positive1.bicep | 19 ++ .../test/positive2.bicep | 15 + .../test/positive3.bicep | 17 ++ .../test/positive_expected_result.json | 18 ++ .../test/negative1.bicep | 15 + .../test/negative2.bicep | 15 + .../test/positive1.bicep | 15 + .../test/positive10.bicep | 11 + .../test/positive11.bicep | 15 + .../test/positive12.bicep | 14 + .../test/positive2.bicep | 11 + .../test/positive3.bicep | 14 + .../test/positive4.bicep | 11 + .../test/positive5.bicep | 15 + .../test/positive6.bicep | 14 + .../test/positive7.bicep | 15 + .../test/positive8.bicep | 11 + .../test/positive9.bicep | 14 + .../test/positive_expected_result.json | 72 +++++ .../test/negative1.bicep | 29 ++ .../test/negative2.bicep | 29 ++ .../test/positive1.bicep | 28 ++ .../test/positive2.bicep | 29 ++ .../test/positive3.bicep | 28 ++ .../test/positive4.bicep | 29 ++ .../test/positive5.bicep | 165 ++++++++++ .../test/positive_expected_result.json | 36 +++ .../test/negative1.bicep | 15 + .../test/negative2.bicep | 15 + .../test/positive1.bicep | 15 + .../test/positive2.bicep | 15 + .../test/positive_expected_result.json | 12 + .../test/negative1.bicep | 14 + .../test/negative2.bicep | 14 + .../test/positive1.bicep | 13 + .../test/positive2.bicep | 14 + .../test/positive3.bicep | 13 + .../test/positive4.bicep | 14 + .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 24 ++ .../test/negative2.bicep | 14 + .../test/negative3.bicep | 22 ++ .../test/negative4.bicep | 24 ++ .../test/negative5.bicep | 14 + .../test/negative6.bicep | 22 ++ .../test/positive1.bicep | 39 +++ .../test/positive2.bicep | 14 + .../test/positive3.bicep | 22 ++ .../test/positive4.bicep | 24 ++ .../test/positive5.bicep | 14 + .../test/positive6.bicep | 22 ++ .../test/positive_expected_result.json | 36 +++ .../test/negative1.bicep | 24 ++ .../test/negative2.bicep | 14 + .../test/negative3.bicep | 22 ++ .../test/negative4.bicep | 24 ++ .../test/negative5.bicep | 14 + .../test/negative6.bicep | 22 ++ .../test/positive1.bicep | 39 +++ .../test/positive2.bicep | 14 + .../test/positive3.bicep | 22 ++ .../test/positive4.bicep | 24 ++ .../test/positive5.bicep | 14 + .../test/positive6.bicep | 22 ++ .../test/positive_expected_result.json | 36 +++ .../test/negative1.bicep | 18 ++ .../test/negative2.bicep | 18 ++ .../test/positive1.bicep | 14 + .../test/positive2.bicep | 14 + .../test/positive_expected_result.json | 12 + .../test/negative1.bicep | 13 + .../test/negative2.bicep | 13 + .../test/positive1.bicep | 13 + .../test/positive2.bicep | 13 + .../test/positive3.bicep | 13 + .../test/positive4.bicep | 13 + .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 40 +++ .../test/negative2.bicep | 40 +++ .../test/positive1.bicep | 37 +++ .../test/positive2.bicep | 40 +++ .../test/positive3.bicep | 37 +++ .../test/positive4.bicep | 40 +++ .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 38 +++ .../test/negative2.bicep | 38 +++ .../test/positive1.bicep | 37 +++ .../test/positive2.bicep | 38 +++ .../test/positive3.bicep | 38 +++ .../test/positive4.bicep | 37 +++ .../test/positive5.bicep | 38 +++ .../test/positive6.bicep | 38 +++ .../test/positive_expected_result.json | 36 +++ .../test/negative1.bicep | 7 + .../test/negative2.bicep | 7 + .../test/negative3.bicep | 7 + .../test/negative4.bicep | 7 + .../test/positive1.bicep | 21 ++ .../test/positive2.bicep | 7 + .../test/positive3.bicep | 21 ++ .../test/positive4.bicep | 7 + .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 10 + .../test/negative2.bicep | 9 + .../test/negative3.bicep | 9 + .../test/negative4.bicep | 10 + .../test/negative5.bicep | 9 + .../test/negative6.bicep | 9 + .../test/positive1.bicep | 10 + .../test/positive2.bicep | 10 + .../test/positive_expected_result.json | 12 + .../test/negative1.bicep | 20 ++ .../test/negative2.bicep | 20 ++ .../test/negative3.bicep | 197 ++++++++++++ .../test/positive1.bicep | 20 ++ .../test/positive2.bicep | 20 ++ .../test/positive3.bicep | 12 + .../test/positive_expected_result.json | 18 ++ .../test/negative1.bicep | 17 ++ .../test/negative2.bicep | 17 ++ .../test/positive1.bicep | 24 ++ .../test/positive2.bicep | 13 + .../test/positive3.bicep | 13 + .../test/positive4.bicep | 24 ++ .../test/positive5.bicep | 13 + .../test/positive6.bicep | 13 + .../test/positive_expected_result.json | 36 +++ .../test/negative1.bicep | 15 + .../test/negative2.bicep | 13 + .../test/negative3.bicep | 15 + .../test/negative4.bicep | 13 + .../test/positive1.bicep | 15 + .../test/positive2.bicep | 12 + .../test/positive3.bicep | 13 + .../test/positive4.bicep | 15 + .../test/positive5.bicep | 12 + .../test/positive6.bicep | 13 + .../test/positive_expected_result.json | 36 +++ .../test/negative1.bicep | 8 + .../test/negative2.bicep | 90 ++++++ .../test/negative3.bicep | 33 ++ .../test/negative4.bicep | 8 + .../test/negative5.bicep | 90 ++++++ .../test/negative6.bicep | 33 ++ .../test/positive1.bicep | 8 + .../test/positive2.bicep | 90 ++++++ .../test/positive3.bicep | 33 ++ .../test/positive4.bicep | 8 + .../test/positive5.bicep | 90 ++++++ .../test/positive6.bicep | 33 ++ .../test/positive_expected_result.json | 36 +++ .../test/negative1.bicep | 25 ++ .../test/negative2.bicep | 26 ++ .../test/negative3.bicep | 25 ++ .../test/negative4.bicep | 26 ++ .../test/positive1.bicep | 26 ++ .../test/positive2.bicep | 16 + .../test/positive3.bicep | 26 ++ .../test/positive4.bicep | 16 + .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 15 + .../test/negative2.bicep | 15 + .../test/positive1.bicep | 15 + .../test/positive2.bicep | 15 + .../test/positive3.bicep | 15 + .../test/positive4.bicep | 15 + .../test/positive_expected_result.json | 36 +++ .../test/negative1.bicep | 17 ++ .../test/negative2.bicep | 17 ++ .../test/negative3.bicep | 17 ++ .../test/negative4.bicep | 17 ++ .../test/positive1.bicep | 17 ++ .../test/positive2.bicep | 16 + .../test/positive3.bicep | 13 + .../test/positive4.bicep | 16 + .../test/positive5.bicep | 17 ++ .../test/positive6.bicep | 16 + .../test/positive7.bicep | 13 + .../test/positive8.bicep | 16 + .../test/positive_expected_result.json | 72 +++++ .../test/negative1.bicep | 9 + .../test/negative2.bicep | 9 + .../test/positive1.bicep | 9 + .../test/positive2.bicep | 5 + .../test/positive3.bicep | 9 + .../test/positive4.bicep | 5 + .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 12 + .../test/negative2.bicep | 17 ++ .../test/negative3.bicep | 12 + .../test/negative4.bicep | 17 ++ .../test/positive1.bicep | 9 + .../test/positive2.bicep | 12 + .../test/positive3.bicep | 10 + .../test/positive4.bicep | 9 + .../test/positive5.bicep | 12 + .../test/positive6.bicep | 10 + .../test/positive_expected_result.json | 36 +++ .../test/negative1.bicep | 9 + .../test/negative2.bicep | 9 + .../test/positive1.bicep | 8 + .../test/positive2.bicep | 9 + .../test/positive3.bicep | 8 + .../test/positive4.bicep | 9 + .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 9 + .../test/negative2.bicep | 9 + .../test/positive1.bicep | 8 + .../test/positive2.bicep | 9 + .../test/positive3.bicep | 8 + .../test/positive4.bicep | 9 + .../test/positive_expected_result.json | 24 ++ .../test/negative1.bicep | 12 + .../test/negative2.bicep | 12 + .../test/positive1.bicep | 9 + .../test/positive2.bicep | 12 + .../test/positive3.bicep | 10 + .../test/positive4.bicep | 9 + .../test/positive5.bicep | 12 + .../test/positive6.bicep | 10 + .../test/positive_expected_result.json | 36 +++ 290 files changed, 7326 insertions(+) create mode 100644 assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive10.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive7.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive8.bicep create mode 100644 assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive9.bicep create mode 100644 assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative5.bicep create mode 100644 assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive10.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive11.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive12.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive7.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive8.bicep create mode 100644 assets/queries/azureResourceManager/email_notifications_set_off/test/positive9.bicep create mode 100644 assets/queries/azureResourceManager/key_vault_not_recoverable/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/key_vault_not_recoverable/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/log_profile_incorrect_category/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/log_profile_incorrect_category/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative5.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative6.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative5.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative6.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/secret_without_expiration_date/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/secret_without_expiration_date/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/secret_without_expiration_date/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/secret_without_expiration_date/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/secret_without_expiration_date/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/secret_without_expiration_date/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative5.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative6.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/standard_price_not_selected/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/standard_price_not_selected/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/standard_price_not_selected/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/standard_price_not_selected/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/standard_price_not_selected/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/standard_price_not_selected/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative5.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative6.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive7.bicep create mode 100644 assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive8.bicep create mode 100644 assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/website_not_forcing_https/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/website_not_forcing_https/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/website_not_forcing_https/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/website_not_forcing_https/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/website_not_forcing_https/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/website_not_forcing_https/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive6.bicep diff --git a/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/negative1.bicep b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/negative1.bicep new file mode 100644 index 00000000000..15acd7fcfa1 --- /dev/null +++ b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/negative1.bicep @@ -0,0 +1,9 @@ +resource sample_server_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/server/default' + properties: { + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/negative2.bicep b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/negative2.bicep new file mode 100644 index 00000000000..15acd7fcfa1 --- /dev/null +++ b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/negative2.bicep @@ -0,0 +1,9 @@ +resource sample_server_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/server/default' + properties: { + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive1.bicep b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive1.bicep new file mode 100644 index 00000000000..bdec0c0fc0d --- /dev/null +++ b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive1.bicep @@ -0,0 +1,9 @@ +resource sample_server_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/server/default' + properties: { + emailAccountAdmins: false + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive2.bicep b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive2.bicep new file mode 100644 index 00000000000..c2debc2e0cf --- /dev/null +++ b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive2.bicep @@ -0,0 +1,8 @@ +resource sample_server_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/server/default' + properties: { + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive3.bicep b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive3.bicep new file mode 100644 index 00000000000..bdec0c0fc0d --- /dev/null +++ b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive3.bicep @@ -0,0 +1,9 @@ +resource sample_server_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/server/default' + properties: { + emailAccountAdmins: false + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive4.bicep b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive4.bicep new file mode 100644 index 00000000000..c2debc2e0cf --- /dev/null +++ b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive4.bicep @@ -0,0 +1,8 @@ +resource sample_server_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/server/default' + properties: { + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive_expected_result.json b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive_expected_result.json index 9d18c13ae33..8c4c5e42123 100644 --- a/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/account_admins_not_notified_by_email/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "INFO", "line": 15, "filename": "positive4.json" + }, + { + "queryName": "Account Admins Not Notified By Email", + "severity": "INFO", + "line": 4, + "filename": "positive1.bicep" + }, + { + "queryName": "Account Admins Not Notified By Email", + "severity": "INFO", + "line": 3, + "filename": "positive2.bicep" + }, + { + "queryName": "Account Admins Not Notified By Email", + "severity": "INFO", + "line": 4, + "filename": "positive3.bicep" + }, + { + "queryName": "Account Admins Not Notified By Email", + "severity": "INFO", + "line": 3, + "filename": "positive4.bicep" } ] diff --git a/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/negative1.bicep b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/negative1.bicep new file mode 100644 index 00000000000..28feebcaee9 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/negative1.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/negative2.bicep b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/negative2.bicep new file mode 100644 index 00000000000..28feebcaee9 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/negative2.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive1.bicep b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive1.bicep new file mode 100644 index 00000000000..f7c4d735b8f --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive1.bicep @@ -0,0 +1,31 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive2.bicep b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive2.bicep new file mode 100644 index 00000000000..2320fff408c --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive2.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: '' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive3.bicep b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive3.bicep new file mode 100644 index 00000000000..f7c4d735b8f --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive3.bicep @@ -0,0 +1,31 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive4.bicep b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive4.bicep new file mode 100644 index 00000000000..2320fff408c --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive4.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: '' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive_expected_result.json b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive_expected_result.json index 680dc3ae97c..31a9ddc78c3 100644 --- a/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/aks_cluster_network_policy_not_configured/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "MEDIUM", "line": 39, "filename": "positive4.json" + }, + { + "queryName": "AKS Cluster Network Policy Not Configured", + "severity": "MEDIUM", + "line": 2, + "filename": "positive1.bicep" + }, + { + "queryName": "AKS Cluster Network Policy Not Configured", + "severity": "MEDIUM", + "line": 31, + "filename": "positive2.bicep" + }, + { + "queryName": "AKS Cluster Network Policy Not Configured", + "severity": "MEDIUM", + "line": 2, + "filename": "positive3.bicep" + }, + { + "queryName": "AKS Cluster Network Policy Not Configured", + "severity": "MEDIUM", + "line": 31, + "filename": "positive4.bicep" } ] diff --git a/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/negative1.bicep new file mode 100644 index 00000000000..328011b6b12 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/negative1.bicep @@ -0,0 +1,32 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + enableRBAC: true + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/negative2.bicep new file mode 100644 index 00000000000..328011b6b12 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/negative2.bicep @@ -0,0 +1,32 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + enableRBAC: true + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive1.bicep new file mode 100644 index 00000000000..f7c4d735b8f --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive1.bicep @@ -0,0 +1,31 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive2.bicep new file mode 100644 index 00000000000..9b535a52948 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive2.bicep @@ -0,0 +1,32 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + enableRBAC: false + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive3.bicep new file mode 100644 index 00000000000..f7c4d735b8f --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive3.bicep @@ -0,0 +1,31 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive4.bicep new file mode 100644 index 00000000000..9b535a52948 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive4.bicep @@ -0,0 +1,32 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + enableRBAC: false + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive_expected_result.json index 4044e4f5294..70cdf5c8a8f 100644 --- a/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/aks_cluster_rbac_disabled/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "HIGH", "line": 38, "fileName": "positive4.json" + }, + { + "queryName": "AKS Cluster RBAC Disabled", + "severity": "HIGH", + "line": 4, + "fileName": "positive1.bicep" + }, + { + "queryName": "AKS Cluster RBAC Disabled", + "severity": "HIGH", + "line": 26, + "fileName": "positive2.bicep" + }, + { + "queryName": "AKS Cluster RBAC Disabled", + "severity": "HIGH", + "line": 4, + "fileName": "positive3.bicep" + }, + { + "queryName": "AKS Cluster RBAC Disabled", + "severity": "HIGH", + "line": 26, + "fileName": "positive4.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative1.bicep b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative1.bicep new file mode 100644 index 00000000000..128a124cf0a --- /dev/null +++ b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative1.bicep @@ -0,0 +1,39 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + addonProfiles: { + kubeDashboard: { + enabled: false + } + } + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative2.bicep b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative2.bicep new file mode 100644 index 00000000000..128a124cf0a --- /dev/null +++ b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative2.bicep @@ -0,0 +1,39 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + addonProfiles: { + kubeDashboard: { + enabled: false + } + } + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative3.bicep b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative3.bicep new file mode 100644 index 00000000000..28feebcaee9 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative3.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative4.bicep b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative4.bicep new file mode 100644 index 00000000000..28feebcaee9 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/negative4.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive1.bicep b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive1.bicep new file mode 100644 index 00000000000..a16bdd9730f --- /dev/null +++ b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive1.bicep @@ -0,0 +1,39 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + addonProfiles: { + kubeDashboard: { + enabled: true + } + } + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive2.bicep b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive2.bicep new file mode 100644 index 00000000000..a16bdd9730f --- /dev/null +++ b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive2.bicep @@ -0,0 +1,39 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + addonProfiles: { + kubeDashboard: { + enabled: true + } + } + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive_expected_result.json index da466fb42f9..2a226e8456a 100644 --- a/assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/aks_dashboard_enabled/test/positive_expected_result.json @@ -10,5 +10,17 @@ "severity": "LOW", "line": 16, "filename": "positive2.json" + }, + { + "queryName": "AKS Dashboard Is Enabled", + "severity": "LOW", + "line": 8, + "filename": "positive1.bicep" + }, + { + "queryName": "AKS Dashboard Is Enabled", + "severity": "LOW", + "line": 8, + "filename": "positive2.bicep" } ] diff --git a/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/negative1.bicep new file mode 100644 index 00000000000..ef868ef0acd --- /dev/null +++ b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/negative1.bicep @@ -0,0 +1,39 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + addonProfiles: { + omsagent: { + enabled: true + } + } + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/negative2.bicep new file mode 100644 index 00000000000..ef868ef0acd --- /dev/null +++ b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/negative2.bicep @@ -0,0 +1,39 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + addonProfiles: { + omsagent: { + enabled: true + } + } + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive1.bicep new file mode 100644 index 00000000000..c7ae876259c --- /dev/null +++ b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive1.bicep @@ -0,0 +1,39 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + addonProfiles: { + omsagent: { + enabled: false + } + } + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive2.bicep new file mode 100644 index 00000000000..28feebcaee9 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive2.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive3.bicep new file mode 100644 index 00000000000..c7ae876259c --- /dev/null +++ b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive3.bicep @@ -0,0 +1,39 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + addonProfiles: { + omsagent: { + enabled: false + } + } + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive4.bicep new file mode 100644 index 00000000000..28feebcaee9 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive4.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + networkProfile: { + networkPolicy: 'azure' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive_expected_result.json index ab9b11c83cd..1f589057ff2 100644 --- a/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/aks_logging_azure_monitoring_disabled/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "MEDIUM", "line": 8, "filename": "positive4.json" + }, + { + "queryName": "AKS Logging To Azure Monitoring Is Disabled", + "severity": "MEDIUM", + "line": 8, + "filename": "positive1.bicep" + }, + { + "queryName": "AKS Logging To Azure Monitoring Is Disabled", + "severity": "MEDIUM", + "line": 2, + "filename": "positive2.bicep" + }, + { + "queryName": "AKS Logging To Azure Monitoring Is Disabled", + "severity": "MEDIUM", + "line": 8, + "filename": "positive3.bicep" + }, + { + "queryName": "AKS Logging To Azure Monitoring Is Disabled", + "severity": "MEDIUM", + "line": 2, + "filename": "positive4.bicep" } ] diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative1.bicep new file mode 100644 index 00000000000..4c413a954e2 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative1.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + apiServerAccessProfile: { + authorizedIPRanges: ['192.168.0.1', '192.168.0.18'] + } + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative2.bicep new file mode 100644 index 00000000000..0ae5b2a2224 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative2.bicep @@ -0,0 +1,32 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + apiServerAuthorizedIPRanges: ['192.168.0.1', '192.168.0.18'] + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative3.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative3.bicep new file mode 100644 index 00000000000..4c413a954e2 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative3.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + apiServerAccessProfile: { + authorizedIPRanges: ['192.168.0.1', '192.168.0.18'] + } + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative4.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative4.bicep new file mode 100644 index 00000000000..0ae5b2a2224 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/negative4.bicep @@ -0,0 +1,32 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + apiServerAuthorizedIPRanges: ['192.168.0.1', '192.168.0.18'] + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive1.bicep new file mode 100644 index 00000000000..98ce916790d --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive1.bicep @@ -0,0 +1,31 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2017-08-31' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive10.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive10.bicep new file mode 100644 index 00000000000..a4f7dcaa482 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive10.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + apiServerAccessProfile: { + authorizedIPRanges: [] + } + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive2.bicep new file mode 100644 index 00000000000..2c4d107bc6b --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive2.bicep @@ -0,0 +1,31 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive3.bicep new file mode 100644 index 00000000000..55d3a47753d --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive3.bicep @@ -0,0 +1,32 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + apiServerAuthorizedIPRanges: [] + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive4.bicep new file mode 100644 index 00000000000..f7c4d735b8f --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive4.bicep @@ -0,0 +1,31 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive5.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive5.bicep new file mode 100644 index 00000000000..a4f7dcaa482 --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive5.bicep @@ -0,0 +1,34 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + apiServerAccessProfile: { + authorizedIPRanges: [] + } + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive6.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive6.bicep new file mode 100644 index 00000000000..98ce916790d --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive6.bicep @@ -0,0 +1,31 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2017-08-31' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive7.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive7.bicep new file mode 100644 index 00000000000..2c4d107bc6b --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive7.bicep @@ -0,0 +1,31 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive8.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive8.bicep new file mode 100644 index 00000000000..55d3a47753d --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive8.bicep @@ -0,0 +1,32 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + apiServerAuthorizedIPRanges: [] + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive9.bicep b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive9.bicep new file mode 100644 index 00000000000..f7c4d735b8f --- /dev/null +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive9.bicep @@ -0,0 +1,31 @@ +resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = { + name: 'aksCluster1' + location: resourceGroup().location + properties: { + kubernetesVersion: '1.15.7' + dnsPrefix: 'dnsprefix' + agentPoolProfiles: [ + { + name: 'agentpool' + count: 2 + vmSize: 'Standard_A1' + osType: 'Linux' + storageProfile: 'ManagedDisks' + } + ] + linuxProfile: { + adminUsername: 'adminUserName' + ssh: { + publicKeys: [ + { + keyData: 'keyData' + } + ] + } + } + servicePrincipalProfile: { + clientId: 'servicePrincipalAppId' + secret: 'servicePrincipalAppPassword' + } + } +} diff --git a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive_expected_result.json index 07da9b40775..5c44f1fdc75 100644 --- a/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/aks_with_authorized_ip_ranges_disabled/test/positive_expected_result.json @@ -58,5 +58,65 @@ "severity": "LOW", "line": 39, "filename": "positive10.json" + }, + { + "queryName": "AKS With Authorized IP Ranges Disabled", + "severity": "LOW", + "line": 1, + "filename": "positive1.bicep" + }, + { + "queryName": "AKS With Authorized IP Ranges Disabled", + "severity": "LOW", + "line": 2, + "filename": "positive2.bicep" + }, + { + "queryName": "AKS With Authorized IP Ranges Disabled", + "severity": "LOW", + "line": 30, + "filename": "positive3.bicep" + }, + { + "queryName": "AKS With Authorized IP Ranges Disabled", + "severity": "LOW", + "line": 2, + "filename": "positive4.bicep" + }, + { + "queryName": "AKS With Authorized IP Ranges Disabled", + "severity": "LOW", + "line": 31, + "filename": "positive5.bicep" + }, + { + "queryName": "AKS With Authorized IP Ranges Disabled", + "severity": "LOW", + "line": 1, + "filename": "positive6.bicep" + }, + { + "queryName": "AKS With Authorized IP Ranges Disabled", + "severity": "LOW", + "line": 2, + "filename": "positive7.bicep" + }, + { + "queryName": "AKS With Authorized IP Ranges Disabled", + "severity": "LOW", + "line": 30, + "filename": "positive8.bicep" + }, + { + "queryName": "AKS With Authorized IP Ranges Disabled", + "severity": "LOW", + "line": 2, + "filename": "positive9.bicep" + }, + { + "queryName": "AKS With Authorized IP Ranges Disabled", + "severity": "LOW", + "line": 31, + "filename": "positive10.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative1.bicep b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative1.bicep new file mode 100644 index 00000000000..765e610bad4 --- /dev/null +++ b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative1.bicep @@ -0,0 +1,68 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +@description('Specifies the location for all resources.') +param location string = resourceGroup().location + +@description('Specifies a username for the Virtual Machine.') +param adminUsername string + +@description( + 'Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH key pairs.' +) +param adminPublicKey string + +@description('description') +param vmSize string = 'Standard_D2s_v3' + +var vmName = '${projectName}-vm' +var networkInterfaceName = '${projectName}-nic' + +resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { + name: vmName + location: location + properties: { + hardwareProfile: { + vmSize: vmSize + } + osProfile: { + computerName: vmName + adminUsername: adminUsername + linuxConfiguration: { + disablePasswordAuthentication: true + ssh: { + publicKeys: [ + { + path: '/home/${adminUsername}/.ssh/authorized_keys' + keyData: adminPublicKey + } + ] + } + } + } + storageProfile: { + imageReference: { + publisher: 'Canonical' + offer: 'UbuntuServer' + sku: '18.04-LTS' + version: 'latest' + } + osDisk: { + createOption: 'fromImage' + } + } + networkProfile: { + networkInterfaces: [ + { + id: resourceId( + 'Microsoft.Network/networkInterfaces', + networkInterfaceName + ) + } + ] + } + } + dependsOn: [ + resourceId('Microsoft.Network/networkInterfaces', networkInterfaceName) + ] +} diff --git a/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative2.bicep b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative2.bicep new file mode 100644 index 00000000000..2243e011c26 --- /dev/null +++ b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative2.bicep @@ -0,0 +1,97 @@ +@description('Username for the Virtual Machine.') +param adminUsername string + +@description('Password for the Virtual Machine.') +@minLength(12) +@secure() +param adminPassword string + +@description( + 'The Windows version for the VM. This will pick a fully patched image of this given Windows version.' +) +@allowed( + [ + '2008-R2-SP1' + '2012-Datacenter' + '2012-R2-Datacenter' + '2016-Nano-Server' + '2016-Datacenter-with-Containers' + '2016-Datacenter' + '2019-Datacenter' + '2019-Datacenter-Core' + '2019-Datacenter-Core-smalldisk' + '2019-Datacenter-Core-with-Containers' + '2019-Datacenter-Core-with-Containers-smalldisk' + '2019-Datacenter-smalldisk' + '2019-Datacenter-with-Containers' + '2019-Datacenter-with-Containers-smalldisk' + ] +) +param OSVersion string = '2019-Datacenter' + +@description('Size of the virtual machine.') +param vmSize string = 'Standard_D2_v3' + +@description('Location for all resources.') +param location string = resourceGroup().location + +@description('Name of the virtual machine.') +param vmName string = 'simple-vm' + +var storageAccountName = 'bootdiags${uniqueString(resourceGroup().id)}' +var nicName = 'myVMNic' + +resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { + name: vmName + location: location + properties: { + hardwareProfile: { + vmSize: vmSize + } + osProfile: { + computerName: vmName + adminUsername: adminUsername + adminPassword: adminPassword + } + storageProfile: { + imageReference: { + publisher: 'MicrosoftWindowsServer' + offer: 'WindowsServer' + sku: OSVersion + version: 'latest' + } + osDisk: { + createOption: 'FromImage' + managedDisk: { + storageAccountType: 'StandardSSD_LRS' + } + } + dataDisks: [ + { + diskSizeGB: 1023 + lun: 0 + createOption: 'Empty' + } + ] + } + networkProfile: { + networkInterfaces: [ + { + id: resourceId('Microsoft.Network/networkInterfaces', nicName) + } + ] + } + diagnosticsProfile: { + bootDiagnostics: { + enabled: true + storageUri: reference( + resourceId('Microsoft.Storage/storageAccounts', storageAccountName) + ).primaryEndpoints.blob + } + } + } + dependsOn: [ + resourceId('Microsoft.Network/networkInterfaces', nicName) + resourceId('Microsoft.Storage/storageAccounts', storageAccountName) + ] +} diff --git a/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative3.bicep b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative3.bicep new file mode 100644 index 00000000000..765e610bad4 --- /dev/null +++ b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative3.bicep @@ -0,0 +1,68 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +@description('Specifies the location for all resources.') +param location string = resourceGroup().location + +@description('Specifies a username for the Virtual Machine.') +param adminUsername string + +@description( + 'Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH key pairs.' +) +param adminPublicKey string + +@description('description') +param vmSize string = 'Standard_D2s_v3' + +var vmName = '${projectName}-vm' +var networkInterfaceName = '${projectName}-nic' + +resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { + name: vmName + location: location + properties: { + hardwareProfile: { + vmSize: vmSize + } + osProfile: { + computerName: vmName + adminUsername: adminUsername + linuxConfiguration: { + disablePasswordAuthentication: true + ssh: { + publicKeys: [ + { + path: '/home/${adminUsername}/.ssh/authorized_keys' + keyData: adminPublicKey + } + ] + } + } + } + storageProfile: { + imageReference: { + publisher: 'Canonical' + offer: 'UbuntuServer' + sku: '18.04-LTS' + version: 'latest' + } + osDisk: { + createOption: 'fromImage' + } + } + networkProfile: { + networkInterfaces: [ + { + id: resourceId( + 'Microsoft.Network/networkInterfaces', + networkInterfaceName + ) + } + ] + } + } + dependsOn: [ + resourceId('Microsoft.Network/networkInterfaces', networkInterfaceName) + ] +} diff --git a/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative4.bicep b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative4.bicep new file mode 100644 index 00000000000..2243e011c26 --- /dev/null +++ b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative4.bicep @@ -0,0 +1,97 @@ +@description('Username for the Virtual Machine.') +param adminUsername string + +@description('Password for the Virtual Machine.') +@minLength(12) +@secure() +param adminPassword string + +@description( + 'The Windows version for the VM. This will pick a fully patched image of this given Windows version.' +) +@allowed( + [ + '2008-R2-SP1' + '2012-Datacenter' + '2012-R2-Datacenter' + '2016-Nano-Server' + '2016-Datacenter-with-Containers' + '2016-Datacenter' + '2019-Datacenter' + '2019-Datacenter-Core' + '2019-Datacenter-Core-smalldisk' + '2019-Datacenter-Core-with-Containers' + '2019-Datacenter-Core-with-Containers-smalldisk' + '2019-Datacenter-smalldisk' + '2019-Datacenter-with-Containers' + '2019-Datacenter-with-Containers-smalldisk' + ] +) +param OSVersion string = '2019-Datacenter' + +@description('Size of the virtual machine.') +param vmSize string = 'Standard_D2_v3' + +@description('Location for all resources.') +param location string = resourceGroup().location + +@description('Name of the virtual machine.') +param vmName string = 'simple-vm' + +var storageAccountName = 'bootdiags${uniqueString(resourceGroup().id)}' +var nicName = 'myVMNic' + +resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { + name: vmName + location: location + properties: { + hardwareProfile: { + vmSize: vmSize + } + osProfile: { + computerName: vmName + adminUsername: adminUsername + adminPassword: adminPassword + } + storageProfile: { + imageReference: { + publisher: 'MicrosoftWindowsServer' + offer: 'WindowsServer' + sku: OSVersion + version: 'latest' + } + osDisk: { + createOption: 'FromImage' + managedDisk: { + storageAccountType: 'StandardSSD_LRS' + } + } + dataDisks: [ + { + diskSizeGB: 1023 + lun: 0 + createOption: 'Empty' + } + ] + } + networkProfile: { + networkInterfaces: [ + { + id: resourceId('Microsoft.Network/networkInterfaces', nicName) + } + ] + } + diagnosticsProfile: { + bootDiagnostics: { + enabled: true + storageUri: reference( + resourceId('Microsoft.Storage/storageAccounts', storageAccountName) + ).primaryEndpoints.blob + } + } + } + dependsOn: [ + resourceId('Microsoft.Network/networkInterfaces', nicName) + resourceId('Microsoft.Storage/storageAccounts', storageAccountName) + ] +} diff --git a/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative5.bicep b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative5.bicep new file mode 100644 index 00000000000..87adabc94ef --- /dev/null +++ b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/negative5.bicep @@ -0,0 +1,289 @@ +@description('The name of the VM') +param virtualMachineName string = 'myVM' + +@description('The virtual machine size.') +param virtualMachineSize string = 'Standard_D8s_v3' + +@description('Specify the name of an existing VNet in the same resource group') +param existingVirtualNetworkName string + +@description('Specify the resrouce group of the existing VNet') +param existingVnetResourceGroup string = resourceGroup().name + +@description('Specify the name of the Subnet Name') +param existingSubnetName string + +@description('Windows Server and SQL Offer') +@allowed( + [ + 'sql2019-ws2019' + 'sql2017-ws2019' + 'SQL2017-WS2016' + 'SQL2016SP1-WS2016' + 'SQL2016SP2-WS2016' + 'SQL2014SP3-WS2012R2' + 'SQL2014SP2-WS2012R2' + ] +) +param imageOffer string = 'sql2019-ws2019' + +@description('SQL Server Sku') +@allowed(['Standard', 'Enterprise', 'SQLDEV', 'Web', 'Express']) +param sqlSku string = 'Standard' + +@description('Zone to deploy to') +@allowed([1, 2, 3]) +param zone int = 1 + +@description('The admin user name of the VM') +param adminUsername string + +@description('The admin password of the VM') +@secure() +param adminPassword string + +@description('SQL Server Workload Type') +@allowed(['General', 'OLTP', 'DW']) +param storageWorkloadType string = 'General' + +@description('Amount of data disks (1TB each) for SQL Data files') +@minValue(1) +@maxValue(8) +param sqlDataDisksCount int = 1 + +@description( + 'Path for SQL Data files. Please choose drive letter from F to Z, and other drives from A to E are reserved for system' +) +param dataPath string = 'F:\\SQLData' + +@description('SQL Log UltraSSD Disk size in GiB.') +param sqlLogUltraSSDDiskSizeInGB int = 512 + +@description( + 'SQL Log UltraSSD Disk IOPS value representing the maximum IOPS that the disk can achieve.' +) +param sqlLogUltraSSDdiskIOPSReadWrite int = 20000 + +@description( + 'SQL Log UltraSSD Disk MBps value representing the maximum throughput that the disk can achieve.' +) +param sqlLogUltraSSDdiskMbpsReadWrite int = 500 + +@description( + 'Path for SQL Log files. Please choose drive letter from F to Z and different than the one used for SQL data. Drive letter from A to E are reserved for system' +) +param logPath string = 'G:\\SQLLog' + +@description('Location for all resources.') +@allowed(['East US 2', 'SouthEast Asia', 'North Europe']) +param location string + +var networkInterfaceName = '${virtualMachineName}-nic' +var networkSecurityGroupName = '${virtualMachineName}-nsg' +var networkSecurityGroupRules = [ + { + name: 'RDP' + properties: { + priority: 300 + protocol: 'TCP' + access: 'Allow' + direction: 'Inbound' + sourceAddressPrefix: '*' + sourcePortRange: '*' + destinationAddressPrefix: '*' + destinationPortRange: '3389' + } + } +] +var publicIpAddressName = '${virtualMachineName}-publicip-${uniqueString(virtualMachineName)}' +var publicIpAddressType = 'Dynamic' +var publicIpAddressSku = 'Basic' +var diskConfigurationType = 'NEW' +var nsgId = networkSecurityGroup.id +var subnetRef = resourceId( + existingVnetResourceGroup, + 'Microsoft.Network/virtualNetWorks/subnets', + existingVirtualNetworkName, + existingSubnetName +) +var dataDisksLuns = array(range(0, sqlDataDisksCount)) +var logDisksLuns = array(range(sqlDataDisksCount, 1)) +var dataDisks = { + createOption: 'empty' + caching: 'ReadOnly' + writeAcceleratorEnabled: false + storageAccountType: 'Premium_LRS' + diskSizeGB: 1023 +} +var tempDbPath = 'D:\\SQLTempdb' + +resource virtualMachineName_dataDisk_UltraSSD 'Microsoft.Compute/disks@2019-11-01' = [ + for i in range(0, 1): { + name: '${virtualMachineName}-dataDisk-UltraSSD-${i}' + location: location + sku: { + name: 'UltraSSD_LRS' + } + zones: [zone] + properties: { + creationData: { + createOption: 'Empty' + } + encryptionSettingsCollection: { + enabled: false + encryptionSettings: [ + { + diskEncryptionKey: { + sourceVault: { + id: '/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault' + } + secretUrl: 'https://myvmvault.vault-int.azure-int.net/secrets/{secret}' + } + keyEncryptionKey: { + sourceVault: { + id: '/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault' + } + keyUrl: 'https://myvmvault.vault-int.azure-int.net/keys/{key}' + } + } + ] + } + diskSizeGB: sqlLogUltraSSDDiskSizeInGB + diskIOPSReadWrite: sqlLogUltraSSDdiskIOPSReadWrite + diskMBpsReadWrite: sqlLogUltraSSDdiskMbpsReadWrite + } + } +] + +resource publicIpAddress 'Microsoft.Network/publicIpAddresses@2020-05-01' = { + name: publicIpAddressName + location: location + sku: { + name: publicIpAddressSku + } + zones: [zone] + properties: { + publicIPAllocationMethod: publicIpAddressType + } +} + +resource networkSecurityGroup 'Microsoft.Network/networkSecurityGroups@2020-05-01' = { + name: networkSecurityGroupName + location: location + properties: { + securityRules: networkSecurityGroupRules + } +} + +resource networkInterface 'Microsoft.Network/networkInterfaces@2020-05-01' = { + name: networkInterfaceName + location: location + properties: { + ipConfigurations: [ + { + name: 'ipconfig1' + properties: { + subnet: { + id: subnetRef + } + privateIPAllocationMethod: 'Dynamic' + publicIPAddress: { + id: publicIpAddress.id + } + } + } + ] + enableAcceleratedNetworking: true + networkSecurityGroup: { + id: nsgId + } + } +} + +resource virtualMachine 'Microsoft.Compute/virtualMachines@2019-12-01' = { + name: virtualMachineName + location: location + zones: [zone] + properties: { + hardwareProfile: { + vmSize: virtualMachineSize + } + additionalCapabilities: { + ultraSSDEnabled: 'true' + } + storageProfile: { + osDisk: { + createOption: 'fromImage' + managedDisk: { + storageAccountType: 'Premium_LRS' + } + } + imageReference: { + publisher: 'MicrosoftSQLServer' + offer: imageOffer + sku: sqlSku + version: 'latest' + } + dataDisks: [ + for j in range(0, (sqlDataDisksCount + 1)): { + lun: j + createOption: 'attach' + caching: ((j >= sqlDataDisksCount) ? 'None' : dataDisks.caching) + managedDisk: { + id: ((j >= sqlDataDisksCount) + ? resourceId( + 'Microsoft.Compute/disks/', + '${virtualMachineName}-dataDisk-UltraSSD-0' + ) + : resourceId( + 'Microsoft.Compute/disks/', + '${virtualMachineName}-dataDisk-${j}' + )) + } + } + ] + } + networkProfile: { + networkInterfaces: [ + { + id: networkInterface.id + } + ] + } + osProfile: { + computerName: virtualMachineName + adminUsername: adminUsername + adminPassword: adminPassword + windowsConfiguration: { + enableAutomaticUpdates: true + provisionVMAgent: true + } + } + } + dependsOn: [virtualMachineName_dataDisk_UltraSSD, 'PremiumSSDLoop'] +} + +resource Microsoft_SqlVirtualMachine_SqlVirtualMachines_virtualMachine 'Microsoft.SqlVirtualMachine/SqlVirtualMachines@2017-03-01-preview' = { + name: virtualMachineName + location: location + properties: { + virtualMachineResourceId: virtualMachine.id + sqlManagement: 'Full' + sqlServerLicenseType: 'PAYG' + storageConfigurationSettings: { + diskConfigurationType: diskConfigurationType + storageWorkloadType: storageWorkloadType + sqlDataSettings: { + luns: dataDisksLuns + defaultFilePath: dataPath + } + sqlLogSettings: { + luns: logDisksLuns + defaultFilePath: logPath + } + sqlTempDbSettings: { + defaultFilePath: tempDbPath + } + } + } +} diff --git a/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive1.bicep b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive1.bicep new file mode 100644 index 00000000000..6eab151ce1a --- /dev/null +++ b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive1.bicep @@ -0,0 +1,55 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +@description('Specifies the location for all resources.') +param location string = resourceGroup().location + +@description('Specifies a username for the Virtual Machine.') +param adminUsername string + +@description('description') +param vmSize string = 'Standard_D2s_v3' + +var vmName = '${projectName}-vm' +var networkInterfaceName = '${projectName}-nic' + +resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { + name: vmName + location: location + properties: { + hardwareProfile: { + vmSize: vmSize + } + osProfile: { + computerName: vmName + adminUsername: adminUsername + linuxConfiguration: { + disablePasswordAuthentication: false + } + } + storageProfile: { + imageReference: { + publisher: 'Canonical' + offer: 'UbuntuServer' + sku: '18.04-LTS' + version: 'latest' + } + osDisk: { + createOption: 'fromImage' + } + } + networkProfile: { + networkInterfaces: [ + { + id: resourceId( + 'Microsoft.Network/networkInterfaces', + networkInterfaceName + ) + } + ] + } + } + dependsOn: [ + resourceId('Microsoft.Network/networkInterfaces', networkInterfaceName) + ] +} diff --git a/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive2.bicep b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive2.bicep new file mode 100644 index 00000000000..269c260743c --- /dev/null +++ b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive2.bicep @@ -0,0 +1,52 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +@description('Specifies the location for all resources.') +param location string = resourceGroup().location + +@description('Specifies a username for the Virtual Machine.') +param adminUsername string + +@description('description') +param vmSize string = 'Standard_D2s_v3' + +var vmName = '${projectName}-vm' +var networkInterfaceName = '${projectName}-nic' + +resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { + name: vmName + location: location + properties: { + hardwareProfile: { + vmSize: vmSize + } + osProfile: { + computerName: vmName + adminUsername: adminUsername + } + storageProfile: { + imageReference: { + publisher: 'Canonical' + offer: 'UbuntuServer' + sku: '18.04-LTS' + version: 'latest' + } + osDisk: { + createOption: 'fromImage' + } + } + networkProfile: { + networkInterfaces: [ + { + id: resourceId( + 'Microsoft.Network/networkInterfaces', + networkInterfaceName + ) + } + ] + } + } + dependsOn: [ + resourceId('Microsoft.Network/networkInterfaces', networkInterfaceName) + ] +} diff --git a/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive3.bicep b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive3.bicep new file mode 100644 index 00000000000..6eab151ce1a --- /dev/null +++ b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive3.bicep @@ -0,0 +1,55 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +@description('Specifies the location for all resources.') +param location string = resourceGroup().location + +@description('Specifies a username for the Virtual Machine.') +param adminUsername string + +@description('description') +param vmSize string = 'Standard_D2s_v3' + +var vmName = '${projectName}-vm' +var networkInterfaceName = '${projectName}-nic' + +resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { + name: vmName + location: location + properties: { + hardwareProfile: { + vmSize: vmSize + } + osProfile: { + computerName: vmName + adminUsername: adminUsername + linuxConfiguration: { + disablePasswordAuthentication: false + } + } + storageProfile: { + imageReference: { + publisher: 'Canonical' + offer: 'UbuntuServer' + sku: '18.04-LTS' + version: 'latest' + } + osDisk: { + createOption: 'fromImage' + } + } + networkProfile: { + networkInterfaces: [ + { + id: resourceId( + 'Microsoft.Network/networkInterfaces', + networkInterfaceName + ) + } + ] + } + } + dependsOn: [ + resourceId('Microsoft.Network/networkInterfaces', networkInterfaceName) + ] +} diff --git a/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive4.bicep b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive4.bicep new file mode 100644 index 00000000000..269c260743c --- /dev/null +++ b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive4.bicep @@ -0,0 +1,52 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +@description('Specifies the location for all resources.') +param location string = resourceGroup().location + +@description('Specifies a username for the Virtual Machine.') +param adminUsername string + +@description('description') +param vmSize string = 'Standard_D2s_v3' + +var vmName = '${projectName}-vm' +var networkInterfaceName = '${projectName}-nic' + +resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { + name: vmName + location: location + properties: { + hardwareProfile: { + vmSize: vmSize + } + osProfile: { + computerName: vmName + adminUsername: adminUsername + } + storageProfile: { + imageReference: { + publisher: 'Canonical' + offer: 'UbuntuServer' + sku: '18.04-LTS' + version: 'latest' + } + osDisk: { + createOption: 'fromImage' + } + } + networkProfile: { + networkInterfaces: [ + { + id: resourceId( + 'Microsoft.Network/networkInterfaces', + networkInterfaceName + ) + } + ] + } + } + dependsOn: [ + resourceId('Microsoft.Network/networkInterfaces', networkInterfaceName) + ] +} diff --git a/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive_expected_result.json b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive_expected_result.json index 90610f903ce..9b56de65a46 100644 --- a/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/azure_instance_using_basic_authentication/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "MEDIUM", "line": 42, "filename": "positive4.json" + }, + { + "queryName": "Azure Instance Using Basic Authentication", + "severity": "MEDIUM", + "line": 27, + "filename": "positive1.bicep" + }, + { + "queryName": "Azure Instance Using Basic Authentication", + "severity": "MEDIUM", + "line": 17, + "filename": "positive2.bicep" + }, + { + "queryName": "Azure Instance Using Basic Authentication", + "severity": "MEDIUM", + "line": 27, + "filename": "positive3.bicep" + }, + { + "queryName": "Azure Instance Using Basic Authentication", + "severity": "MEDIUM", + "line": 17, + "filename": "positive4.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/negative1.bicep b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/negative1.bicep new file mode 100644 index 00000000000..7a51402cbac --- /dev/null +++ b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/negative1.bicep @@ -0,0 +1,31 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +var vmName = '${projectName}-vm' + +resource vmName_disk1 'Microsoft.Compute/disks@2020-09-30' = { + name: '${vmName}-disk1' + location: resourceGroup().location + sku: { + name: 'Standard_LRS' + } + properties: { + creationData: { + createOption: 'Empty' + } + diskSizeGB: 512 + encryptionSettingsCollection: { + enabled: true + encryptionSettings: [ + { + diskEncryptionKey: { + secretUrl: 'https://secret.com/secrets/secret' + sourceVault: { + id: '/someid/somekey' + } + } + } + ] + } + } +} diff --git a/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/negative2.bicep b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/negative2.bicep new file mode 100644 index 00000000000..7a51402cbac --- /dev/null +++ b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/negative2.bicep @@ -0,0 +1,31 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +var vmName = '${projectName}-vm' + +resource vmName_disk1 'Microsoft.Compute/disks@2020-09-30' = { + name: '${vmName}-disk1' + location: resourceGroup().location + sku: { + name: 'Standard_LRS' + } + properties: { + creationData: { + createOption: 'Empty' + } + diskSizeGB: 512 + encryptionSettingsCollection: { + enabled: true + encryptionSettings: [ + { + diskEncryptionKey: { + secretUrl: 'https://secret.com/secrets/secret' + sourceVault: { + id: '/someid/somekey' + } + } + } + ] + } + } +} diff --git a/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive1.bicep b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive1.bicep new file mode 100644 index 00000000000..d9af58059ee --- /dev/null +++ b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive1.bicep @@ -0,0 +1,31 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +var vmName = '${projectName}-vm' + +resource vmName_disk1 'Microsoft.Compute/disks@2020-09-30' = { + name: '${vmName}-disk1' + location: resourceGroup().location + sku: { + name: 'Standard_LRS' + } + properties: { + creationData: { + createOption: 'Empty' + } + diskSizeGB: 512 + encryptionSettingsCollection: { + enabled: false + encryptionSettings: [ + { + diskEncryptionKey: { + secretUrl: 'https://secret.com/secrets/secret' + sourceVault: { + id: '/someid/somekey' + } + } + } + ] + } + } +} diff --git a/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive2.bicep b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive2.bicep new file mode 100644 index 00000000000..b9cd95bea36 --- /dev/null +++ b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive2.bicep @@ -0,0 +1,18 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +var vmName = '${projectName}-vm' + +resource vmName_disk1 'Microsoft.Compute/disks@2020-09-30' = { + name: '${vmName}-disk1' + location: resourceGroup().location + sku: { + name: 'Standard_LRS' + } + properties: { + creationData: { + createOption: 'Empty' + } + diskSizeGB: 512 + } +} diff --git a/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive3.bicep b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive3.bicep new file mode 100644 index 00000000000..d9af58059ee --- /dev/null +++ b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive3.bicep @@ -0,0 +1,31 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +var vmName = '${projectName}-vm' + +resource vmName_disk1 'Microsoft.Compute/disks@2020-09-30' = { + name: '${vmName}-disk1' + location: resourceGroup().location + sku: { + name: 'Standard_LRS' + } + properties: { + creationData: { + createOption: 'Empty' + } + diskSizeGB: 512 + encryptionSettingsCollection: { + enabled: false + encryptionSettings: [ + { + diskEncryptionKey: { + secretUrl: 'https://secret.com/secrets/secret' + sourceVault: { + id: '/someid/somekey' + } + } + } + ] + } + } +} diff --git a/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive4.bicep b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive4.bicep new file mode 100644 index 00000000000..b9cd95bea36 --- /dev/null +++ b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive4.bicep @@ -0,0 +1,18 @@ +@description('Specifies a name for generating resource names.') +param projectName string + +var vmName = '${projectName}-vm' + +resource vmName_disk1 'Microsoft.Compute/disks@2020-09-30' = { + name: '${vmName}-disk1' + location: resourceGroup().location + sku: { + name: 'Standard_LRS' + } + properties: { + creationData: { + createOption: 'Empty' + } + diskSizeGB: 512 + } +} diff --git a/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive_expected_result.json b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive_expected_result.json index 428e8043646..f69a151c8c5 100644 --- a/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/azure_managed_disk_without_encryption/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "HIGH", "line": 21, "filename": "positive4.json" + }, + { + "queryName": "Azure Managed Disk Without Encryption", + "severity": "HIGH", + "line": 18, + "filename": "positive1.bicep" + }, + { + "queryName": "Azure Managed Disk Without Encryption", + "severity": "HIGH", + "line": 7, + "filename": "positive2.bicep" + }, + { + "queryName": "Azure Managed Disk Without Encryption", + "severity": "HIGH", + "line": 18, + "filename": "positive3.bicep" + }, + { + "queryName": "Azure Managed Disk Without Encryption", + "severity": "HIGH", + "line": 7, + "filename": "positive4.bicep" } ] diff --git a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative1.bicep b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative1.bicep new file mode 100644 index 00000000000..22b202e3202 --- /dev/null +++ b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative1.bicep @@ -0,0 +1,17 @@ +param supportLogStorageAccountType string + +var computeLocation = 'comloc' + +resource negative1 'Microsoft.Storage/storageAccounts@2021-06-01' = { + kind: 'Storage' + location: computeLocation + name: 'negative1' + properties: { + publicNetworkAccess: 'Disabled' + } + sku: { + name: supportLogStorageAccountType + } + tags: {} + dependsOn: [] +} diff --git a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative2.bicep b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative2.bicep new file mode 100644 index 00000000000..380bbdf43e1 --- /dev/null +++ b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative2.bicep @@ -0,0 +1,19 @@ +param supportLogStorageAccountType string + +var computeLocation = 'comloc' + +resource negative2 'Microsoft.Storage/storageAccounts@2021-06-01' = { + kind: 'Storage' + location: computeLocation + name: 'negative2' + properties: { + networkAcls: { + defaultAction: 'Deny' + } + } + sku: { + name: supportLogStorageAccountType + } + tags: {} + dependsOn: [] +} diff --git a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive1.bicep b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive1.bicep new file mode 100644 index 00000000000..b659a1ed1f9 --- /dev/null +++ b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive1.bicep @@ -0,0 +1,19 @@ +param supportLogStorageAccountType string + +var computeLocation = 'comloc' + +resource positive1 'Microsoft.Storage/storageAccounts@2021-06-01' = { + kind: 'Storage' + location: computeLocation + name: 'positive1' + properties: { + networkAcls: { + defaultAction: 'Allow' + } + } + sku: { + name: supportLogStorageAccountType + } + tags: {} + dependsOn: [] +} diff --git a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive2.bicep b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive2.bicep new file mode 100644 index 00000000000..62f05f7d4a0 --- /dev/null +++ b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive2.bicep @@ -0,0 +1,15 @@ +param supportLogStorageAccountType string + +var computeLocation = 'comloc' + +resource positive2 'Microsoft.Storage/storageAccounts@2021-06-01' = { + kind: 'Storage' + location: computeLocation + name: 'positive2' + properties: {} + sku: { + name: supportLogStorageAccountType + } + tags: {} + dependsOn: [] +} diff --git a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive3.bicep b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive3.bicep new file mode 100644 index 00000000000..41449b9c03e --- /dev/null +++ b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive3.bicep @@ -0,0 +1,17 @@ +param supportLogStorageAccountType string + +var computeLocation = 'comloc' + +resource positive3 'Microsoft.Storage/storageAccounts@2021-06-01' = { + kind: 'Storage' + location: computeLocation + name: 'positive3' + properties: { + publicNetworkAccess: 'Enabled' + } + sku: { + name: supportLogStorageAccountType + } + tags: {} + dependsOn: [] +} diff --git a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive_expected_result.json b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive_expected_result.json index bd1b964727d..54b3560d6a7 100644 --- a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive_expected_result.json @@ -16,5 +16,23 @@ "severity": "HIGH", "line": 12, "fileName": "positive3.json" + }, + { + "queryName": "Default Azure Storage Account Network Access Is Too Permissive", + "severity": "HIGH", + "line": 11, + "fileName": "positive1.bicep" + }, + { + "queryName": "Default Azure Storage Account Network Access Is Too Permissive", + "severity": "HIGH", + "line": 9, + "fileName": "positive2.bicep" + }, + { + "queryName": "Default Azure Storage Account Network Access Is Too Permissive", + "severity": "HIGH", + "line": 10, + "fileName": "positive3.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/negative1.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/negative1.bicep new file mode 100644 index 00000000000..26f3a5742be --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/negative1.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/negative2.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/negative2.bicep new file mode 100644 index 00000000000..26f3a5742be --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/negative2.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive1.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive1.bicep new file mode 100644 index 00000000000..fce90975370 --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive1.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'Off' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive10.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive10.bicep new file mode 100644 index 00000000000..edfc2f0fe0c --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive10.bicep @@ -0,0 +1,11 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive11.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive11.bicep new file mode 100644 index 00000000000..d761b527a04 --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive11.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'Off' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive12.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive12.bicep new file mode 100644 index 00000000000..316159f73c0 --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive12.bicep @@ -0,0 +1,14 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive2.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive2.bicep new file mode 100644 index 00000000000..047c95bb6d7 --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive2.bicep @@ -0,0 +1,11 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive3.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive3.bicep new file mode 100644 index 00000000000..0de0191abec --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive3.bicep @@ -0,0 +1,14 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive4.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive4.bicep new file mode 100644 index 00000000000..edfc2f0fe0c --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive4.bicep @@ -0,0 +1,11 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive5.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive5.bicep new file mode 100644 index 00000000000..d761b527a04 --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive5.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'Off' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive6.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive6.bicep new file mode 100644 index 00000000000..316159f73c0 --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive6.bicep @@ -0,0 +1,14 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive7.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive7.bicep new file mode 100644 index 00000000000..fce90975370 --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive7.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'Off' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive8.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive8.bicep new file mode 100644 index 00000000000..047c95bb6d7 --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive8.bicep @@ -0,0 +1,11 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive9.bicep b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive9.bicep new file mode 100644 index 00000000000..0de0191abec --- /dev/null +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive9.bicep @@ -0,0 +1,14 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive_expected_result.json b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive_expected_result.json index 41a16fb6131..205542f4c46 100644 --- a/assets/queries/azureResourceManager/email_notifications_set_off/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/email_notifications_set_off/test/positive_expected_result.json @@ -70,5 +70,77 @@ "severity": "INFO", "line": 22, "filename": "positive12.json" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 7, + "filename": "positive1.bicep" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 3, + "filename": "positive2.bicep" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 6, + "filename": "positive3.bicep" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 3, + "filename": "positive4.bicep" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 11, + "filename": "positive5.bicep" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 10, + "filename": "positive6.bicep" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 7, + "filename": "positive7.bicep" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 3, + "filename": "positive8.bicep" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 6, + "filename": "positive9.bicep" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 3, + "filename": "positive10.bicep" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 11, + "filename": "positive11.bicep" + }, + { + "queryName": "Email Notifications Disabled", + "severity": "INFO", + "line": 10, + "filename": "positive12.bicep" } ] diff --git a/assets/queries/azureResourceManager/key_vault_not_recoverable/test/negative1.bicep b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/negative1.bicep new file mode 100644 index 00000000000..605f77b7f5b --- /dev/null +++ b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/negative1.bicep @@ -0,0 +1,29 @@ +resource keyVaultInstance 'Microsoft.KeyVault/vaults@2019-09-01' = { + name: 'keyVaultInstance' + location: 'location' + tags: {} + properties: { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + sku: { + family: 'A' + name: 'standard' + } + accessPolicies: [ + { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + objectId: '99998888-8666-4144-9199-2d7cd0111111' + permissions: { + keys: ['encrypt'] + } + } + ] + vaultUri: 'string' + enabledForDeployment: true + enabledForDiskEncryption: true + enabledForTemplateDeployment: true + enableSoftDelete: true + softDeleteRetentionInDays: 80 + enableRbacAuthorization: true + enablePurgeProtection: true + } +} diff --git a/assets/queries/azureResourceManager/key_vault_not_recoverable/test/negative2.bicep b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/negative2.bicep new file mode 100644 index 00000000000..605f77b7f5b --- /dev/null +++ b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/negative2.bicep @@ -0,0 +1,29 @@ +resource keyVaultInstance 'Microsoft.KeyVault/vaults@2019-09-01' = { + name: 'keyVaultInstance' + location: 'location' + tags: {} + properties: { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + sku: { + family: 'A' + name: 'standard' + } + accessPolicies: [ + { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + objectId: '99998888-8666-4144-9199-2d7cd0111111' + permissions: { + keys: ['encrypt'] + } + } + ] + vaultUri: 'string' + enabledForDeployment: true + enabledForDiskEncryption: true + enabledForTemplateDeployment: true + enableSoftDelete: true + softDeleteRetentionInDays: 80 + enableRbacAuthorization: true + enablePurgeProtection: true + } +} diff --git a/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive1.bicep b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive1.bicep new file mode 100644 index 00000000000..6810bc4560a --- /dev/null +++ b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive1.bicep @@ -0,0 +1,28 @@ +resource keyVaultInstance 'Microsoft.KeyVault/vaults@2019-09-01' = { + name: 'keyVaultInstance' + location: 'location' + tags: {} + properties: { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + sku: { + family: 'A' + name: 'standard' + } + accessPolicies: [ + { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + objectId: '99998888-8666-4144-9199-2d7cd0111111' + permissions: { + keys: ['encrypt'] + } + } + ] + vaultUri: 'string' + enabledForDeployment: true + enabledForDiskEncryption: true + enabledForTemplateDeployment: true + enableSoftDelete: true + softDeleteRetentionInDays: 80 + enableRbacAuthorization: true + } +} diff --git a/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive2.bicep b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive2.bicep new file mode 100644 index 00000000000..87d7c4a0542 --- /dev/null +++ b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive2.bicep @@ -0,0 +1,29 @@ +resource keyVaultInstance 'Microsoft.KeyVault/vaults@2019-09-01' = { + name: 'keyVaultInstance' + location: 'location' + tags: {} + properties: { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + sku: { + family: 'A' + name: 'standard' + } + accessPolicies: [ + { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + objectId: '99998888-8666-4144-9199-2d7cd0111111' + permissions: { + keys: ['encrypt'] + } + } + ] + vaultUri: 'string' + enabledForDeployment: true + enabledForDiskEncryption: true + enabledForTemplateDeployment: true + enableSoftDelete: true + softDeleteRetentionInDays: 80 + enableRbacAuthorization: true + enablePurgeProtection: false + } +} diff --git a/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive3.bicep b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive3.bicep new file mode 100644 index 00000000000..6810bc4560a --- /dev/null +++ b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive3.bicep @@ -0,0 +1,28 @@ +resource keyVaultInstance 'Microsoft.KeyVault/vaults@2019-09-01' = { + name: 'keyVaultInstance' + location: 'location' + tags: {} + properties: { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + sku: { + family: 'A' + name: 'standard' + } + accessPolicies: [ + { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + objectId: '99998888-8666-4144-9199-2d7cd0111111' + permissions: { + keys: ['encrypt'] + } + } + ] + vaultUri: 'string' + enabledForDeployment: true + enabledForDiskEncryption: true + enabledForTemplateDeployment: true + enableSoftDelete: true + softDeleteRetentionInDays: 80 + enableRbacAuthorization: true + } +} diff --git a/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive4.bicep b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive4.bicep new file mode 100644 index 00000000000..87d7c4a0542 --- /dev/null +++ b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive4.bicep @@ -0,0 +1,29 @@ +resource keyVaultInstance 'Microsoft.KeyVault/vaults@2019-09-01' = { + name: 'keyVaultInstance' + location: 'location' + tags: {} + properties: { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + sku: { + family: 'A' + name: 'standard' + } + accessPolicies: [ + { + tenantId: '72f98888-8666-4144-9199-2d7cd0111111' + objectId: '99998888-8666-4144-9199-2d7cd0111111' + permissions: { + keys: ['encrypt'] + } + } + ] + vaultUri: 'string' + enabledForDeployment: true + enabledForDiskEncryption: true + enabledForTemplateDeployment: true + enableSoftDelete: true + softDeleteRetentionInDays: 80 + enableRbacAuthorization: true + enablePurgeProtection: false + } +} diff --git a/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive5.bicep b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive5.bicep new file mode 100644 index 00000000000..b6f1c125f60 --- /dev/null +++ b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive5.bicep @@ -0,0 +1,165 @@ +param vaults_pgs_bot_prod_name int = 5 + +resource vaults_pgs_bot_prod_name_resource 'Microsoft.KeyVault/vaults@2016-10-01' = { + name: vaults_pgs_bot_prod_name + location: 'westeurope' + tags: { + ProjectCodeBU: 'UKMUMD' + ApplicationName: 'PGS HR Chatbot' + ProjectCodePGDS: 'PRJ0024896' + CostCentreBU: 'UKMUMD' + DataClassification: 'General' + BusinessUnit: 'PGS' + Owner: 'Pru UK Andover Innovation Team' + Contact: 'andover2@prudential.co.uk' + CostCentrePGDS: 'ITBUEXP' + Criticality: 'Low' + } + properties: { + sku: { + family: 'A' + name: 'standard' + } + tenantId: 'aa42167d-6f8d-45ce-b655-d245ef97da66' + accessPolicies: [ + { + tenantId: 'aa42167d-6f8d-45ce-b655-d245ef97da66' + objectId: 'f3e7baf5-8d66-4fb2-b7aa-7b7484309df6' + permissions: { + keys: [ + 'Get' + 'Create' + 'Delete' + 'List' + 'Update' + 'Import' + 'Backup' + 'Restore' + 'Recover' + ] + secrets: [ + 'Get' + 'List' + 'Set' + 'Delete' + 'Backup' + 'Restore' + 'Recover' + ] + certificates: [ + 'Get' + 'Delete' + 'List' + 'Create' + 'Import' + 'Update' + 'DeleteIssuers' + 'GetIssuers' + 'ListIssuers' + 'ManageContacts' + 'ManageIssuers' + 'SetIssuers' + ] + storage: [ + 'delete' + 'deletesas' + 'get' + 'getsas' + 'list' + 'listsas' + 'regeneratekey' + 'set' + 'setsas' + 'update' + ] + } + } + { + tenantId: 'aa42167d-6f8d-45ce-b655-d245ef97da66' + objectId: '1033a977-ffdc-4359-869a-b673d075f128' + permissions: { + keys: [] + secrets: [ + 'Get' + ] + certificates: [] + storage: [] + } + } + { + tenantId: 'aa42167d-6f8d-45ce-b655-d245ef97da66' + objectId: '13be5d2d-6e1f-4667-add4-02d2d1142ac5' + permissions: { + keys: [] + secrets: [ + 'Get' + 'List' + 'Set' + 'Delete' + 'Backup' + 'Restore' + 'Recover' + 'Purge' + ] + certificates: [] + storage: [] + } + } + { + tenantId: 'aa42167d-6f8d-45ce-b655-d245ef97da66' + objectId: 'e56a2de8-a788-415f-b10f-14bfd3000e1d' + permissions: { + keys: [ + 'Get' + 'List' + 'Update' + 'Create' + 'Import' + 'Delete' + 'Recover' + 'Backup' + 'Restore' + 'Decrypt' + 'Encrypt' + 'UnwrapKey' + 'WrapKey' + 'Verify' + 'Sign' + 'Purge' + ] + secrets: [ + 'Get' + 'List' + 'Set' + 'Delete' + 'Recover' + 'Backup' + 'Restore' + 'Purge' + ] + certificates: [ + 'Get' + 'List' + 'Update' + 'Create' + 'Import' + 'Delete' + 'Recover' + 'Backup' + 'Restore' + 'ManageContacts' + 'ManageIssuers' + 'GetIssuers' + 'ListIssuers' + 'SetIssuers' + 'DeleteIssuers' + 'Purge' + ] + } + } + ] + enabledForDeployment: false + enabledForDiskEncryption: false + enabledForTemplateDeployment: false + } +} diff --git a/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive_expected_result.json b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive_expected_result.json index 70c55b484d3..aedb11e80d1 100644 --- a/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/key_vault_not_recoverable/test/positive_expected_result.json @@ -34,5 +34,41 @@ "severity": "HIGH", "line": 23, "fileName": "positive5.json" + }, + { + "queryName": "Key Vault Not Recoverable", + "severity": "HIGH", + "line": 5, + "fileName": "positive1.bicep" + }, + { + "queryName": "Key Vault Not Recoverable", + "severity": "HIGH", + "line": 27, + "fileName": "positive2.bicep" + }, + { + "queryName": "Key Vault Not Recoverable", + "severity": "HIGH", + "line": 5, + "fileName": "positive3.bicep" + }, + { + "queryName": "Key Vault Not Recoverable", + "severity": "HIGH", + "line": 27, + "fileName": "positive4.bicep" + }, + { + "queryName": "Key Vault Not Recoverable", + "severity": "HIGH", + "line": 18, + "fileName": "positive5.bicep" + }, + { + "queryName": "Key Vault Not Recoverable", + "severity": "HIGH", + "line": 18, + "fileName": "positive5.bicep" } ] diff --git a/assets/queries/azureResourceManager/log_profile_incorrect_category/test/negative1.bicep b/assets/queries/azureResourceManager/log_profile_incorrect_category/test/negative1.bicep new file mode 100644 index 00000000000..cfbbe1b2039 --- /dev/null +++ b/assets/queries/azureResourceManager/log_profile_incorrect_category/test/negative1.bicep @@ -0,0 +1,15 @@ +resource string 'microsoft.insights/logprofiles@2016-03-01' = { + name: 'string' + location: 'eastus' + tags: {} + properties: { + storageAccountId: 'storageAccountId' + serviceBusRuleId: 'serviceBusRuleId' + locations: ['eastus'] + categories: ['Write'] + retentionPolicy: { + enabled: true + days: 450 + } + } +} diff --git a/assets/queries/azureResourceManager/log_profile_incorrect_category/test/negative2.bicep b/assets/queries/azureResourceManager/log_profile_incorrect_category/test/negative2.bicep new file mode 100644 index 00000000000..cfbbe1b2039 --- /dev/null +++ b/assets/queries/azureResourceManager/log_profile_incorrect_category/test/negative2.bicep @@ -0,0 +1,15 @@ +resource string 'microsoft.insights/logprofiles@2016-03-01' = { + name: 'string' + location: 'eastus' + tags: {} + properties: { + storageAccountId: 'storageAccountId' + serviceBusRuleId: 'serviceBusRuleId' + locations: ['eastus'] + categories: ['Write'] + retentionPolicy: { + enabled: true + days: 450 + } + } +} diff --git a/assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive1.bicep b/assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive1.bicep new file mode 100644 index 00000000000..e53aac892fb --- /dev/null +++ b/assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive1.bicep @@ -0,0 +1,15 @@ +resource string 'microsoft.insights/logprofiles@2016-03-01' = { + name: 'string' + location: 'eastus' + tags: {} + properties: { + storageAccountId: 'storageAccountId' + serviceBusRuleId: 'serviceBusRuleId' + locations: ['eastus'] + categories: ['Writ'] + retentionPolicy: { + enabled: true + days: 450 + } + } +} diff --git a/assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive2.bicep b/assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive2.bicep new file mode 100644 index 00000000000..e53aac892fb --- /dev/null +++ b/assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive2.bicep @@ -0,0 +1,15 @@ +resource string 'microsoft.insights/logprofiles@2016-03-01' = { + name: 'string' + location: 'eastus' + tags: {} + properties: { + storageAccountId: 'storageAccountId' + serviceBusRuleId: 'serviceBusRuleId' + locations: ['eastus'] + categories: ['Writ'] + retentionPolicy: { + enabled: true + days: 450 + } + } +} diff --git a/assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive_expected_result.json b/assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive_expected_result.json index d6d8fd0dca2..5493d0ff29d 100644 --- a/assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/log_profile_incorrect_category/test/positive_expected_result.json @@ -10,5 +10,17 @@ "severity": "LOW", "line": 24, "fileName": "positive2.json" + }, + { + "queryName": "Log Profile Incorrect Category", + "severity": "LOW", + "line": 9, + "fileName": "positive1.bicep" + }, + { + "queryName": "Log Profile Incorrect Category", + "severity": "LOW", + "line": 9, + "fileName": "positive2.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/negative1.bicep new file mode 100644 index 00000000000..fa00f3f509a --- /dev/null +++ b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/negative1.bicep @@ -0,0 +1,14 @@ +resource server 'Microsoft.DBforMySQL/servers@2017-12-01' = { + name: 'server' + identity: { + type: 'SystemAssigned' + } + properties: { + version: '5.6' + sslEnforcement: 'Enabled' + createMode: 'GeoRestore' + sourceServerId: 'id' + } + location: 'location' + tags: {} +} diff --git a/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/negative2.bicep new file mode 100644 index 00000000000..fa00f3f509a --- /dev/null +++ b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/negative2.bicep @@ -0,0 +1,14 @@ +resource server 'Microsoft.DBforMySQL/servers@2017-12-01' = { + name: 'server' + identity: { + type: 'SystemAssigned' + } + properties: { + version: '5.6' + sslEnforcement: 'Enabled' + createMode: 'GeoRestore' + sourceServerId: 'id' + } + location: 'location' + tags: {} +} diff --git a/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive1.bicep new file mode 100644 index 00000000000..0e217e6268b --- /dev/null +++ b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive1.bicep @@ -0,0 +1,13 @@ +resource server 'Microsoft.DBforMySQL/servers@2017-12-01' = { + name: 'server' + identity: { + type: 'SystemAssigned' + } + properties: { + version: '5.6' + createMode: 'GeoRestore' + sourceServerId: 'id' + } + location: 'location' + tags: {} +} diff --git a/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive2.bicep new file mode 100644 index 00000000000..74ba85a1f9d --- /dev/null +++ b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive2.bicep @@ -0,0 +1,14 @@ +resource server 'Microsoft.DBforMySQL/servers@2017-12-01' = { + name: 'server' + identity: { + type: 'SystemAssigned' + } + properties: { + version: '5.6' + sslEnforcement: 'Disabled' + createMode: 'GeoRestore' + sourceServerId: 'id' + } + location: 'location' + tags: {} +} diff --git a/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive3.bicep new file mode 100644 index 00000000000..0e217e6268b --- /dev/null +++ b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive3.bicep @@ -0,0 +1,13 @@ +resource server 'Microsoft.DBforMySQL/servers@2017-12-01' = { + name: 'server' + identity: { + type: 'SystemAssigned' + } + properties: { + version: '5.6' + createMode: 'GeoRestore' + sourceServerId: 'id' + } + location: 'location' + tags: {} +} diff --git a/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive4.bicep new file mode 100644 index 00000000000..74ba85a1f9d --- /dev/null +++ b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive4.bicep @@ -0,0 +1,14 @@ +resource server 'Microsoft.DBforMySQL/servers@2017-12-01' = { + name: 'server' + identity: { + type: 'SystemAssigned' + } + properties: { + version: '5.6' + sslEnforcement: 'Disabled' + createMode: 'GeoRestore' + sourceServerId: 'id' + } + location: 'location' + tags: {} +} diff --git a/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive_expected_result.json index e9aa5d90167..a2a485c0bac 100644 --- a/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/mysql_server_ssl_enforcement_disabled/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "MEDIUM", "line": 20, "fileName": "positive4.json" + }, + { + "queryName": "MySQL Server SSL Enforcement Disabled", + "severity": "MEDIUM", + "line": 6, + "fileName": "positive1.bicep" + }, + { + "queryName": "MySQL Server SSL Enforcement Disabled", + "severity": "MEDIUM", + "line": 8, + "fileName": "positive2.bicep" + }, + { + "queryName": "MySQL Server SSL Enforcement Disabled", + "severity": "MEDIUM", + "line": 6, + "fileName": "positive3.bicep" + }, + { + "queryName": "MySQL Server SSL Enforcement Disabled", + "severity": "MEDIUM", + "line": 8, + "fileName": "positive4.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative1.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative1.bicep new file mode 100644 index 00000000000..5188c2febbc --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative1.bicep @@ -0,0 +1,24 @@ +resource security_group 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'security group' + location: 'location1' + tags: {} + properties: { + securityRules: [ + { + id: 'id' + properties: { + description: 'access to RDP' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRange: '3389' + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Deny' + priority: 301 + direction: 'Inbound' + } + name: 'security rule' + } + ] + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative2.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative2.bicep new file mode 100644 index 00000000000..5ac777d2a3e --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative2.bicep @@ -0,0 +1,14 @@ +resource sample_securitygroup 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + name: 'sample/securitygroup' + properties: { + description: 'access' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['4030-5100'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative3.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative3.bicep new file mode 100644 index 00000000000..01771aa98d6 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative3.bicep @@ -0,0 +1,22 @@ +resource securitygroup 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'securitygroup' + location: 'location1' + tags: {} + properties: {} +} + +resource securitygroup_sr 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + parent: securitygroup + properties: { + description: 'access' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['6634'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } + name: 'sr' +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative4.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative4.bicep new file mode 100644 index 00000000000..5188c2febbc --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative4.bicep @@ -0,0 +1,24 @@ +resource security_group 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'security group' + location: 'location1' + tags: {} + properties: { + securityRules: [ + { + id: 'id' + properties: { + description: 'access to RDP' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRange: '3389' + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Deny' + priority: 301 + direction: 'Inbound' + } + name: 'security rule' + } + ] + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative5.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative5.bicep new file mode 100644 index 00000000000..5ac777d2a3e --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative5.bicep @@ -0,0 +1,14 @@ +resource sample_securitygroup 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + name: 'sample/securitygroup' + properties: { + description: 'access' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['4030-5100'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative6.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative6.bicep new file mode 100644 index 00000000000..01771aa98d6 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/negative6.bicep @@ -0,0 +1,22 @@ +resource securitygroup 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'securitygroup' + location: 'location1' + tags: {} + properties: {} +} + +resource securitygroup_sr 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + parent: securitygroup + properties: { + description: 'access' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['6634'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } + name: 'sr' +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive1.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive1.bicep new file mode 100644 index 00000000000..7123b102346 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive1.bicep @@ -0,0 +1,39 @@ +resource security_group 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'security group' + location: 'location1' + tags: {} + properties: { + securityRules: [ + { + id: 'id' + properties: { + description: 'access to RDP' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRange: '3389' + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 301 + direction: 'Inbound' + } + name: 'security rule' + } + { + id: 'id2' + properties: { + description: 'access to SSH' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRange: '22' + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Deny' + priority: 301 + direction: 'Inbound' + } + name: 'security rule2' + } + ] + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive2.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive2.bicep new file mode 100644 index 00000000000..1ced10f0188 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive2.bicep @@ -0,0 +1,14 @@ +resource sample_securitygroup 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + name: 'sample/securitygroup' + properties: { + description: 'access to RDP' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['3333-3389'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive3.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive3.bicep new file mode 100644 index 00000000000..75dc7c65ccc --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive3.bicep @@ -0,0 +1,22 @@ +resource securitygroup 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'securitygroup' + location: 'location1' + tags: {} + properties: {} +} + +resource securitygroup_sr 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + parent: securitygroup + properties: { + description: 'access to RDP' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['3333-3389'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } + name: 'sr' +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive4.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive4.bicep new file mode 100644 index 00000000000..99da3c759c4 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive4.bicep @@ -0,0 +1,24 @@ +resource security_group 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'security group' + location: 'location1' + tags: {} + properties: { + securityRules: [ + { + id: 'id' + properties: { + description: 'access to RDP' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRange: '3389' + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 301 + direction: 'Inbound' + } + name: 'security rule' + } + ] + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive5.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive5.bicep new file mode 100644 index 00000000000..1ced10f0188 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive5.bicep @@ -0,0 +1,14 @@ +resource sample_securitygroup 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + name: 'sample/securitygroup' + properties: { + description: 'access to RDP' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['3333-3389'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive6.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive6.bicep new file mode 100644 index 00000000000..75dc7c65ccc --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive6.bicep @@ -0,0 +1,22 @@ +resource securitygroup 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'securitygroup' + location: 'location1' + tags: {} + properties: {} +} + +resource securitygroup_sr 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + parent: securitygroup + properties: { + description: 'access to RDP' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['3333-3389'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } + name: 'sr' +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive_expected_result.json b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive_expected_result.json index d8f69b76e0d..81f2c0350d3 100644 --- a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_rdp/test/positive_expected_result.json @@ -34,5 +34,41 @@ "severity": "HIGH", "line": 22, "fileName": "positive6.json" + }, + { + "queryName": "Network Security Group With Unrestricted Access To RDP", + "severity": "HIGH", + "line": 9, + "fileName": "positive1.bicep" + }, + { + "queryName": "Network Security Group With Unrestricted Access To RDP", + "severity": "HIGH", + "line": 3, + "fileName": "positive2.bicep" + }, + { + "queryName": "Network Security Group With Unrestricted Access To RDP", + "severity": "HIGH", + "line": 10, + "fileName": "positive3.bicep" + }, + { + "queryName": "Network Security Group With Unrestricted Access To RDP", + "severity": "HIGH", + "line": 9, + "fileName": "positive4.bicep" + }, + { + "queryName": "Network Security Group With Unrestricted Access To RDP", + "severity": "HIGH", + "line": 3, + "fileName": "positive5.bicep" + }, + { + "queryName": "Network Security Group With Unrestricted Access To RDP", + "severity": "HIGH", + "line": 10, + "fileName": "positive6.bicep" } ] diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative1.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative1.bicep new file mode 100644 index 00000000000..ee5ac3bcee3 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative1.bicep @@ -0,0 +1,24 @@ +resource security_group 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'security group' + location: 'location1' + tags: {} + properties: { + securityRules: [ + { + id: 'id' + properties: { + description: 'access to SSH' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRange: '22' + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Deny' + priority: 301 + direction: 'Inbound' + } + name: 'security rule' + } + ] + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative2.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative2.bicep new file mode 100644 index 00000000000..5ac777d2a3e --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative2.bicep @@ -0,0 +1,14 @@ +resource sample_securitygroup 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + name: 'sample/securitygroup' + properties: { + description: 'access' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['4030-5100'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative3.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative3.bicep new file mode 100644 index 00000000000..01771aa98d6 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative3.bicep @@ -0,0 +1,22 @@ +resource securitygroup 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'securitygroup' + location: 'location1' + tags: {} + properties: {} +} + +resource securitygroup_sr 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + parent: securitygroup + properties: { + description: 'access' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['6634'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } + name: 'sr' +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative4.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative4.bicep new file mode 100644 index 00000000000..ee5ac3bcee3 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative4.bicep @@ -0,0 +1,24 @@ +resource security_group 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'security group' + location: 'location1' + tags: {} + properties: { + securityRules: [ + { + id: 'id' + properties: { + description: 'access to SSH' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRange: '22' + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Deny' + priority: 301 + direction: 'Inbound' + } + name: 'security rule' + } + ] + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative5.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative5.bicep new file mode 100644 index 00000000000..5ac777d2a3e --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative5.bicep @@ -0,0 +1,14 @@ +resource sample_securitygroup 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + name: 'sample/securitygroup' + properties: { + description: 'access' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['4030-5100'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative6.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative6.bicep new file mode 100644 index 00000000000..01771aa98d6 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/negative6.bicep @@ -0,0 +1,22 @@ +resource securitygroup 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'securitygroup' + location: 'location1' + tags: {} + properties: {} +} + +resource securitygroup_sr 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + parent: securitygroup + properties: { + description: 'access' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['6634'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } + name: 'sr' +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive1.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive1.bicep new file mode 100644 index 00000000000..1fc290ccf3d --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive1.bicep @@ -0,0 +1,39 @@ +resource security_group 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'security group' + location: 'location1' + tags: {} + properties: { + securityRules: [ + { + id: 'id' + properties: { + description: 'access to SSH' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRange: '22' + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 301 + direction: 'Inbound' + } + name: 'security rule' + } + { + id: 'id2' + properties: { + description: 'access to RDP' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRange: '3389' + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Deny' + priority: 301 + direction: 'Inbound' + } + name: 'security rule2' + } + ] + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive2.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive2.bicep new file mode 100644 index 00000000000..5ef4d1c1452 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive2.bicep @@ -0,0 +1,14 @@ +resource sample_securitygroup 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + name: 'sample/securitygroup' + properties: { + description: 'access to SSH' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['22-23'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive3.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive3.bicep new file mode 100644 index 00000000000..f6aaaa8f206 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive3.bicep @@ -0,0 +1,22 @@ +resource securitygroup 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'securitygroup' + location: 'location1' + tags: {} + properties: {} +} + +resource securitygroup_sr 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + parent: securitygroup + properties: { + description: 'access to SSH' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['22-23'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } + name: 'sr' +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive4.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive4.bicep new file mode 100644 index 00000000000..d56b261851f --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive4.bicep @@ -0,0 +1,24 @@ +resource security_group 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'security group' + location: 'location1' + tags: {} + properties: { + securityRules: [ + { + id: 'id' + properties: { + description: 'access to SSH' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRange: '22' + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 301 + direction: 'Inbound' + } + name: 'security rule' + } + ] + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive5.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive5.bicep new file mode 100644 index 00000000000..5ef4d1c1452 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive5.bicep @@ -0,0 +1,14 @@ +resource sample_securitygroup 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + name: 'sample/securitygroup' + properties: { + description: 'access to SSH' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['22-23'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive6.bicep b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive6.bicep new file mode 100644 index 00000000000..f6aaaa8f206 --- /dev/null +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive6.bicep @@ -0,0 +1,22 @@ +resource securitygroup 'Microsoft.Network/networkSecurityGroups@2020-11-01' = { + name: 'securitygroup' + location: 'location1' + tags: {} + properties: {} +} + +resource securitygroup_sr 'Microsoft.Network/networkSecurityGroups/securityRules@2020-11-01' = { + parent: securitygroup + properties: { + description: 'access to SSH' + protocol: 'Tcp' + sourcePortRange: '*' + destinationPortRanges: ['22-23'] + sourceAddressPrefix: '*' + destinationAddressPrefix: '*' + access: 'Allow' + priority: 100 + direction: 'Inbound' + } + name: 'sr' +} diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive_expected_result.json b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive_expected_result.json index a2a2afda9bc..5fc594a3a8f 100644 --- a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive_expected_result.json @@ -34,5 +34,41 @@ "severity": "MEDIUM", "line": 22, "fileName": "positive6.json" + }, + { + "queryName": "Network Security Group With Unrestricted Access To SSH", + "severity": "MEDIUM", + "line": 9, + "fileName": "positive1.bicep" + }, + { + "queryName": "Network Security Group With Unrestricted Access To SSH", + "severity": "MEDIUM", + "line": 3, + "fileName": "positive2.bicep" + }, + { + "queryName": "Network Security Group With Unrestricted Access To SSH", + "severity": "MEDIUM", + "line": 10, + "fileName": "positive3.bicep" + }, + { + "queryName": "Network Security Group With Unrestricted Access To SSH", + "severity": "MEDIUM", + "line": 9, + "fileName": "positive4.bicep" + }, + { + "queryName": "Network Security Group With Unrestricted Access To SSH", + "severity": "MEDIUM", + "line": 3, + "fileName": "positive5.bicep" + }, + { + "queryName": "Network Security Group With Unrestricted Access To SSH", + "severity": "MEDIUM", + "line": 10, + "fileName": "positive6.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/negative1.bicep b/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/negative1.bicep new file mode 100644 index 00000000000..967f0ca6bb6 --- /dev/null +++ b/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/negative1.bicep @@ -0,0 +1,18 @@ +@description('Name sof resource group') +param resourceGroupName string + +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/negative2.bicep b/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/negative2.bicep new file mode 100644 index 00000000000..967f0ca6bb6 --- /dev/null +++ b/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/negative2.bicep @@ -0,0 +1,18 @@ +@description('Name sof resource group') +param resourceGroupName string + +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive1.bicep b/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive1.bicep new file mode 100644 index 00000000000..be678e8f4bc --- /dev/null +++ b/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive1.bicep @@ -0,0 +1,14 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive2.bicep b/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive2.bicep new file mode 100644 index 00000000000..be678e8f4bc --- /dev/null +++ b/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive2.bicep @@ -0,0 +1,14 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive_expected_result.json b/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive_expected_result.json index 47e85da9240..05b67ec86dd 100644 --- a/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/phone_number_not_set_security_contacts/test/positive_expected_result.json @@ -10,5 +10,17 @@ "severity": "LOW", "line": 15, "fileName": "positive2.json" + }, + { + "queryName": "Phone Number Not Set For Security Contacts", + "severity": "LOW", + "line": 3, + "fileName": "positive1.bicep" + }, + { + "queryName": "Phone Number Not Set For Security Contacts", + "severity": "LOW", + "line": 3, + "fileName": "positive2.bicep" } ] diff --git a/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/negative1.bicep b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/negative1.bicep new file mode 100644 index 00000000000..16b85bbe326 --- /dev/null +++ b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/negative1.bicep @@ -0,0 +1,13 @@ +resource roleDef 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' = { + name: 'roleDef' + properties: { + roleName: 'my-custom-role' + description: 'This is a custom role' + permissions: [ + { + actions: ['Microsoft.Authorization/roleDefinitions/read'] + } + ] + assignableScopes: [subscription().id] + } +} diff --git a/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/negative2.bicep b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/negative2.bicep new file mode 100644 index 00000000000..16b85bbe326 --- /dev/null +++ b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/negative2.bicep @@ -0,0 +1,13 @@ +resource roleDef 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' = { + name: 'roleDef' + properties: { + roleName: 'my-custom-role' + description: 'This is a custom role' + permissions: [ + { + actions: ['Microsoft.Authorization/roleDefinitions/read'] + } + ] + assignableScopes: [subscription().id] + } +} diff --git a/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive1.bicep b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive1.bicep new file mode 100644 index 00000000000..45c4124d4b7 --- /dev/null +++ b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive1.bicep @@ -0,0 +1,13 @@ +resource roleDef 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' = { + name: 'roleDef' + properties: { + roleName: 'my-custom-role' + description: 'This is a custom role' + permissions: [ + { + actions: ['*'] + } + ] + assignableScopes: [subscription().id] + } +} diff --git a/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive2.bicep b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive2.bicep new file mode 100644 index 00000000000..368fedc0aed --- /dev/null +++ b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive2.bicep @@ -0,0 +1,13 @@ +resource roleDef 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' = { + name: 'roleDef' + properties: { + roleName: 'my-custom-role' + description: 'This is a custom role' + permissions: [ + { + actions: ['Microsoft.Authorization/roleDefinitions/write'] + } + ] + assignableScopes: [subscription().id] + } +} diff --git a/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive3.bicep b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive3.bicep new file mode 100644 index 00000000000..45c4124d4b7 --- /dev/null +++ b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive3.bicep @@ -0,0 +1,13 @@ +resource roleDef 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' = { + name: 'roleDef' + properties: { + roleName: 'my-custom-role' + description: 'This is a custom role' + permissions: [ + { + actions: ['*'] + } + ] + assignableScopes: [subscription().id] + } +} diff --git a/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive4.bicep b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive4.bicep new file mode 100644 index 00000000000..368fedc0aed --- /dev/null +++ b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive4.bicep @@ -0,0 +1,13 @@ +resource roleDef 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' = { + name: 'roleDef' + properties: { + roleName: 'my-custom-role' + description: 'This is a custom role' + permissions: [ + { + actions: ['Microsoft.Authorization/roleDefinitions/write'] + } + ] + assignableScopes: [subscription().id] + } +} diff --git a/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive_expected_result.json b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive_expected_result.json index 848b2a462bd..494dc192beb 100644 --- a/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/role_definitions_allow_custom_subscription_role_creation/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "HIGH", "line": 20, "fileName": "positive4.json" + }, + { + "queryName": "Role Definitions Allow Custom Subscription Role Creation", + "severity": "HIGH", + "line": 8, + "fileName": "positive1.bicep" + }, + { + "queryName": "Role Definitions Allow Custom Subscription Role Creation", + "severity": "HIGH", + "line": 8, + "fileName": "positive2.bicep" + }, + { + "queryName": "Role Definitions Allow Custom Subscription Role Creation", + "severity": "HIGH", + "line": 8, + "fileName": "positive3.bicep" + }, + { + "queryName": "Role Definitions Allow Custom Subscription Role Creation", + "severity": "HIGH", + "line": 8, + "fileName": "positive4.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/secret_without_expiration_date/test/negative1.bicep b/assets/queries/azureResourceManager/secret_without_expiration_date/test/negative1.bicep new file mode 100644 index 00000000000..7ed87f0e955 --- /dev/null +++ b/assets/queries/azureResourceManager/secret_without_expiration_date/test/negative1.bicep @@ -0,0 +1,40 @@ +resource keyVault1 'Microsoft.KeyVault/vaults@2016-10-01' = { + name: 'keyVault1' + location: resourceGroup().location + tags: { + displayName: 'keyVault1' + } + properties: { + enabledForDeployment: true + enabledForTemplateDeployment: true + enabledForDiskEncryption: true + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + accessPolicies: [ + { + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + objectId: 'objectId' + permissions: { + keys: ['Get'] + secrets: ['List', 'Get', 'Set'] + } + } + ] + sku: { + name: 'standard' + family: 'A' + } + } +} + +resource keyVault1_keyVaultSecret1 'Microsoft.KeyVault/vaults/secrets@2016-10-01' = { + parent: keyVault1 + name: 'keyVaultSecret1' + properties: { + value: 'secretValue' + attributes: { + enabled: true + nbf: 1585206000 + exp: 1679814000 + } + } +} diff --git a/assets/queries/azureResourceManager/secret_without_expiration_date/test/negative2.bicep b/assets/queries/azureResourceManager/secret_without_expiration_date/test/negative2.bicep new file mode 100644 index 00000000000..7ed87f0e955 --- /dev/null +++ b/assets/queries/azureResourceManager/secret_without_expiration_date/test/negative2.bicep @@ -0,0 +1,40 @@ +resource keyVault1 'Microsoft.KeyVault/vaults@2016-10-01' = { + name: 'keyVault1' + location: resourceGroup().location + tags: { + displayName: 'keyVault1' + } + properties: { + enabledForDeployment: true + enabledForTemplateDeployment: true + enabledForDiskEncryption: true + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + accessPolicies: [ + { + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + objectId: 'objectId' + permissions: { + keys: ['Get'] + secrets: ['List', 'Get', 'Set'] + } + } + ] + sku: { + name: 'standard' + family: 'A' + } + } +} + +resource keyVault1_keyVaultSecret1 'Microsoft.KeyVault/vaults/secrets@2016-10-01' = { + parent: keyVault1 + name: 'keyVaultSecret1' + properties: { + value: 'secretValue' + attributes: { + enabled: true + nbf: 1585206000 + exp: 1679814000 + } + } +} diff --git a/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive1.bicep b/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive1.bicep new file mode 100644 index 00000000000..991b532bdda --- /dev/null +++ b/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive1.bicep @@ -0,0 +1,37 @@ +resource keyVault1 'Microsoft.KeyVault/vaults@2016-10-01' = { + name: 'keyVault1' + location: resourceGroup().location + tags: { + displayName: 'keyVault1' + } + properties: { + enabledForDeployment: true + enabledForTemplateDeployment: true + enabledForDiskEncryption: true + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + accessPolicies: [ + { + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + objectId: 'objectId' + permissions: { + keys: ['Get'] + secrets: ['List', 'Get', 'Set'] + } + } + ] + sku: { + name: 'standard' + family: 'A' + } + } +} + +resource keyVault1_secretid1 'Microsoft.KeyVault/vaults/secrets@2019-09-01' = { + parent: keyVault1 + name: 'secretid1' + tags: {} + properties: { + value: 'string' + contentType: 'string' + } +} diff --git a/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive2.bicep b/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive2.bicep new file mode 100644 index 00000000000..a6b4f52eef3 --- /dev/null +++ b/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive2.bicep @@ -0,0 +1,40 @@ +resource keyVault1 'Microsoft.KeyVault/vaults@2016-10-01' = { + name: 'keyVault1' + location: resourceGroup().location + tags: { + displayName: 'keyVault1' + } + properties: { + enabledForDeployment: true + enabledForTemplateDeployment: true + enabledForDiskEncryption: true + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + accessPolicies: [ + { + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + objectId: 'objectId' + permissions: { + keys: ['Get'] + secrets: ['List', 'Get', 'Set'] + } + } + ] + sku: { + name: 'standard' + family: 'A' + } + } +} + +resource keyVault1_keyVaultSecret1 'Microsoft.KeyVault/vaults/secrets@2016-10-01' = { + parent: keyVault1 + name: 'keyVaultSecret1' + properties: { + value: 'string' + contentType: 'string' + attributes: { + enabled: true + nbf: 1585206000 + } + } +} diff --git a/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive3.bicep b/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive3.bicep new file mode 100644 index 00000000000..991b532bdda --- /dev/null +++ b/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive3.bicep @@ -0,0 +1,37 @@ +resource keyVault1 'Microsoft.KeyVault/vaults@2016-10-01' = { + name: 'keyVault1' + location: resourceGroup().location + tags: { + displayName: 'keyVault1' + } + properties: { + enabledForDeployment: true + enabledForTemplateDeployment: true + enabledForDiskEncryption: true + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + accessPolicies: [ + { + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + objectId: 'objectId' + permissions: { + keys: ['Get'] + secrets: ['List', 'Get', 'Set'] + } + } + ] + sku: { + name: 'standard' + family: 'A' + } + } +} + +resource keyVault1_secretid1 'Microsoft.KeyVault/vaults/secrets@2019-09-01' = { + parent: keyVault1 + name: 'secretid1' + tags: {} + properties: { + value: 'string' + contentType: 'string' + } +} diff --git a/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive4.bicep b/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive4.bicep new file mode 100644 index 00000000000..a6b4f52eef3 --- /dev/null +++ b/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive4.bicep @@ -0,0 +1,40 @@ +resource keyVault1 'Microsoft.KeyVault/vaults@2016-10-01' = { + name: 'keyVault1' + location: resourceGroup().location + tags: { + displayName: 'keyVault1' + } + properties: { + enabledForDeployment: true + enabledForTemplateDeployment: true + enabledForDiskEncryption: true + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + accessPolicies: [ + { + tenantId: 'xx0xxx10-00x0-00x0-0x01-x0x0x01xx100' + objectId: 'objectId' + permissions: { + keys: ['Get'] + secrets: ['List', 'Get', 'Set'] + } + } + ] + sku: { + name: 'standard' + family: 'A' + } + } +} + +resource keyVault1_keyVaultSecret1 'Microsoft.KeyVault/vaults/secrets@2016-10-01' = { + parent: keyVault1 + name: 'keyVaultSecret1' + properties: { + value: 'string' + contentType: 'string' + attributes: { + enabled: true + nbf: 1585206000 + } + } +} diff --git a/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive_expected_result.json b/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive_expected_result.json index cc8fef2be57..07b856517d0 100644 --- a/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/secret_without_expiration_date/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "MEDIUM", "line": 56, "filename": "positive4.json" + }, + { + "queryName": "Secret Without Expiration Date", + "severity": "MEDIUM", + "line": 33, + "filename": "positive1.bicep" + }, + { + "queryName": "Secret Without Expiration Date", + "severity": "MEDIUM", + "line": 35, + "filename": "positive2.bicep" + }, + { + "queryName": "Secret Without Expiration Date", + "severity": "MEDIUM", + "line": 33, + "filename": "positive3.bicep" + }, + { + "queryName": "Secret Without Expiration Date", + "severity": "MEDIUM", + "line": 35, + "filename": "positive4.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/negative1.bicep b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/negative1.bicep new file mode 100644 index 00000000000..8b81169e2e4 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/negative1.bicep @@ -0,0 +1,38 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2014-04-01' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_securityPolicy1 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'securityPolicy1' + properties: { + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } + dependsOn: [sqlServer1] +} diff --git a/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/negative2.bicep b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/negative2.bicep new file mode 100644 index 00000000000..8b81169e2e4 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/negative2.bicep @@ -0,0 +1,38 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2014-04-01' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_securityPolicy1 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'securityPolicy1' + properties: { + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } + dependsOn: [sqlServer1] +} diff --git a/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive1.bicep b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive1.bicep new file mode 100644 index 00000000000..639eb07e2b2 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive1.bicep @@ -0,0 +1,37 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2014-04-01' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_securityPolicy1 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'securityPolicy1' + properties: { + emailAccountAdmins: true + retentionDays: 4 + state: 'Enabled' + } + dependsOn: [sqlServer1] +} diff --git a/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive2.bicep b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive2.bicep new file mode 100644 index 00000000000..0b2f05d3408 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive2.bicep @@ -0,0 +1,38 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2014-04-01' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_securityPolicy1 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'securityPolicy1' + properties: { + emailAccountAdmins: true + emailAddresses: [] + retentionDays: 4 + state: 'Enabled' + } + dependsOn: [sqlServer1] +} diff --git a/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive3.bicep b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive3.bicep new file mode 100644 index 00000000000..226d8dc314e --- /dev/null +++ b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive3.bicep @@ -0,0 +1,38 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2014-04-01' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_securityPolicy1 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'securityPolicy1' + properties: { + emailAccountAdmins: true + emailAddresses: ['', ''] + retentionDays: 4 + state: 'Enabled' + } + dependsOn: [sqlServer1] +} diff --git a/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive4.bicep b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive4.bicep new file mode 100644 index 00000000000..639eb07e2b2 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive4.bicep @@ -0,0 +1,37 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2014-04-01' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_securityPolicy1 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'securityPolicy1' + properties: { + emailAccountAdmins: true + retentionDays: 4 + state: 'Enabled' + } + dependsOn: [sqlServer1] +} diff --git a/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive5.bicep b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive5.bicep new file mode 100644 index 00000000000..0b2f05d3408 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive5.bicep @@ -0,0 +1,38 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2014-04-01' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_securityPolicy1 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'securityPolicy1' + properties: { + emailAccountAdmins: true + emailAddresses: [] + retentionDays: 4 + state: 'Enabled' + } + dependsOn: [sqlServer1] +} diff --git a/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive6.bicep b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive6.bicep new file mode 100644 index 00000000000..226d8dc314e --- /dev/null +++ b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive6.bicep @@ -0,0 +1,38 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2014-04-01' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_securityPolicy1 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'securityPolicy1' + properties: { + emailAccountAdmins: true + emailAddresses: ['', ''] + retentionDays: 4 + state: 'Enabled' + } + dependsOn: [sqlServer1] +} diff --git a/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive_expected_result.json b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive_expected_result.json index 7d363cac535..203f8fff574 100644 --- a/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/sql_alert_policy_without_emails/test/positive_expected_result.json @@ -34,5 +34,41 @@ "severity": "INFO", "line": 50, "filename": "positive6.json" + }, + { + "queryName": "SQL Alert Policy Without Emails", + "severity": "INFO", + "line": 31, + "filename": "positive1.bicep" + }, + { + "queryName": "SQL Alert Policy Without Emails", + "severity": "INFO", + "line": 33, + "filename": "positive2.bicep" + }, + { + "queryName": "SQL Alert Policy Without Emails", + "severity": "INFO", + "line": 33, + "filename": "positive3.bicep" + }, + { + "queryName": "SQL Alert Policy Without Emails", + "severity": "INFO", + "line": 31, + "filename": "positive4.bicep" + }, + { + "queryName": "SQL Alert Policy Without Emails", + "severity": "INFO", + "line": 33, + "filename": "positive5.bicep" + }, + { + "queryName": "SQL Alert Policy Without Emails", + "severity": "INFO", + "line": 33, + "filename": "positive6.bicep" } ] diff --git a/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative1.bicep b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative1.bicep new file mode 100644 index 00000000000..9e8401770ae --- /dev/null +++ b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative1.bicep @@ -0,0 +1,7 @@ +resource sample_firewall 'Microsoft.Sql/servers/firewallRules@2021-02-01-preview' = { + name: 'sample/firewall' + properties: { + endIpAddress: '0.0.0.0' + startIpAddress: '0.0.0.0' + } +} diff --git a/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative2.bicep b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative2.bicep new file mode 100644 index 00000000000..3914a3a94f3 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative2.bicep @@ -0,0 +1,7 @@ +resource sample_firewall 'Microsoft.Sql/servers/firewallRules@2021-02-01-preview' = { + name: 'sample/firewall' + properties: { + endIpAddress: '192.168.1.2' + startIpAddress: '192.168.1.254' + } +} diff --git a/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative3.bicep b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative3.bicep new file mode 100644 index 00000000000..9e8401770ae --- /dev/null +++ b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative3.bicep @@ -0,0 +1,7 @@ +resource sample_firewall 'Microsoft.Sql/servers/firewallRules@2021-02-01-preview' = { + name: 'sample/firewall' + properties: { + endIpAddress: '0.0.0.0' + startIpAddress: '0.0.0.0' + } +} diff --git a/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative4.bicep b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative4.bicep new file mode 100644 index 00000000000..3914a3a94f3 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/negative4.bicep @@ -0,0 +1,7 @@ +resource sample_firewall 'Microsoft.Sql/servers/firewallRules@2021-02-01-preview' = { + name: 'sample/firewall' + properties: { + endIpAddress: '192.168.1.2' + startIpAddress: '192.168.1.254' + } +} diff --git a/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive1.bicep b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive1.bicep new file mode 100644 index 00000000000..d8432478f39 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive1.bicep @@ -0,0 +1,21 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_AllowAllWindowsAzureIps 'Microsoft.Sql/servers/firewallRules@2021-02-01-preview' = { + parent: sqlServer1 + location: resourceGroup().location + name: 'AllowAllWindowsAzureIps' + properties: { + endIpAddress: '255.255.255.255' + startIpAddress: '0.0.0.0' + } +} diff --git a/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive2.bicep b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive2.bicep new file mode 100644 index 00000000000..2f8fe41d8c3 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive2.bicep @@ -0,0 +1,7 @@ +resource sample_firewall 'Microsoft.Sql/servers/firewallRules@2021-02-01-preview' = { + name: 'sample/firewall' + properties: { + endIpAddress: '255.255.255.255' + startIpAddress: '0.0.0.0/0' + } +} diff --git a/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive3.bicep b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive3.bicep new file mode 100644 index 00000000000..d8432478f39 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive3.bicep @@ -0,0 +1,21 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_AllowAllWindowsAzureIps 'Microsoft.Sql/servers/firewallRules@2021-02-01-preview' = { + parent: sqlServer1 + location: resourceGroup().location + name: 'AllowAllWindowsAzureIps' + properties: { + endIpAddress: '255.255.255.255' + startIpAddress: '0.0.0.0' + } +} diff --git a/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive4.bicep b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive4.bicep new file mode 100644 index 00000000000..2f8fe41d8c3 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive4.bicep @@ -0,0 +1,7 @@ +resource sample_firewall 'Microsoft.Sql/servers/firewallRules@2021-02-01-preview' = { + name: 'sample/firewall' + properties: { + endIpAddress: '255.255.255.255' + startIpAddress: '0.0.0.0/0' + } +} diff --git a/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive_expected_result.json b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive_expected_result.json index b6fe1a7f551..0b8fdaabb48 100644 --- a/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/sql_database_server_firewall_allows_all_ips/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "CRITICAL", "line": 16, "filename": "positive4.json" + }, + { + "queryName": "SQL Database Server Firewall Allows All IPS", + "severity": "CRITICAL", + "line": 18, + "filename": "positive1.bicep" + }, + { + "queryName": "SQL Database Server Firewall Allows All IPS", + "severity": "CRITICAL", + "line": 4, + "filename": "positive2.bicep" + }, + { + "queryName": "SQL Database Server Firewall Allows All IPS", + "severity": "CRITICAL", + "line": 18, + "filename": "positive3.bicep" + }, + { + "queryName": "SQL Database Server Firewall Allows All IPS", + "severity": "CRITICAL", + "line": 4, + "filename": "positive4.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative1.bicep new file mode 100644 index 00000000000..9aa532a81ef --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative1.bicep @@ -0,0 +1,10 @@ +resource sample_databases_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/databases/default' + properties: { + disabledAlerts: [] + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative2.bicep new file mode 100644 index 00000000000..0aad626f49d --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative2.bicep @@ -0,0 +1,9 @@ +resource sample_databases_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/databases/default' + properties: { + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative3.bicep b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative3.bicep new file mode 100644 index 00000000000..c7db07ef044 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative3.bicep @@ -0,0 +1,9 @@ +resource sample_databases_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/databases/default' + properties: { + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Disabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative4.bicep b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative4.bicep new file mode 100644 index 00000000000..9aa532a81ef --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative4.bicep @@ -0,0 +1,10 @@ +resource sample_databases_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/databases/default' + properties: { + disabledAlerts: [] + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative5.bicep b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative5.bicep new file mode 100644 index 00000000000..0aad626f49d --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative5.bicep @@ -0,0 +1,9 @@ +resource sample_databases_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/databases/default' + properties: { + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative6.bicep b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative6.bicep new file mode 100644 index 00000000000..c7db07ef044 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative6.bicep @@ -0,0 +1,9 @@ +resource sample_databases_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/databases/default' + properties: { + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Disabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive1.bicep new file mode 100644 index 00000000000..0e0d36691ad --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive1.bicep @@ -0,0 +1,10 @@ +resource sample_databases_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/databases/default' + properties: { + disabledAlerts: ['Sql_Injection'] + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive2.bicep new file mode 100644 index 00000000000..0e0d36691ad --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive2.bicep @@ -0,0 +1,10 @@ +resource sample_databases_default 'Microsoft.Sql/servers/databases/securityAlertPolicies@2021-02-01-preview' = { + name: 'sample/databases/default' + properties: { + disabledAlerts: ['Sql_Injection'] + emailAccountAdmins: true + emailAddresses: ['sample@email.com'] + retentionDays: 4 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive_expected_result.json index 49d4e56fd3d..6c4cf599b71 100644 --- a/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/positive_expected_result.json @@ -10,5 +10,17 @@ "severity": "MEDIUM", "line": 16, "filename": "positive2.json" + }, + { + "queryName": "SQL Server Database With Alerts Disabled", + "severity": "MEDIUM", + "line": 4, + "filename": "positive1.bicep" + }, + { + "queryName": "SQL Server Database With Alerts Disabled", + "severity": "MEDIUM", + "line": 4, + "filename": "positive2.bicep" } ] diff --git a/assets/queries/azureResourceManager/standard_price_not_selected/test/negative1.bicep b/assets/queries/azureResourceManager/standard_price_not_selected/test/negative1.bicep new file mode 100644 index 00000000000..9c25285d67b --- /dev/null +++ b/assets/queries/azureResourceManager/standard_price_not_selected/test/negative1.bicep @@ -0,0 +1,20 @@ +resource webApp1 'Microsoft.Web/sites@2018-11-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: resourceId('Microsoft.Web/serverfarms', 'appServicePlan1') + } + dependsOn: [resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')] +} + +resource Princing 'Microsoft.Security/pricings@2017-08-01-preview' = { + name: 'Princing' + properties: { + pricingTier: 'Standard' + } +} diff --git a/assets/queries/azureResourceManager/standard_price_not_selected/test/negative2.bicep b/assets/queries/azureResourceManager/standard_price_not_selected/test/negative2.bicep new file mode 100644 index 00000000000..9c25285d67b --- /dev/null +++ b/assets/queries/azureResourceManager/standard_price_not_selected/test/negative2.bicep @@ -0,0 +1,20 @@ +resource webApp1 'Microsoft.Web/sites@2018-11-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: resourceId('Microsoft.Web/serverfarms', 'appServicePlan1') + } + dependsOn: [resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')] +} + +resource Princing 'Microsoft.Security/pricings@2017-08-01-preview' = { + name: 'Princing' + properties: { + pricingTier: 'Standard' + } +} diff --git a/assets/queries/azureResourceManager/standard_price_not_selected/test/negative3.bicep b/assets/queries/azureResourceManager/standard_price_not_selected/test/negative3.bicep new file mode 100644 index 00000000000..93217fda79e --- /dev/null +++ b/assets/queries/azureResourceManager/standard_price_not_selected/test/negative3.bicep @@ -0,0 +1,197 @@ +@description( + 'Name of the central Log Analytics workspace that stores security event and data collected by Azure Security Center' +) +@allowed(['az-security-workspace']) +param workspaceName string = 'az-security-workspace' + +@description( + 'Name of the resource group where the central log analytics workspace belongs to' +) +@allowed(['azsec-security-rg']) +param workspaceRgName string = 'azsec-security-rg' + +@description('Specify whether Auto Provisoning is turned on or off') +@allowed(['On', 'Off']) +param autoProvisionSetting string = 'On' + +@description( + 'Email of the administrator who should be notified about Azure Security Center alert' +) +param ascOwnerEmail string + +@description( + 'Phone number of the administrator should be notified about Azure Security Center alert' +) +param ascOwnerContact string + +@description( + 'Specify whether you want to notify high severity alert to ASC administrator' +) +@allowed(['On', 'Off']) +param highSeverityAlertNotification string = 'On' + +@description( + 'Specifiy whether you want to notify high severity alert to subscription owner' +) +@allowed(['On', 'Off']) +param subscriptionOwnerNotification string = 'On' + +@description( + 'Specifiy whether you want to enable Standard tier for Virtual Machine resource type' +) +@allowed(['Standard', 'Free']) +param virtualMachineTier string = 'Standard' + +@description( + 'Specify whether you want to enable Standard tier for Azure App Service resource type' +) +@allowed(['Standard', 'Free']) +param appServiceTier string = 'Standard' + +@description( + 'Specify whether you want to enable Standard tier for PaaS SQL Service resource type' +) +@allowed(['Standard', 'Free']) +param paasSQLServiceTier string = 'Standard' + +@description( + 'Specify whether you want to enable Standard tier for SQL Server on VM resource type' +) +@allowed(['Standard', 'Free']) +param sqlServerOnVmTier string = 'Standard' + +@description( + 'Specify whether you want to enable Standard tier for Storage Account resource type' +) +@allowed(['Standard', 'Free']) +param storageAccountTier string = 'Standard' + +@description( + 'Specify whether you want to enable Standard tier for Kubernetes service resource type' +) +@allowed(['Standard', 'Free']) +param kubernetesServiceTier string = 'Standard' + +@description( + 'Specify whether you want to enable Standard tier for Container Registry resource type' +) +@allowed(['Standard', 'Free']) +param containerRegistryTier string = 'Standard' + +@description( + 'Specify whether you want to enable Standard tier for Key Vault resource type' +) +@allowed(['Standard', 'Free']) +param keyvaultTier string = 'Standard' + +@description( + 'Select integration name to enable. Only MCAS or MDATP is supported.' +) +@allowed(['MCAS', 'MDATP']) +param integrationName string + +@description('Specify whether you want to enable or not.') +@allowed([true, false]) +param integrationEnabled bool + +resource default 'Microsoft.Security/workspaceSettings@2017-08-01-preview' = { + name: 'default' + properties: { + scope: subscription().id + workspaceId: '${subscription().id}/resourceGroups/${workspaceRgName}/providers/Microsoft.OperationalInsights/workspaces/${workspaceName}' + } +} + +resource Microsoft_Security_autoProvisioningSettings_default 'Microsoft.Security/autoProvisioningSettings@2017-08-01-preview' = { + name: 'default' + properties: { + autoProvision: autoProvisionSetting + } +} + +resource default1 'Microsoft.Security/securityContacts@2017-08-01-preview' = { + name: 'default1' + properties: { + emails: ascOwnerEmail + phone: ascOwnerContact + alertNotifications: { + state: 'On' + minimalSeverity: highSeverityAlertNotification + } + notificationsByRole: { + state: 'On' + roles: subscriptionOwnerNotification + } + } +} + +resource VirtualMachines 'Microsoft.Security/pricings@2018-06-01' = { + name: 'VirtualMachines' + properties: { + pricingTier: virtualMachineTier + } +} + +resource AppServices 'Microsoft.Security/pricings@2018-06-01' = { + name: 'AppServices' + properties: { + pricingTier: appServiceTier + } + dependsOn: [VirtualMachines] +} + +resource SqlServers 'Microsoft.Security/pricings@2018-06-01' = { + name: 'SqlServers' + properties: { + pricingTier: paasSQLServiceTier + } + dependsOn: [AppServices] +} + +resource SqlServerVirtualMachines 'Microsoft.Security/pricings@2018-06-01' = { + name: 'SqlServerVirtualMachines' + properties: { + pricingTier: sqlServerOnVmTier + } + dependsOn: [SqlServers] +} + +resource StorageAccounts 'Microsoft.Security/pricings@2018-06-01' = { + name: 'StorageAccounts' + properties: { + pricingTier: storageAccountTier + } + dependsOn: [SqlServerVirtualMachines] +} + +resource KubernetesService 'Microsoft.Security/pricings@2018-06-01' = { + name: 'KubernetesService' + properties: { + pricingTier: kubernetesServiceTier + } + dependsOn: [StorageAccounts] +} + +resource ContainerRegistry 'Microsoft.Security/pricings@2018-06-01' = { + name: 'ContainerRegistry' + properties: { + pricingTier: containerRegistryTier + } + dependsOn: [KubernetesService] +} + +resource KeyVaults 'Microsoft.Security/pricings@2018-06-01' = { + name: 'KeyVaults' + properties: { + pricingTier: keyvaultTier + } + dependsOn: [ContainerRegistry] +} + +resource integration 'Microsoft.Security/settings@2019-01-01' = { + name: integrationName + kind: 'DataExportSettings' + properties: { + enabled: integrationEnabled + } +} diff --git a/assets/queries/azureResourceManager/standard_price_not_selected/test/positive1.bicep b/assets/queries/azureResourceManager/standard_price_not_selected/test/positive1.bicep new file mode 100644 index 00000000000..85ca3401022 --- /dev/null +++ b/assets/queries/azureResourceManager/standard_price_not_selected/test/positive1.bicep @@ -0,0 +1,20 @@ +resource webApp1 'Microsoft.Web/sites@2018-11-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: resourceId('Microsoft.Web/serverfarms', 'appServicePlan1') + } + dependsOn: [resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')] +} + +resource Princing 'Microsoft.Security/pricings@2017-08-01-preview' = { + name: 'Princing' + properties: { + pricingTier: 'Free' + } +} diff --git a/assets/queries/azureResourceManager/standard_price_not_selected/test/positive2.bicep b/assets/queries/azureResourceManager/standard_price_not_selected/test/positive2.bicep new file mode 100644 index 00000000000..85ca3401022 --- /dev/null +++ b/assets/queries/azureResourceManager/standard_price_not_selected/test/positive2.bicep @@ -0,0 +1,20 @@ +resource webApp1 'Microsoft.Web/sites@2018-11-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: resourceId('Microsoft.Web/serverfarms', 'appServicePlan1') + } + dependsOn: [resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')] +} + +resource Princing 'Microsoft.Security/pricings@2017-08-01-preview' = { + name: 'Princing' + properties: { + pricingTier: 'Free' + } +} diff --git a/assets/queries/azureResourceManager/standard_price_not_selected/test/positive3.bicep b/assets/queries/azureResourceManager/standard_price_not_selected/test/positive3.bicep new file mode 100644 index 00000000000..07a43aa798a --- /dev/null +++ b/assets/queries/azureResourceManager/standard_price_not_selected/test/positive3.bicep @@ -0,0 +1,12 @@ +@description( + 'Specifiy whether you want to enable Standard tier for Virtual Machine resource type' +) +@allowed(['Standard', 'Free']) +param virtualMachineTier string = 'Free' + +resource VirtualMachines 'Microsoft.Security/pricings@2018-06-01' = { + name: 'VirtualMachines' + properties: { + pricingTier: virtualMachineTier + } +} diff --git a/assets/queries/azureResourceManager/standard_price_not_selected/test/positive_expected_result.json b/assets/queries/azureResourceManager/standard_price_not_selected/test/positive_expected_result.json index 1bdd4945792..d934e5404b5 100644 --- a/assets/queries/azureResourceManager/standard_price_not_selected/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/standard_price_not_selected/test/positive_expected_result.json @@ -16,5 +16,23 @@ "severity": "LOW", "line": 23, "filename": "positive3.json" + }, + { + "queryName": "Standard Price Is Not Selected", + "severity": "LOW", + "line": 18, + "filename": "positive1.bicep" + }, + { + "queryName": "Standard Price Is Not Selected", + "severity": "LOW", + "line": 18, + "filename": "positive2.bicep" + }, + { + "queryName": "Standard Price Is Not Selected", + "severity": "LOW", + "line": 10, + "filename": "positive3.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/negative1.bicep b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/negative1.bicep new file mode 100644 index 00000000000..fb6c6db603c --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/negative1.bicep @@ -0,0 +1,17 @@ +resource storageaccount1Negative1 'Microsoft.Storage/storageAccounts@2021-02-01' = { + name: 'storageaccount1Negative1' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: { + networkAcls: { + defaultAction: 'Deny' + } + } +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/negative2.bicep b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/negative2.bicep new file mode 100644 index 00000000000..fb6c6db603c --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/negative2.bicep @@ -0,0 +1,17 @@ +resource storageaccount1Negative1 'Microsoft.Storage/storageAccounts@2021-02-01' = { + name: 'storageaccount1Negative1' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: { + networkAcls: { + defaultAction: 'Deny' + } + } +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive1.bicep b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive1.bicep new file mode 100644 index 00000000000..24ddf1f0e63 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive1.bicep @@ -0,0 +1,24 @@ +@description('Storage Account type') +@allowed(['Standard_LRS', 'Standard_GRS', 'Standard_ZRS', 'Premium_LRS']) +param storageAccountType string = 'Standard_LRS' + +@description('Location for all resources.') +param location string = resourceGroup().location + +var storageAccountName = 'store${uniqueString(resourceGroup().id)}' + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccountName + location: location + sku: { + name: storageAccountType + } + kind: 'StorageV2' + properties: { + networkAcls: { + defaultAction: 'Allow' + } + } +} + +output storageAccountName string = storageAccountName diff --git a/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive2.bicep b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive2.bicep new file mode 100644 index 00000000000..f92a0b1ed70 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive2.bicep @@ -0,0 +1,13 @@ +resource storageaccount1Positive2 'Microsoft.Storage/storageAccounts@2017-10-01' = { + name: 'storageaccount1Positive2' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: {} +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive3.bicep b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive3.bicep new file mode 100644 index 00000000000..e096df7e842 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive3.bicep @@ -0,0 +1,13 @@ +resource storageaccount1Positive3 'Microsoft.Storage/storageAccounts@2016-12-01' = { + name: 'storageaccount1Positive3' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'Storage' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: {} +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive4.bicep b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive4.bicep new file mode 100644 index 00000000000..24ddf1f0e63 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive4.bicep @@ -0,0 +1,24 @@ +@description('Storage Account type') +@allowed(['Standard_LRS', 'Standard_GRS', 'Standard_ZRS', 'Premium_LRS']) +param storageAccountType string = 'Standard_LRS' + +@description('Location for all resources.') +param location string = resourceGroup().location + +var storageAccountName = 'store${uniqueString(resourceGroup().id)}' + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccountName + location: location + sku: { + name: storageAccountType + } + kind: 'StorageV2' + properties: { + networkAcls: { + defaultAction: 'Allow' + } + } +} + +output storageAccountName string = storageAccountName diff --git a/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive5.bicep b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive5.bicep new file mode 100644 index 00000000000..f92a0b1ed70 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive5.bicep @@ -0,0 +1,13 @@ +resource storageaccount1Positive2 'Microsoft.Storage/storageAccounts@2017-10-01' = { + name: 'storageaccount1Positive2' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: {} +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive6.bicep b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive6.bicep new file mode 100644 index 00000000000..e096df7e842 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive6.bicep @@ -0,0 +1,13 @@ +resource storageaccount1Positive3 'Microsoft.Storage/storageAccounts@2016-12-01' = { + name: 'storageaccount1Positive3' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'Storage' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: {} +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive_expected_result.json b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive_expected_result.json index 4287a0eb99d..efe274a3d47 100644 --- a/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/storage_account_allows_network_default_access/test/positive_expected_result.json @@ -34,5 +34,41 @@ "severity": "LOW", "line": 10, "fileName": "positive6.json" + }, + { + "queryName": "Storage Account Allows Default Network Access", + "severity": "LOW", + "line": 19, + "fileName": "positive1.bicep" + }, + { + "queryName": "Storage Account Allows Default Network Access", + "severity": "LOW", + "line": 12, + "fileName": "positive2.bicep" + }, + { + "queryName": "Storage Account Allows Default Network Access", + "severity": "LOW", + "line": 1, + "fileName": "positive3.bicep" + }, + { + "queryName": "Storage Account Allows Default Network Access", + "severity": "LOW", + "line": 19, + "fileName": "positive4.bicep" + }, + { + "queryName": "Storage Account Allows Default Network Access", + "severity": "LOW", + "line": 12, + "fileName": "positive5.bicep" + }, + { + "queryName": "Storage Account Allows Default Network Access", + "severity": "LOW", + "line": 1, + "fileName": "positive6.bicep" } ] diff --git a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative1.bicep b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative1.bicep new file mode 100644 index 00000000000..55c4c961ae6 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative1.bicep @@ -0,0 +1,15 @@ +resource storageaccount1Negative1 'Microsoft.Storage/storageAccounts@2021-02-01' = { + name: 'storageaccount1Negative1' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: { + supportsHttpsTrafficOnly: true + } +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative2.bicep b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative2.bicep new file mode 100644 index 00000000000..26b3b54190d --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative2.bicep @@ -0,0 +1,13 @@ +resource storageaccount1Positive3 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: 'storageaccount1Positive3' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: {} +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative3.bicep b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative3.bicep new file mode 100644 index 00000000000..55c4c961ae6 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative3.bicep @@ -0,0 +1,15 @@ +resource storageaccount1Negative1 'Microsoft.Storage/storageAccounts@2021-02-01' = { + name: 'storageaccount1Negative1' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: { + supportsHttpsTrafficOnly: true + } +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative4.bicep b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative4.bicep new file mode 100644 index 00000000000..26b3b54190d --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/negative4.bicep @@ -0,0 +1,13 @@ +resource storageaccount1Positive3 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: 'storageaccount1Positive3' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: {} +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive1.bicep b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive1.bicep new file mode 100644 index 00000000000..db070e8b163 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive1.bicep @@ -0,0 +1,15 @@ +resource storageaccount1 'Microsoft.Storage/storageAccounts@2021-02-01' = { + name: 'storageaccount1' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: { + supportsHttpsTrafficOnly: false + } +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive2.bicep b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive2.bicep new file mode 100644 index 00000000000..03652431ed9 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive2.bicep @@ -0,0 +1,12 @@ +resource storageaccount1Positive2 'Microsoft.Storage/storageAccounts@2017-10-01' = { + name: 'storageaccount1Positive2' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive3.bicep b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive3.bicep new file mode 100644 index 00000000000..523176375c9 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive3.bicep @@ -0,0 +1,13 @@ +resource storageaccount1Positive3 'Microsoft.Storage/storageAccounts@2018-02-01' = { + name: 'storageaccount1Positive3' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: {} +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive4.bicep b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive4.bicep new file mode 100644 index 00000000000..db070e8b163 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive4.bicep @@ -0,0 +1,15 @@ +resource storageaccount1 'Microsoft.Storage/storageAccounts@2021-02-01' = { + name: 'storageaccount1' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: { + supportsHttpsTrafficOnly: false + } +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive5.bicep b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive5.bicep new file mode 100644 index 00000000000..03652431ed9 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive5.bicep @@ -0,0 +1,12 @@ +resource storageaccount1Positive2 'Microsoft.Storage/storageAccounts@2017-10-01' = { + name: 'storageaccount1Positive2' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive6.bicep b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive6.bicep new file mode 100644 index 00000000000..523176375c9 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive6.bicep @@ -0,0 +1,13 @@ +resource storageaccount1Positive3 'Microsoft.Storage/storageAccounts@2018-02-01' = { + name: 'storageaccount1Positive3' + tags: { + displayName: 'storageaccount1' + } + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Premium_LRS' + tier: 'Premium' + } + properties: {} +} diff --git a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive_expected_result.json b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive_expected_result.json index b610df4a795..a7fe7354ff6 100644 --- a/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/storage_account_allows_unsecure_transfer/test/positive_expected_result.json @@ -34,5 +34,41 @@ "severity": "MEDIUM", "line": 20, "fileName": "positive6.json" + }, + { + "queryName": "Storage Account Allows Unsecure Transfer", + "severity": "MEDIUM", + "line": 13, + "fileName": "positive1.bicep" + }, + { + "queryName": "Storage Account Allows Unsecure Transfer", + "severity": "MEDIUM", + "line": 2, + "fileName": "positive2.bicep" + }, + { + "queryName": "Storage Account Allows Unsecure Transfer", + "severity": "MEDIUM", + "line": 12, + "fileName": "positive3.bicep" + }, + { + "queryName": "Storage Account Allows Unsecure Transfer", + "severity": "MEDIUM", + "line": 13, + "fileName": "positive4.bicep" + }, + { + "queryName": "Storage Account Allows Unsecure Transfer", + "severity": "MEDIUM", + "line": 2, + "fileName": "positive5.bicep" + }, + { + "queryName": "Storage Account Allows Unsecure Transfer", + "severity": "MEDIUM", + "line": 12, + "fileName": "positive6.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative1.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative1.bicep new file mode 100644 index 00000000000..a2a80c135c5 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative1.bicep @@ -0,0 +1,8 @@ +resource blob_container_example 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-02-01' = { + name: 'blob/container/example' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'None' + metadata: {} + } +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative2.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative2.bicep new file mode 100644 index 00000000000..4a0b6c5e1ab --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative2.bicep @@ -0,0 +1,90 @@ +@description('Name of the virtual network to use for cloud shell containers.') +param existingVNETName string + +@description('Name of the subnet to use for storage account.') +param existingStorageSubnetName string + +@description('Name of the subnet to use for cloud shell containers.') +param existingContainerSubnetName string + +@description('Name of the storage account in subnet.') +param storageAccountName string + +@description('Location for all resources.') +param location string = resourceGroup().location + +var containerSubnetRef = resourceId( + 'Microsoft.Network/virtualNetworks/subnets', + existingVNETName, + existingContainerSubnetName +) +var storageSubnetRef = resourceId( + 'Microsoft.Network/virtualNetworks/subnets', + existingVNETName, + existingStorageSubnetName +) + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccountName + location: location + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + networkAcls: { + bypass: 'None' + virtualNetworkRules: [ + { + id: containerSubnetRef + action: 'Allow' + } + { + id: storageSubnetRef + action: 'Allow' + } + ] + defaultAction: 'Deny' + } + supportsHttpsTrafficOnly: true + encryption: { + services: { + file: { + keyType: 'Account' + enabled: true + } + blob: { + keyType: 'Account' + enabled: true + } + } + keySource: 'Microsoft.Storage' + } + accessTier: 'Cool' + } +} + +resource storageAccountName_default 'Microsoft.Storage/storageAccounts/blobServices@2019-06-01' = { + parent: storageAccount + name: 'default' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + properties: { + deleteRetentionPolicy: { + enabled: false + } + } +} + +resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { + parent: storageAccountName_default + name: 'container' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'None' + metadata: {} + } +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative3.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative3.bicep new file mode 100644 index 00000000000..31cecd636e7 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative3.bicep @@ -0,0 +1,33 @@ +@description('Specifies the name of the Azure Storage account.') +param storageAccountName string + +@description('Specifies the name of the blob container.') +param containerName string = 'logs' + +@description( + 'Specifies the location in which the Azure Storage resources should be deployed.' +) +param location string = resourceGroup().location + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccountName + location: location + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + } +} + +resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { + name: '${storageAccountName}/default/${containerName}' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'None' + metadata: {} + } + dependsOn: [storageAccount] +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative4.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative4.bicep new file mode 100644 index 00000000000..a2a80c135c5 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative4.bicep @@ -0,0 +1,8 @@ +resource blob_container_example 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-02-01' = { + name: 'blob/container/example' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'None' + metadata: {} + } +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative5.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative5.bicep new file mode 100644 index 00000000000..4a0b6c5e1ab --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative5.bicep @@ -0,0 +1,90 @@ +@description('Name of the virtual network to use for cloud shell containers.') +param existingVNETName string + +@description('Name of the subnet to use for storage account.') +param existingStorageSubnetName string + +@description('Name of the subnet to use for cloud shell containers.') +param existingContainerSubnetName string + +@description('Name of the storage account in subnet.') +param storageAccountName string + +@description('Location for all resources.') +param location string = resourceGroup().location + +var containerSubnetRef = resourceId( + 'Microsoft.Network/virtualNetworks/subnets', + existingVNETName, + existingContainerSubnetName +) +var storageSubnetRef = resourceId( + 'Microsoft.Network/virtualNetworks/subnets', + existingVNETName, + existingStorageSubnetName +) + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccountName + location: location + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + networkAcls: { + bypass: 'None' + virtualNetworkRules: [ + { + id: containerSubnetRef + action: 'Allow' + } + { + id: storageSubnetRef + action: 'Allow' + } + ] + defaultAction: 'Deny' + } + supportsHttpsTrafficOnly: true + encryption: { + services: { + file: { + keyType: 'Account' + enabled: true + } + blob: { + keyType: 'Account' + enabled: true + } + } + keySource: 'Microsoft.Storage' + } + accessTier: 'Cool' + } +} + +resource storageAccountName_default 'Microsoft.Storage/storageAccounts/blobServices@2019-06-01' = { + parent: storageAccount + name: 'default' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + properties: { + deleteRetentionPolicy: { + enabled: false + } + } +} + +resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { + parent: storageAccountName_default + name: 'container' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'None' + metadata: {} + } +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative6.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative6.bicep new file mode 100644 index 00000000000..31cecd636e7 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative6.bicep @@ -0,0 +1,33 @@ +@description('Specifies the name of the Azure Storage account.') +param storageAccountName string + +@description('Specifies the name of the blob container.') +param containerName string = 'logs' + +@description( + 'Specifies the location in which the Azure Storage resources should be deployed.' +) +param location string = resourceGroup().location + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccountName + location: location + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + } +} + +resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { + name: '${storageAccountName}/default/${containerName}' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'None' + metadata: {} + } + dependsOn: [storageAccount] +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive1.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive1.bicep new file mode 100644 index 00000000000..74647217fe5 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive1.bicep @@ -0,0 +1,8 @@ +resource blob_container_example 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-02-01' = { + name: 'blob/container/example' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'Container' + metadata: {} + } +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive2.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive2.bicep new file mode 100644 index 00000000000..ed32c989d85 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive2.bicep @@ -0,0 +1,90 @@ +@description('Name of the virtual network to use for cloud shell containers.') +param existingVNETName string + +@description('Name of the subnet to use for storage account.') +param existingStorageSubnetName string + +@description('Name of the subnet to use for cloud shell containers.') +param existingContainerSubnetName string + +@description('Name of the storage account in subnet.') +param storageAccountName string + +@description('Location for all resources.') +param location string = resourceGroup().location + +var containerSubnetRef = resourceId( + 'Microsoft.Network/virtualNetworks/subnets', + existingVNETName, + existingContainerSubnetName +) +var storageSubnetRef = resourceId( + 'Microsoft.Network/virtualNetworks/subnets', + existingVNETName, + existingStorageSubnetName +) + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccountName + location: location + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + networkAcls: { + bypass: 'None' + virtualNetworkRules: [ + { + id: containerSubnetRef + action: 'Allow' + } + { + id: storageSubnetRef + action: 'Allow' + } + ] + defaultAction: 'Deny' + } + supportsHttpsTrafficOnly: true + encryption: { + services: { + file: { + keyType: 'Account' + enabled: true + } + blob: { + keyType: 'Account' + enabled: true + } + } + keySource: 'Microsoft.Storage' + } + accessTier: 'Cool' + } +} + +resource storageAccountName_default 'Microsoft.Storage/storageAccounts/blobServices@2019-06-01' = { + parent: storageAccount + name: 'default' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + properties: { + deleteRetentionPolicy: { + enabled: false + } + } +} + +resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { + parent: storageAccountName_default + name: 'container' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'Blob' + metadata: {} + } +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive3.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive3.bicep new file mode 100644 index 00000000000..eb6327f22b7 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive3.bicep @@ -0,0 +1,33 @@ +@description('Specifies the name of the Azure Storage account.') +param storageAccountName string + +@description('Specifies the name of the blob container.') +param containerName string = 'logs' + +@description( + 'Specifies the location in which the Azure Storage resources should be deployed.' +) +param location string = resourceGroup().location + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccountName + location: location + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + } +} + +resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { + name: '${storageAccountName}/default/${containerName}' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'Blob' + metadata: {} + } + dependsOn: [storageAccount] +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive4.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive4.bicep new file mode 100644 index 00000000000..74647217fe5 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive4.bicep @@ -0,0 +1,8 @@ +resource blob_container_example 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-02-01' = { + name: 'blob/container/example' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'Container' + metadata: {} + } +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive5.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive5.bicep new file mode 100644 index 00000000000..ed32c989d85 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive5.bicep @@ -0,0 +1,90 @@ +@description('Name of the virtual network to use for cloud shell containers.') +param existingVNETName string + +@description('Name of the subnet to use for storage account.') +param existingStorageSubnetName string + +@description('Name of the subnet to use for cloud shell containers.') +param existingContainerSubnetName string + +@description('Name of the storage account in subnet.') +param storageAccountName string + +@description('Location for all resources.') +param location string = resourceGroup().location + +var containerSubnetRef = resourceId( + 'Microsoft.Network/virtualNetworks/subnets', + existingVNETName, + existingContainerSubnetName +) +var storageSubnetRef = resourceId( + 'Microsoft.Network/virtualNetworks/subnets', + existingVNETName, + existingStorageSubnetName +) + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccountName + location: location + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + networkAcls: { + bypass: 'None' + virtualNetworkRules: [ + { + id: containerSubnetRef + action: 'Allow' + } + { + id: storageSubnetRef + action: 'Allow' + } + ] + defaultAction: 'Deny' + } + supportsHttpsTrafficOnly: true + encryption: { + services: { + file: { + keyType: 'Account' + enabled: true + } + blob: { + keyType: 'Account' + enabled: true + } + } + keySource: 'Microsoft.Storage' + } + accessTier: 'Cool' + } +} + +resource storageAccountName_default 'Microsoft.Storage/storageAccounts/blobServices@2019-06-01' = { + parent: storageAccount + name: 'default' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + properties: { + deleteRetentionPolicy: { + enabled: false + } + } +} + +resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { + parent: storageAccountName_default + name: 'container' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'Blob' + metadata: {} + } +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive6.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive6.bicep new file mode 100644 index 00000000000..eb6327f22b7 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive6.bicep @@ -0,0 +1,33 @@ +@description('Specifies the name of the Azure Storage account.') +param storageAccountName string + +@description('Specifies the name of the blob container.') +param containerName string = 'logs' + +@description( + 'Specifies the location in which the Azure Storage resources should be deployed.' +) +param location string = resourceGroup().location + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccountName + location: location + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + } +} + +resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { + name: '${storageAccountName}/default/${containerName}' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'Blob' + metadata: {} + } + dependsOn: [storageAccount] +} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json index 89e56633bd6..65b7607b4cb 100644 --- a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json @@ -34,5 +34,41 @@ "severity": "HIGH", "line": 52, "fileName": "positive6.json" + }, + { + "queryName": "Storage Blob Service Container With Public Access", + "severity": "HIGH", + "line": 5, + "fileName": "positive1.bicep" + }, + { + "queryName": "Storage Blob Service Container With Public Access", + "severity": "HIGH", + "line": 87, + "fileName": "positive2.bicep" + }, + { + "queryName": "Storage Blob Service Container With Public Access", + "severity": "HIGH", + "line": 29, + "fileName": "positive3.bicep" + }, + { + "queryName": "Storage Blob Service Container With Public Access", + "severity": "HIGH", + "line": 5, + "fileName": "positive4.bicep" + }, + { + "queryName": "Storage Blob Service Container With Public Access", + "severity": "HIGH", + "line": 87, + "fileName": "positive5.bicep" + }, + { + "queryName": "Storage Blob Service Container With Public Access", + "severity": "HIGH", + "line": 29, + "fileName": "positive6.bicep" } ] diff --git a/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative1.bicep b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative1.bicep new file mode 100644 index 00000000000..d0eac8e9c62 --- /dev/null +++ b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative1.bicep @@ -0,0 +1,25 @@ +resource storage 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: 'storage' + location: 'location1' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + networkAcls: { + virtualNetworkRules: [ + { + id: 'id' + action: 'Allow' + } + { + id: 'id' + action: 'Allow' + } + ] + defaultAction: 'Allow' + } + } +} diff --git a/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative2.bicep b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative2.bicep new file mode 100644 index 00000000000..1263f5ffa71 --- /dev/null +++ b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative2.bicep @@ -0,0 +1,26 @@ +resource storage 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: 'storage' + location: 'location1' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + networkAcls: { + bypass: 'AzureServices' + virtualNetworkRules: [ + { + id: 'id' + action: 'Allow' + } + { + id: 'id' + action: 'Allow' + } + ] + defaultAction: 'Deny' + } + } +} diff --git a/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative3.bicep b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative3.bicep new file mode 100644 index 00000000000..d0eac8e9c62 --- /dev/null +++ b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative3.bicep @@ -0,0 +1,25 @@ +resource storage 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: 'storage' + location: 'location1' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + networkAcls: { + virtualNetworkRules: [ + { + id: 'id' + action: 'Allow' + } + { + id: 'id' + action: 'Allow' + } + ] + defaultAction: 'Allow' + } + } +} diff --git a/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative4.bicep b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative4.bicep new file mode 100644 index 00000000000..1263f5ffa71 --- /dev/null +++ b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/negative4.bicep @@ -0,0 +1,26 @@ +resource storage 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: 'storage' + location: 'location1' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + networkAcls: { + bypass: 'AzureServices' + virtualNetworkRules: [ + { + id: 'id' + action: 'Allow' + } + { + id: 'id' + action: 'Allow' + } + ] + defaultAction: 'Deny' + } + } +} diff --git a/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive1.bicep b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive1.bicep new file mode 100644 index 00000000000..1199327af79 --- /dev/null +++ b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive1.bicep @@ -0,0 +1,26 @@ +resource storage 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: 'storage' + location: 'location1' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + networkAcls: { + bypass: 'None' + virtualNetworkRules: [ + { + id: 'id' + action: 'Allow' + } + { + id: 'id' + action: 'Allow' + } + ] + defaultAction: 'Deny' + } + } +} diff --git a/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive2.bicep b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive2.bicep new file mode 100644 index 00000000000..60ae2d6c063 --- /dev/null +++ b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive2.bicep @@ -0,0 +1,16 @@ +resource storage 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: 'storage' + location: 'location1' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + networkAcls: { + bypass: 'None' + defaultAction: 'Deny' + } + } +} diff --git a/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive3.bicep b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive3.bicep new file mode 100644 index 00000000000..1199327af79 --- /dev/null +++ b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive3.bicep @@ -0,0 +1,26 @@ +resource storage 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: 'storage' + location: 'location1' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + networkAcls: { + bypass: 'None' + virtualNetworkRules: [ + { + id: 'id' + action: 'Allow' + } + { + id: 'id' + action: 'Allow' + } + ] + defaultAction: 'Deny' + } + } +} diff --git a/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive4.bicep b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive4.bicep new file mode 100644 index 00000000000..60ae2d6c063 --- /dev/null +++ b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive4.bicep @@ -0,0 +1,16 @@ +resource storage 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: 'storage' + location: 'location1' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + networkAcls: { + bypass: 'None' + defaultAction: 'Deny' + } + } +} diff --git a/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive_expected_result.json index aa83a1091b1..3663ce2444c 100644 --- a/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "MEDIUM", "line": 23, "fileName": "positive4.json" + }, + { + "queryName": "Trusted Microsoft Services Not Enabled", + "severity": "MEDIUM", + "line": 11, + "fileName": "positive1.bicep" + }, + { + "queryName": "Trusted Microsoft Services Not Enabled", + "severity": "MEDIUM", + "line": 11, + "fileName": "positive2.bicep" + }, + { + "queryName": "Trusted Microsoft Services Not Enabled", + "severity": "MEDIUM", + "line": 11, + "fileName": "positive3.bicep" + }, + { + "queryName": "Trusted Microsoft Services Not Enabled", + "severity": "MEDIUM", + "line": 11, + "fileName": "positive4.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/negative1.bicep b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/negative1.bicep new file mode 100644 index 00000000000..5b54e902114 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/negative1.bicep @@ -0,0 +1,15 @@ +resource string 'microsoft.insights/logprofiles@2016-03-01' = { + name: 'string' + location: 'location' + tags: {} + properties: { + storageAccountId: 'storageAccountId' + serviceBusRuleId: 'serviceBusRuleId' + locations: ['location1'] + categories: ['Write'] + retentionPolicy: { + enabled: true + days: 400 + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/negative2.bicep b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/negative2.bicep new file mode 100644 index 00000000000..5b54e902114 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/negative2.bicep @@ -0,0 +1,15 @@ +resource string 'microsoft.insights/logprofiles@2016-03-01' = { + name: 'string' + location: 'location' + tags: {} + properties: { + storageAccountId: 'storageAccountId' + serviceBusRuleId: 'serviceBusRuleId' + locations: ['location1'] + categories: ['Write'] + retentionPolicy: { + enabled: true + days: 400 + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive1.bicep b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive1.bicep new file mode 100644 index 00000000000..d59ff8b7796 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive1.bicep @@ -0,0 +1,15 @@ +resource string 'microsoft.insights/logprofiles@2016-03-01' = { + name: 'string' + location: 'location' + tags: {} + properties: { + storageAccountId: 'storageAccountId' + serviceBusRuleId: 'serviceBusRuleId' + locations: ['location1'] + categories: ['Write'] + retentionPolicy: { + enabled: true + days: 300 + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive2.bicep b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive2.bicep new file mode 100644 index 00000000000..ea22101c9c7 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive2.bicep @@ -0,0 +1,15 @@ +resource string 'microsoft.insights/logprofiles@2016-03-01' = { + name: 'string' + location: 'location' + tags: {} + properties: { + storageAccountId: 'storageAccountId' + serviceBusRuleId: 'serviceBusRuleId' + locations: ['location1'] + categories: ['Write'] + retentionPolicy: { + enabled: false + days: 300 + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive3.bicep b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive3.bicep new file mode 100644 index 00000000000..d59ff8b7796 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive3.bicep @@ -0,0 +1,15 @@ +resource string 'microsoft.insights/logprofiles@2016-03-01' = { + name: 'string' + location: 'location' + tags: {} + properties: { + storageAccountId: 'storageAccountId' + serviceBusRuleId: 'serviceBusRuleId' + locations: ['location1'] + categories: ['Write'] + retentionPolicy: { + enabled: true + days: 300 + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive4.bicep b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive4.bicep new file mode 100644 index 00000000000..ea22101c9c7 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive4.bicep @@ -0,0 +1,15 @@ +resource string 'microsoft.insights/logprofiles@2016-03-01' = { + name: 'string' + location: 'location' + tags: {} + properties: { + storageAccountId: 'storageAccountId' + serviceBusRuleId: 'serviceBusRuleId' + locations: ['location1'] + categories: ['Write'] + retentionPolicy: { + enabled: false + days: 300 + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive_expected_result.json b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive_expected_result.json index b2162149cd8..3ce6f3b5fcd 100644 --- a/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/unrecommended_log_profile_retention_policy/test/positive_expected_result.json @@ -34,5 +34,41 @@ "severity": "LOW", "line": 28, "fileName": "positive4.json" + }, + { + "queryName": "Unrecommended Log Profile Retention Policy", + "severity": "LOW", + "line": 12, + "fileName": "positive1.bicep" + }, + { + "queryName": "Unrecommended Log Profile Retention Policy", + "severity": "LOW", + "line": 12, + "fileName": "positive2.bicep" + }, + { + "queryName": "Unrecommended Log Profile Retention Policy", + "severity": "LOW", + "line": 11, + "fileName": "positive2.bicep" + }, + { + "queryName": "Unrecommended Log Profile Retention Policy", + "severity": "LOW", + "line": 12, + "fileName": "positive3.bicep" + }, + { + "queryName": "Unrecommended Log Profile Retention Policy", + "severity": "LOW", + "line": 11, + "fileName": "positive4.bicep" + }, + { + "queryName": "Unrecommended Log Profile Retention Policy", + "severity": "LOW", + "line": 12, + "fileName": "positive4.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative1.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative1.bicep new file mode 100644 index 00000000000..92e80a9d0ed --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative1.bicep @@ -0,0 +1,17 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/flowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + enabled: true + retentionPolicy: { + days: 92 + enabled: true + } + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative2.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative2.bicep new file mode 100644 index 00000000000..07adf43e456 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative2.bicep @@ -0,0 +1,17 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/FlowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + enabled: true + retentionPolicy: { + days: 95 + enabled: true + } + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative3.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative3.bicep new file mode 100644 index 00000000000..92e80a9d0ed --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative3.bicep @@ -0,0 +1,17 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/flowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + enabled: true + retentionPolicy: { + days: 92 + enabled: true + } + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative4.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative4.bicep new file mode 100644 index 00000000000..07adf43e456 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/negative4.bicep @@ -0,0 +1,17 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/FlowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + enabled: true + retentionPolicy: { + days: 95 + enabled: true + } + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive1.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive1.bicep new file mode 100644 index 00000000000..71504ddc706 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive1.bicep @@ -0,0 +1,17 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/flowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + enabled: true + retentionPolicy: { + days: 2 + enabled: false + } + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive2.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive2.bicep new file mode 100644 index 00000000000..7eb2e0048bd --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive2.bicep @@ -0,0 +1,16 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/FlowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + enabled: true + retentionPolicy: { + days: 2 + } + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive3.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive3.bicep new file mode 100644 index 00000000000..760c06b0ea9 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive3.bicep @@ -0,0 +1,13 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/FlowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + enabled: true + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive4.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive4.bicep new file mode 100644 index 00000000000..461f5de28d2 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive4.bicep @@ -0,0 +1,16 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/FlowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + retentionPolicy: { + days: 95 + enabled: true + } + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive5.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive5.bicep new file mode 100644 index 00000000000..71504ddc706 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive5.bicep @@ -0,0 +1,17 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/flowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + enabled: true + retentionPolicy: { + days: 2 + enabled: false + } + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive6.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive6.bicep new file mode 100644 index 00000000000..7eb2e0048bd --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive6.bicep @@ -0,0 +1,16 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/FlowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + enabled: true + retentionPolicy: { + days: 2 + } + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive7.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive7.bicep new file mode 100644 index 00000000000..760c06b0ea9 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive7.bicep @@ -0,0 +1,13 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/FlowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + enabled: true + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive8.bicep b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive8.bicep new file mode 100644 index 00000000000..461f5de28d2 --- /dev/null +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive8.bicep @@ -0,0 +1,16 @@ +resource flowlogs_sample 'Microsoft.Network/networkWatchers/FlowLogs@2020-11-01' = { + name: 'flowlogs/sample' + location: 'location' + tags: {} + properties: { + targetResourceId: 'targetResourceId' + storageId: 'storageId' + retentionPolicy: { + days: 95 + enabled: true + } + format: { + type: 'JSON' + } + } +} diff --git a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive_expected_result.json b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive_expected_result.json index 5b9f8ed8b13..559db459cb4 100644 --- a/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/unrecommended_network_watcher_flow_log_retention_policy/test/positive_expected_result.json @@ -70,5 +70,77 @@ "severity": "LOW", "line": 17, "fileName": "positive8.json" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 10, + "fileName": "positive1.bicep" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 11, + "fileName": "positive1.bicep" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 10, + "fileName": "positive2.bicep" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 9, + "fileName": "positive2.bicep" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 5, + "fileName": "positive3.bicep" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 5, + "fileName": "positive4.bicep" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 10, + "fileName": "positive5.bicep" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 11, + "fileName": "positive5.bicep" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 9, + "fileName": "positive6.bicep" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 10, + "fileName": "positive6.bicep" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 5, + "fileName": "positive7.bicep" + }, + { + "queryName": "Unrecommended Network Watcher Flow Log Retention Policy", + "severity": "LOW", + "line": 5, + "fileName": "positive8.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/negative1.bicep b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/negative1.bicep new file mode 100644 index 00000000000..d89cbaa2d53 --- /dev/null +++ b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/negative1.bicep @@ -0,0 +1,9 @@ +resource App 'Microsoft.Web/sites@2020-12-01' = { + name: 'App' + location: resourceGroup().location + properties: { + siteConfig: { + minTlsVersion: '1.2' + } + } +} diff --git a/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/negative2.bicep b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/negative2.bicep new file mode 100644 index 00000000000..d89cbaa2d53 --- /dev/null +++ b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/negative2.bicep @@ -0,0 +1,9 @@ +resource App 'Microsoft.Web/sites@2020-12-01' = { + name: 'App' + location: resourceGroup().location + properties: { + siteConfig: { + minTlsVersion: '1.2' + } + } +} diff --git a/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive1.bicep b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive1.bicep new file mode 100644 index 00000000000..93f9cb55fe5 --- /dev/null +++ b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive1.bicep @@ -0,0 +1,9 @@ +resource App 'Microsoft.Web/sites@2020-12-01' = { + name: 'App' + location: resourceGroup().location + properties: { + siteConfig: { + minTlsVersion: '1.0' + } + } +} diff --git a/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive2.bicep b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive2.bicep new file mode 100644 index 00000000000..3b9462b1ddd --- /dev/null +++ b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive2.bicep @@ -0,0 +1,5 @@ +resource App 'Microsoft.Web/sites@2020-12-01' = { + name: 'App' + location: resourceGroup().location + properties: {} +} diff --git a/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive3.bicep b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive3.bicep new file mode 100644 index 00000000000..93f9cb55fe5 --- /dev/null +++ b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive3.bicep @@ -0,0 +1,9 @@ +resource App 'Microsoft.Web/sites@2020-12-01' = { + name: 'App' + location: resourceGroup().location + properties: { + siteConfig: { + minTlsVersion: '1.0' + } + } +} diff --git a/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive4.bicep b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive4.bicep new file mode 100644 index 00000000000..3b9462b1ddd --- /dev/null +++ b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive4.bicep @@ -0,0 +1,5 @@ +resource App 'Microsoft.Web/sites@2020-12-01' = { + name: 'App' + location: resourceGroup().location + properties: {} +} diff --git a/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive_expected_result.json b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive_expected_result.json index d0e889f2cb6..6ec44374599 100644 --- a/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/web_app_not_using_tls_last_version/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "MEDIUM", "line": 10, "filename": "positive4.json" + }, + { + "queryName": "Web App Not Using TLS Last Version", + "severity": "MEDIUM", + "line": 6, + "filename": "positive1.bicep" + }, + { + "queryName": "Web App Not Using TLS Last Version", + "severity": "MEDIUM", + "line": 2, + "filename": "positive2.bicep" + }, + { + "queryName": "Web App Not Using TLS Last Version", + "severity": "MEDIUM", + "line": 6, + "filename": "positive3.bicep" + }, + { + "queryName": "Web App Not Using TLS Last Version", + "severity": "MEDIUM", + "line": 2, + "filename": "positive4.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative1.bicep new file mode 100644 index 00000000000..17d6bf657c2 --- /dev/null +++ b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative1.bicep @@ -0,0 +1,12 @@ +resource webSiteNegative1 'Microsoft.Web/sites@2019-08-01' = { + name: 'webSiteNegative1' + location: 'location1' + identity: { + type: 'SystemAssigned' + } + tags: {} + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative2.bicep new file mode 100644 index 00000000000..2a7a84b391b --- /dev/null +++ b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative2.bicep @@ -0,0 +1,17 @@ +var identityName = 'value' + +resource webSiteNegative2 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSiteNegative2' + location: 'location1' + tags: {} + identity: { + type: 'UserAssigned' + userAssignedIdentities: { + '${resourceId('Microsoft.ManagedIdentity/userAssignedIdentities',identityName)}': {} + } + } + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative3.bicep b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative3.bicep new file mode 100644 index 00000000000..17d6bf657c2 --- /dev/null +++ b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative3.bicep @@ -0,0 +1,12 @@ +resource webSiteNegative1 'Microsoft.Web/sites@2019-08-01' = { + name: 'webSiteNegative1' + location: 'location1' + identity: { + type: 'SystemAssigned' + } + tags: {} + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative4.bicep b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative4.bicep new file mode 100644 index 00000000000..2a7a84b391b --- /dev/null +++ b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/negative4.bicep @@ -0,0 +1,17 @@ +var identityName = 'value' + +resource webSiteNegative2 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSiteNegative2' + location: 'location1' + tags: {} + identity: { + type: 'UserAssigned' + userAssignedIdentities: { + '${resourceId('Microsoft.ManagedIdentity/userAssignedIdentities',identityName)}': {} + } + } + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive1.bicep new file mode 100644 index 00000000000..885ee15b357 --- /dev/null +++ b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive1.bicep @@ -0,0 +1,9 @@ +resource webSitePositive2 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSitePositive2' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive2.bicep new file mode 100644 index 00000000000..0349686eb23 --- /dev/null +++ b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive2.bicep @@ -0,0 +1,12 @@ +resource webSitePositive3 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSitePositive3' + location: 'location1' + tags: {} + identity: { + type: 'None' + } + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive3.bicep new file mode 100644 index 00000000000..67607270b21 --- /dev/null +++ b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive3.bicep @@ -0,0 +1,10 @@ +resource webSitePositive3 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSitePositive3' + location: 'location1' + tags: {} + identity: {} + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive4.bicep new file mode 100644 index 00000000000..885ee15b357 --- /dev/null +++ b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive4.bicep @@ -0,0 +1,9 @@ +resource webSitePositive2 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSitePositive2' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive5.bicep b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive5.bicep new file mode 100644 index 00000000000..0349686eb23 --- /dev/null +++ b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive5.bicep @@ -0,0 +1,12 @@ +resource webSitePositive3 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSitePositive3' + location: 'location1' + tags: {} + identity: { + type: 'None' + } + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive6.bicep b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive6.bicep new file mode 100644 index 00000000000..67607270b21 --- /dev/null +++ b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive6.bicep @@ -0,0 +1,10 @@ +resource webSitePositive3 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSitePositive3' + location: 'location1' + tags: {} + identity: {} + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive_expected_result.json index a970f83c2e4..294c2c55972 100644 --- a/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/website_azure_active_directory_disabled/test/positive_expected_result.json @@ -34,5 +34,41 @@ "severity": "LOW", "line": 17, "fileName": "positive6.json" + }, + { + "queryName": "Website Azure Active Directory Disabled", + "severity": "LOW", + "line": 2, + "fileName": "positive1.bicep" + }, + { + "queryName": "Website Azure Active Directory Disabled", + "severity": "LOW", + "line": 5, + "fileName": "positive2.bicep" + }, + { + "queryName": "Website Azure Active Directory Disabled", + "severity": "LOW", + "line": 5, + "fileName": "positive3.bicep" + }, + { + "queryName": "Website Azure Active Directory Disabled", + "severity": "LOW", + "line": 2, + "fileName": "positive4.bicep" + }, + { + "queryName": "Website Azure Active Directory Disabled", + "severity": "LOW", + "line": 5, + "fileName": "positive5.bicep" + }, + { + "queryName": "Website Azure Active Directory Disabled", + "severity": "LOW", + "line": 5, + "fileName": "positive6.bicep" } ] diff --git a/assets/queries/azureResourceManager/website_not_forcing_https/test/negative1.bicep b/assets/queries/azureResourceManager/website_not_forcing_https/test/negative1.bicep new file mode 100644 index 00000000000..29fc2158115 --- /dev/null +++ b/assets/queries/azureResourceManager/website_not_forcing_https/test/negative1.bicep @@ -0,0 +1,9 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_not_forcing_https/test/negative2.bicep b/assets/queries/azureResourceManager/website_not_forcing_https/test/negative2.bicep new file mode 100644 index 00000000000..29fc2158115 --- /dev/null +++ b/assets/queries/azureResourceManager/website_not_forcing_https/test/negative2.bicep @@ -0,0 +1,9 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_not_forcing_https/test/positive1.bicep b/assets/queries/azureResourceManager/website_not_forcing_https/test/positive1.bicep new file mode 100644 index 00000000000..6f0ef54f3aa --- /dev/null +++ b/assets/queries/azureResourceManager/website_not_forcing_https/test/positive1.bicep @@ -0,0 +1,8 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + } +} diff --git a/assets/queries/azureResourceManager/website_not_forcing_https/test/positive2.bicep b/assets/queries/azureResourceManager/website_not_forcing_https/test/positive2.bicep new file mode 100644 index 00000000000..758b59cc289 --- /dev/null +++ b/assets/queries/azureResourceManager/website_not_forcing_https/test/positive2.bicep @@ -0,0 +1,9 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: false + } +} diff --git a/assets/queries/azureResourceManager/website_not_forcing_https/test/positive3.bicep b/assets/queries/azureResourceManager/website_not_forcing_https/test/positive3.bicep new file mode 100644 index 00000000000..6f0ef54f3aa --- /dev/null +++ b/assets/queries/azureResourceManager/website_not_forcing_https/test/positive3.bicep @@ -0,0 +1,8 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + } +} diff --git a/assets/queries/azureResourceManager/website_not_forcing_https/test/positive4.bicep b/assets/queries/azureResourceManager/website_not_forcing_https/test/positive4.bicep new file mode 100644 index 00000000000..758b59cc289 --- /dev/null +++ b/assets/queries/azureResourceManager/website_not_forcing_https/test/positive4.bicep @@ -0,0 +1,9 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: false + } +} diff --git a/assets/queries/azureResourceManager/website_not_forcing_https/test/positive_expected_result.json b/assets/queries/azureResourceManager/website_not_forcing_https/test/positive_expected_result.json index 85d5eb855d9..139dfcbc9e3 100644 --- a/assets/queries/azureResourceManager/website_not_forcing_https/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/website_not_forcing_https/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "MEDIUM", "line": 19, "fileName": "positive4.json" + }, + { + "queryName": "Website Not Forcing HTTPS", + "severity": "MEDIUM", + "line": 5, + "fileName": "positive1.bicep" + }, + { + "queryName": "Website Not Forcing HTTPS", + "severity": "MEDIUM", + "line": 7, + "fileName": "positive2.bicep" + }, + { + "queryName": "Website Not Forcing HTTPS", + "severity": "MEDIUM", + "line": 5, + "fileName": "positive3.bicep" + }, + { + "queryName": "Website Not Forcing HTTPS", + "severity": "MEDIUM", + "line": 7, + "fileName": "positive4.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/negative1.bicep new file mode 100644 index 00000000000..c003246f604 --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/negative1.bicep @@ -0,0 +1,9 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + clientCertEnabled: true + } +} diff --git a/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/negative2.bicep new file mode 100644 index 00000000000..c003246f604 --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/negative2.bicep @@ -0,0 +1,9 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + clientCertEnabled: true + } +} diff --git a/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive1.bicep new file mode 100644 index 00000000000..6f0ef54f3aa --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive1.bicep @@ -0,0 +1,8 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + } +} diff --git a/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive2.bicep new file mode 100644 index 00000000000..5ce6fbc0e6a --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive2.bicep @@ -0,0 +1,9 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + clientCertEnabled: false + } +} diff --git a/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive3.bicep new file mode 100644 index 00000000000..6f0ef54f3aa --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive3.bicep @@ -0,0 +1,8 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + } +} diff --git a/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive4.bicep new file mode 100644 index 00000000000..5ce6fbc0e6a --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive4.bicep @@ -0,0 +1,9 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + clientCertEnabled: false + } +} diff --git a/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive_expected_result.json index e6c734aee1f..68777490f18 100644 --- a/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/website_with_client_certificate_auth_disabled/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "MEDIUM", "line": 19, "fileName": "positive4.json" + }, + { + "queryName": "Website with Client Certificate Auth Disabled", + "severity": "MEDIUM", + "line": 5, + "fileName": "positive1.bicep" + }, + { + "queryName": "Website with Client Certificate Auth Disabled", + "severity": "MEDIUM", + "line": 7, + "fileName": "positive2.bicep" + }, + { + "queryName": "Website with Client Certificate Auth Disabled", + "severity": "MEDIUM", + "line": 5, + "fileName": "positive3.bicep" + }, + { + "queryName": "Website with Client Certificate Auth Disabled", + "severity": "MEDIUM", + "line": 7, + "fileName": "positive4.bicep" } ] \ No newline at end of file diff --git a/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/negative1.bicep new file mode 100644 index 00000000000..b0b8c8e726b --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/negative1.bicep @@ -0,0 +1,12 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + siteConfig: { + http20Enabled: true + } + } +} diff --git a/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/negative2.bicep new file mode 100644 index 00000000000..b0b8c8e726b --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/negative2.bicep @@ -0,0 +1,12 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + siteConfig: { + http20Enabled: true + } + } +} diff --git a/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive1.bicep new file mode 100644 index 00000000000..29fc2158115 --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive1.bicep @@ -0,0 +1,9 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive2.bicep new file mode 100644 index 00000000000..03656e73be2 --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive2.bicep @@ -0,0 +1,12 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + siteConfig: { + http20Enabled: false + } + } +} diff --git a/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive3.bicep new file mode 100644 index 00000000000..b4cfb1a0ac3 --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive3.bicep @@ -0,0 +1,10 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + siteConfig: {} + } +} diff --git a/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive4.bicep new file mode 100644 index 00000000000..29fc2158115 --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive4.bicep @@ -0,0 +1,9 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + } +} diff --git a/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive5.bicep b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive5.bicep new file mode 100644 index 00000000000..03656e73be2 --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive5.bicep @@ -0,0 +1,12 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + siteConfig: { + http20Enabled: false + } + } +} diff --git a/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive6.bicep b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive6.bicep new file mode 100644 index 00000000000..b4cfb1a0ac3 --- /dev/null +++ b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive6.bicep @@ -0,0 +1,10 @@ +resource webSite 'Microsoft.Web/sites@2020-12-01' = { + name: 'webSite' + location: 'location1' + tags: {} + properties: { + enabled: true + httpsOnly: true + siteConfig: {} + } +} diff --git a/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive_expected_result.json index 7e237461eb5..1385deea8c6 100644 --- a/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/website_with_http20enabled_disabled/test/positive_expected_result.json @@ -34,5 +34,41 @@ "severity": "LOW", "line": 17, "fileName": "positive6.json" + }, + { + "queryName": "Website with 'Http20Enabled' Disabled", + "severity": "LOW", + "line": 5, + "fileName": "positive1.bicep" + }, + { + "queryName": "Website with 'Http20Enabled' Disabled", + "severity": "LOW", + "line": 5, + "fileName": "positive2.bicep" + }, + { + "queryName": "Website with 'Http20Enabled' Disabled", + "severity": "LOW", + "line": 5, + "fileName": "positive3.bicep" + }, + { + "queryName": "Website with 'Http20Enabled' Disabled", + "severity": "LOW", + "line": 5, + "fileName": "positive4.bicep" + }, + { + "queryName": "Website with 'Http20Enabled' Disabled", + "severity": "LOW", + "line": 5, + "fileName": "positive5.bicep" + }, + { + "queryName": "Website with 'Http20Enabled' Disabled", + "severity": "LOW", + "line": 5, + "fileName": "positive6.bicep" } ] From cba79da78f0f28567839ca62cb888a2834cb01f1 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 22 Apr 2024 15:57:11 +0100 Subject: [PATCH 060/130] finished query testing --- test/main_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/main_test.go b/test/main_test.go index d153d1891df..8bec98bf744 100644 --- a/test/main_test.go +++ b/test/main_test.go @@ -16,6 +16,7 @@ import ( "github.com/Checkmarx/kics/pkg/parser" ansibleConfigParser "github.com/Checkmarx/kics/pkg/parser/ansible/ini/config" ansibleHostsParser "github.com/Checkmarx/kics/pkg/parser/ansible/ini/hosts" + bicepParser "github.com/Checkmarx/kics/pkg/parser/bicep" buildahParser "github.com/Checkmarx/kics/pkg/parser/buildah" dockerParser "github.com/Checkmarx/kics/pkg/parser/docker" protoParser "github.com/Checkmarx/kics/pkg/parser/grpc" @@ -64,7 +65,7 @@ var ( "../assets/queries/openAPI/general": {FileKind: []model.FileKind{model.KindYAML, model.KindJSON}, Platform: "openAPI"}, "../assets/queries/openAPI/3.0": {FileKind: []model.FileKind{model.KindYAML, model.KindJSON}, Platform: "openAPI"}, "../assets/queries/openAPI/2.0": {FileKind: []model.FileKind{model.KindYAML, model.KindJSON}, Platform: "openAPI"}, - "../assets/queries/azureResourceManager": {FileKind: []model.FileKind{model.KindJSON}, Platform: "azureResourceManager"}, + "../assets/queries/azureResourceManager": {FileKind: []model.FileKind{model.KindJSON, model.KindBICEP}, Platform: "azureResourceManager"}, "../assets/queries/googleDeploymentManager/gcp": {FileKind: []model.FileKind{model.KindYAML}, Platform: "googleDeploymentManager"}, "../assets/queries/googleDeploymentManager/gcp_bom": {FileKind: []model.FileKind{model.KindYAML}, Platform: "googleDeploymentManager"}, "../assets/queries/grpc": {FileKind: []model.FileKind{model.KindPROTO}, Platform: "grpc"}, @@ -194,6 +195,7 @@ func getCombinedParser() []*parser.Parser { bd, _ := parser.NewBuilder(). Add(&jsonParser.Parser{}). Add(&yamlParser.Parser{}). + Add(&bicepParser.Parser{}). Add(terraformParser.NewDefault()). Add(&dockerParser.Parser{}). Add(&protoParser.Parser{}). From 40d3b2b6c559e0c3f11487a9895cc2a70792f6e2 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 22 Apr 2024 15:57:55 +0100 Subject: [PATCH 061/130] changed kics lines in parameters --- pkg/parser/bicep/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index e35e645080f..814ec9504f8 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -166,7 +166,7 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } } - line := map[string]int{kicsLine: ctx.GetStop().GetLine() + 1} + line := map[string]int{kicsLine: ctx.GetStop().GetLine()} lines := map[string]map[string]int{ kicsPrefix + "defaultValue": line, kicsPrefix + "type": line, From 22eb183d1e24a3a066759b94cfeccc33d40d6a05 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 22 Apr 2024 17:06:03 +0100 Subject: [PATCH 062/130] fix unit tests with new kics lines for parameters --- pkg/parser/bicep/parser_test.go | 910 ++++++++++++++++---------------- 1 file changed, 455 insertions(+), 455 deletions(-) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 4d66cb44792..4522df3c373 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -108,109 +108,109 @@ func TestParseBicepFile(t *testing.T) { name: "Parse Bicep file with parameters", filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "parameters.bicep"), want: `{ - "parameters": { - "array": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 18 - }, - "_kics_type": { - "_kics_line": 18 - } + "parameters": { + "array": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 17 }, - "defaultValue": [ - "string" - ], - "type": "string" + "_kics_type": { + "_kics_line": 17 + } }, - "isNumber": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 10 - }, - "_kics_type": { - "_kics_line": 10 - } - }, - "defaultValue": true, - "metadata": { - "description": "This is a test bool param declaration." + "defaultValue": [ + "string" + ], + "type": "string" + }, + "isNumber": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 9 }, - "type": "bool" + "_kics_type": { + "_kics_line": 9 + } }, - "middleString": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 13 - }, - "_kics_type": { - "_kics_line": 13 - } - }, - "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'", - "metadata": { - "description": "This is a test middle string param declaration." - }, - "type": "string" + "defaultValue": true, + "metadata": { + "description": "This is a test bool param declaration." }, - "null": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 20 - }, - "_kics_type": { - "_kics_line": 20 - } + "type": "bool" + }, + "middleString": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 12 }, - "defaultValue": null, - "type": "string" + "_kics_type": { + "_kics_line": 12 + } }, - "numberNodes": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 7 - }, - "_kics_type": { - "_kics_line": 7 - } - }, - "defaultValue": 2, - "metadata": { - "description": "This is a test int param declaration." - }, - "type": "int" + "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'", + "metadata": { + "description": "This is a test middle string param declaration." }, - "projectName": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 4 - }, - "_kics_type": { - "_kics_line": 4 - } + "type": "string" + }, + "null": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 19 }, - "defaultValue": "[newGuid()]", - "metadata": { - "description": "This is a test param with secure declaration." + "_kics_type": { + "_kics_line": 19 + } + }, + "defaultValue": null, + "type": "string" + }, + "numberNodes": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 6 }, - "type": "secureString" + "_kics_type": { + "_kics_line": 6 + } }, - "secObj": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 16 - }, - "_kics_type": { - "_kics_line": 16 - } + "defaultValue": 2, + "metadata": { + "description": "This is a test int param declaration." + }, + "type": "int" + }, + "projectName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 3 }, - "defaultValue": false, - "type": "secureObject" - } + "_kics_type": { + "_kics_line": 3 + } + }, + "defaultValue": "[newGuid()]", + "metadata": { + "description": "This is a test param with secure declaration." + }, + "type": "secureString" }, - "resources": [], - "variables": {} - }`, + "secObj": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 15 + }, + "_kics_type": { + "_kics_line": 15 + } + }, + "defaultValue": false, + "type": "secureObject" + } + }, + "resources": [], + "variables": {} + }`, wantErr: false, }, { @@ -240,453 +240,453 @@ func TestParseBicepFile(t *testing.T) { name: "Parse completed Bicep file", filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "resources.bicep"), want: `{ - "parameters": { - "OSVersion": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 35 - }, - "_kics_type": { - "_kics_line": 35 - } + "parameters": { + "OSVersion": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 34 }, - "allowedValues": [ - [ - "2008-R2-SP1", - "2012-Datacenter", - "2012-R2-Datacenter", - "2016-Nano-Server", - "2016-Datacenter-with-Containers", - "2016-Datacenter", - "2019-Datacenter", - "2019-Datacenter-Core", - "2019-Datacenter-Core-smalldisk", - "2019-Datacenter-Core-with-Containers", - "2019-Datacenter-Core-with-Containers-smalldisk", - "2019-Datacenter-smalldisk", - "2019-Datacenter-with-Containers", - "2019-Datacenter-with-Containers-smalldisk" - ] - ], - "defaultValue": "2019-Datacenter", - "metadata": { - "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version." - }, - "type": "string" + "_kics_type": { + "_kics_line": 34 + } }, - "adminPassword": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 10 - }, - "_kics_type": { - "_kics_line": 10 - } - }, - "metadata": { - "description": "Password for the Virtual Machine." + "allowedValues": [ + [ + "2008-R2-SP1", + "2012-Datacenter", + "2012-R2-Datacenter", + "2016-Nano-Server", + "2016-Datacenter-with-Containers", + "2016-Datacenter", + "2019-Datacenter", + "2019-Datacenter-Core", + "2019-Datacenter-Core-smalldisk", + "2019-Datacenter-Core-with-Containers", + "2019-Datacenter-Core-with-Containers-smalldisk", + "2019-Datacenter-smalldisk", + "2019-Datacenter-with-Containers", + "2019-Datacenter-with-Containers-smalldisk" + ] + ], + "defaultValue": "2019-Datacenter", + "metadata": { + "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version." + }, + "type": "string" + }, + "adminPassword": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 9 }, - "minLength": 12, - "type": "secureString" + "_kics_type": { + "_kics_line": 9 + } }, - "adminUsername": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 5 - }, - "_kics_type": { - "_kics_line": 5 - } + "metadata": { + "description": "Password for the Virtual Machine." + }, + "minLength": 12, + "type": "secureString" + }, + "adminUsername": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 4 }, - "metadata": { - "description": "Username for the Virtual Machine." + "_kics_type": { + "_kics_line": 4 + } + }, + "metadata": { + "description": "Username for the Virtual Machine." + }, + "type": "string" + }, + "location": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 40 }, - "type": "string" + "_kics_type": { + "_kics_line": 40 + } }, - "location": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 41 - }, - "_kics_type": { - "_kics_line": 41 - } + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location for all resources." + }, + "type": "string" + }, + "parenthesis": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 45 }, - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." + "_kics_type": { + "_kics_line": 45 + } + }, + "defaultValue": "simple-vm", + "type": "string" + }, + "vmName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 43 }, - "type": "string" + "_kics_type": { + "_kics_line": 43 + } }, - "parenthesis": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 46 - }, - "_kics_type": { - "_kics_line": 46 - } + "defaultValue": "simple-vm", + "metadata": { + "description": "Name of the virtual machine." + }, + "type": "string" + }, + "vmSize": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 37 }, - "defaultValue": "simple-vm", - "type": "string" + "_kics_type": { + "_kics_line": 37 + } }, - "vmName": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 44 - }, - "_kics_type": { - "_kics_line": 44 - } + "defaultValue": "Standard_D2_v3", + "metadata": { + "description": "Size of the virtual machine." + }, + "type": "string" + } + }, + "resources": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 51 }, - "defaultValue": "simple-vm", - "metadata": { - "description": "Name of the virtual machine." + "_kics_apiVersion": { + "_kics_line": 50 }, - "type": "string" - }, - "vmSize": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 38 - }, - "_kics_type": { - "_kics_line": 38 - } + "_kics_dependsOn": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 100 + } + } + ], + "_kics_line": 100 }, - "defaultValue": "Standard_D2_v3", - "metadata": { - "description": "Size of the virtual machine." + "_kics_location": { + "_kics_line": 53 }, - "type": "string" - } - }, - "resources": [ - { + "_kics_name": { + "_kics_line": 52 + }, + "_kics_properties": { + "_kics_line": 54 + }, + "_kics_type": { + "_kics_line": 50 + } + }, + "apiVersion": "2021-03-01", + "dependsOn": [ + { + "resourceId": [ + "Microsoft.Network/networkInterfaces", + "variables('nicName')" + ] + }, + { + "resourceId": [ + "Microsoft.Storage/storageAccounts", + "variables('storageAccountName')" + ] + } + ], + "identifier": "vm", + "location": "[parameters('location')]", + "metadata": { + "description": "This is a test description for resources" + }, + "name": "[parameters('vmName')]", + "properties": { "_kics_lines": { "_kics__default": { - "_kics_line": 51 - }, - "_kics_apiVersion": { - "_kics_line": 50 - }, - "_kics_dependsOn": { - "_kics_arr": [ - { - "_kics__default": { - "_kics_line": 100 - } - } - ], - "_kics_line": 100 + "_kics_line": 54 }, - "_kics_location": { - "_kics_line": 53 + "_kics_diagnosticsProfile": { + "_kics_line": 91 }, - "_kics_name": { - "_kics_line": 52 + "_kics_hardwareProfile": { + "_kics_line": 55 }, - "_kics_properties": { - "_kics_line": 54 + "_kics_networkProfile": { + "_kics_line": 84 }, - "_kics_type": { - "_kics_line": 50 - } - }, - "apiVersion": "2021-03-01", - "dependsOn": [ - { - "resourceId": [ - "Microsoft.Network/networkInterfaces", - "variables('nicName')" - ] + "_kics_osProfile": { + "_kics_line": 58 }, - { - "resourceId": [ - "Microsoft.Storage/storageAccounts", - "variables('storageAccountName')" - ] + "_kics_storageProfile": { + "_kics_line": 63 } - ], - "identifier": "vm", - "location": "[parameters('location')]", - "metadata": { - "description": "This is a test description for resources" }, - "name": "[parameters('vmName')]", - "properties": { + "diagnosticsProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 54 - }, - "_kics_diagnosticsProfile": { "_kics_line": 91 }, - "_kics_hardwareProfile": { - "_kics_line": 55 - }, - "_kics_networkProfile": { - "_kics_line": 84 - }, - "_kics_osProfile": { - "_kics_line": 58 - }, - "_kics_storageProfile": { - "_kics_line": 63 + "_kics_bootDiagnostics": { + "_kics_line": 92 } }, - "diagnosticsProfile": { + "bootDiagnostics": { "_kics_lines": { "_kics__default": { - "_kics_line": 91 - }, - "_kics_bootDiagnostics": { "_kics_line": 92 + }, + "_kics_enabled": { + "_kics_line": 93 + }, + "_kics_storageUri": { + "_kics_line": 94 } }, - "bootDiagnostics": { + "enabled": true, + "storageUri": "[reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob]" + } + }, + "hardwareProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 55 + }, + "_kics_vmSize": { + "_kics_line": 56 + } + }, + "vmSize": "[parameters('vmSize')]" + }, + "networkProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 84 + }, + "_kics_networkInterfaces": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 85 + } + } + ], + "_kics_line": 85 + } + }, + "networkInterfaces": [ + { "_kics_lines": { "_kics__default": { - "_kics_line": 92 + "_kics_line": 86 }, - "_kics_enabled": { - "_kics_line": 93 - }, - "_kics_storageUri": { - "_kics_line": 94 + "_kics_id": { + "_kics_line": 87 } }, - "enabled": true, - "storageUri": "[reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob]" - } - }, - "hardwareProfile": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 55 - }, - "_kics_vmSize": { - "_kics_line": 56 + "id": { + "resourceId": [ + "Microsoft.Network/networkInterfaces", + "nick.variables('nicName')" + ] } + } + ] + }, + "osProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 58 + }, + "_kics_adminPassword": { + "_kics_line": 61 }, - "vmSize": "[parameters('vmSize')]" + "_kics_adminUsername": { + "_kics_line": 60 + }, + "_kics_computerName": { + "_kics_line": 59 + } }, - "networkProfile": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 84 - }, - "_kics_networkInterfaces": { - "_kics_arr": [ - { - "_kics__default": { - "_kics_line": 85 - } - } - ], - "_kics_line": 85 - } + "adminPassword": "[parameters('adminPassword')]", + "adminUsername": "[parameters('adminUsername')]", + "computerName": "[computer.parameters('vmName')]" + }, + "storageProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 63 }, - "networkInterfaces": [ - { - "_kics_lines": { + "_kics_dataDisks": { + "_kics_arr": [ + { "_kics__default": { - "_kics_line": 86 - }, - "_kics_id": { - "_kics_line": 87 + "_kics_line": 76 } - }, - "id": { - "resourceId": [ - "Microsoft.Network/networkInterfaces", - "nick.variables('nicName')" - ] } - } - ] + ], + "_kics_line": 76 + }, + "_kics_imageReference": { + "_kics_line": 64 + }, + "_kics_osDisk": { + "_kics_line": 70 + } }, - "osProfile": { + "dataDisks": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 77 + }, + "_kics_createOption": { + "_kics_line": 80 + }, + "_kics_diskSizeGB": { + "_kics_line": 78 + }, + "_kics_lun": { + "_kics_line": 79 + } + }, + "createOption": "Empty", + "diskSizeGB": 1023, + "lun": 0 + } + ], + "imageReference": { "_kics_lines": { "_kics__default": { - "_kics_line": 58 + "_kics_line": 64 }, - "_kics_adminPassword": { - "_kics_line": 61 + "_kics_offer": { + "_kics_line": 66 }, - "_kics_adminUsername": { - "_kics_line": 60 + "_kics_publisher": { + "_kics_line": 65 }, - "_kics_computerName": { - "_kics_line": 59 + "_kics_sku": { + "_kics_line": 67 + }, + "_kics_version": { + "_kics_line": 68 } }, - "adminPassword": "[parameters('adminPassword')]", - "adminUsername": "[parameters('adminUsername')]", - "computerName": "[computer.parameters('vmName')]" + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "[parameters('OSVersion')]", + "version": "latest" }, - "storageProfile": { + "osDisk": { "_kics_lines": { "_kics__default": { - "_kics_line": 63 - }, - "_kics_dataDisks": { - "_kics_arr": [ - { - "_kics__default": { - "_kics_line": 76 - } - } - ], - "_kics_line": 76 + "_kics_line": 70 }, - "_kics_imageReference": { - "_kics_line": 64 + "_kics_createOption": { + "_kics_line": 71 }, - "_kics_osDisk": { - "_kics_line": 70 + "_kics_managedDisk": { + "_kics_line": 72 } }, - "dataDisks": [ - { - "_kics_lines": { - "_kics__default": { - "_kics_line": 77 - }, - "_kics_createOption": { - "_kics_line": 80 - }, - "_kics_diskSizeGB": { - "_kics_line": 78 - }, - "_kics_lun": { - "_kics_line": 79 - } - }, - "createOption": "Empty", - "diskSizeGB": 1023, - "lun": 0 - } - ], - "imageReference": { + "createOption": "FromImage", + "managedDisk": { "_kics_lines": { "_kics__default": { - "_kics_line": 64 - }, - "_kics_offer": { - "_kics_line": 66 - }, - "_kics_publisher": { - "_kics_line": 65 - }, - "_kics_sku": { - "_kics_line": 67 - }, - "_kics_version": { - "_kics_line": 68 - } - }, - "offer": "WindowsServer", - "publisher": "MicrosoftWindowsServer", - "sku": "[parameters('OSVersion')]", - "version": "latest" - }, - "osDisk": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 70 - }, - "_kics_createOption": { - "_kics_line": 71 - }, - "_kics_managedDisk": { "_kics_line": 72 + }, + "_kics_storageAccountType": { + "_kics_line": 73 } }, - "createOption": "FromImage", - "managedDisk": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 72 - }, - "_kics_storageAccountType": { - "_kics_line": 73 - } - }, - "storageAccountType": "StandardSSD_LRS" - } + "storageAccountType": "StandardSSD_LRS" } } - }, - "type": "Microsoft.Compute/virtualMachines" + } }, - { - "_kics_lines": { - "_kics__default": { - "_kics_line": 106 - }, - "_kics_apiVersion": { - "_kics_line": 106 - }, - "_kics_assignableScopes": { - "_kics_arr": [ - { - "_kics__default": { - "_kics_line": 116 - } - } - ], - "_kics_line": 116 - }, - "_kics_location": { - "_kics_line": 108 - }, - "_kics_name": { - "_kics_line": 107 - }, - "_kics_type": { - "_kics_line": 106 - }, - "_kics_userAssignedIdentities": { - "_kics_line": 113 - } + "type": "Microsoft.Compute/virtualMachines" + }, + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 106 }, - "apiVersion": "2021-03-01", - "assignableScopes": [ - "[subscription().id]" - ], - "identifier": "nic", - "location": null, - "name": "", - "type": "Microsoft.Network/networkInterfaces", - "userAssignedIdentities": { - "'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { - "_kics_lines": { + "_kics_apiVersion": { + "_kics_line": 106 + }, + "_kics_assignableScopes": { + "_kics_arr": [ + { "_kics__default": { - "_kics_line": 114 + "_kics_line": 116 } } - }, + ], + "_kics_line": 116 + }, + "_kics_location": { + "_kics_line": 108 + }, + "_kics_name": { + "_kics_line": 107 + }, + "_kics_type": { + "_kics_line": 106 + }, + "_kics_userAssignedIdentities": { + "_kics_line": 113 + } + }, + "apiVersion": "2021-03-01", + "assignableScopes": [ + "[subscription().id]" + ], + "identifier": "nic", + "location": null, + "name": "", + "type": "Microsoft.Network/networkInterfaces", + "userAssignedIdentities": { + "'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { "_kics_lines": { - "_kics_'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { - "_kics_line": 114 - }, "_kics__default": { - "_kics_line": 113 + "_kics_line": 114 } } + }, + "_kics_lines": { + "_kics_'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { + "_kics_line": 114 + }, + "_kics__default": { + "_kics_line": 113 + } } } - ], - "variables": { - "nicName": { - "value": "myVMNic" - }, - "storageAccountName": { - "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" - } } - }`, + ], + "variables": { + "nicName": { + "value": "myVMNic" + }, + "storageAccountName": { + "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" + } + } + }`, wantErr: false, }, } From f407875cee61faf330b8a8b49db33239a2c756e6 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 22 Apr 2024 17:06:58 +0100 Subject: [PATCH 063/130] added bicep tests for hardcoded securestring query --- .../test/negative1.bicep | 15 +++++++++++++++ .../test/negative2.bicep | 15 +++++++++++++++ .../test/negative3.bicep | 15 +++++++++++++++ .../test/negative4.bicep | 15 +++++++++++++++ .../test/positive1.bicep | 15 +++++++++++++++ .../test/positive2.bicep | 15 +++++++++++++++ .../test/positive_expected_result.json | 12 ++++++++++++ 7 files changed, 102 insertions(+) create mode 100644 assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive2.bicep diff --git a/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative1.bicep b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative1.bicep new file mode 100644 index 00000000000..0dee47cf157 --- /dev/null +++ b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative1.bicep @@ -0,0 +1,15 @@ +@secure() +param secureParameter string = newGuid() +param adminLogin string +param sqlServerName string + +resource sqlServer 'Microsoft.Sql/servers@2015-05-01-preview' = { + name: sqlServerName + location: resourceGroup().location + tags: {} + properties: { + administratorLogin: adminLogin + administratorLoginPassword: secureParameter + version: '12.0' + } +} diff --git a/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative2.bicep b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative2.bicep new file mode 100644 index 00000000000..c76d59fecb6 --- /dev/null +++ b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative2.bicep @@ -0,0 +1,15 @@ +@secure() +param adminPassword string +param adminLogin string +param sqlServerName string + +resource sqlServer 'Microsoft.Sql/servers@2015-05-01-preview' = { + name: sqlServerName + location: resourceGroup().location + tags: {} + properties: { + administratorLogin: adminLogin + administratorLoginPassword: adminPassword + version: '12.0' + } +} diff --git a/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative3.bicep b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative3.bicep new file mode 100644 index 00000000000..0dee47cf157 --- /dev/null +++ b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative3.bicep @@ -0,0 +1,15 @@ +@secure() +param secureParameter string = newGuid() +param adminLogin string +param sqlServerName string + +resource sqlServer 'Microsoft.Sql/servers@2015-05-01-preview' = { + name: sqlServerName + location: resourceGroup().location + tags: {} + properties: { + administratorLogin: adminLogin + administratorLoginPassword: secureParameter + version: '12.0' + } +} diff --git a/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative4.bicep b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative4.bicep new file mode 100644 index 00000000000..c76d59fecb6 --- /dev/null +++ b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/negative4.bicep @@ -0,0 +1,15 @@ +@secure() +param adminPassword string +param adminLogin string +param sqlServerName string + +resource sqlServer 'Microsoft.Sql/servers@2015-05-01-preview' = { + name: sqlServerName + location: resourceGroup().location + tags: {} + properties: { + administratorLogin: adminLogin + administratorLoginPassword: adminPassword + version: '12.0' + } +} diff --git a/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive1.bicep b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive1.bicep new file mode 100644 index 00000000000..dbbd4ac48cf --- /dev/null +++ b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive1.bicep @@ -0,0 +1,15 @@ +@secure() +param adminPassword string = 'HardcodedPassword' +param adminLogin string +param sqlServerName string + +resource sqlServer 'Microsoft.Sql/servers@2015-05-01-preview' = { + name: sqlServerName + location: resourceGroup().location + tags: {} + properties: { + administratorLogin: adminLogin + administratorLoginPassword: adminPassword + version: '12.0' + } +} diff --git a/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive2.bicep b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive2.bicep new file mode 100644 index 00000000000..dbbd4ac48cf --- /dev/null +++ b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive2.bicep @@ -0,0 +1,15 @@ +@secure() +param adminPassword string = 'HardcodedPassword' +param adminLogin string +param sqlServerName string + +resource sqlServer 'Microsoft.Sql/servers@2015-05-01-preview' = { + name: sqlServerName + location: resourceGroup().location + tags: {} + properties: { + administratorLogin: adminLogin + administratorLoginPassword: adminPassword + version: '12.0' + } +} diff --git a/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive_expected_result.json b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive_expected_result.json index 8ee8524f96f..66a1cf66b62 100644 --- a/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/hardcoded_securestring_parameter_default_value/test/positive_expected_result.json @@ -10,5 +10,17 @@ "severity": "HIGH", "line": 9, "fileName": "positive2.json" + }, + { + "queryName": "Hardcoded SecureString Parameter Default Value", + "severity": "HIGH", + "line": 2, + "fileName": "positive1.bicep" + }, + { + "queryName": "Hardcoded SecureString Parameter Default Value", + "severity": "HIGH", + "line": 2, + "fileName": "positive2.bicep" } ] \ No newline at end of file From 753fd54b5284d1d7b299b79b4b8c4ae40316e4e7 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 22 Apr 2024 17:44:13 +0100 Subject: [PATCH 064/130] added bicep tests for app service authentication not set query --- .../test/negative1.bicep | 35 ++++++++++++++ .../test/negative2.bicep | 35 ++++++++++++++ .../test/negative3.bicep | 35 ++++++++++++++ .../test/negative4.bicep | 35 ++++++++++++++ .../test/positive1.bicep | 35 ++++++++++++++ .../test/positive2.bicep | 35 ++++++++++++++ .../test/positive3.bicep | 35 ++++++++++++++ .../test/positive4.bicep | 35 ++++++++++++++ .../test/positive5.bicep | 35 ++++++++++++++ .../test/positive6.bicep | 35 ++++++++++++++ .../test/positive7.bicep | 35 ++++++++++++++ .../test/positive8.bicep | 35 ++++++++++++++ .../test/positive_expected_result.json | 48 +++++++++++++++++++ 13 files changed, 468 insertions(+) create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive7.bicep create mode 100644 assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive8.bicep diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative1.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative1.bicep new file mode 100644 index 00000000000..09fe9eba4eb --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative1.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + enabled: true + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative2.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative2.bicep new file mode 100644 index 00000000000..09fe9eba4eb --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative2.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + enabled: true + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative3.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative3.bicep new file mode 100644 index 00000000000..09fe9eba4eb --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative3.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + enabled: true + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative4.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative4.bicep new file mode 100644 index 00000000000..09fe9eba4eb --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/negative4.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + enabled: true + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive1.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive1.bicep new file mode 100644 index 00000000000..3c7a2884f6d --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive1.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + enabled: false + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive2.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive2.bicep new file mode 100644 index 00000000000..9df4a4ca82f --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive2.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + alwaysOn: true + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive3.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive3.bicep new file mode 100644 index 00000000000..3c7a2884f6d --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive3.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + enabled: false + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive4.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive4.bicep new file mode 100644 index 00000000000..9fcdbd767f9 --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive4.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + alwaysOn: false + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive5.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive5.bicep new file mode 100644 index 00000000000..3c7a2884f6d --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive5.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + enabled: false + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive6.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive6.bicep new file mode 100644 index 00000000000..9df4a4ca82f --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive6.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + alwaysOn: true + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive7.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive7.bicep new file mode 100644 index 00000000000..3c7a2884f6d --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive7.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + enabled: false + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive8.bicep b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive8.bicep new file mode 100644 index 00000000000..9fcdbd767f9 --- /dev/null +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive8.bicep @@ -0,0 +1,35 @@ +resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = { + name: 'appServicePlan1' + location: resourceGroup().location + sku: { + name: 'F1' + capacity: 1 + } + tags: { + displayName: 'appServicePlan1' + } + properties: { + name: 'appServicePlan1' + } +} + +resource webApp1 'Microsoft.Web/sites@2020-12-01' = { + name: 'webApp1' + location: resourceGroup().location + tags: { + 'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource' + displayName: 'webApp1' + } + properties: { + name: 'webApp1' + serverFarmId: appServicePlan1.id + } +} + +resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = { + parent: webApp1 + name: 'authsettings' + properties: { + alwaysOn: false + } +} diff --git a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive_expected_result.json b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive_expected_result.json index 62411c91ec7..d3571dede33 100644 --- a/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/app_service_authentication_not_set/test/positive_expected_result.json @@ -46,5 +46,53 @@ "severity": "MEDIUM", "line": 42, "fileName": "positive8.json" + }, + { + "queryName": "App Service Authentication Is Not Set", + "severity": "MEDIUM", + "line": 33, + "fileName": "positive1.bicep" + }, + { + "queryName": "App Service Authentication Is Not Set", + "severity": "MEDIUM", + "line": 31, + "fileName": "positive2.bicep" + }, + { + "queryName": "App Service Authentication Is Not Set", + "severity": "MEDIUM", + "line": 33, + "fileName": "positive3.bicep" + }, + { + "queryName": "App Service Authentication Is Not Set", + "severity": "MEDIUM", + "line": 31, + "fileName": "positive4.bicep" + }, + { + "queryName": "App Service Authentication Is Not Set", + "severity": "MEDIUM", + "line": 33, + "fileName": "positive5.bicep" + }, + { + "queryName": "App Service Authentication Is Not Set", + "severity": "MEDIUM", + "line": 31, + "fileName": "positive6.bicep" + }, + { + "queryName": "App Service Authentication Is Not Set", + "severity": "MEDIUM", + "line": 33, + "fileName": "positive7.bicep" + }, + { + "queryName": "App Service Authentication Is Not Set", + "severity": "MEDIUM", + "line": 31, + "fileName": "positive8.bicep" } ] \ No newline at end of file From 4ddedfb5a5b475c88501f6ca71e9be42ad9c1fa2 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 24 Apr 2024 11:09:52 +0100 Subject: [PATCH 065/130] updated bicep tests for default storage account too permissive query --- .../test/negative1.bicep | 3 ++- .../test/positive1.bicep | 3 ++- .../test/positive2.bicep | 3 ++- .../test/positive3.bicep | 3 ++- .../test/positive_expected_result.json | 6 +++--- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative1.bicep b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative1.bicep index 22b202e3202..ae76d77701c 100644 --- a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative1.bicep +++ b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/negative1.bicep @@ -1,8 +1,9 @@ param supportLogStorageAccountType string +param storageApiVersion string = '2021-06-01' var computeLocation = 'comloc' -resource negative1 'Microsoft.Storage/storageAccounts@2021-06-01' = { +resource negative1 'Microsoft.Storage/storageAccounts@storageApiVersion' = { kind: 'Storage' location: computeLocation name: 'negative1' diff --git a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive1.bicep b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive1.bicep index b659a1ed1f9..8672c796698 100644 --- a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive1.bicep +++ b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive1.bicep @@ -1,8 +1,9 @@ param supportLogStorageAccountType string +param storageApiVersion string = '2021-06-01' var computeLocation = 'comloc' -resource positive1 'Microsoft.Storage/storageAccounts@2021-06-01' = { +resource positive1 'Microsoft.Storage/storageAccounts@storageApiVersion' = { kind: 'Storage' location: computeLocation name: 'positive1' diff --git a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive2.bicep b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive2.bicep index 62f05f7d4a0..7c18a5d9b82 100644 --- a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive2.bicep +++ b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive2.bicep @@ -1,8 +1,9 @@ param supportLogStorageAccountType string +param storageApiVersion string = '2021-06-01' var computeLocation = 'comloc' -resource positive2 'Microsoft.Storage/storageAccounts@2021-06-01' = { +resource positive2 'Microsoft.Storage/storageAccounts@storageApiVersion' = { kind: 'Storage' location: computeLocation name: 'positive2' diff --git a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive3.bicep b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive3.bicep index 41449b9c03e..0b2da297940 100644 --- a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive3.bicep +++ b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive3.bicep @@ -1,8 +1,9 @@ param supportLogStorageAccountType string +param storageApiVersion string = '2021-06-01' var computeLocation = 'comloc' -resource positive3 'Microsoft.Storage/storageAccounts@2021-06-01' = { +resource positive3 'Microsoft.Storage/storageAccounts@storageApiVersion' = { kind: 'Storage' location: computeLocation name: 'positive3' diff --git a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive_expected_result.json b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive_expected_result.json index 54b3560d6a7..51ce6bdf54a 100644 --- a/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/default_azure_storage_account_network_access_is_too_permissive/test/positive_expected_result.json @@ -20,19 +20,19 @@ { "queryName": "Default Azure Storage Account Network Access Is Too Permissive", "severity": "HIGH", - "line": 11, + "line": 12, "fileName": "positive1.bicep" }, { "queryName": "Default Azure Storage Account Network Access Is Too Permissive", "severity": "HIGH", - "line": 9, + "line": 10, "fileName": "positive2.bicep" }, { "queryName": "Default Azure Storage Account Network Access Is Too Permissive", "severity": "HIGH", - "line": 10, + "line": 11, "fileName": "positive3.bicep" } ] \ No newline at end of file From 360b9faa4d9c00d661850f362488a6035dc1c665 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 24 Apr 2024 14:34:59 +0100 Subject: [PATCH 066/130] fixed unit tests for resources --- pkg/parser/bicep/parser_test.go | 912 ++++++++++++++++---------------- 1 file changed, 457 insertions(+), 455 deletions(-) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 4522df3c373..5921f8ed7c9 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -108,109 +108,109 @@ func TestParseBicepFile(t *testing.T) { name: "Parse Bicep file with parameters", filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "parameters.bicep"), want: `{ - "parameters": { - "array": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 17 + "parameters": { + "array": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 17 + }, + "_kics_type": { + "_kics_line": 17 + } }, - "_kics_type": { - "_kics_line": 17 - } + "defaultValue": [ + "string" + ], + "type": "string" }, - "defaultValue": [ - "string" - ], - "type": "string" - }, - "isNumber": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 9 + "isNumber": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 9 + }, + "_kics_type": { + "_kics_line": 9 + } }, - "_kics_type": { - "_kics_line": 9 - } - }, - "defaultValue": true, - "metadata": { - "description": "This is a test bool param declaration." - }, - "type": "bool" - }, - "middleString": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 12 + "defaultValue": true, + "metadata": { + "description": "This is a test bool param declaration." }, - "_kics_type": { - "_kics_line": 12 - } - }, - "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'", - "metadata": { - "description": "This is a test middle string param declaration." + "type": "bool" }, - "type": "string" - }, - "null": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 19 + "middleString": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 12 + }, + "_kics_type": { + "_kics_line": 12 + } }, - "_kics_type": { - "_kics_line": 19 - } - }, - "defaultValue": null, - "type": "string" - }, - "numberNodes": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 6 + "defaultValue": "'teste-${parameters('numberNodes')}${parameters('isNumber')}-teste'", + "metadata": { + "description": "This is a test middle string param declaration." }, - "_kics_type": { - "_kics_line": 6 - } + "type": "string" }, - "defaultValue": 2, - "metadata": { - "description": "This is a test int param declaration." - }, - "type": "int" - }, - "projectName": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 3 + "null": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 19 + }, + "_kics_type": { + "_kics_line": 19 + } }, - "_kics_type": { - "_kics_line": 3 - } + "defaultValue": null, + "type": "string" }, - "defaultValue": "[newGuid()]", - "metadata": { - "description": "This is a test param with secure declaration." + "numberNodes": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 6 + }, + "_kics_type": { + "_kics_line": 6 + } + }, + "defaultValue": 2, + "metadata": { + "description": "This is a test int param declaration." + }, + "type": "int" }, - "type": "secureString" - }, - "secObj": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 15 + "projectName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 3 + }, + "_kics_type": { + "_kics_line": 3 + } }, - "_kics_type": { - "_kics_line": 15 - } + "defaultValue": "[newGuid()]", + "metadata": { + "description": "This is a test param with secure declaration." + }, + "type": "secureString" }, - "defaultValue": false, - "type": "secureObject" - } - }, - "resources": [], - "variables": {} - }`, + "secObj": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 15 + }, + "_kics_type": { + "_kics_line": 15 + } + }, + "defaultValue": false, + "type": "secureObject" + } + }, + "resources": [], + "variables": {} + }`, wantErr: false, }, { @@ -240,453 +240,455 @@ func TestParseBicepFile(t *testing.T) { name: "Parse completed Bicep file", filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "resources.bicep"), want: `{ - "parameters": { - "OSVersion": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 34 - }, - "_kics_type": { - "_kics_line": 34 - } - }, - "allowedValues": [ - [ - "2008-R2-SP1", - "2012-Datacenter", - "2012-R2-Datacenter", - "2016-Nano-Server", - "2016-Datacenter-with-Containers", - "2016-Datacenter", - "2019-Datacenter", - "2019-Datacenter-Core", - "2019-Datacenter-Core-smalldisk", - "2019-Datacenter-Core-with-Containers", - "2019-Datacenter-Core-with-Containers-smalldisk", - "2019-Datacenter-smalldisk", - "2019-Datacenter-with-Containers", - "2019-Datacenter-with-Containers-smalldisk" - ] - ], - "defaultValue": "2019-Datacenter", - "metadata": { - "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version." - }, - "type": "string" - }, - "adminPassword": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 9 + "parameters": { + "OSVersion": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 34 + }, + "_kics_type": { + "_kics_line": 34 + } }, - "_kics_type": { - "_kics_line": 9 - } - }, - "metadata": { - "description": "Password for the Virtual Machine." - }, - "minLength": 12, - "type": "secureString" - }, - "adminUsername": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 4 + "allowedValues": [ + [ + "2008-R2-SP1", + "2012-Datacenter", + "2012-R2-Datacenter", + "2016-Nano-Server", + "2016-Datacenter-with-Containers", + "2016-Datacenter", + "2019-Datacenter", + "2019-Datacenter-Core", + "2019-Datacenter-Core-smalldisk", + "2019-Datacenter-Core-with-Containers", + "2019-Datacenter-Core-with-Containers-smalldisk", + "2019-Datacenter-smalldisk", + "2019-Datacenter-with-Containers", + "2019-Datacenter-with-Containers-smalldisk" + ] + ], + "defaultValue": "2019-Datacenter", + "metadata": { + "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version." }, - "_kics_type": { - "_kics_line": 4 - } + "type": "string" }, - "metadata": { - "description": "Username for the Virtual Machine." - }, - "type": "string" - }, - "location": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 40 + "adminPassword": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 9 + }, + "_kics_type": { + "_kics_line": 9 + } }, - "_kics_type": { - "_kics_line": 40 - } - }, - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - }, - "type": "string" - }, - "parenthesis": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 45 + "metadata": { + "description": "Password for the Virtual Machine." }, - "_kics_type": { - "_kics_line": 45 - } + "minLength": 12, + "type": "secureString" }, - "defaultValue": "simple-vm", - "type": "string" - }, - "vmName": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 43 + "adminUsername": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 4 + }, + "_kics_type": { + "_kics_line": 4 + } }, - "_kics_type": { - "_kics_line": 43 - } - }, - "defaultValue": "simple-vm", - "metadata": { - "description": "Name of the virtual machine." - }, - "type": "string" - }, - "vmSize": { - "_kics_lines": { - "_kics_defaultValue": { - "_kics_line": 37 + "metadata": { + "description": "Username for the Virtual Machine." }, - "_kics_type": { - "_kics_line": 37 - } - }, - "defaultValue": "Standard_D2_v3", - "metadata": { - "description": "Size of the virtual machine." + "type": "string" }, - "type": "string" - } - }, - "resources": [ - { - "_kics_lines": { - "_kics__default": { - "_kics_line": 51 - }, - "_kics_apiVersion": { - "_kics_line": 50 + "location": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 40 + }, + "_kics_type": { + "_kics_line": 40 + } }, - "_kics_dependsOn": { - "_kics_arr": [ - { - "_kics__default": { - "_kics_line": 100 - } - } - ], - "_kics_line": 100 + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location for all resources." }, - "_kics_location": { - "_kics_line": 53 + "type": "string" + }, + "parenthesis": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 45 + }, + "_kics_type": { + "_kics_line": 45 + } }, - "_kics_name": { - "_kics_line": 52 + "defaultValue": "simple-vm", + "type": "string" + }, + "vmName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 43 + }, + "_kics_type": { + "_kics_line": 43 + } }, - "_kics_properties": { - "_kics_line": 54 + "defaultValue": "simple-vm", + "metadata": { + "description": "Name of the virtual machine." }, - "_kics_type": { - "_kics_line": 50 - } + "type": "string" }, - "apiVersion": "2021-03-01", - "dependsOn": [ - { - "resourceId": [ - "Microsoft.Network/networkInterfaces", - "variables('nicName')" - ] + "vmSize": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 37 + }, + "_kics_type": { + "_kics_line": 37 + } }, - { - "resourceId": [ - "Microsoft.Storage/storageAccounts", - "variables('storageAccountName')" - ] - } - ], - "identifier": "vm", - "location": "[parameters('location')]", - "metadata": { - "description": "This is a test description for resources" - }, - "name": "[parameters('vmName')]", - "properties": { + "defaultValue": "Standard_D2_v3", + "metadata": { + "description": "Size of the virtual machine." + }, + "type": "string" + } + }, + "resources": [ + { "_kics_lines": { "_kics__default": { - "_kics_line": 54 + "_kics_line": 51 }, - "_kics_diagnosticsProfile": { - "_kics_line": 91 + "_kics_apiVersion": { + "_kics_line": 50 + }, + "_kics_dependsOn": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 100 + } + } + ], + "_kics_line": 100 }, - "_kics_hardwareProfile": { - "_kics_line": 55 + "_kics_location": { + "_kics_line": 53 }, - "_kics_networkProfile": { - "_kics_line": 84 + "_kics_name": { + "_kics_line": 52 }, - "_kics_osProfile": { - "_kics_line": 58 + "_kics_properties": { + "_kics_line": 54 }, - "_kics_storageProfile": { - "_kics_line": 63 + "_kics_type": { + "_kics_line": 50 } }, - "diagnosticsProfile": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 91 - }, - "_kics_bootDiagnostics": { - "_kics_line": 92 - } + "apiVersion": "2021-03-01", + "dependsOn": [ + { + "resourceId": [ + "Microsoft.Network/networkInterfaces", + "variables('nicName')" + ] }, - "bootDiagnostics": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 92 - }, - "_kics_enabled": { - "_kics_line": 93 - }, - "_kics_storageUri": { - "_kics_line": 94 - } - }, - "enabled": true, - "storageUri": "[reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob]" + { + "resourceId": [ + "Microsoft.Storage/storageAccounts", + "variables('storageAccountName')" + ] } + ], + "identifier": "vm", + "location": "[parameters('location')]", + "metadata": { + "description": "This is a test description for resources" }, - "hardwareProfile": { + "name": "[parameters('vmName')]", + "properties": { "_kics_lines": { "_kics__default": { + "_kics_line": 54 + }, + "_kics_diagnosticsProfile": { + "_kics_line": 91 + }, + "_kics_hardwareProfile": { "_kics_line": 55 }, - "_kics_vmSize": { - "_kics_line": 56 - } - }, - "vmSize": "[parameters('vmSize')]" - }, - "networkProfile": { - "_kics_lines": { - "_kics__default": { + "_kics_networkProfile": { "_kics_line": 84 }, - "_kics_networkInterfaces": { - "_kics_arr": [ - { - "_kics__default": { - "_kics_line": 85 - } - } - ], - "_kics_line": 85 + "_kics_osProfile": { + "_kics_line": 58 + }, + "_kics_storageProfile": { + "_kics_line": 63 } }, - "networkInterfaces": [ - { + "diagnosticsProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 91 + }, + "_kics_bootDiagnostics": { + "_kics_line": 92 + } + }, + "bootDiagnostics": { "_kics_lines": { "_kics__default": { - "_kics_line": 86 + "_kics_line": 92 }, - "_kics_id": { - "_kics_line": 87 + "_kics_enabled": { + "_kics_line": 93 + }, + "_kics_storageUri": { + "_kics_line": 94 } }, - "id": { - "resourceId": [ - "Microsoft.Network/networkInterfaces", - "nick.variables('nicName')" - ] - } + "enabled": true, + "storageUri": "[reference(resourceId(Microsoft.Storage/storageAccounts, variables('storageAccountName'))).primaryEndpoints.blob]" } - ] - }, - "osProfile": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 58 - }, - "_kics_adminPassword": { - "_kics_line": 61 - }, - "_kics_adminUsername": { - "_kics_line": 60 + }, + "hardwareProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 55 + }, + "_kics_vmSize": { + "_kics_line": 56 + } }, - "_kics_computerName": { - "_kics_line": 59 - } + "vmSize": "[parameters('vmSize')]" }, - "adminPassword": "[parameters('adminPassword')]", - "adminUsername": "[parameters('adminUsername')]", - "computerName": "[computer.parameters('vmName')]" - }, - "storageProfile": { - "_kics_lines": { - "_kics__default": { - "_kics_line": 63 + "networkProfile": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 84 + }, + "_kics_networkInterfaces": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 85 + } + } + ], + "_kics_line": 85 + } }, - "_kics_dataDisks": { - "_kics_arr": [ - { + "networkInterfaces": [ + { + "_kics_lines": { "_kics__default": { - "_kics_line": 76 + "_kics_line": 86 + }, + "_kics_id": { + "_kics_line": 87 } - } - ], - "_kics_line": 76 - }, - "_kics_imageReference": { - "_kics_line": 64 - }, - "_kics_osDisk": { - "_kics_line": 70 - } - }, - "dataDisks": [ - { - "_kics_lines": { - "_kics__default": { - "_kics_line": 77 }, - "_kics_createOption": { - "_kics_line": 80 - }, - "_kics_diskSizeGB": { - "_kics_line": 78 - }, - "_kics_lun": { - "_kics_line": 79 + "id": { + "resourceId": [ + "Microsoft.Network/networkInterfaces", + "nick.variables('nicName')" + ] } - }, - "createOption": "Empty", - "diskSizeGB": 1023, - "lun": 0 - } - ], - "imageReference": { + } + ] + }, + "osProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 64 + "_kics_line": 58 }, - "_kics_offer": { - "_kics_line": 66 + "_kics_adminPassword": { + "_kics_line": 61 }, - "_kics_publisher": { - "_kics_line": 65 + "_kics_adminUsername": { + "_kics_line": 60 }, - "_kics_sku": { - "_kics_line": 67 - }, - "_kics_version": { - "_kics_line": 68 + "_kics_computerName": { + "_kics_line": 59 } }, - "offer": "WindowsServer", - "publisher": "MicrosoftWindowsServer", - "sku": "[parameters('OSVersion')]", - "version": "latest" + "adminPassword": "[parameters('adminPassword')]", + "adminUsername": "[parameters('adminUsername')]", + "computerName": "[computer.parameters('vmName')]" }, - "osDisk": { + "storageProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 70 + "_kics_line": 63 + }, + "_kics_dataDisks": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 76 + } + } + ], + "_kics_line": 76 }, - "_kics_createOption": { - "_kics_line": 71 + "_kics_imageReference": { + "_kics_line": 64 }, - "_kics_managedDisk": { - "_kics_line": 72 + "_kics_osDisk": { + "_kics_line": 70 } }, - "createOption": "FromImage", - "managedDisk": { + "dataDisks": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 77 + }, + "_kics_createOption": { + "_kics_line": 80 + }, + "_kics_diskSizeGB": { + "_kics_line": 78 + }, + "_kics_lun": { + "_kics_line": 79 + } + }, + "createOption": "Empty", + "diskSizeGB": 1023, + "lun": 0 + } + ], + "imageReference": { "_kics_lines": { "_kics__default": { - "_kics_line": 72 + "_kics_line": 64 + }, + "_kics_offer": { + "_kics_line": 66 + }, + "_kics_publisher": { + "_kics_line": 65 + }, + "_kics_sku": { + "_kics_line": 67 + }, + "_kics_version": { + "_kics_line": 68 + } + }, + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "[parameters('OSVersion')]", + "version": "latest" + }, + "osDisk": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 70 + }, + "_kics_createOption": { + "_kics_line": 71 }, - "_kics_storageAccountType": { - "_kics_line": 73 + "_kics_managedDisk": { + "_kics_line": 72 } }, - "storageAccountType": "StandardSSD_LRS" + "createOption": "FromImage", + "managedDisk": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 72 + }, + "_kics_storageAccountType": { + "_kics_line": 73 + } + }, + "storageAccountType": "StandardSSD_LRS" + } } } - } - }, - "type": "Microsoft.Compute/virtualMachines" - }, - { - "_kics_lines": { - "_kics__default": { - "_kics_line": 106 }, - "_kics_apiVersion": { - "_kics_line": 106 + "resources": [], + "type": "Microsoft.Compute/virtualMachines" + }, + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 106 + }, + "_kics_apiVersion": { + "_kics_line": 106 + }, + "_kics_assignableScopes": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 116 + } + } + ], + "_kics_line": 116 + }, + "_kics_location": { + "_kics_line": 108 + }, + "_kics_name": { + "_kics_line": 107 + }, + "_kics_type": { + "_kics_line": 106 + }, + "_kics_userAssignedIdentities": { + "_kics_line": 113 + } }, - "_kics_assignableScopes": { - "_kics_arr": [ - { + "apiVersion": "2021-03-01", + "assignableScopes": [ + "[subscription().id]" + ], + "identifier": "nic", + "location": null, + "name": "", + "resources": [], + "type": "Microsoft.Network/networkInterfaces", + "userAssignedIdentities": { + "'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { + "_kics_lines": { "_kics__default": { - "_kics_line": 116 + "_kics_line": 114 } } - ], - "_kics_line": 116 - }, - "_kics_location": { - "_kics_line": 108 - }, - "_kics_name": { - "_kics_line": 107 - }, - "_kics_type": { - "_kics_line": 106 - }, - "_kics_userAssignedIdentities": { - "_kics_line": 113 - } - }, - "apiVersion": "2021-03-01", - "assignableScopes": [ - "[subscription().id]" - ], - "identifier": "nic", - "location": null, - "name": "", - "type": "Microsoft.Network/networkInterfaces", - "userAssignedIdentities": { - "'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { + }, "_kics_lines": { - "_kics__default": { + "_kics_'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { "_kics_line": 114 + }, + "_kics__default": { + "_kics_line": 113 } } - }, - "_kics_lines": { - "_kics_'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { - "_kics_line": 114 - }, - "_kics__default": { - "_kics_line": 113 - } } } + ], + "variables": { + "nicName": { + "value": "myVMNic" + }, + "storageAccountName": { + "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" + } } - ], - "variables": { - "nicName": { - "value": "myVMNic" - }, - "storageAccountName": { - "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" - } - } - }`, + }`, wantErr: false, }, } From 60aa2a7f1e8217c2b6e8b24d268cb11ed5b04351 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Tue, 30 Apr 2024 11:49:32 +0100 Subject: [PATCH 067/130] added disable secrets disclaimer to docs --- docs/future_improvements.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/future_improvements.md b/docs/future_improvements.md index bba4510d51e..204a9343ebb 100644 --- a/docs/future_improvements.md +++ b/docs/future_improvements.md @@ -20,9 +20,11 @@ KICS does not currently support the analysis of modules within Bicep files. Due Due to the nature of regex-based pattern matching, the passwords and secrets query may generate false positives when applied to Bicep files. Bicep files have a different syntax and structure compared to other file formats which can affect the accuracy of the query. -To mitigate the potential for false positives and ensure a more accurate scanning process for Bicep files, we recommend users consider disabling the passwords and secrets query when scanning Bicep files. This can be achieved by using the "--disable-secrets" flag. +To avoid potential false positives and improve the accuracy of scans when working with Bicep files, we recommend users consider disabling the passwords and secrets query. This can be done by using the "--disable-secrets" flag. -Note: Disabling the passwords and secrets query may reduce the overall coverage of security checks performed by KICS. Therefore, users should consider the trade-offs and implications based on their specific use case and security requirements. More information about this query can be found on the [Password and Secrets documentation](https://github.com/Checkmarx/kics/blob/master/docs/secrets.md). +**Note**: When using the "--disable-secrets" flag, be aware that this will disable the passwords and secrets query for all languages, not just Bicep files. As a result, you may miss some security checks in other files. Before using this flag, carefully consider the impact on your overall security coverage, especially if your project includes multiple languages or file types. + +We advise reviewing your project's specific security needs to determine if this flag is appropriate. More information about the passwords and secrets query is available in our [Password and Secrets documentation](https://github.com/Checkmarx/kics/blob/master/docs/secrets.md). --- From 577cd099a35b5f75b0ff1257987f0c5e4e48e2d1 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Tue, 30 Apr 2024 11:59:08 +0100 Subject: [PATCH 068/130] fix unit tests for bicep completed file --- pkg/parser/bicep/parser_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 5921f8ed7c9..2a005be4aa2 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -618,7 +618,6 @@ func TestParseBicepFile(t *testing.T) { } } }, - "resources": [], "type": "Microsoft.Compute/virtualMachines" }, { @@ -659,7 +658,6 @@ func TestParseBicepFile(t *testing.T) { "identifier": "nic", "location": null, "name": "", - "resources": [], "type": "Microsoft.Network/networkInterfaces", "userAssignedIdentities": { "'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { From f50ffd7756c46d007eedc86adadc1988e3caac77 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 30 Apr 2024 12:22:03 +0100 Subject: [PATCH 069/130] added test files for postgres1 --- .../test/negative1.bicep | 38 +++++++++++++++++++ .../test/negative2.bicep | 38 +++++++++++++++++++ .../test/negative3.bicep | 38 +++++++++++++++++++ .../test/negative4.bicep | 38 +++++++++++++++++++ .../test/positive1.bicep | 38 +++++++++++++++++++ .../test/positive2.bicep | 30 +++++++++++++++ .../test/positive3.bicep | 38 +++++++++++++++++++ .../test/positive4.bicep | 38 +++++++++++++++++++ .../test/positive5.bicep | 30 +++++++++++++++ .../test/positive6.bicep | 38 +++++++++++++++++++ .../test/positive_expected_result.json | 36 ++++++++++++++++++ 11 files changed, 400 insertions(+) create mode 100644 assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive6.bicep diff --git a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative1.bicep new file mode 100644 index 00000000000..cba1be8698b --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative1.bicep @@ -0,0 +1,38 @@ +resource servers1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + name: 'servers1' + identity: { + type: 'SystemAssigned' + } + sku: { + name: 'B_Gen4_1' + tier: 'Basic' + capacity: 500 + size: '500MB' + family: 'family' + } + properties: { + version: '11' + sslEnforcement: 'Enabled' + minimalTlsVersion: 'TLS1_2' + infrastructureEncryption: 'Enabled' + publicNetworkAccess: 'Disabled' + storageProfile: { + backupRetentionDays: 90 + geoRedundantBackup: 'Enabled' + storageMB: 50 + storageAutogrow: 'Enabled' + } + createMode: 'Replica' + sourceServerId: 'sample_id' + } + location: 'string' + tags: {} +} + +resource servers1_connection_throttling 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: servers1 + name: 'connection_throttling' + properties: { + value: 'On' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative2.bicep new file mode 100644 index 00000000000..cba1be8698b --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative2.bicep @@ -0,0 +1,38 @@ +resource servers1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + name: 'servers1' + identity: { + type: 'SystemAssigned' + } + sku: { + name: 'B_Gen4_1' + tier: 'Basic' + capacity: 500 + size: '500MB' + family: 'family' + } + properties: { + version: '11' + sslEnforcement: 'Enabled' + minimalTlsVersion: 'TLS1_2' + infrastructureEncryption: 'Enabled' + publicNetworkAccess: 'Disabled' + storageProfile: { + backupRetentionDays: 90 + geoRedundantBackup: 'Enabled' + storageMB: 50 + storageAutogrow: 'Enabled' + } + createMode: 'Replica' + sourceServerId: 'sample_id' + } + location: 'string' + tags: {} +} + +resource servers1_connection_throttling 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: servers1 + name: 'connection_throttling' + properties: { + value: 'On' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative3.bicep b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative3.bicep new file mode 100644 index 00000000000..cba1be8698b --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative3.bicep @@ -0,0 +1,38 @@ +resource servers1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + name: 'servers1' + identity: { + type: 'SystemAssigned' + } + sku: { + name: 'B_Gen4_1' + tier: 'Basic' + capacity: 500 + size: '500MB' + family: 'family' + } + properties: { + version: '11' + sslEnforcement: 'Enabled' + minimalTlsVersion: 'TLS1_2' + infrastructureEncryption: 'Enabled' + publicNetworkAccess: 'Disabled' + storageProfile: { + backupRetentionDays: 90 + geoRedundantBackup: 'Enabled' + storageMB: 50 + storageAutogrow: 'Enabled' + } + createMode: 'Replica' + sourceServerId: 'sample_id' + } + location: 'string' + tags: {} +} + +resource servers1_connection_throttling 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: servers1 + name: 'connection_throttling' + properties: { + value: 'On' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative4.bicep b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative4.bicep new file mode 100644 index 00000000000..cba1be8698b --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/negative4.bicep @@ -0,0 +1,38 @@ +resource servers1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + name: 'servers1' + identity: { + type: 'SystemAssigned' + } + sku: { + name: 'B_Gen4_1' + tier: 'Basic' + capacity: 500 + size: '500MB' + family: 'family' + } + properties: { + version: '11' + sslEnforcement: 'Enabled' + minimalTlsVersion: 'TLS1_2' + infrastructureEncryption: 'Enabled' + publicNetworkAccess: 'Disabled' + storageProfile: { + backupRetentionDays: 90 + geoRedundantBackup: 'Enabled' + storageMB: 50 + storageAutogrow: 'Enabled' + } + createMode: 'Replica' + sourceServerId: 'sample_id' + } + location: 'string' + tags: {} +} + +resource servers1_connection_throttling 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: servers1 + name: 'connection_throttling' + properties: { + value: 'On' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive1.bicep new file mode 100644 index 00000000000..bcb6d9b23f9 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive1.bicep @@ -0,0 +1,38 @@ +resource servers1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + name: 'servers1' + identity: { + type: 'SystemAssigned' + } + sku: { + name: 'B_Gen4_1' + tier: 'Basic' + capacity: 500 + size: '500MB' + family: 'family' + } + properties: { + version: '11' + sslEnforcement: 'Enabled' + minimalTlsVersion: 'TLS1_2' + infrastructureEncryption: 'Enabled' + publicNetworkAccess: 'Disabled' + storageProfile: { + backupRetentionDays: 90 + geoRedundantBackup: 'Enabled' + storageMB: 50 + storageAutogrow: 'Enabled' + } + createMode: 'Replica' + sourceServerId: 'sample_id' + } + location: 'string' + tags: {} +} + +resource servers1_connection_throttling 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: servers1 + name: 'connection_throttling' + properties: { + value: 'Off' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive2.bicep new file mode 100644 index 00000000000..7a3c82cc54b --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive2.bicep @@ -0,0 +1,30 @@ +resource servers1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + name: 'servers1' + identity: { + type: 'SystemAssigned' + } + sku: { + name: 'B_Gen4_1' + tier: 'Basic' + capacity: 500 + size: '500MB' + family: 'family' + } + properties: { + version: '11' + sslEnforcement: 'Enabled' + minimalTlsVersion: 'TLS1_2' + infrastructureEncryption: 'Enabled' + publicNetworkAccess: 'Disabled' + storageProfile: { + backupRetentionDays: 90 + geoRedundantBackup: 'Enabled' + storageMB: 50 + storageAutogrow: 'Enabled' + } + createMode: 'Replica' + sourceServerId: 'sample_id' + } + location: 'string' + tags: {} +} diff --git a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive3.bicep new file mode 100644 index 00000000000..8629a9b9536 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive3.bicep @@ -0,0 +1,38 @@ +resource servers1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + name: 'servers1' + identity: { + type: 'SystemAssigned' + } + sku: { + name: 'B_Gen4_1' + tier: 'Basic' + capacity: 500 + size: '500MB' + family: 'family' + } + properties: { + version: '11' + sslEnforcement: 'Enabled' + minimalTlsVersion: 'TLS1_2' + infrastructureEncryption: 'Enabled' + publicNetworkAccess: 'Disabled' + storageProfile: { + backupRetentionDays: 90 + geoRedundantBackup: 'Enabled' + storageMB: 50 + storageAutogrow: 'Enabled' + } + createMode: 'Replica' + sourceServerId: 'sample_id' + } + location: 'string' + tags: {} +} + +resource servers1_sample_config 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: servers1 + name: 'sample_config' + properties: { + value: 'Off' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive4.bicep new file mode 100644 index 00000000000..bcb6d9b23f9 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive4.bicep @@ -0,0 +1,38 @@ +resource servers1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + name: 'servers1' + identity: { + type: 'SystemAssigned' + } + sku: { + name: 'B_Gen4_1' + tier: 'Basic' + capacity: 500 + size: '500MB' + family: 'family' + } + properties: { + version: '11' + sslEnforcement: 'Enabled' + minimalTlsVersion: 'TLS1_2' + infrastructureEncryption: 'Enabled' + publicNetworkAccess: 'Disabled' + storageProfile: { + backupRetentionDays: 90 + geoRedundantBackup: 'Enabled' + storageMB: 50 + storageAutogrow: 'Enabled' + } + createMode: 'Replica' + sourceServerId: 'sample_id' + } + location: 'string' + tags: {} +} + +resource servers1_connection_throttling 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: servers1 + name: 'connection_throttling' + properties: { + value: 'Off' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive5.bicep b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive5.bicep new file mode 100644 index 00000000000..7a3c82cc54b --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive5.bicep @@ -0,0 +1,30 @@ +resource servers1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + name: 'servers1' + identity: { + type: 'SystemAssigned' + } + sku: { + name: 'B_Gen4_1' + tier: 'Basic' + capacity: 500 + size: '500MB' + family: 'family' + } + properties: { + version: '11' + sslEnforcement: 'Enabled' + minimalTlsVersion: 'TLS1_2' + infrastructureEncryption: 'Enabled' + publicNetworkAccess: 'Disabled' + storageProfile: { + backupRetentionDays: 90 + geoRedundantBackup: 'Enabled' + storageMB: 50 + storageAutogrow: 'Enabled' + } + createMode: 'Replica' + sourceServerId: 'sample_id' + } + location: 'string' + tags: {} +} diff --git a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive6.bicep b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive6.bicep new file mode 100644 index 00000000000..8629a9b9536 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive6.bicep @@ -0,0 +1,38 @@ +resource servers1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + name: 'servers1' + identity: { + type: 'SystemAssigned' + } + sku: { + name: 'B_Gen4_1' + tier: 'Basic' + capacity: 500 + size: '500MB' + family: 'family' + } + properties: { + version: '11' + sslEnforcement: 'Enabled' + minimalTlsVersion: 'TLS1_2' + infrastructureEncryption: 'Enabled' + publicNetworkAccess: 'Disabled' + storageProfile: { + backupRetentionDays: 90 + geoRedundantBackup: 'Enabled' + storageMB: 50 + storageAutogrow: 'Enabled' + } + createMode: 'Replica' + sourceServerId: 'sample_id' + } + location: 'string' + tags: {} +} + +resource servers1_sample_config 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: servers1 + name: 'sample_config' + properties: { + value: 'Off' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive_expected_result.json index 695cc730245..b27316cd0d4 100644 --- a/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/postgres_sql_database_server_connection_throttling_disabled/test/positive_expected_result.json @@ -34,5 +34,41 @@ "severity": "MEDIUM", "line": 11, "fileName": "positive6.json" + }, + { + "queryName": "PostgresSQL Database Server Connection Throttling Disabled", + "severity": "MEDIUM", + "line": 36, + "fileName": "positive1.bicep" + }, + { + "queryName": "PostgresSQL Database Server Connection Throttling Disabled", + "severity": "MEDIUM", + "line": 2, + "fileName": "positive2.bicep" + }, + { + "queryName": "PostgresSQL Database Server Connection Throttling Disabled", + "severity": "MEDIUM", + "line": 2, + "fileName": "positive3.bicep" + }, + { + "queryName": "PostgresSQL Database Server Connection Throttling Disabled", + "severity": "MEDIUM", + "line": 36, + "fileName": "positive4.bicep" + }, + { + "queryName": "PostgresSQL Database Server Connection Throttling Disabled", + "severity": "MEDIUM", + "line": 2, + "fileName": "positive5.bicep" + }, + { + "queryName": "PostgresSQL Database Server Connection Throttling Disabled", + "severity": "MEDIUM", + "line": 2, + "fileName": "positive6.bicep" } ] From 60220081d90c2ef2f4a15d77ffa08e4b5f98996f Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 30 Apr 2024 14:19:28 +0100 Subject: [PATCH 070/130] added test files for postgres2 --- .../test/negative1.bicep | 45 ++++++++++ .../test/negative2.bicep | 45 ++++++++++ .../test/positive1.bicep | 89 +++++++++++++++++++ .../test/positive2.bicep | 37 ++++++++ .../test/positive3.bicep | 36 ++++++++ .../test/positive4.bicep | 36 ++++++++ .../test/positive5.bicep | 89 +++++++++++++++++++ .../test/positive6.bicep | 37 ++++++++ .../test/positive7.bicep | 36 ++++++++ .../test/positive8.bicep | 36 ++++++++ .../test/positive_expected_result.json | 50 ++++++++++- 11 files changed, 535 insertions(+), 1 deletion(-) create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive7.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive8.bicep diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/negative1.bicep new file mode 100644 index 00000000000..25d91d13f3a --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/negative1.bicep @@ -0,0 +1,45 @@ +param databaseSkuName string +param databaseSkuTier string +param databaseDTU string +param databaseSkuSizeMB string + +resource MyDBServerNeg1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServerNeg1' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: databaseSkuName + tier: databaseSkuTier + capacity: databaseDTU + size: databaseSkuSizeMB + family: 'SkuFamily' + } +} + +resource MyDBServerNeg1_log_checkpoints 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServerNeg1 + name: 'log_checkpoints' + properties: { + value: 'on' + } + location: resourceGroup().location + dependsOn: [ + 'Microsoft.DBforPostgreSQL/servers/MyDBServer' + ] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/negative2.bicep new file mode 100644 index 00000000000..25d91d13f3a --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/negative2.bicep @@ -0,0 +1,45 @@ +param databaseSkuName string +param databaseSkuTier string +param databaseDTU string +param databaseSkuSizeMB string + +resource MyDBServerNeg1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServerNeg1' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: databaseSkuName + tier: databaseSkuTier + capacity: databaseDTU + size: databaseSkuSizeMB + family: 'SkuFamily' + } +} + +resource MyDBServerNeg1_log_checkpoints 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServerNeg1 + name: 'log_checkpoints' + properties: { + value: 'on' + } + location: resourceGroup().location + dependsOn: [ + 'Microsoft.DBforPostgreSQL/servers/MyDBServer' + ] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive1.bicep new file mode 100644 index 00000000000..c69776cb159 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive1.bicep @@ -0,0 +1,89 @@ +param dataDirectory string +param maxSizeMB string +param minSizeMB string +param pageSizeMB string +param workMemMB string +param maintenanceMemMB string +param checkpointSegments string +param checkpointCompletionTarget string + +resource MyDBServer1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer1' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer1_log_checkpoints 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServer1 + name: 'log_checkpoints' + properties: { + configurationSets: [ + { + configurationSetType: 'Microsoft.DBforPostgreSQL/servers/configurations/dbconfig' + configurationSet: { + name: 'dbconfig' + configurationParameters: [ + { + name: 'data_directory' + value: dataDirectory + } + { + name: 'max_size' + value: maxSizeMB + } + { + name: 'min_size' + value: minSizeMB + } + { + name: 'page_size' + value: pageSizeMB + } + { + name: 'work_mem' + value: workMemMB + } + { + name: 'maintenance_work_mem' + value: maintenanceMemMB + } + { + name: 'checkpoint_segments' + value: checkpointSegments + } + { + name: 'checkpoint_completion_target' + value: checkpointCompletionTarget + } + ] + } + } + ] + } + location: resourceGroup().location + dependsOn: [ + 'Microsoft.DBforPostgreSQL/servers/MyDBServer' + ] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive2.bicep new file mode 100644 index 00000000000..d503968ed30 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive2.bicep @@ -0,0 +1,37 @@ +resource MyDBServer2 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer2' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer2_log_checkpoints 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServer2 + name: 'log_checkpoints' + properties: { + value: 'off' + } + location: resourceGroup().location + dependsOn: ['Microsoft.DBforPostgreSQL/servers/MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive3.bicep new file mode 100644 index 00000000000..59dfce33c72 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive3.bicep @@ -0,0 +1,36 @@ +resource MyDBServer3 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer3' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer_log_checkpoints 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + name: 'MyDBServer/log_checkpoints' + properties: { + value: 'off' + } + location: resourceGroup().location + dependsOn: ['MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive4.bicep new file mode 100644 index 00000000000..300426acf61 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive4.bicep @@ -0,0 +1,36 @@ +resource MyDBServer3 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer3' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer_log_checkpoints 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + name: 'MyDBServer/log_checkpoints' + properties: { + source: 'source' + } + location: resourceGroup().location + dependsOn: ['MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive5.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive5.bicep new file mode 100644 index 00000000000..c69776cb159 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive5.bicep @@ -0,0 +1,89 @@ +param dataDirectory string +param maxSizeMB string +param minSizeMB string +param pageSizeMB string +param workMemMB string +param maintenanceMemMB string +param checkpointSegments string +param checkpointCompletionTarget string + +resource MyDBServer1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer1' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer1_log_checkpoints 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServer1 + name: 'log_checkpoints' + properties: { + configurationSets: [ + { + configurationSetType: 'Microsoft.DBforPostgreSQL/servers/configurations/dbconfig' + configurationSet: { + name: 'dbconfig' + configurationParameters: [ + { + name: 'data_directory' + value: dataDirectory + } + { + name: 'max_size' + value: maxSizeMB + } + { + name: 'min_size' + value: minSizeMB + } + { + name: 'page_size' + value: pageSizeMB + } + { + name: 'work_mem' + value: workMemMB + } + { + name: 'maintenance_work_mem' + value: maintenanceMemMB + } + { + name: 'checkpoint_segments' + value: checkpointSegments + } + { + name: 'checkpoint_completion_target' + value: checkpointCompletionTarget + } + ] + } + } + ] + } + location: resourceGroup().location + dependsOn: [ + 'Microsoft.DBforPostgreSQL/servers/MyDBServer' + ] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive6.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive6.bicep new file mode 100644 index 00000000000..d503968ed30 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive6.bicep @@ -0,0 +1,37 @@ +resource MyDBServer2 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer2' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer2_log_checkpoints 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServer2 + name: 'log_checkpoints' + properties: { + value: 'off' + } + location: resourceGroup().location + dependsOn: ['Microsoft.DBforPostgreSQL/servers/MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive7.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive7.bicep new file mode 100644 index 00000000000..59dfce33c72 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive7.bicep @@ -0,0 +1,36 @@ +resource MyDBServer3 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer3' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer_log_checkpoints 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + name: 'MyDBServer/log_checkpoints' + properties: { + value: 'off' + } + location: resourceGroup().location + dependsOn: ['MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive8.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive8.bicep new file mode 100644 index 00000000000..300426acf61 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive8.bicep @@ -0,0 +1,36 @@ +resource MyDBServer3 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer3' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer_log_checkpoints 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + name: 'MyDBServer/log_checkpoints' + properties: { + source: 'source' + } + location: resourceGroup().location + dependsOn: ['MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive_expected_result.json index 12b6a9328df..1cc3d9d0314 100644 --- a/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_checkpoint_disabled/test/positive_expected_result.json @@ -46,5 +46,53 @@ "severity": "MEDIUM", "line": 45, "fileName": "positive8.json" + }, + { + "queryName": "PostgreSQL Database Server Log Checkpoints Disabled", + "severity": "MEDIUM", + "line": 40, + "fileName": "positive1.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Checkpoints Disabled", + "severity": "MEDIUM", + "line": 33, + "fileName": "positive2.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Checkpoints Disabled", + "severity": "MEDIUM", + "line": 32, + "fileName": "positive3.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Checkpoints Disabled", + "severity": "MEDIUM", + "line": 31, + "fileName": "positive4.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Checkpoints Disabled", + "severity": "MEDIUM", + "line": 40, + "fileName": "positive5.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Checkpoints Disabled", + "severity": "MEDIUM", + "line": 33, + "fileName": "positive6.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Checkpoints Disabled", + "severity": "MEDIUM", + "line": 32, + "fileName": "positive7.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Checkpoints Disabled", + "severity": "MEDIUM", + "line": 31, + "fileName": "positive8.bicep" } -] +] \ No newline at end of file From e96f5cab77d4bac85db6fae1d86514d2b51aada3 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 30 Apr 2024 14:26:05 +0100 Subject: [PATCH 071/130] added test files for postgres3 --- .../test/negative1.bicep | 31 ++++++++++++ .../test/negative2.bicep | 36 +++++++++++++ .../test/negative3.bicep | 31 ++++++++++++ .../test/negative4.bicep | 36 +++++++++++++ .../test/positive1.bicep | 43 ++++++++++++++++ .../test/positive2.bicep | 36 +++++++++++++ .../test/positive3.bicep | 36 +++++++++++++ .../test/positive4.bicep | 43 ++++++++++++++++ .../test/positive5.bicep | 43 ++++++++++++++++ .../test/positive6.bicep | 36 +++++++++++++ .../test/positive7.bicep | 36 +++++++++++++ .../test/positive8.bicep | 43 ++++++++++++++++ .../test/positive_expected_result.json | 50 ++++++++++++++++++- 13 files changed, 499 insertions(+), 1 deletion(-) create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive7.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive8.bicep diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative1.bicep new file mode 100644 index 00000000000..6ae9c4584c7 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative1.bicep @@ -0,0 +1,31 @@ +resource MyDBServerNeg1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServerNeg1' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } +} + +resource MyDBServerNeg1_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServerNeg1 + name: 'log_connections' + properties: { + value: 'on' + } + location: resourceGroup().location + dependsOn: ['Microsoft.DBforPostgreSQL/servers/MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative2.bicep new file mode 100644 index 00000000000..eef84783af1 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative2.bicep @@ -0,0 +1,36 @@ +resource MyDBServer3 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer3' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + name: 'MyDBServer/log_connections' + properties: { + value: 'on' + } + location: resourceGroup().location + dependsOn: ['MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative3.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative3.bicep new file mode 100644 index 00000000000..6ae9c4584c7 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative3.bicep @@ -0,0 +1,31 @@ +resource MyDBServerNeg1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServerNeg1' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } +} + +resource MyDBServerNeg1_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServerNeg1 + name: 'log_connections' + properties: { + value: 'on' + } + location: resourceGroup().location + dependsOn: ['Microsoft.DBforPostgreSQL/servers/MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative4.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative4.bicep new file mode 100644 index 00000000000..eef84783af1 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/negative4.bicep @@ -0,0 +1,36 @@ +resource MyDBServer3 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer3' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + name: 'MyDBServer/log_connections' + properties: { + value: 'on' + } + location: resourceGroup().location + dependsOn: ['MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive1.bicep new file mode 100644 index 00000000000..6cf5d66c773 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive1.bicep @@ -0,0 +1,43 @@ +resource MyDBServer1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer1' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer1_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServer1 + name: 'log_connections' + properties: { + configurationSets: [ + { + configurationSetType: 'Microsoft.DBforPostgreSQL/servers/configurations/dbconfig' + configurationSet: { + name: 'dbconfig' + } + } + ] + } + location: resourceGroup().location +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive2.bicep new file mode 100644 index 00000000000..570a007e459 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive2.bicep @@ -0,0 +1,36 @@ +resource MyDBServer2 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer2' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer2_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServer2 + name: 'log_connections' + properties: { + value: 'off' + } + location: resourceGroup().location +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive3.bicep new file mode 100644 index 00000000000..7bb9001e643 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive3.bicep @@ -0,0 +1,36 @@ +resource MyDBServer3 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer3' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + name: 'MyDBServer/log_connections' + properties: { + value: 'off' + } + location: resourceGroup().location + dependsOn: ['MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive4.bicep new file mode 100644 index 00000000000..11454ba3cc9 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive4.bicep @@ -0,0 +1,43 @@ +resource MyDBServer3 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer3' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + name: 'MyDBServer/log_connections' + properties: { + configurationSets: [ + { + configurationSetType: 'Microsoft.DBforPostgreSQL/servers/configurations/dbconfig' + configurationSet: { + name: 'dbconfig' + } + } + ] + } + location: resourceGroup().location + dependsOn: ['MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive5.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive5.bicep new file mode 100644 index 00000000000..6cf5d66c773 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive5.bicep @@ -0,0 +1,43 @@ +resource MyDBServer1 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer1' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer1_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServer1 + name: 'log_connections' + properties: { + configurationSets: [ + { + configurationSetType: 'Microsoft.DBforPostgreSQL/servers/configurations/dbconfig' + configurationSet: { + name: 'dbconfig' + } + } + ] + } + location: resourceGroup().location +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive6.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive6.bicep new file mode 100644 index 00000000000..570a007e459 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive6.bicep @@ -0,0 +1,36 @@ +resource MyDBServer2 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer2' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer2_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + parent: MyDBServer2 + name: 'log_connections' + properties: { + value: 'off' + } + location: resourceGroup().location +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive7.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive7.bicep new file mode 100644 index 00000000000..7bb9001e643 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive7.bicep @@ -0,0 +1,36 @@ +resource MyDBServer3 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer3' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + name: 'MyDBServer/log_connections' + properties: { + value: 'off' + } + location: resourceGroup().location + dependsOn: ['MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive8.bicep b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive8.bicep new file mode 100644 index 00000000000..11454ba3cc9 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive8.bicep @@ -0,0 +1,43 @@ +resource MyDBServer3 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer3' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: 'S0' + tier: 'Basic' + capacity: 1 + family: 'GeneralPurpose' + } +} + +resource MyDBServer_log_connections 'Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01' = { + name: 'MyDBServer/log_connections' + properties: { + configurationSets: [ + { + configurationSetType: 'Microsoft.DBforPostgreSQL/servers/configurations/dbconfig' + configurationSet: { + name: 'dbconfig' + } + } + ] + } + location: resourceGroup().location + dependsOn: ['MyDBServer'] +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive_expected_result.json index 23c9049a5a2..20ea5616ff9 100644 --- a/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/postgres_sql_server_log_connections_disabled/test/positive_expected_result.json @@ -46,5 +46,53 @@ "severity": "MEDIUM", "line": 45, "fileName": "positive8.json" + }, + { + "queryName": "PostgreSQL Database Server Log Connections Disabled", + "severity": "MEDIUM", + "line": 31, + "fileName": "positive1.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Connections Disabled", + "severity": "MEDIUM", + "line": 33, + "fileName": "positive2.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Connections Disabled", + "severity": "MEDIUM", + "line": 32, + "fileName": "positive3.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Connections Disabled", + "severity": "MEDIUM", + "line": 31, + "fileName": "positive4.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Connections Disabled", + "severity": "MEDIUM", + "line": 31, + "fileName": "positive5.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Connections Disabled", + "severity": "MEDIUM", + "line": 33, + "fileName": "positive6.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Connections Disabled", + "severity": "MEDIUM", + "line": 32, + "fileName": "positive7.bicep" + }, + { + "queryName": "PostgreSQL Database Server Log Connections Disabled", + "severity": "MEDIUM", + "line": 31, + "fileName": "positive8.bicep" } -] +] \ No newline at end of file From 1d169b15865210db523e09c7eb94b3cc899e9f68 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 30 Apr 2024 14:30:08 +0100 Subject: [PATCH 072/130] added test files for postgres4 --- .../test/negative1.bicep | 62 +++++++++++++++++++ .../test/negative2.bicep | 62 +++++++++++++++++++ .../test/positive1.bicep | 57 +++++++++++++++++ .../test/positive2.bicep | 61 ++++++++++++++++++ .../test/positive3.bicep | 57 +++++++++++++++++ .../test/positive4.bicep | 61 ++++++++++++++++++ .../test/positive_expected_result.json | 24 +++++++ 7 files changed, 384 insertions(+) create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive4.bicep diff --git a/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/negative1.bicep new file mode 100644 index 00000000000..a50d7c38c63 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/negative1.bicep @@ -0,0 +1,62 @@ +param databaseSkuName int = 5 +param databaseSkuTier int = 5 +param databaseDTU int = 5 +param databaseSkuSizeMB int = 5 + +var serverName = 'server' + +resource MyDBServer 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer' + properties: { + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + sslEnforcement: 'Enabled' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + defaultSecondaryLocation: resourceGroup().location + maxSizeInGB: '10' + isEncrypted: 'false' + isNetworkAccessible: 'true' + identity: '' + } + sku: { + name: databaseSkuName + tier: databaseSkuTier + capacity: databaseDTU + size: databaseSkuSizeMB + family: 'SkuFamily' + } +} + +resource MyDBServer_serverName_firewall 'Microsoft.DBforPostgreSQL/servers/firewallrules@2017-12-01' = { + parent: MyDBServer + location: resourceGroup().location + name: '${serverName}firewall' + properties: { + startIpAddress: '0.0.0.0' + endIpAddress: '255.255.255.255' + } + dependsOn: [ + 'Microsoft.DBforPostgreSQL/servers/${serverName}' + ] +} + +resource MyDBServer_myDB1 'Microsoft.DBforPostgreSQL/servers/databases@2017-12-01' = { + parent: MyDBServer + name: 'myDB1' + properties: { + charset: 'utf8' + collation: 'English_United States.1252' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/negative2.bicep b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/negative2.bicep new file mode 100644 index 00000000000..a50d7c38c63 --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/negative2.bicep @@ -0,0 +1,62 @@ +param databaseSkuName int = 5 +param databaseSkuTier int = 5 +param databaseDTU int = 5 +param databaseSkuSizeMB int = 5 + +var serverName = 'server' + +resource MyDBServer 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer' + properties: { + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + sslEnforcement: 'Enabled' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + defaultSecondaryLocation: resourceGroup().location + maxSizeInGB: '10' + isEncrypted: 'false' + isNetworkAccessible: 'true' + identity: '' + } + sku: { + name: databaseSkuName + tier: databaseSkuTier + capacity: databaseDTU + size: databaseSkuSizeMB + family: 'SkuFamily' + } +} + +resource MyDBServer_serverName_firewall 'Microsoft.DBforPostgreSQL/servers/firewallrules@2017-12-01' = { + parent: MyDBServer + location: resourceGroup().location + name: '${serverName}firewall' + properties: { + startIpAddress: '0.0.0.0' + endIpAddress: '255.255.255.255' + } + dependsOn: [ + 'Microsoft.DBforPostgreSQL/servers/${serverName}' + ] +} + +resource MyDBServer_myDB1 'Microsoft.DBforPostgreSQL/servers/databases@2017-12-01' = { + parent: MyDBServer + name: 'myDB1' + properties: { + charset: 'utf8' + collation: 'English_United States.1252' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive1.bicep new file mode 100644 index 00000000000..57441b3c99f --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive1.bicep @@ -0,0 +1,57 @@ +param databaseSkuName int = 5 +param databaseSkuTier int = 5 +param databaseDTU int = 5 +param databaseSkuSizeMB int = 5 + +var serverName = 'server' + +resource MyDBServer 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: databaseSkuName + tier: databaseSkuTier + capacity: databaseDTU + size: databaseSkuSizeMB + family: 'SkuFamily' + } +} + +resource MyDBServer_serverName_firewall 'Microsoft.DBforPostgreSQL/servers/firewallrules@2017-12-01' = { + parent: MyDBServer + location: resourceGroup().location + name: '${serverName}firewall' + properties: { + startIpAddress: '0.0.0.0' + endIpAddress: '255.255.255.255' + } + dependsOn: [ + 'Microsoft.DBforPostgreSQL/servers/${serverName}' + ] +} + +resource MyDBServer_myDB1 'Microsoft.DBforPostgreSQL/servers/databases@2017-12-01' = { + parent: MyDBServer + name: 'myDB1' + properties: { + charset: 'utf8' + collation: 'English_United States.1252' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive2.bicep new file mode 100644 index 00000000000..02c447fe38d --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive2.bicep @@ -0,0 +1,61 @@ +param databaseSkuName int = 5 +param databaseSkuTier int = 5 +param databaseDTU int = 5 +param databaseSkuSizeMB int = 5 + +var serverName = 'server' + +resource MyDBServer 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer' + properties: { + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + defaultSecondaryLocation: resourceGroup().location + maxSizeInGB: '10' + isEncrypted: 'false' + isNetworkAccessible: 'true' + identity: '' + } + sku: { + name: databaseSkuName + tier: databaseSkuTier + capacity: databaseDTU + size: databaseSkuSizeMB + family: 'SkuFamily' + } +} + +resource MyDBServer_serverName_firewall 'Microsoft.DBforPostgreSQL/servers/firewallrules@2017-12-01' = { + parent: MyDBServer + location: resourceGroup().location + name: '${serverName}firewall' + properties: { + startIpAddress: '0.0.0.0' + endIpAddress: '255.255.255.255' + } + dependsOn: [ + 'Microsoft.DBforPostgreSQL/servers/${serverName}' + ] +} + +resource MyDBServer_myDB1 'Microsoft.DBforPostgreSQL/servers/databases@2017-12-01' = { + parent: MyDBServer + name: 'myDB1' + properties: { + charset: 'utf8' + collation: 'English_United States.1252' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive3.bicep new file mode 100644 index 00000000000..57441b3c99f --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive3.bicep @@ -0,0 +1,57 @@ +param databaseSkuName int = 5 +param databaseSkuTier int = 5 +param databaseDTU int = 5 +param databaseSkuSizeMB int = 5 + +var serverName = 'server' + +resource MyDBServer 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer' + properties: { + sslEnforcement: 'Disabled' + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + } + sku: { + name: databaseSkuName + tier: databaseSkuTier + capacity: databaseDTU + size: databaseSkuSizeMB + family: 'SkuFamily' + } +} + +resource MyDBServer_serverName_firewall 'Microsoft.DBforPostgreSQL/servers/firewallrules@2017-12-01' = { + parent: MyDBServer + location: resourceGroup().location + name: '${serverName}firewall' + properties: { + startIpAddress: '0.0.0.0' + endIpAddress: '255.255.255.255' + } + dependsOn: [ + 'Microsoft.DBforPostgreSQL/servers/${serverName}' + ] +} + +resource MyDBServer_myDB1 'Microsoft.DBforPostgreSQL/servers/databases@2017-12-01' = { + parent: MyDBServer + name: 'myDB1' + properties: { + charset: 'utf8' + collation: 'English_United States.1252' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive4.bicep new file mode 100644 index 00000000000..02c447fe38d --- /dev/null +++ b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive4.bicep @@ -0,0 +1,61 @@ +param databaseSkuName int = 5 +param databaseSkuTier int = 5 +param databaseDTU int = 5 +param databaseSkuSizeMB int = 5 + +var serverName = 'server' + +resource MyDBServer 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = { + kind: '' + location: resourceGroup().location + name: 'MyDBServer' + properties: { + version: '11' + administratorLogin: 'root' + administratorLoginPassword: '12345' + storageMB: '2048' + createMode: 'Default' + collation: 'SQL_Latin1_General_CP1_CI_AS' + creationDate: '2019-04-01T00:00:00Z' + lastModifiedDate: '2019-04-01T00:00:00Z' + maxSizeUnits: 'SizeUnit.megabytes' + isReadOnly: 'false' + isAutoUpgradeEnabled: 'true' + isStateful: 'false' + isExternal: 'false' + defaultSecondaryLocation: resourceGroup().location + maxSizeInGB: '10' + isEncrypted: 'false' + isNetworkAccessible: 'true' + identity: '' + } + sku: { + name: databaseSkuName + tier: databaseSkuTier + capacity: databaseDTU + size: databaseSkuSizeMB + family: 'SkuFamily' + } +} + +resource MyDBServer_serverName_firewall 'Microsoft.DBforPostgreSQL/servers/firewallrules@2017-12-01' = { + parent: MyDBServer + location: resourceGroup().location + name: '${serverName}firewall' + properties: { + startIpAddress: '0.0.0.0' + endIpAddress: '255.255.255.255' + } + dependsOn: [ + 'Microsoft.DBforPostgreSQL/servers/${serverName}' + ] +} + +resource MyDBServer_myDB1 'Microsoft.DBforPostgreSQL/servers/databases@2017-12-01' = { + parent: MyDBServer + name: 'myDB1' + properties: { + charset: 'utf8' + collation: 'English_United States.1252' + } +} diff --git a/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive_expected_result.json index ca8b3e0d43a..55b0b39ad44 100644 --- a/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/postgres_sql_server_ssl_disabled/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "MEDIUM", "line": 15, "fileName": "positive4.json" + }, + { + "queryName": "PostgreSQL Database Server SSL Disabled", + "severity": "MEDIUM", + "line": 13, + "fileName": "positive1.bicep" + }, + { + "queryName": "PostgreSQL Database Server SSL Disabled", + "severity": "MEDIUM", + "line": 12, + "fileName": "positive2.bicep" + }, + { + "queryName": "PostgreSQL Database Server SSL Disabled", + "severity": "MEDIUM", + "line": 13, + "fileName": "positive3.bicep" + }, + { + "queryName": "PostgreSQL Database Server SSL Disabled", + "severity": "MEDIUM", + "line": 12, + "fileName": "positive4.bicep" } ] \ No newline at end of file From abb9bc2214ffe4110ed97cc0251b6ad190900b9b Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 30 Apr 2024 14:34:57 +0100 Subject: [PATCH 073/130] added test files for low retention days query --- .../test/negative1.bicep | 40 +++++++++++++++++++ .../test/negative2.bicep | 40 +++++++++++++++++++ .../test/positive1.bicep | 40 +++++++++++++++++++ .../test/positive2.bicep | 39 ++++++++++++++++++ .../test/positive3.bicep | 40 +++++++++++++++++++ .../test/positive4.bicep | 39 ++++++++++++++++++ .../test/positive_expected_result.json | 24 +++++++++++ 7 files changed, 262 insertions(+) create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive4.bicep diff --git a/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/negative1.bicep b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/negative1.bicep new file mode 100644 index 00000000000..1505a122c36 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/negative1.bicep @@ -0,0 +1,40 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + retentionDays: 100 + state: 'Enabled' + dependsOn: [sqlServer1_sqlDatabase1.id] + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/negative2.bicep b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/negative2.bicep new file mode 100644 index 00000000000..1505a122c36 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/negative2.bicep @@ -0,0 +1,40 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + retentionDays: 100 + state: 'Enabled' + dependsOn: [sqlServer1_sqlDatabase1.id] + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive1.bicep b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive1.bicep new file mode 100644 index 00000000000..4ce07f7f4d7 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive1.bicep @@ -0,0 +1,40 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + retentionDays: 50 + state: 'Enabled' + dependsOn: [sqlServer1_sqlDatabase1.id] + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive2.bicep b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive2.bicep new file mode 100644 index 00000000000..49fb1b44521 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive2.bicep @@ -0,0 +1,39 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + state: 'Enabled' + dependsOn: [sqlServer1_sqlDatabase1.id] + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive3.bicep b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive3.bicep new file mode 100644 index 00000000000..4ce07f7f4d7 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive3.bicep @@ -0,0 +1,40 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + retentionDays: 50 + state: 'Enabled' + dependsOn: [sqlServer1_sqlDatabase1.id] + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive4.bicep b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive4.bicep new file mode 100644 index 00000000000..49fb1b44521 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive4.bicep @@ -0,0 +1,39 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + state: 'Enabled' + dependsOn: [sqlServer1_sqlDatabase1.id] + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive_expected_result.json b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive_expected_result.json index 7b48bb96d7a..7a9d92c7b2f 100644 --- a/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/sql_server_database_with_low_retention_days/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "LOW", "line": 45, "filename": "positive4.json" + }, + { + "queryName": "SQL Server Database With Unrecommended Retention Days", + "severity": "LOW", + "line": 36, + "filename": "positive1.bicep" + }, + { + "queryName": "SQL Server Database With Unrecommended Retention Days", + "severity": "LOW", + "line": 31, + "filename": "positive2.bicep" + }, + { + "queryName": "SQL Server Database With Unrecommended Retention Days", + "severity": "LOW", + "line": 36, + "filename": "positive3.bicep" + }, + { + "queryName": "SQL Server Database With Unrecommended Retention Days", + "severity": "LOW", + "line": 31, + "filename": "positive4.bicep" } ] \ No newline at end of file From 39ad94c22f331e11c0c8d41e655518a1dc6e6724 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 30 Apr 2024 14:37:42 +0100 Subject: [PATCH 074/130] added test files for auditing query --- .../test/negative1.bicep | 39 +++++++++++++++++++ .../test/negative2.bicep | 39 +++++++++++++++++++ .../test/negative3.bicep | 39 +++++++++++++++++++ .../test/negative4.bicep | 39 +++++++++++++++++++ .../test/positive1.bicep | 26 +++++++++++++ .../test/positive2.bicep | 39 +++++++++++++++++++ .../test/positive3.bicep | 26 +++++++++++++ .../test/positive4.bicep | 39 +++++++++++++++++++ .../test/positive_expected_result.json | 26 ++++++++++++- 9 files changed, 311 insertions(+), 1 deletion(-) create mode 100644 assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative2.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative3.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative4.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive4.bicep diff --git a/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative1.bicep b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative1.bicep new file mode 100644 index 00000000000..29ce4a74896 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative1.bicep @@ -0,0 +1,39 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_ssqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'ssqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: 107374182 + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_ssqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_ssqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + retentionDays: 100 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative2.bicep b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative2.bicep new file mode 100644 index 00000000000..7b56756b386 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative2.bicep @@ -0,0 +1,39 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: 1073741824 + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + retentionDays: 100 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative3.bicep b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative3.bicep new file mode 100644 index 00000000000..29ce4a74896 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative3.bicep @@ -0,0 +1,39 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_ssqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'ssqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: 107374182 + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_ssqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_ssqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + retentionDays: 100 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative4.bicep b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative4.bicep new file mode 100644 index 00000000000..7b56756b386 --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/negative4.bicep @@ -0,0 +1,39 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: 1073741824 + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + retentionDays: 100 + state: 'Enabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive1.bicep b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive1.bicep new file mode 100644 index 00000000000..8eac6379d2c --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive1.bicep @@ -0,0 +1,26 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive2.bicep b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive2.bicep new file mode 100644 index 00000000000..4894e9921fe --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive2.bicep @@ -0,0 +1,39 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: 1073741824 + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + retentionDays: 100 + state: 'Disabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive3.bicep b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive3.bicep new file mode 100644 index 00000000000..8eac6379d2c --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive3.bicep @@ -0,0 +1,26 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: '1073741824' + requestedServiceObjectiveName: 'Basic' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive4.bicep b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive4.bicep new file mode 100644 index 00000000000..4894e9921fe --- /dev/null +++ b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive4.bicep @@ -0,0 +1,39 @@ +resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'sqlServer1' + location: resourceGroup().location + tags: { + displayName: 'sqlServer1' + } + properties: { + administratorLogin: 'adminUsername' + administratorLoginPassword: 'adminPassword' + } +} + +resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-preview' = { + parent: sqlServer1 + name: 'sqlDatabase1' + location: resourceGroup().location + tags: { + displayName: 'sqlDatabase1' + } + properties: { + collation: 'SQL_Latin1_General_CP1_CI_AS' + edition: 'Basic' + maxSizeBytes: 1073741824 + requestedServiceObjectiveName: 'Basic' + } +} + +resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditingSettings@2021-02-01-preview' = { + parent: sqlServer1_sqlDatabase1 + name: 'default' + properties: { + auditActionsAndGroups: ['DATABASE_LOGOUT_GROUP'] + isAzureMonitorTargetEnabled: true + isStorageSecondaryKeyInUse: true + queueDelayMs: 1000 + retentionDays: 100 + state: 'Disabled' + } +} diff --git a/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive_expected_result.json b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive_expected_result.json index ddf5fc11edf..031eb5f9e4d 100644 --- a/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/sql_server_database_without_auditing/test/positive_expected_result.json @@ -22,5 +22,29 @@ "severity": "MEDIUM", "line": 24, "filename": "positive4.json" + }, + { + "queryName": "SQL Server Database Without Auditing", + "severity": "MEDIUM", + "line": 15, + "filename": "positive1.bicep" + }, + { + "queryName": "SQL Server Database Without Auditing", + "severity": "MEDIUM", + "line": 15, + "filename": "positive2.bicep" + }, + { + "queryName": "SQL Server Database Without Auditing", + "severity": "MEDIUM", + "line": 15, + "filename": "positive3.bicep" + }, + { + "queryName": "SQL Server Database Without Auditing", + "severity": "MEDIUM", + "line": 15, + "filename": "positive4.bicep" } -] +] \ No newline at end of file From 3eeb71f062fb16516ecd1f2191d9104af50885ea Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 30 Apr 2024 14:41:24 +0100 Subject: [PATCH 075/130] early implementation of nested resources formatting --- pkg/parser/bicep/parser.go | 125 +++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 814ec9504f8..4cbdd1723e1 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -53,6 +53,128 @@ func convertVisitorToJSONBicep(visitor *BicepVisitor) *JSONBicep { } } +type Resource struct { + Name string + Parent string + Children []*Resource + ResourceData interface{} +} + +func filterTestStruct(resources []*Resource) []*Resource { + filteredResources := []*Resource{} + + for _, resource := range resources { + if resource.Parent == "" { + filteredResources = append(filteredResources, resource) + } + } + + return filteredResources +} + +func reformatTestTree(resource Resource) map[string]interface{} { + res := map[string]interface{}{} + + res["identifier"] = resource.Name + children := []interface{}{} + for _, child := range resource.Children { + formattedChild := reformatTestTree(*child) + children = append(children, formattedChild) + } + + res["resources"] = children + for k, v := range resource.ResourceData.(map[string]interface{}) { + res[k] = v + } + + return res +} + +func addChildrenToParents(resources []*Resource) { + resourceMap := map[string]*Resource{} + + for _, resource := range resources { + resourceMap[resource.Name] = resource + } + + for _, resource := range resources { + if resource.Parent != "" { + parent := resourceMap[resource.Parent] + parent.Children = append(parent.Children, resource) + } + } +} + +func shortenTypes(resource map[string]interface{}, parentType string) map[string]interface{} { + newResource := resource + + // currentType := resource["type"] + if _, hasParent := resource["parent"]; hasParent { + newType := strings.Replace(resource["type"].(string), parentType+"/", "", 1) + parentType = resource["type"].(string) + newResource["type"] = newType + } else { + parentType = resource["type"].(string) + } + + if children, hasChildren := resource["resources"]; hasChildren { + newChildren := []interface{}{} + for _, child := range children.([]interface{}) { + newChild := shortenTypes(child.(map[string]interface{}), parentType) + newChildren = append(newChildren, newChild) + } + newResource["resources"] = newChildren + } + + return newResource +} + +func makeResourcesNestedStructure(jBicep *JSONBicep) []interface{} { + resources := []*Resource{} + + trueResources := jBicep.Resources + for _, res := range trueResources { + resName := res.(map[string]interface{})["identifier"].(string) + actualRes := res.(map[string]interface{}) + resParent, ok := actualRes["parent"] + var newRes Resource + if ok { + resParentName, ok := resParent.(string) + if ok { + newRes = Resource{ + Name: resName, + Parent: resParentName, + ResourceData: res, + } + } + } else { + newRes = Resource{ + Name: resName, + ResourceData: res, + } + } + resources = append(resources, &newRes) + } + + addChildrenToParents(resources) + + filteredResources := filterTestStruct(resources) + + reformattedResources := []interface{}{} + for _, node := range filteredResources { + formattedNode := reformatTestTree(*node) + reformattedResources = append(reformattedResources, formattedNode) + } + + resultResources := []interface{}{} + for _, node := range reformattedResources { + newNode := shortenTypes(node.(map[string]interface{}), "") + resultResources = append(resultResources, newNode) + } + + return resultResources +} + // Parse - parses bicep to BicepVisitor template (json file) func (p *Parser) Parse(file string, _ []byte) ([]model.Document, []int, error) { bicepVisitor := NewBicepVisitor() @@ -69,6 +191,9 @@ func (p *Parser) Parse(file string, _ []byte) ([]model.Document, []int, error) { var doc model.Document jBicep := convertVisitorToJSONBicep(bicepVisitor) + testeResources := makeResourcesNestedStructure(jBicep) + + jBicep.Resources = testeResources bicepBytes, err := json.Marshal(jBicep) if err != nil { return nil, nil, err From e7c9a0122d9a7136a4a76c72f7584707bc941000 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 2 May 2024 13:51:12 +0100 Subject: [PATCH 076/130] update unit tests for bicep nested resources --- pkg/parser/bicep/parser_test.go | 509 +++++++++++++++++++---- test/fixtures/bicep_test/resources.bicep | 88 +++- 2 files changed, 526 insertions(+), 71 deletions(-) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 2a005be4aa2..61b72802176 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -244,10 +244,10 @@ func TestParseBicepFile(t *testing.T) { "OSVersion": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 34 + "_kics_line": 33 }, "_kics_type": { - "_kics_line": 34 + "_kics_line": 33 } }, "allowedValues": [ @@ -303,13 +303,55 @@ func TestParseBicepFile(t *testing.T) { }, "type": "string" }, + "existingContainerSubnetName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 53 + }, + "_kics_type": { + "_kics_line": 53 + } + }, + "metadata": { + "description": "Name of the subnet to use for cloud shell containers." + }, + "type": "string" + }, + "existingStorageSubnetName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 50 + }, + "_kics_type": { + "_kics_line": 50 + } + }, + "metadata": { + "description": "Name of the subnet to use for storage account." + }, + "type": "string" + }, + "existingVNETName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 47 + }, + "_kics_type": { + "_kics_line": 47 + } + }, + "metadata": { + "description": "Name of the virtual network to use for cloud shell containers." + }, + "type": "string" + }, "location": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 40 + "_kics_line": 39 }, "_kics_type": { - "_kics_line": 40 + "_kics_line": 39 } }, "defaultValue": "[resourceGroup().location]", @@ -321,10 +363,10 @@ func TestParseBicepFile(t *testing.T) { "parenthesis": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 45 + "_kics_line": 44 }, "_kics_type": { - "_kics_line": 45 + "_kics_line": 44 } }, "defaultValue": "simple-vm", @@ -333,10 +375,10 @@ func TestParseBicepFile(t *testing.T) { "vmName": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 43 + "_kics_line": 42 }, "_kics_type": { - "_kics_line": 43 + "_kics_line": 42 } }, "defaultValue": "simple-vm", @@ -348,10 +390,10 @@ func TestParseBicepFile(t *testing.T) { "vmSize": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 37 + "_kics_line": 36 }, "_kics_type": { - "_kics_line": 37 + "_kics_line": 36 } }, "defaultValue": "Standard_D2_v3", @@ -365,32 +407,32 @@ func TestParseBicepFile(t *testing.T) { { "_kics_lines": { "_kics__default": { - "_kics_line": 51 + "_kics_line": 72 }, "_kics_apiVersion": { - "_kics_line": 50 + "_kics_line": 71 }, "_kics_dependsOn": { "_kics_arr": [ { "_kics__default": { - "_kics_line": 100 + "_kics_line": 121 } } ], - "_kics_line": 100 + "_kics_line": 121 }, "_kics_location": { - "_kics_line": 53 + "_kics_line": 74 }, "_kics_name": { - "_kics_line": 52 + "_kics_line": 73 }, "_kics_properties": { - "_kics_line": 54 + "_kics_line": 75 }, "_kics_type": { - "_kics_line": 50 + "_kics_line": 71 } }, "apiVersion": "2021-03-01", @@ -417,43 +459,43 @@ func TestParseBicepFile(t *testing.T) { "properties": { "_kics_lines": { "_kics__default": { - "_kics_line": 54 + "_kics_line": 75 }, "_kics_diagnosticsProfile": { - "_kics_line": 91 + "_kics_line": 112 }, "_kics_hardwareProfile": { - "_kics_line": 55 + "_kics_line": 76 }, "_kics_networkProfile": { - "_kics_line": 84 + "_kics_line": 105 }, "_kics_osProfile": { - "_kics_line": 58 + "_kics_line": 79 }, "_kics_storageProfile": { - "_kics_line": 63 + "_kics_line": 84 } }, "diagnosticsProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 91 + "_kics_line": 112 }, "_kics_bootDiagnostics": { - "_kics_line": 92 + "_kics_line": 113 } }, "bootDiagnostics": { "_kics_lines": { "_kics__default": { - "_kics_line": 92 + "_kics_line": 113 }, "_kics_enabled": { - "_kics_line": 93 + "_kics_line": 114 }, "_kics_storageUri": { - "_kics_line": 94 + "_kics_line": 115 } }, "enabled": true, @@ -463,10 +505,10 @@ func TestParseBicepFile(t *testing.T) { "hardwareProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 55 + "_kics_line": 76 }, "_kics_vmSize": { - "_kics_line": 56 + "_kics_line": 77 } }, "vmSize": "[parameters('vmSize')]" @@ -474,27 +516,27 @@ func TestParseBicepFile(t *testing.T) { "networkProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 84 + "_kics_line": 105 }, "_kics_networkInterfaces": { "_kics_arr": [ { "_kics__default": { - "_kics_line": 85 + "_kics_line": 106 } } ], - "_kics_line": 85 + "_kics_line": 106 } }, "networkInterfaces": [ { "_kics_lines": { "_kics__default": { - "_kics_line": 86 + "_kics_line": 107 }, "_kics_id": { - "_kics_line": 87 + "_kics_line": 108 } }, "id": { @@ -509,16 +551,16 @@ func TestParseBicepFile(t *testing.T) { "osProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 58 + "_kics_line": 79 }, "_kics_adminPassword": { - "_kics_line": 61 + "_kics_line": 82 }, "_kics_adminUsername": { - "_kics_line": 60 + "_kics_line": 81 }, "_kics_computerName": { - "_kics_line": 59 + "_kics_line": 80 } }, "adminPassword": "[parameters('adminPassword')]", @@ -528,39 +570,39 @@ func TestParseBicepFile(t *testing.T) { "storageProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 63 + "_kics_line": 84 }, "_kics_dataDisks": { "_kics_arr": [ { "_kics__default": { - "_kics_line": 76 + "_kics_line": 97 } } ], - "_kics_line": 76 + "_kics_line": 97 }, "_kics_imageReference": { - "_kics_line": 64 + "_kics_line": 85 }, "_kics_osDisk": { - "_kics_line": 70 + "_kics_line": 91 } }, "dataDisks": [ { "_kics_lines": { "_kics__default": { - "_kics_line": 77 + "_kics_line": 98 }, "_kics_createOption": { - "_kics_line": 80 + "_kics_line": 101 }, "_kics_diskSizeGB": { - "_kics_line": 78 + "_kics_line": 99 }, "_kics_lun": { - "_kics_line": 79 + "_kics_line": 100 } }, "createOption": "Empty", @@ -571,19 +613,19 @@ func TestParseBicepFile(t *testing.T) { "imageReference": { "_kics_lines": { "_kics__default": { - "_kics_line": 64 + "_kics_line": 85 }, "_kics_offer": { - "_kics_line": 66 + "_kics_line": 87 }, "_kics_publisher": { - "_kics_line": 65 + "_kics_line": 86 }, "_kics_sku": { - "_kics_line": 67 + "_kics_line": 88 }, "_kics_version": { - "_kics_line": 68 + "_kics_line": 89 } }, "offer": "WindowsServer", @@ -594,23 +636,23 @@ func TestParseBicepFile(t *testing.T) { "osDisk": { "_kics_lines": { "_kics__default": { - "_kics_line": 70 + "_kics_line": 91 }, "_kics_createOption": { - "_kics_line": 71 + "_kics_line": 92 }, "_kics_managedDisk": { - "_kics_line": 72 + "_kics_line": 93 } }, "createOption": "FromImage", "managedDisk": { "_kics_lines": { "_kics__default": { - "_kics_line": 72 + "_kics_line": 93 }, "_kics_storageAccountType": { - "_kics_line": 73 + "_kics_line": 94 } }, "storageAccountType": "StandardSSD_LRS" @@ -618,37 +660,38 @@ func TestParseBicepFile(t *testing.T) { } } }, + "resources": [], "type": "Microsoft.Compute/virtualMachines" }, { "_kics_lines": { "_kics__default": { - "_kics_line": 106 + "_kics_line": 127 }, "_kics_apiVersion": { - "_kics_line": 106 + "_kics_line": 127 }, "_kics_assignableScopes": { "_kics_arr": [ { "_kics__default": { - "_kics_line": 116 + "_kics_line": 137 } } ], - "_kics_line": 116 + "_kics_line": 137 }, "_kics_location": { - "_kics_line": 108 + "_kics_line": 129 }, "_kics_name": { - "_kics_line": 107 + "_kics_line": 128 }, "_kics_type": { - "_kics_line": 106 + "_kics_line": 127 }, "_kics_userAssignedIdentities": { - "_kics_line": 113 + "_kics_line": 134 } }, "apiVersion": "2021-03-01", @@ -658,32 +701,358 @@ func TestParseBicepFile(t *testing.T) { "identifier": "nic", "location": null, "name": "", + "resources": [], "type": "Microsoft.Network/networkInterfaces", "userAssignedIdentities": { "'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { "_kics_lines": { "_kics__default": { - "_kics_line": 114 + "_kics_line": 135 } } }, "_kics_lines": { "_kics_'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { - "_kics_line": 114 + "_kics_line": 135 }, "_kics__default": { - "_kics_line": 113 + "_kics_line": 134 } } } + }, + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 140 + }, + "_kics_apiVersion": { + "_kics_line": 140 + }, + "_kics_kind": { + "_kics_line": 147 + }, + "_kics_location": { + "_kics_line": 142 + }, + "_kics_name": { + "_kics_line": 141 + }, + "_kics_properties": { + "_kics_line": 148 + }, + "_kics_sku": { + "_kics_line": 143 + }, + "_kics_type": { + "_kics_line": 140 + } + }, + "apiVersion": "2019-06-01", + "identifier": "storageAccount", + "kind": "StorageV2", + "location": "[parameters('location')]", + "name": "[variables('storageAccountName')]", + "properties": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 148 + }, + "_kics_accessTier": { + "_kics_line": 177 + }, + "_kics_encryption": { + "_kics_line": 164 + }, + "_kics_networkAcls": { + "_kics_line": 149 + }, + "_kics_supportsHttpsTrafficOnly": { + "_kics_line": 163 + } + }, + "accessTier": "Cool", + "encryption": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 164 + }, + "_kics_keySource": { + "_kics_line": 175 + }, + "_kics_services": { + "_kics_line": 165 + } + }, + "keySource": "Microsoft.Storage", + "services": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 165 + }, + "_kics_blob": { + "_kics_line": 170 + }, + "_kics_file": { + "_kics_line": 166 + } + }, + "blob": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 170 + }, + "_kics_enabled": { + "_kics_line": 172 + }, + "_kics_keyType": { + "_kics_line": 171 + } + }, + "enabled": true, + "keyType": "Account" + }, + "file": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 166 + }, + "_kics_enabled": { + "_kics_line": 168 + }, + "_kics_keyType": { + "_kics_line": 167 + } + }, + "enabled": true, + "keyType": "Account" + } + } + }, + "networkAcls": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 149 + }, + "_kics_bypass": { + "_kics_line": 150 + }, + "_kics_defaultAction": { + "_kics_line": 161 + }, + "_kics_virtualNetworkRules": { + "_kics_arr": [ + { + "_kics__default": { + "_kics_line": 151 + } + } + ], + "_kics_line": 151 + } + }, + "bypass": "None", + "defaultAction": "Deny", + "virtualNetworkRules": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 152 + }, + "_kics_action": { + "_kics_line": 154 + }, + "_kics_id": { + "_kics_line": 153 + } + }, + "action": "Allow", + "id": "[variables('containerSubnetRef')]" + }, + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 156 + }, + "_kics_action": { + "_kics_line": 158 + }, + "_kics_id": { + "_kics_line": 157 + } + }, + "action": "Allow", + "id": "[variables('storageSubnetRef')]" + } + ] + }, + "supportsHttpsTrafficOnly": true + }, + "resources": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 181 + }, + "_kics_apiVersion": { + "_kics_line": 181 + }, + "_kics_name": { + "_kics_line": 183 + }, + "_kics_parent": { + "_kics_line": 182 + }, + "_kics_properties": { + "_kics_line": 188 + }, + "_kics_sku": { + "_kics_line": 184 + }, + "_kics_type": { + "_kics_line": 181 + } + }, + "apiVersion": "2019-06-01", + "identifier": "storageAccountName_default", + "name": "default", + "parent": "storageAccount", + "properties": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 188 + }, + "_kics_deleteRetentionPolicy": { + "_kics_line": 189 + } + }, + "deleteRetentionPolicy": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 189 + }, + "_kics_enabled": { + "_kics_line": 190 + } + }, + "enabled": false + } + }, + "resources": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 195 + }, + "_kics_apiVersion": { + "_kics_line": 195 + }, + "_kics_name": { + "_kics_line": 197 + }, + "_kics_parent": { + "_kics_line": 196 + }, + "_kics_properties": { + "_kics_line": 198 + }, + "_kics_type": { + "_kics_line": 195 + } + }, + "apiVersion": "2019-06-01", + "identifier": "storageAccountName_default_container", + "name": "container", + "parent": "storageAccountName_default", + "properties": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 198 + }, + "_kics_denyEncryptionScopeOverride": { + "_kics_line": 199 + }, + "_kics_metadata": { + "_kics_line": 201 + }, + "_kics_publicAccess": { + "_kics_line": 200 + } + }, + "denyEncryptionScopeOverride": true, + "metadata": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 201 + } + } + }, + "publicAccess": "Blob" + }, + "resources": [], + "type": "containers" + } + ], + "sku": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 184 + }, + "_kics_name": { + "_kics_line": 185 + }, + "_kics_tier": { + "_kics_line": 186 + } + }, + "name": "Standard_LRS", + "tier": "Standard" + }, + "type": "blobServices" + } + ], + "sku": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 143 + }, + "_kics_name": { + "_kics_line": 144 + }, + "_kics_tier": { + "_kics_line": 145 + } + }, + "name": "Standard_LRS", + "tier": "Standard" + }, + "type": "Microsoft.Storage/storageAccounts" } ], "variables": { + "containerSubnetRef": { + "value": { + "resourceId": [ + "Microsoft.Network/virtualNetworks/subnets", + "parameters('existingVNETName')", + "parameters('existingContainerSubnetName')" + ] + } + }, "nicName": { "value": "myVMNic" }, "storageAccountName": { "value": "'bootdiags${[uniqueString(resourceGroup().id)]}'" + }, + "storageSubnetRef": { + "value": { + "resourceId": [ + "Microsoft.Network/virtualNetworks/subnets", + "parameters('existingVNETName')", + "parameters('existingStorageSubnetName')" + ] + } } } }`, diff --git a/test/fixtures/bicep_test/resources.bicep b/test/fixtures/bicep_test/resources.bicep index c0372c3ff2a..9786ae20421 100644 --- a/test/fixtures/bicep_test/resources.bicep +++ b/test/fixtures/bicep_test/resources.bicep @@ -8,7 +8,6 @@ param adminUsername string @secure() param adminPassword string - @description( '''The Windows version for the VM. This will pick a fully patched image of this given Windows version.''' @@ -44,9 +43,31 @@ param vmName string = 'simple-vm' param parenthesis string = ('simple-vm') +@description('Name of the virtual network to use for cloud shell containers.') +param existingVNETName string + +@description('Name of the subnet to use for storage account.') +param existingStorageSubnetName string + +@description('Name of the subnet to use for cloud shell containers.') +param existingContainerSubnetName string + var storageAccountName = 'bootdiags${uniqueString(resourceGroup().id)}' + var nicName = 'myVMNic' +var containerSubnetRef = resourceId( + 'Microsoft.Network/virtualNetworks/subnets', + existingVNETName, + existingContainerSubnetName +) + +var storageSubnetRef = resourceId( + 'Microsoft.Network/virtualNetworks/subnets', + existingVNETName, + existingStorageSubnetName +) + @sys.description('This is a test description for resources') resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { name: vmName @@ -115,3 +136,68 @@ resource nic 'Microsoft.Network/networkInterfaces@2021-03-01' = { } assignableScopes: [subscription().id] } + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccountName + location: location + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + networkAcls: { + bypass: 'None' + virtualNetworkRules: [ + { + id: containerSubnetRef + action: 'Allow' + } + { + id: storageSubnetRef + action: 'Allow' + } + ] + defaultAction: 'Deny' + } + supportsHttpsTrafficOnly: true + encryption: { + services: { + file: { + keyType: 'Account' + enabled: true + } + blob: { + keyType: 'Account' + enabled: true + } + } + keySource: 'Microsoft.Storage' + } + accessTier: 'Cool' + } +} + +resource storageAccountName_default 'Microsoft.Storage/storageAccounts/blobServices@2019-06-01' = { + parent: storageAccount + name: 'default' + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + properties: { + deleteRetentionPolicy: { + enabled: false + } + } +} + +resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { + parent: storageAccountName_default + name: 'container' + properties: { + denyEncryptionScopeOverride: true + publicAccess: 'Blob' + metadata: {} + } +} From c2856810f131bdd89479336909f228b081f3c41b Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Thu, 2 May 2024 19:53:43 +0100 Subject: [PATCH 077/130] improved nested function --- pkg/parser/bicep/parser.go | 87 +++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 49 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 4cbdd1723e1..f1bc184c412 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -60,22 +60,27 @@ type Resource struct { ResourceData interface{} } -func filterTestStruct(resources []*Resource) []*Resource { - filteredResources := []*Resource{} +// Encurta o array de Resources deixando apenas aquelas do nivel mais alto (não tem parent) +func filterParentStructs(resources []*Resource) []interface{} { + filteredResources := []interface{}{} for _, resource := range resources { if resource.Parent == "" { - filteredResources = append(filteredResources, resource) + formattedNode := reformatTestTree(*resource) + formattedNode = shortenTypes(formattedNode, "") + filteredResources = append(filteredResources, formattedNode) } } return filteredResources } +// Reverte um objeto do tipo struct Resource para a estrutura original do JBicep (inverso do convertOriginalResourcesToStruct) func reformatTestTree(resource Resource) map[string]interface{} { res := map[string]interface{}{} res["identifier"] = resource.Name + children := []interface{}{} for _, child := range resource.Children { formattedChild := reformatTestTree(*child) @@ -90,14 +95,12 @@ func reformatTestTree(resource Resource) map[string]interface{} { return res } +// Adiciona as resources ao array "resources" do seu parent caso exista func addChildrenToParents(resources []*Resource) { resourceMap := map[string]*Resource{} for _, resource := range resources { resourceMap[resource.Name] = resource - } - - for _, resource := range resources { if resource.Parent != "" { parent := resourceMap[resource.Parent] parent.Children = append(parent.Children, resource) @@ -105,74 +108,60 @@ func addChildrenToParents(resources []*Resource) { } } +// Dá trim aos types de forma a que sigam a mesma estrutura que é utilizada pelos ficheiros ARM func shortenTypes(resource map[string]interface{}, parentType string) map[string]interface{} { - newResource := resource - // currentType := resource["type"] if _, hasParent := resource["parent"]; hasParent { newType := strings.Replace(resource["type"].(string), parentType+"/", "", 1) parentType = resource["type"].(string) - newResource["type"] = newType + resource["type"] = newType } else { parentType = resource["type"].(string) } if children, hasChildren := resource["resources"]; hasChildren { - newChildren := []interface{}{} for _, child := range children.([]interface{}) { - newChild := shortenTypes(child.(map[string]interface{}), parentType) - newChildren = append(newChildren, newChild) + updatedChild := shortenTypes(child.(map[string]interface{}), parentType) + child = &updatedChild } - newResource["resources"] = newChildren + resource["resources"] = children } - return newResource + return resource } -func makeResourcesNestedStructure(jBicep *JSONBicep) []interface{} { - resources := []*Resource{} +// Converte array de objetos com a estrutura original do JBicep para um array de Resource +func convertOriginalResourcesToStruct(resources []interface{}) []*Resource { + newResources := []*Resource{} - trueResources := jBicep.Resources - for _, res := range trueResources { - resName := res.(map[string]interface{})["identifier"].(string) + for _, res := range resources { actualRes := res.(map[string]interface{}) - resParent, ok := actualRes["parent"] - var newRes Resource - if ok { - resParentName, ok := resParent.(string) - if ok { - newRes = Resource{ - Name: resName, - Parent: resParentName, - ResourceData: res, - } - } - } else { - newRes = Resource{ - Name: resName, - ResourceData: res, - } + resName := actualRes["identifier"].(string) + newRes := Resource{ + Name: resName, + ResourceData: res, + } + + if resParent, ok := actualRes["parent"]; ok { + newRes.Parent = resParent.(string) } - resources = append(resources, &newRes) + + newResources = append(newResources, &newRes) } - addChildrenToParents(resources) + return newResources - filteredResources := filterTestStruct(resources) +} - reformattedResources := []interface{}{} - for _, node := range filteredResources { - formattedNode := reformatTestTree(*node) - reformattedResources = append(reformattedResources, formattedNode) - } +func makeResourcesNestedStructure(jBicep *JSONBicep) []interface{} { + trueResources := jBicep.Resources + resources := convertOriginalResourcesToStruct(trueResources) - resultResources := []interface{}{} - for _, node := range reformattedResources { - newNode := shortenTypes(node.(map[string]interface{}), "") - resultResources = append(resultResources, newNode) - } + addChildrenToParents(resources) - return resultResources + filteredResources := filterParentStructs(resources) + + return filteredResources } // Parse - parses bicep to BicepVisitor template (json file) From ae3cc3d88e2f12dbcd4fa7bdf26787a6180cdeb6 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Fri, 3 May 2024 11:24:25 +0100 Subject: [PATCH 078/130] fixed bicep tests --- .../test/positive_expected_result.json | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json index 65b7607b4cb..89e56633bd6 100644 --- a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json @@ -34,41 +34,5 @@ "severity": "HIGH", "line": 52, "fileName": "positive6.json" - }, - { - "queryName": "Storage Blob Service Container With Public Access", - "severity": "HIGH", - "line": 5, - "fileName": "positive1.bicep" - }, - { - "queryName": "Storage Blob Service Container With Public Access", - "severity": "HIGH", - "line": 87, - "fileName": "positive2.bicep" - }, - { - "queryName": "Storage Blob Service Container With Public Access", - "severity": "HIGH", - "line": 29, - "fileName": "positive3.bicep" - }, - { - "queryName": "Storage Blob Service Container With Public Access", - "severity": "HIGH", - "line": 5, - "fileName": "positive4.bicep" - }, - { - "queryName": "Storage Blob Service Container With Public Access", - "severity": "HIGH", - "line": 87, - "fileName": "positive5.bicep" - }, - { - "queryName": "Storage Blob Service Container With Public Access", - "severity": "HIGH", - "line": 29, - "fileName": "positive6.bicep" } ] From 85eb2a84fc5b551f2b0e9943bc465f1c3b9baf05 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Fri, 3 May 2024 12:18:41 +0100 Subject: [PATCH 079/130] added unit tests for arm storage blob and storage rwd queries --- .../test/negative4.bicep | 8 -- .../test/negative5.bicep | 90 -------------- .../test/negative6.bicep | 33 ----- .../test/positive4.bicep | 8 -- .../test/positive5.bicep | 90 -------------- .../test/positive6.bicep | 33 ----- .../test/positive_expected_result.json | 18 +++ .../test/negative1.bicep | 19 +++ .../test/positive1.bicep | 19 +++ .../test/positive2.bicep | 6 + .../test/positive3.bicep | 19 +++ .../test/positive4.bicep | 11 ++ .../test/positive5.bicep | 11 ++ .../test/positive6.bicep | 3 + .../test/positive7.bicep | 4 + .../test/positive_expected_result.json | 114 ++++++++++++++++++ 16 files changed, 224 insertions(+), 262 deletions(-) delete mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative4.bicep delete mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative5.bicep delete mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative6.bicep delete mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive4.bicep delete mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive5.bicep delete mode 100644 assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/negative1.bicep create mode 100644 assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive1.bicep create mode 100644 assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive2.bicep create mode 100644 assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive3.bicep create mode 100644 assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive4.bicep create mode 100644 assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive5.bicep create mode 100644 assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive6.bicep create mode 100644 assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive7.bicep diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative4.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative4.bicep deleted file mode 100644 index a2a80c135c5..00000000000 --- a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative4.bicep +++ /dev/null @@ -1,8 +0,0 @@ -resource blob_container_example 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-02-01' = { - name: 'blob/container/example' - properties: { - denyEncryptionScopeOverride: true - publicAccess: 'None' - metadata: {} - } -} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative5.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative5.bicep deleted file mode 100644 index 4a0b6c5e1ab..00000000000 --- a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative5.bicep +++ /dev/null @@ -1,90 +0,0 @@ -@description('Name of the virtual network to use for cloud shell containers.') -param existingVNETName string - -@description('Name of the subnet to use for storage account.') -param existingStorageSubnetName string - -@description('Name of the subnet to use for cloud shell containers.') -param existingContainerSubnetName string - -@description('Name of the storage account in subnet.') -param storageAccountName string - -@description('Location for all resources.') -param location string = resourceGroup().location - -var containerSubnetRef = resourceId( - 'Microsoft.Network/virtualNetworks/subnets', - existingVNETName, - existingContainerSubnetName -) -var storageSubnetRef = resourceId( - 'Microsoft.Network/virtualNetworks/subnets', - existingVNETName, - existingStorageSubnetName -) - -resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { - name: storageAccountName - location: location - sku: { - name: 'Standard_LRS' - tier: 'Standard' - } - kind: 'StorageV2' - properties: { - networkAcls: { - bypass: 'None' - virtualNetworkRules: [ - { - id: containerSubnetRef - action: 'Allow' - } - { - id: storageSubnetRef - action: 'Allow' - } - ] - defaultAction: 'Deny' - } - supportsHttpsTrafficOnly: true - encryption: { - services: { - file: { - keyType: 'Account' - enabled: true - } - blob: { - keyType: 'Account' - enabled: true - } - } - keySource: 'Microsoft.Storage' - } - accessTier: 'Cool' - } -} - -resource storageAccountName_default 'Microsoft.Storage/storageAccounts/blobServices@2019-06-01' = { - parent: storageAccount - name: 'default' - sku: { - name: 'Standard_LRS' - tier: 'Standard' - } - properties: { - deleteRetentionPolicy: { - enabled: false - } - } -} - -resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { - parent: storageAccountName_default - name: 'container' - properties: { - denyEncryptionScopeOverride: true - publicAccess: 'None' - metadata: {} - } -} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative6.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative6.bicep deleted file mode 100644 index 31cecd636e7..00000000000 --- a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/negative6.bicep +++ /dev/null @@ -1,33 +0,0 @@ -@description('Specifies the name of the Azure Storage account.') -param storageAccountName string - -@description('Specifies the name of the blob container.') -param containerName string = 'logs' - -@description( - 'Specifies the location in which the Azure Storage resources should be deployed.' -) -param location string = resourceGroup().location - -resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { - name: storageAccountName - location: location - sku: { - name: 'Standard_LRS' - tier: 'Standard' - } - kind: 'StorageV2' - properties: { - accessTier: 'Hot' - } -} - -resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { - name: '${storageAccountName}/default/${containerName}' - properties: { - denyEncryptionScopeOverride: true - publicAccess: 'None' - metadata: {} - } - dependsOn: [storageAccount] -} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive4.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive4.bicep deleted file mode 100644 index 74647217fe5..00000000000 --- a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive4.bicep +++ /dev/null @@ -1,8 +0,0 @@ -resource blob_container_example 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-02-01' = { - name: 'blob/container/example' - properties: { - denyEncryptionScopeOverride: true - publicAccess: 'Container' - metadata: {} - } -} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive5.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive5.bicep deleted file mode 100644 index ed32c989d85..00000000000 --- a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive5.bicep +++ /dev/null @@ -1,90 +0,0 @@ -@description('Name of the virtual network to use for cloud shell containers.') -param existingVNETName string - -@description('Name of the subnet to use for storage account.') -param existingStorageSubnetName string - -@description('Name of the subnet to use for cloud shell containers.') -param existingContainerSubnetName string - -@description('Name of the storage account in subnet.') -param storageAccountName string - -@description('Location for all resources.') -param location string = resourceGroup().location - -var containerSubnetRef = resourceId( - 'Microsoft.Network/virtualNetworks/subnets', - existingVNETName, - existingContainerSubnetName -) -var storageSubnetRef = resourceId( - 'Microsoft.Network/virtualNetworks/subnets', - existingVNETName, - existingStorageSubnetName -) - -resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { - name: storageAccountName - location: location - sku: { - name: 'Standard_LRS' - tier: 'Standard' - } - kind: 'StorageV2' - properties: { - networkAcls: { - bypass: 'None' - virtualNetworkRules: [ - { - id: containerSubnetRef - action: 'Allow' - } - { - id: storageSubnetRef - action: 'Allow' - } - ] - defaultAction: 'Deny' - } - supportsHttpsTrafficOnly: true - encryption: { - services: { - file: { - keyType: 'Account' - enabled: true - } - blob: { - keyType: 'Account' - enabled: true - } - } - keySource: 'Microsoft.Storage' - } - accessTier: 'Cool' - } -} - -resource storageAccountName_default 'Microsoft.Storage/storageAccounts/blobServices@2019-06-01' = { - parent: storageAccount - name: 'default' - sku: { - name: 'Standard_LRS' - tier: 'Standard' - } - properties: { - deleteRetentionPolicy: { - enabled: false - } - } -} - -resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { - parent: storageAccountName_default - name: 'container' - properties: { - denyEncryptionScopeOverride: true - publicAccess: 'Blob' - metadata: {} - } -} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive6.bicep b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive6.bicep deleted file mode 100644 index eb6327f22b7..00000000000 --- a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive6.bicep +++ /dev/null @@ -1,33 +0,0 @@ -@description('Specifies the name of the Azure Storage account.') -param storageAccountName string - -@description('Specifies the name of the blob container.') -param containerName string = 'logs' - -@description( - 'Specifies the location in which the Azure Storage resources should be deployed.' -) -param location string = resourceGroup().location - -resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { - name: storageAccountName - location: location - sku: { - name: 'Standard_LRS' - tier: 'Standard' - } - kind: 'StorageV2' - properties: { - accessTier: 'Hot' - } -} - -resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { - name: '${storageAccountName}/default/${containerName}' - properties: { - denyEncryptionScopeOverride: true - publicAccess: 'Blob' - metadata: {} - } - dependsOn: [storageAccount] -} diff --git a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json index 5b6961233e3..8958f4d9404 100644 --- a/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/storage_blob_service_container_with_public_access/test/positive_expected_result.json @@ -40,5 +40,23 @@ "severity": "HIGH", "line": 96, "fileName": "positive7.json" + }, + { + "queryName": "Storage Blob Service Container With Public Access", + "severity": "HIGH", + "line": 5, + "fileName": "positive1.bicep" + }, + { + "queryName": "Storage Blob Service Container With Public Access", + "severity": "HIGH", + "line": 87, + "fileName": "positive2.bicep" + }, + { + "queryName": "Storage Blob Service Container With Public Access", + "severity": "HIGH", + "line": 29, + "fileName": "positive3.bicep" } ] diff --git a/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/negative1.bicep b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/negative1.bicep new file mode 100644 index 00000000000..67d7f58e39c --- /dev/null +++ b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/negative1.bicep @@ -0,0 +1,19 @@ +resource default_Microsoft_Insights 'Microsoft.Storage/storageAccounts/queueServices/providers/diagnosticsettings@2017-05-01-preview' = { + name: 'Microsoft.Storage/storageAccounts/queueServices/providers' + properties: { + logs: [ + { + category: 'StorageRead' + enabled: true + } + { + category: 'StorageWrite' + enabled: true + } + { + category: 'StorageDelete' + enabled: true + } + ] + } +} diff --git a/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive1.bicep b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive1.bicep new file mode 100644 index 00000000000..881432f2508 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive1.bicep @@ -0,0 +1,19 @@ +resource default_Microsoft_Insights 'Microsoft.Storage/storageAccounts/queueServices/providers/diagnosticsettings@2017-05-01-preview' = { + name: 'Microsoft.Storage/storageAccounts/queueServices/providers' + properties: { + logs: [ + { + category: 'StorageRead' + enabled: false + } + { + category: 'StorageWrite' + enabled: false + } + { + category: 'StorageDelete' + enabled: false + } + ] + } +} diff --git a/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive2.bicep b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive2.bicep new file mode 100644 index 00000000000..9abd315009a --- /dev/null +++ b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive2.bicep @@ -0,0 +1,6 @@ +resource default_Microsoft_Insights 'Microsoft.Storage/storageAccounts/queueServices/providers/diagnosticsettings@2017-05-01-preview' = { + name: 'Microsoft.Storage/storageAccounts/queueServices/providers' + properties:{ + logs:[] + } +} diff --git a/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive3.bicep b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive3.bicep new file mode 100644 index 00000000000..7ee37f5a4ef --- /dev/null +++ b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive3.bicep @@ -0,0 +1,19 @@ +resource default_Microsoft_Insights 'Microsoft.Storage/storageAccounts/queueServices/providers/diagnosticsettings@2017-05-01-preview' = { + name: 'Microsoft.Storage/storageAccounts/queueServices/providers' + properties: { + logs: [ + { + category: 'StorageRead' + enabled: false + } + { + category: 'StorageWrite' + enabled: true + } + { + category: 'StorageDelete' + enabled: false + } + ] + } +} diff --git a/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive4.bicep b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive4.bicep new file mode 100644 index 00000000000..e17fc0b221a --- /dev/null +++ b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive4.bicep @@ -0,0 +1,11 @@ +resource default_Microsoft_Insights 'Microsoft.Storage/storageAccounts/queueServices/providers/diagnosticsettings@2017-05-01-preview' = { + name: 'Microsoft.Storage/storageAccounts/queueServices/providers' + properties: { + logs: [ + { + category: 'StorageWrite' + enabled: true + } + ] + } +} diff --git a/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive5.bicep b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive5.bicep new file mode 100644 index 00000000000..2eee3637d3e --- /dev/null +++ b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive5.bicep @@ -0,0 +1,11 @@ +resource default_Microsoft_Insights 'Microsoft.Storage/storageAccounts/queueServices/providers/diagnosticsettings@2017-05-01-preview' = { + name: 'Microsoft.Storage/storageAccounts/queueServices/providers' + properties: { + logs: [ + { + category: 'StorageWrite' + enabled: false + } + ] + } +} diff --git a/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive6.bicep b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive6.bicep new file mode 100644 index 00000000000..a0df173d8fc --- /dev/null +++ b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive6.bicep @@ -0,0 +1,3 @@ +resource default_Microsoft_Insights 'Microsoft.Storage/storageAccounts/queueServices/providers/diagnosticsettings@2017-05-01-preview' = { + name: 'Microsoft.Storage/storageAccounts/queueServices/providers' +} diff --git a/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive7.bicep b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive7.bicep new file mode 100644 index 00000000000..6c28c1c2649 --- /dev/null +++ b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive7.bicep @@ -0,0 +1,4 @@ +resource default_Microsoft_Insights 'Microsoft.Storage/storageAccounts/queueServices/providers/diagnosticsettings@2017-05-01-preview' = { + name: 'Microsoft.Storage/storageAccounts/queueServices/providers' + properties: {} +} diff --git a/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive_expected_result.json b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive_expected_result.json index db3efe2941c..a38a9ae1865 100644 --- a/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/storage_logging_for_read_write_delete_requests_disabled/test/positive_expected_result.json @@ -106,5 +106,119 @@ "severity": "MEDIUM", "line": 69, "fileName": "positive6.json" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 7, + "fileName": "positive1.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 15, + "fileName": "positive1.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 11, + "fileName": "positive1.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 4, + "fileName": "positive2.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 4, + "fileName": "positive2.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 4, + "fileName": "positive2.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 7, + "fileName": "positive3.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 15, + "fileName": "positive3.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 4, + "fileName": "positive4.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 4, + "fileName": "positive4.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 7, + "fileName": "positive5.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 4, + "fileName": "positive5.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 4, + "fileName": "positive5.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 2, + "fileName": "positive6.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 2, + "fileName": "positive6.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 2, + "fileName": "positive6.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 3, + "fileName": "positive7.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 3, + "fileName": "positive7.bicep" + }, + { + "queryName": "Storage Logging For Read Write And Delete Requests Disabled", + "severity": "MEDIUM", + "line": 3, + "fileName": "positive7.bicep" } ] From 059ae264b0caf02a1e4752263549890a7645a4be Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Fri, 3 May 2024 15:35:24 +0100 Subject: [PATCH 080/130] improved nested resources functions --- pkg/parser/bicep/parser.go | 52 +++++++++++++-------------------- pkg/parser/bicep/parser_test.go | 3 -- 2 files changed, 20 insertions(+), 35 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index f1bc184c412..3e5d64f4626 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -55,6 +55,7 @@ func convertVisitorToJSONBicep(visitor *BicepVisitor) *JSONBicep { type Resource struct { Name string + FullType string Parent string Children []*Resource ResourceData interface{} @@ -67,7 +68,6 @@ func filterParentStructs(resources []*Resource) []interface{} { for _, resource := range resources { if resource.Parent == "" { formattedNode := reformatTestTree(*resource) - formattedNode = shortenTypes(formattedNode, "") filteredResources = append(filteredResources, formattedNode) } } @@ -75,24 +75,33 @@ func filterParentStructs(resources []*Resource) []interface{} { return filteredResources } +func setChildType(child *map[string]interface{}, parentType string) { + + if parentType != "" { + newType := strings.Replace((*child)["type"].(string), parentType+"/", "", 1) + (*child)["type"] = newType + } +} + // Reverte um objeto do tipo struct Resource para a estrutura original do JBicep (inverso do convertOriginalResourcesToStruct) func reformatTestTree(resource Resource) map[string]interface{} { - res := map[string]interface{}{} - - res["identifier"] = resource.Name + reformattedResource := map[string]interface{}{} children := []interface{}{} for _, child := range resource.Children { formattedChild := reformatTestTree(*child) + setChildType(&formattedChild, resource.FullType) children = append(children, formattedChild) } + if len(children) > 0 { + reformattedResource["resources"] = children + } - res["resources"] = children for k, v := range resource.ResourceData.(map[string]interface{}) { - res[k] = v + reformattedResource[k] = v } - return res + return reformattedResource } // Adiciona as resources ao array "resources" do seu parent caso exista @@ -108,28 +117,6 @@ func addChildrenToParents(resources []*Resource) { } } -// Dá trim aos types de forma a que sigam a mesma estrutura que é utilizada pelos ficheiros ARM -func shortenTypes(resource map[string]interface{}, parentType string) map[string]interface{} { - - if _, hasParent := resource["parent"]; hasParent { - newType := strings.Replace(resource["type"].(string), parentType+"/", "", 1) - parentType = resource["type"].(string) - resource["type"] = newType - } else { - parentType = resource["type"].(string) - } - - if children, hasChildren := resource["resources"]; hasChildren { - for _, child := range children.([]interface{}) { - updatedChild := shortenTypes(child.(map[string]interface{}), parentType) - child = &updatedChild - } - resource["resources"] = children - } - - return resource -} - // Converte array de objetos com a estrutura original do JBicep para um array de Resource func convertOriginalResourcesToStruct(resources []interface{}) []*Resource { newResources := []*Resource{} @@ -137,8 +124,10 @@ func convertOriginalResourcesToStruct(resources []interface{}) []*Resource { for _, res := range resources { actualRes := res.(map[string]interface{}) resName := actualRes["identifier"].(string) + resType := actualRes["type"].(string) newRes := Resource{ Name: resName, + FullType: resType, ResourceData: res, } @@ -154,11 +143,10 @@ func convertOriginalResourcesToStruct(resources []interface{}) []*Resource { } func makeResourcesNestedStructure(jBicep *JSONBicep) []interface{} { - trueResources := jBicep.Resources - resources := convertOriginalResourcesToStruct(trueResources) + originalResources := jBicep.Resources + resources := convertOriginalResourcesToStruct(originalResources) addChildrenToParents(resources) - filteredResources := filterParentStructs(resources) return filteredResources diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 61b72802176..b77a541cac8 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -660,7 +660,6 @@ func TestParseBicepFile(t *testing.T) { } } }, - "resources": [], "type": "Microsoft.Compute/virtualMachines" }, { @@ -701,7 +700,6 @@ func TestParseBicepFile(t *testing.T) { "identifier": "nic", "location": null, "name": "", - "resources": [], "type": "Microsoft.Network/networkInterfaces", "userAssignedIdentities": { "'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { @@ -989,7 +987,6 @@ func TestParseBicepFile(t *testing.T) { }, "publicAccess": "Blob" }, - "resources": [], "type": "containers" } ], From 889d64a9afb815f940561936eb1d1b54c299fffb Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Fri, 3 May 2024 15:43:08 +0100 Subject: [PATCH 081/130] lint fixes --- pkg/parser/bicep/parser.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 3e5d64f4626..bd2339e3837 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -67,7 +67,7 @@ func filterParentStructs(resources []*Resource) []interface{} { for _, resource := range resources { if resource.Parent == "" { - formattedNode := reformatTestTree(*resource) + formattedNode := reformatTestTree(resource) filteredResources = append(filteredResources, formattedNode) } } @@ -84,12 +84,12 @@ func setChildType(child *map[string]interface{}, parentType string) { } // Reverte um objeto do tipo struct Resource para a estrutura original do JBicep (inverso do convertOriginalResourcesToStruct) -func reformatTestTree(resource Resource) map[string]interface{} { +func reformatTestTree(resource *Resource) map[string]interface{} { reformattedResource := map[string]interface{}{} children := []interface{}{} for _, child := range resource.Children { - formattedChild := reformatTestTree(*child) + formattedChild := reformatTestTree(child) setChildType(&formattedChild, resource.FullType) children = append(children, formattedChild) } @@ -139,7 +139,6 @@ func convertOriginalResourcesToStruct(resources []interface{}) []*Resource { } return newResources - } func makeResourcesNestedStructure(jBicep *JSONBicep) []interface{} { From 344dc2c2e18f44b2ae5fbc68140464ee8de5675d Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Fri, 3 May 2024 15:45:49 +0100 Subject: [PATCH 082/130] lint fixes --- pkg/parser/bicep/parser.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index bd2339e3837..ab4f9a88db9 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -75,11 +75,11 @@ func filterParentStructs(resources []*Resource) []interface{} { return filteredResources } -func setChildType(child *map[string]interface{}, parentType string) { +func setChildType(child map[string]interface{}, parentType string) { if parentType != "" { - newType := strings.Replace((*child)["type"].(string), parentType+"/", "", 1) - (*child)["type"] = newType + newType := strings.Replace((child)["type"].(string), parentType+"/", "", 1) + (child)["type"] = newType } } @@ -90,7 +90,7 @@ func reformatTestTree(resource *Resource) map[string]interface{} { children := []interface{}{} for _, child := range resource.Children { formattedChild := reformatTestTree(child) - setChildType(&formattedChild, resource.FullType) + setChildType(formattedChild, resource.FullType) children = append(children, formattedChild) } if len(children) > 0 { From 46ec0f0bc5ebb97bc9af18639d8ef83996833763 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Fri, 3 May 2024 15:48:04 +0100 Subject: [PATCH 083/130] lint --- pkg/parser/bicep/parser.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index ab4f9a88db9..ba096e960c4 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -76,7 +76,6 @@ func filterParentStructs(resources []*Resource) []interface{} { } func setChildType(child map[string]interface{}, parentType string) { - if parentType != "" { newType := strings.Replace((child)["type"].(string), parentType+"/", "", 1) (child)["type"] = newType From c1d1179b0f07dc3e0237c1ee98b91049ebd2c93f Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 6 May 2024 09:56:13 +0100 Subject: [PATCH 084/130] fixed support for non-sequential nested resources --- pkg/parser/bicep/parser.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index ba096e960c4..7e6e22ed19d 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -109,6 +109,9 @@ func addChildrenToParents(resources []*Resource) { for _, resource := range resources { resourceMap[resource.Name] = resource + } + + for _, resource := range resources { if resource.Parent != "" { parent := resourceMap[resource.Parent] parent.Children = append(parent.Children, resource) From e45909a3234e9b8e06945aaa05d569cad0079fdf Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 6 May 2024 10:23:31 +0100 Subject: [PATCH 085/130] added safety verification in nested resources function --- pkg/parser/bicep/parser.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 7e6e22ed19d..22eca7cbf19 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -96,7 +96,11 @@ func reformatTestTree(resource *Resource) map[string]interface{} { reformattedResource["resources"] = children } - for k, v := range resource.ResourceData.(map[string]interface{}) { + resData, ok := resource.ResourceData.(map[string]interface{}) + if !ok { + return reformattedResource + } + for k, v := range resData { reformattedResource[k] = v } From b2cd4cdb03bfb1b31cc4e848f8d199df8c63990a Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 7 May 2024 14:41:56 +0100 Subject: [PATCH 086/130] added more protection against panics --- pkg/parser/bicep/parser.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 22eca7cbf19..eab6af5fb52 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -484,9 +484,11 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf } } // Last expression with string right piece - interpString = append(interpString, - ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())).Accept(s), - ctx.STRING_RIGHT_PIECE().GetText()) + if len(ctx.AllExpression()) > 0 { + interpString = append(interpString, + ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())).Accept(s), + ctx.STRING_RIGHT_PIECE().GetText()) + } str := "" for _, v := range interpString { switch v := v.(type) { From c39a1fdf26bbe2cf7db62aabff4a5755b840f493 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 7 May 2024 14:44:00 +0100 Subject: [PATCH 087/130] fixed typos --- docs/future_improvements.md | 2 +- docs/platforms.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/future_improvements.md b/docs/future_improvements.md index 204a9343ebb..59274d993b8 100644 --- a/docs/future_improvements.md +++ b/docs/future_improvements.md @@ -30,5 +30,5 @@ We advise reviewing your project's specific security needs to determine if this ## Contribution -If you'd like to contribute or provide insightfull feedback regarding KICS' capabilities and limitations, please don't hesitate to contact [our team](https://github.com/Checkmarx/kics/issues/). +If you'd like to contribute or provide insightful feedback regarding KICS' capabilities and limitations, please don't hesitate to contact [our team](https://github.com/Checkmarx/kics/issues/). We appreciate your patience and understanding as we strive to deliver a more robust scanning solution. \ No newline at end of file diff --git a/docs/platforms.md b/docs/platforms.md index d4ff477c1b4..beddfb6ea1d 100644 --- a/docs/platforms.md +++ b/docs/platforms.md @@ -28,7 +28,7 @@ For instructions on converting between ARM JSON templates and Bicep code, refer Note that KICS recognizes this technology as Azure Resource Manager (for queries purpose). -Explore our ongoing enhancements and planed features on our [Future Improvements](future_improvements.md) page. +Explore our ongoing enhancements and planned features on our [Future Improvements](future_improvements.md) page. ## CDK From f0203eaf38218f84323bebca8eefadc612a1eeda Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 7 May 2024 14:51:26 +0100 Subject: [PATCH 088/130] fixed redundant assignment --- pkg/parser/bicep/parser.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index eab6af5fb52..be3f277d82d 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -331,8 +331,6 @@ func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interf line := map[string]int{kicsLine: ctx.GetStart().GetLine()} lines[kicsPrefix+"apiVersion"] = line - - line = map[string]int{kicsLine: ctx.GetStart().GetLine()} lines[kicsPrefix+"type"] = line s.resourceList = append(s.resourceList, resource) From d89e441f9e943427f911866329bdb1436b087987 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 7 May 2024 15:07:58 +0100 Subject: [PATCH 089/130] upgraded aws back to 1.26.1 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index b463482d9b6..a36d0af9514 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/agnivade/levenshtein v1.1.1 github.com/alexmullins/zip v0.0.0-20180717182244-4affb64b04d0 github.com/antlr4-go/antlr/v4 v4.13.0 - github.com/aws/aws-sdk-go-v2 v1.17.6 + github.com/aws/aws-sdk-go-v2 v1.26.1 github.com/bigkevmcd/go-configparser v0.0.0-20230427073640-c6b631f70126 github.com/cheggaaa/pb/v3 v3.1.2 github.com/emicklei/proto v1.11.2 From afecbfa76bf5db36bb38f0fb0ede2f59a6c9674f Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Tue, 7 May 2024 15:32:47 +0100 Subject: [PATCH 090/130] added analyzer test for bicep --- go.sum | 5 ++--- pkg/analyzer/analyzer_test.go | 13 +++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/go.sum b/go.sum index 9a3ebb099c1..790ea866bbc 100644 --- a/go.sum +++ b/go.sum @@ -241,9 +241,8 @@ github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:W github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.44.295 h1:SGjU1+MqttXfRiWHD6WU0DRhaanJgAFY+xIhEaugV8Y= github.com/aws/aws-sdk-go v1.44.295/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.17.6 h1:Y773UK7OBqhzi5VDXMi1zVGsoj+CVHs2eaC2bDsLwi0= -github.com/aws/aws-sdk-go-v2 v1.17.6/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= +github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= diff --git a/pkg/analyzer/analyzer_test.go b/pkg/analyzer/analyzer_test.go index 98cdf146a9c..8354a1d4e60 100644 --- a/pkg/analyzer/analyzer_test.go +++ b/pkg/analyzer/analyzer_test.go @@ -423,6 +423,19 @@ func TestAnalyzer_Analyze(t *testing.T) { excludeGitIgnore: false, MaxFileSize: -1, }, + { + name: "analyze_test_bicep", + paths: []string{filepath.FromSlash("../../test/fixtures/bicep_test")}, + wantTypes: []string{"bicep"}, + wantExclude: []string{}, + typesFromFlag: []string{""}, + excludeTypesFromFlag: []string{""}, + wantLOC: 227, + wantErr: false, + gitIgnoreFileName: "", + excludeGitIgnore: false, + MaxFileSize: -1, + }, } for _, tt := range tests { From ad4677016e37b9053332968bd51290247146e682 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Tue, 7 May 2024 15:47:00 +0100 Subject: [PATCH 091/130] grammar update to parse expression with double COL --- pkg/parser/bicep/antlr/bicep.g4 | 1 + pkg/parser/bicep/antlr/parser/bicep.interp | 2 +- pkg/parser/bicep/antlr/parser/bicep_parser.go | 491 ++++++++++-------- 3 files changed, 269 insertions(+), 225 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index fabfcdaa895..4b0b3221ddf 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -62,6 +62,7 @@ expression: | expression QMARK expression COL expression | expression DOT property = identifier | expression COL name = identifier + | expression COL COL name = identifier | expression logicCharacter expression | primaryExpression; diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index e8ffc34c57a..7c47d2a944d 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -118,4 +118,4 @@ identifier atn: -[4, 1, 42, 322, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 1, 0, 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 65, 8, 1, 1, 2, 5, 2, 68, 8, 2, 10, 2, 12, 2, 71, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 77, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 82, 8, 2, 3, 2, 84, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 92, 8, 4, 10, 4, 12, 4, 95, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 104, 8, 5, 10, 5, 12, 5, 107, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 5, 7, 126, 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 7, 1, 7, 1, 7, 3, 7, 134, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 141, 8, 7, 10, 7, 12, 7, 144, 9, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 156, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 171, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 197, 8, 11, 10, 11, 12, 11, 200, 9, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 212, 8, 13, 1, 14, 1, 14, 3, 14, 216, 8, 14, 1, 14, 1, 14, 3, 14, 220, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 231, 8, 16, 1, 17, 1, 17, 4, 17, 235, 8, 17, 11, 17, 12, 17, 236, 1, 17, 1, 17, 4, 17, 241, 8, 17, 11, 17, 12, 17, 242, 5, 17, 245, 8, 17, 10, 17, 12, 17, 248, 9, 17, 3, 17, 250, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 256, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 263, 8, 19, 10, 19, 12, 19, 266, 9, 19, 1, 19, 5, 19, 269, 8, 19, 10, 19, 12, 19, 272, 9, 19, 1, 19, 1, 19, 1, 20, 1, 20, 4, 20, 278, 8, 20, 11, 20, 12, 20, 279, 1, 20, 3, 20, 283, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 294, 8, 22, 1, 23, 1, 23, 1, 23, 3, 23, 299, 8, 23, 1, 23, 3, 23, 302, 8, 23, 1, 23, 3, 23, 305, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 3, 24, 312, 8, 24, 1, 24, 5, 24, 315, 8, 24, 10, 24, 12, 24, 318, 9, 24, 1, 25, 1, 25, 1, 25, 0, 1, 22, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, 2, 1, 0, 32, 37, 3, 0, 14, 20, 25, 27, 38, 38, 347, 0, 55, 1, 0, 0, 0, 2, 64, 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, 87, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 105, 1, 0, 0, 0, 12, 119, 1, 0, 0, 0, 14, 123, 1, 0, 0, 0, 16, 147, 1, 0, 0, 0, 18, 155, 1, 0, 0, 0, 20, 170, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 201, 1, 0, 0, 0, 26, 211, 1, 0, 0, 0, 28, 213, 1, 0, 0, 0, 30, 223, 1, 0, 0, 0, 32, 230, 1, 0, 0, 0, 34, 232, 1, 0, 0, 0, 36, 255, 1, 0, 0, 0, 38, 260, 1, 0, 0, 0, 40, 275, 1, 0, 0, 0, 42, 284, 1, 0, 0, 0, 44, 293, 1, 0, 0, 0, 46, 295, 1, 0, 0, 0, 48, 308, 1, 0, 0, 0, 50, 319, 1, 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 58, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 0, 0, 1, 59, 1, 1, 0, 0, 0, 60, 65, 3, 4, 2, 0, 61, 65, 3, 8, 4, 0, 62, 65, 3, 10, 5, 0, 63, 65, 5, 40, 0, 0, 64, 60, 1, 0, 0, 0, 64, 61, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 63, 1, 0, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 42, 21, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 14, 0, 0, 73, 83, 3, 50, 25, 0, 74, 76, 3, 30, 15, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 84, 1, 0, 0, 0, 78, 79, 5, 20, 0, 0, 79, 81, 3, 20, 10, 0, 80, 82, 3, 6, 3, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 74, 1, 0, 0, 0, 83, 78, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 5, 40, 0, 0, 86, 5, 1, 0, 0, 0, 87, 88, 5, 11, 0, 0, 88, 89, 3, 22, 11, 0, 89, 7, 1, 0, 0, 0, 90, 92, 3, 42, 21, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 15, 0, 0, 97, 98, 3, 50, 25, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 22, 11, 0, 100, 101, 5, 40, 0, 0, 101, 9, 1, 0, 0, 0, 102, 104, 3, 42, 21, 0, 103, 102, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 5, 20, 0, 0, 109, 110, 3, 50, 25, 0, 110, 111, 3, 20, 10, 0, 111, 115, 5, 11, 0, 0, 112, 116, 3, 12, 6, 0, 113, 116, 3, 34, 17, 0, 114, 116, 3, 14, 7, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 11, 1, 0, 0, 0, 119, 120, 5, 28, 0, 0, 120, 121, 3, 28, 14, 0, 121, 122, 3, 34, 17, 0, 122, 13, 1, 0, 0, 0, 123, 127, 5, 4, 0, 0, 124, 126, 5, 40, 0, 0, 125, 124, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 133, 5, 29, 0, 0, 131, 134, 3, 50, 25, 0, 132, 134, 3, 16, 8, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 30, 0, 0, 136, 137, 3, 22, 11, 0, 137, 138, 5, 10, 0, 0, 138, 142, 3, 18, 9, 0, 139, 141, 5, 40, 0, 0, 140, 139, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 5, 5, 0, 0, 146, 15, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, 3, 50, 25, 0, 149, 150, 5, 3, 0, 0, 150, 151, 3, 50, 25, 0, 151, 152, 5, 7, 0, 0, 152, 17, 1, 0, 0, 0, 153, 156, 3, 22, 11, 0, 154, 156, 3, 12, 6, 0, 155, 153, 1, 0, 0, 0, 155, 154, 1, 0, 0, 0, 156, 19, 1, 0, 0, 0, 157, 163, 5, 21, 0, 0, 158, 159, 3, 22, 11, 0, 159, 160, 5, 22, 0, 0, 160, 162, 1, 0, 0, 0, 161, 158, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 167, 3, 22, 11, 0, 167, 168, 5, 23, 0, 0, 168, 171, 1, 0, 0, 0, 169, 171, 5, 24, 0, 0, 170, 157, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, 21, 1, 0, 0, 0, 172, 173, 6, 11, -1, 0, 173, 174, 3, 26, 13, 0, 174, 198, 1, 0, 0, 0, 175, 176, 10, 5, 0, 0, 176, 177, 5, 31, 0, 0, 177, 178, 3, 22, 11, 0, 178, 179, 5, 10, 0, 0, 179, 180, 3, 22, 11, 6, 180, 197, 1, 0, 0, 0, 181, 182, 10, 2, 0, 0, 182, 183, 3, 24, 12, 0, 183, 184, 3, 22, 11, 3, 184, 197, 1, 0, 0, 0, 185, 186, 10, 6, 0, 0, 186, 187, 5, 4, 0, 0, 187, 188, 3, 22, 11, 0, 188, 189, 5, 5, 0, 0, 189, 197, 1, 0, 0, 0, 190, 191, 10, 4, 0, 0, 191, 192, 5, 8, 0, 0, 192, 197, 3, 50, 25, 0, 193, 194, 10, 3, 0, 0, 194, 195, 5, 10, 0, 0, 195, 197, 3, 50, 25, 0, 196, 175, 1, 0, 0, 0, 196, 181, 1, 0, 0, 0, 196, 185, 1, 0, 0, 0, 196, 190, 1, 0, 0, 0, 196, 193, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 23, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 202, 7, 0, 0, 0, 202, 25, 1, 0, 0, 0, 203, 212, 3, 32, 16, 0, 204, 212, 3, 46, 23, 0, 205, 212, 3, 20, 10, 0, 206, 212, 5, 1, 0, 0, 207, 212, 3, 38, 19, 0, 208, 212, 3, 34, 17, 0, 209, 212, 3, 14, 7, 0, 210, 212, 3, 28, 14, 0, 211, 203, 1, 0, 0, 0, 211, 204, 1, 0, 0, 0, 211, 205, 1, 0, 0, 0, 211, 206, 1, 0, 0, 0, 211, 207, 1, 0, 0, 0, 211, 208, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 211, 210, 1, 0, 0, 0, 212, 27, 1, 0, 0, 0, 213, 215, 5, 6, 0, 0, 214, 216, 5, 40, 0, 0, 215, 214, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 219, 3, 22, 11, 0, 218, 220, 5, 40, 0, 0, 219, 218, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, 5, 7, 0, 0, 222, 29, 1, 0, 0, 0, 223, 224, 3, 50, 25, 0, 224, 31, 1, 0, 0, 0, 225, 231, 5, 39, 0, 0, 226, 231, 5, 16, 0, 0, 227, 231, 5, 17, 0, 0, 228, 231, 5, 18, 0, 0, 229, 231, 3, 50, 25, 0, 230, 225, 1, 0, 0, 0, 230, 226, 1, 0, 0, 0, 230, 227, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, 229, 1, 0, 0, 0, 231, 33, 1, 0, 0, 0, 232, 249, 5, 12, 0, 0, 233, 235, 5, 40, 0, 0, 234, 233, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 234, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 246, 1, 0, 0, 0, 238, 240, 3, 36, 18, 0, 239, 241, 5, 40, 0, 0, 240, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 245, 1, 0, 0, 0, 244, 238, 1, 0, 0, 0, 245, 248, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 250, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 249, 234, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 5, 13, 0, 0, 252, 35, 1, 0, 0, 0, 253, 256, 3, 50, 25, 0, 254, 256, 3, 20, 10, 0, 255, 253, 1, 0, 0, 0, 255, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 258, 5, 10, 0, 0, 258, 259, 3, 22, 11, 0, 259, 37, 1, 0, 0, 0, 260, 264, 5, 4, 0, 0, 261, 263, 5, 40, 0, 0, 262, 261, 1, 0, 0, 0, 263, 266, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 270, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 267, 269, 3, 40, 20, 0, 268, 267, 1, 0, 0, 0, 269, 272, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 273, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 273, 274, 5, 5, 0, 0, 274, 39, 1, 0, 0, 0, 275, 282, 3, 22, 11, 0, 276, 278, 5, 40, 0, 0, 277, 276, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 283, 5, 3, 0, 0, 282, 277, 1, 0, 0, 0, 282, 281, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 41, 1, 0, 0, 0, 284, 285, 5, 2, 0, 0, 285, 286, 3, 44, 22, 0, 286, 287, 5, 40, 0, 0, 287, 43, 1, 0, 0, 0, 288, 294, 3, 46, 23, 0, 289, 290, 3, 22, 11, 0, 290, 291, 5, 8, 0, 0, 291, 292, 3, 46, 23, 0, 292, 294, 1, 0, 0, 0, 293, 288, 1, 0, 0, 0, 293, 289, 1, 0, 0, 0, 294, 45, 1, 0, 0, 0, 295, 296, 3, 50, 25, 0, 296, 301, 5, 6, 0, 0, 297, 299, 5, 40, 0, 0, 298, 297, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 302, 3, 48, 24, 0, 301, 298, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 304, 1, 0, 0, 0, 303, 305, 5, 40, 0, 0, 304, 303, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 5, 7, 0, 0, 307, 47, 1, 0, 0, 0, 308, 316, 3, 22, 11, 0, 309, 311, 5, 3, 0, 0, 310, 312, 5, 40, 0, 0, 311, 310, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 315, 3, 22, 11, 0, 314, 309, 1, 0, 0, 0, 315, 318, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 49, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 319, 320, 7, 1, 0, 0, 320, 51, 1, 0, 0, 0, 36, 55, 64, 69, 76, 81, 83, 93, 105, 115, 127, 133, 142, 155, 163, 170, 196, 198, 211, 215, 219, 230, 236, 242, 246, 249, 255, 264, 270, 279, 282, 293, 298, 301, 304, 311, 316] \ No newline at end of file +[4, 1, 42, 326, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 1, 0, 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 65, 8, 1, 1, 2, 5, 2, 68, 8, 2, 10, 2, 12, 2, 71, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 77, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 82, 8, 2, 3, 2, 84, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 92, 8, 4, 10, 4, 12, 4, 95, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 104, 8, 5, 10, 5, 12, 5, 107, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 5, 7, 126, 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 7, 1, 7, 1, 7, 3, 7, 134, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 141, 8, 7, 10, 7, 12, 7, 144, 9, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 156, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 171, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 201, 8, 11, 10, 11, 12, 11, 204, 9, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 216, 8, 13, 1, 14, 1, 14, 3, 14, 220, 8, 14, 1, 14, 1, 14, 3, 14, 224, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 235, 8, 16, 1, 17, 1, 17, 4, 17, 239, 8, 17, 11, 17, 12, 17, 240, 1, 17, 1, 17, 4, 17, 245, 8, 17, 11, 17, 12, 17, 246, 5, 17, 249, 8, 17, 10, 17, 12, 17, 252, 9, 17, 3, 17, 254, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 260, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 267, 8, 19, 10, 19, 12, 19, 270, 9, 19, 1, 19, 5, 19, 273, 8, 19, 10, 19, 12, 19, 276, 9, 19, 1, 19, 1, 19, 1, 20, 1, 20, 4, 20, 282, 8, 20, 11, 20, 12, 20, 283, 1, 20, 3, 20, 287, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 298, 8, 22, 1, 23, 1, 23, 1, 23, 3, 23, 303, 8, 23, 1, 23, 3, 23, 306, 8, 23, 1, 23, 3, 23, 309, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 3, 24, 316, 8, 24, 1, 24, 5, 24, 319, 8, 24, 10, 24, 12, 24, 322, 9, 24, 1, 25, 1, 25, 1, 25, 0, 1, 22, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, 2, 1, 0, 32, 37, 3, 0, 14, 20, 25, 27, 38, 38, 352, 0, 55, 1, 0, 0, 0, 2, 64, 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, 87, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 105, 1, 0, 0, 0, 12, 119, 1, 0, 0, 0, 14, 123, 1, 0, 0, 0, 16, 147, 1, 0, 0, 0, 18, 155, 1, 0, 0, 0, 20, 170, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 205, 1, 0, 0, 0, 26, 215, 1, 0, 0, 0, 28, 217, 1, 0, 0, 0, 30, 227, 1, 0, 0, 0, 32, 234, 1, 0, 0, 0, 34, 236, 1, 0, 0, 0, 36, 259, 1, 0, 0, 0, 38, 264, 1, 0, 0, 0, 40, 279, 1, 0, 0, 0, 42, 288, 1, 0, 0, 0, 44, 297, 1, 0, 0, 0, 46, 299, 1, 0, 0, 0, 48, 312, 1, 0, 0, 0, 50, 323, 1, 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 58, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 0, 0, 1, 59, 1, 1, 0, 0, 0, 60, 65, 3, 4, 2, 0, 61, 65, 3, 8, 4, 0, 62, 65, 3, 10, 5, 0, 63, 65, 5, 40, 0, 0, 64, 60, 1, 0, 0, 0, 64, 61, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 63, 1, 0, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 42, 21, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 14, 0, 0, 73, 83, 3, 50, 25, 0, 74, 76, 3, 30, 15, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 84, 1, 0, 0, 0, 78, 79, 5, 20, 0, 0, 79, 81, 3, 20, 10, 0, 80, 82, 3, 6, 3, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 74, 1, 0, 0, 0, 83, 78, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 5, 40, 0, 0, 86, 5, 1, 0, 0, 0, 87, 88, 5, 11, 0, 0, 88, 89, 3, 22, 11, 0, 89, 7, 1, 0, 0, 0, 90, 92, 3, 42, 21, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 15, 0, 0, 97, 98, 3, 50, 25, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 22, 11, 0, 100, 101, 5, 40, 0, 0, 101, 9, 1, 0, 0, 0, 102, 104, 3, 42, 21, 0, 103, 102, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 5, 20, 0, 0, 109, 110, 3, 50, 25, 0, 110, 111, 3, 20, 10, 0, 111, 115, 5, 11, 0, 0, 112, 116, 3, 12, 6, 0, 113, 116, 3, 34, 17, 0, 114, 116, 3, 14, 7, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 11, 1, 0, 0, 0, 119, 120, 5, 28, 0, 0, 120, 121, 3, 28, 14, 0, 121, 122, 3, 34, 17, 0, 122, 13, 1, 0, 0, 0, 123, 127, 5, 4, 0, 0, 124, 126, 5, 40, 0, 0, 125, 124, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 133, 5, 29, 0, 0, 131, 134, 3, 50, 25, 0, 132, 134, 3, 16, 8, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 30, 0, 0, 136, 137, 3, 22, 11, 0, 137, 138, 5, 10, 0, 0, 138, 142, 3, 18, 9, 0, 139, 141, 5, 40, 0, 0, 140, 139, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 5, 5, 0, 0, 146, 15, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, 3, 50, 25, 0, 149, 150, 5, 3, 0, 0, 150, 151, 3, 50, 25, 0, 151, 152, 5, 7, 0, 0, 152, 17, 1, 0, 0, 0, 153, 156, 3, 22, 11, 0, 154, 156, 3, 12, 6, 0, 155, 153, 1, 0, 0, 0, 155, 154, 1, 0, 0, 0, 156, 19, 1, 0, 0, 0, 157, 163, 5, 21, 0, 0, 158, 159, 3, 22, 11, 0, 159, 160, 5, 22, 0, 0, 160, 162, 1, 0, 0, 0, 161, 158, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 167, 3, 22, 11, 0, 167, 168, 5, 23, 0, 0, 168, 171, 1, 0, 0, 0, 169, 171, 5, 24, 0, 0, 170, 157, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, 21, 1, 0, 0, 0, 172, 173, 6, 11, -1, 0, 173, 174, 3, 26, 13, 0, 174, 202, 1, 0, 0, 0, 175, 176, 10, 6, 0, 0, 176, 177, 5, 31, 0, 0, 177, 178, 3, 22, 11, 0, 178, 179, 5, 10, 0, 0, 179, 180, 3, 22, 11, 7, 180, 201, 1, 0, 0, 0, 181, 182, 10, 2, 0, 0, 182, 183, 3, 24, 12, 0, 183, 184, 3, 22, 11, 3, 184, 201, 1, 0, 0, 0, 185, 186, 10, 7, 0, 0, 186, 187, 5, 4, 0, 0, 187, 188, 3, 22, 11, 0, 188, 189, 5, 5, 0, 0, 189, 201, 1, 0, 0, 0, 190, 191, 10, 5, 0, 0, 191, 192, 5, 8, 0, 0, 192, 201, 3, 50, 25, 0, 193, 194, 10, 4, 0, 0, 194, 195, 5, 10, 0, 0, 195, 201, 3, 50, 25, 0, 196, 197, 10, 3, 0, 0, 197, 198, 5, 10, 0, 0, 198, 199, 5, 10, 0, 0, 199, 201, 3, 50, 25, 0, 200, 175, 1, 0, 0, 0, 200, 181, 1, 0, 0, 0, 200, 185, 1, 0, 0, 0, 200, 190, 1, 0, 0, 0, 200, 193, 1, 0, 0, 0, 200, 196, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 23, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 205, 206, 7, 0, 0, 0, 206, 25, 1, 0, 0, 0, 207, 216, 3, 32, 16, 0, 208, 216, 3, 46, 23, 0, 209, 216, 3, 20, 10, 0, 210, 216, 5, 1, 0, 0, 211, 216, 3, 38, 19, 0, 212, 216, 3, 34, 17, 0, 213, 216, 3, 14, 7, 0, 214, 216, 3, 28, 14, 0, 215, 207, 1, 0, 0, 0, 215, 208, 1, 0, 0, 0, 215, 209, 1, 0, 0, 0, 215, 210, 1, 0, 0, 0, 215, 211, 1, 0, 0, 0, 215, 212, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 214, 1, 0, 0, 0, 216, 27, 1, 0, 0, 0, 217, 219, 5, 6, 0, 0, 218, 220, 5, 40, 0, 0, 219, 218, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 223, 3, 22, 11, 0, 222, 224, 5, 40, 0, 0, 223, 222, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 226, 5, 7, 0, 0, 226, 29, 1, 0, 0, 0, 227, 228, 3, 50, 25, 0, 228, 31, 1, 0, 0, 0, 229, 235, 5, 39, 0, 0, 230, 235, 5, 16, 0, 0, 231, 235, 5, 17, 0, 0, 232, 235, 5, 18, 0, 0, 233, 235, 3, 50, 25, 0, 234, 229, 1, 0, 0, 0, 234, 230, 1, 0, 0, 0, 234, 231, 1, 0, 0, 0, 234, 232, 1, 0, 0, 0, 234, 233, 1, 0, 0, 0, 235, 33, 1, 0, 0, 0, 236, 253, 5, 12, 0, 0, 237, 239, 5, 40, 0, 0, 238, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 250, 1, 0, 0, 0, 242, 244, 3, 36, 18, 0, 243, 245, 5, 40, 0, 0, 244, 243, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 249, 1, 0, 0, 0, 248, 242, 1, 0, 0, 0, 249, 252, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 254, 1, 0, 0, 0, 252, 250, 1, 0, 0, 0, 253, 238, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 256, 5, 13, 0, 0, 256, 35, 1, 0, 0, 0, 257, 260, 3, 50, 25, 0, 258, 260, 3, 20, 10, 0, 259, 257, 1, 0, 0, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 262, 5, 10, 0, 0, 262, 263, 3, 22, 11, 0, 263, 37, 1, 0, 0, 0, 264, 268, 5, 4, 0, 0, 265, 267, 5, 40, 0, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 274, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 271, 273, 3, 40, 20, 0, 272, 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 277, 278, 5, 5, 0, 0, 278, 39, 1, 0, 0, 0, 279, 286, 3, 22, 11, 0, 280, 282, 5, 40, 0, 0, 281, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 287, 5, 3, 0, 0, 286, 281, 1, 0, 0, 0, 286, 285, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 41, 1, 0, 0, 0, 288, 289, 5, 2, 0, 0, 289, 290, 3, 44, 22, 0, 290, 291, 5, 40, 0, 0, 291, 43, 1, 0, 0, 0, 292, 298, 3, 46, 23, 0, 293, 294, 3, 22, 11, 0, 294, 295, 5, 8, 0, 0, 295, 296, 3, 46, 23, 0, 296, 298, 1, 0, 0, 0, 297, 292, 1, 0, 0, 0, 297, 293, 1, 0, 0, 0, 298, 45, 1, 0, 0, 0, 299, 300, 3, 50, 25, 0, 300, 305, 5, 6, 0, 0, 301, 303, 5, 40, 0, 0, 302, 301, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 306, 3, 48, 24, 0, 305, 302, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 308, 1, 0, 0, 0, 307, 309, 5, 40, 0, 0, 308, 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, 5, 7, 0, 0, 311, 47, 1, 0, 0, 0, 312, 320, 3, 22, 11, 0, 313, 315, 5, 3, 0, 0, 314, 316, 5, 40, 0, 0, 315, 314, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 319, 3, 22, 11, 0, 318, 313, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 49, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 324, 7, 1, 0, 0, 324, 51, 1, 0, 0, 0, 36, 55, 64, 69, 76, 81, 83, 93, 105, 115, 127, 133, 142, 155, 163, 170, 200, 202, 215, 219, 223, 234, 240, 246, 250, 253, 259, 268, 274, 283, 286, 297, 302, 305, 308, 315, 320] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 6a63fc20302..b4b4c6a3271 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -57,7 +57,7 @@ func bicepParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 42, 322, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 42, 326, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, @@ -76,131 +76,133 @@ func bicepParserInit() { 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 171, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, - 5, 11, 197, 8, 11, 10, 11, 12, 11, 200, 9, 11, 1, 12, 1, 12, 1, 13, 1, - 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 212, 8, 13, 1, 14, - 1, 14, 3, 14, 216, 8, 14, 1, 14, 1, 14, 3, 14, 220, 8, 14, 1, 14, 1, 14, - 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 231, 8, 16, 1, - 17, 1, 17, 4, 17, 235, 8, 17, 11, 17, 12, 17, 236, 1, 17, 1, 17, 4, 17, - 241, 8, 17, 11, 17, 12, 17, 242, 5, 17, 245, 8, 17, 10, 17, 12, 17, 248, - 9, 17, 3, 17, 250, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 256, 8, 18, - 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 263, 8, 19, 10, 19, 12, 19, 266, - 9, 19, 1, 19, 5, 19, 269, 8, 19, 10, 19, 12, 19, 272, 9, 19, 1, 19, 1, - 19, 1, 20, 1, 20, 4, 20, 278, 8, 20, 11, 20, 12, 20, 279, 1, 20, 3, 20, - 283, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, - 22, 3, 22, 294, 8, 22, 1, 23, 1, 23, 1, 23, 3, 23, 299, 8, 23, 1, 23, 3, - 23, 302, 8, 23, 1, 23, 3, 23, 305, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, - 24, 3, 24, 312, 8, 24, 1, 24, 5, 24, 315, 8, 24, 10, 24, 12, 24, 318, 9, - 24, 1, 25, 1, 25, 1, 25, 0, 1, 22, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, 2, 1, - 0, 32, 37, 3, 0, 14, 20, 25, 27, 38, 38, 347, 0, 55, 1, 0, 0, 0, 2, 64, - 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, 87, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, - 105, 1, 0, 0, 0, 12, 119, 1, 0, 0, 0, 14, 123, 1, 0, 0, 0, 16, 147, 1, - 0, 0, 0, 18, 155, 1, 0, 0, 0, 20, 170, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, - 24, 201, 1, 0, 0, 0, 26, 211, 1, 0, 0, 0, 28, 213, 1, 0, 0, 0, 30, 223, - 1, 0, 0, 0, 32, 230, 1, 0, 0, 0, 34, 232, 1, 0, 0, 0, 36, 255, 1, 0, 0, - 0, 38, 260, 1, 0, 0, 0, 40, 275, 1, 0, 0, 0, 42, 284, 1, 0, 0, 0, 44, 293, - 1, 0, 0, 0, 46, 295, 1, 0, 0, 0, 48, 308, 1, 0, 0, 0, 50, 319, 1, 0, 0, - 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, - 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 58, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, - 58, 59, 5, 0, 0, 1, 59, 1, 1, 0, 0, 0, 60, 65, 3, 4, 2, 0, 61, 65, 3, 8, - 4, 0, 62, 65, 3, 10, 5, 0, 63, 65, 5, 40, 0, 0, 64, 60, 1, 0, 0, 0, 64, - 61, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 63, 1, 0, 0, 0, 65, 3, 1, 0, 0, - 0, 66, 68, 3, 42, 21, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, - 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, - 72, 73, 5, 14, 0, 0, 73, 83, 3, 50, 25, 0, 74, 76, 3, 30, 15, 0, 75, 77, - 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 84, 1, 0, 0, 0, - 78, 79, 5, 20, 0, 0, 79, 81, 3, 20, 10, 0, 80, 82, 3, 6, 3, 0, 81, 80, - 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 74, 1, 0, 0, 0, - 83, 78, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 5, 40, 0, 0, 86, 5, 1, - 0, 0, 0, 87, 88, 5, 11, 0, 0, 88, 89, 3, 22, 11, 0, 89, 7, 1, 0, 0, 0, - 90, 92, 3, 42, 21, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, - 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, - 97, 5, 15, 0, 0, 97, 98, 3, 50, 25, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, - 22, 11, 0, 100, 101, 5, 40, 0, 0, 101, 9, 1, 0, 0, 0, 102, 104, 3, 42, - 21, 0, 103, 102, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, - 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, - 109, 5, 20, 0, 0, 109, 110, 3, 50, 25, 0, 110, 111, 3, 20, 10, 0, 111, - 115, 5, 11, 0, 0, 112, 116, 3, 12, 6, 0, 113, 116, 3, 34, 17, 0, 114, 116, - 3, 14, 7, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, - 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 11, 1, 0, 0, 0, - 119, 120, 5, 28, 0, 0, 120, 121, 3, 28, 14, 0, 121, 122, 3, 34, 17, 0, - 122, 13, 1, 0, 0, 0, 123, 127, 5, 4, 0, 0, 124, 126, 5, 40, 0, 0, 125, - 124, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, - 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 133, 5, 29, - 0, 0, 131, 134, 3, 50, 25, 0, 132, 134, 3, 16, 8, 0, 133, 131, 1, 0, 0, - 0, 133, 132, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 30, 0, 0, 136, - 137, 3, 22, 11, 0, 137, 138, 5, 10, 0, 0, 138, 142, 3, 18, 9, 0, 139, 141, - 5, 40, 0, 0, 140, 139, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, - 0, 0, 142, 143, 1, 0, 0, 0, 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, - 145, 146, 5, 5, 0, 0, 146, 15, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, - 3, 50, 25, 0, 149, 150, 5, 3, 0, 0, 150, 151, 3, 50, 25, 0, 151, 152, 5, - 7, 0, 0, 152, 17, 1, 0, 0, 0, 153, 156, 3, 22, 11, 0, 154, 156, 3, 12, - 6, 0, 155, 153, 1, 0, 0, 0, 155, 154, 1, 0, 0, 0, 156, 19, 1, 0, 0, 0, - 157, 163, 5, 21, 0, 0, 158, 159, 3, 22, 11, 0, 159, 160, 5, 22, 0, 0, 160, - 162, 1, 0, 0, 0, 161, 158, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, - 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, - 0, 0, 166, 167, 3, 22, 11, 0, 167, 168, 5, 23, 0, 0, 168, 171, 1, 0, 0, - 0, 169, 171, 5, 24, 0, 0, 170, 157, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, - 21, 1, 0, 0, 0, 172, 173, 6, 11, -1, 0, 173, 174, 3, 26, 13, 0, 174, 198, - 1, 0, 0, 0, 175, 176, 10, 5, 0, 0, 176, 177, 5, 31, 0, 0, 177, 178, 3, - 22, 11, 0, 178, 179, 5, 10, 0, 0, 179, 180, 3, 22, 11, 6, 180, 197, 1, - 0, 0, 0, 181, 182, 10, 2, 0, 0, 182, 183, 3, 24, 12, 0, 183, 184, 3, 22, - 11, 3, 184, 197, 1, 0, 0, 0, 185, 186, 10, 6, 0, 0, 186, 187, 5, 4, 0, - 0, 187, 188, 3, 22, 11, 0, 188, 189, 5, 5, 0, 0, 189, 197, 1, 0, 0, 0, - 190, 191, 10, 4, 0, 0, 191, 192, 5, 8, 0, 0, 192, 197, 3, 50, 25, 0, 193, - 194, 10, 3, 0, 0, 194, 195, 5, 10, 0, 0, 195, 197, 3, 50, 25, 0, 196, 175, - 1, 0, 0, 0, 196, 181, 1, 0, 0, 0, 196, 185, 1, 0, 0, 0, 196, 190, 1, 0, - 0, 0, 196, 193, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, - 198, 199, 1, 0, 0, 0, 199, 23, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 202, - 7, 0, 0, 0, 202, 25, 1, 0, 0, 0, 203, 212, 3, 32, 16, 0, 204, 212, 3, 46, - 23, 0, 205, 212, 3, 20, 10, 0, 206, 212, 5, 1, 0, 0, 207, 212, 3, 38, 19, - 0, 208, 212, 3, 34, 17, 0, 209, 212, 3, 14, 7, 0, 210, 212, 3, 28, 14, - 0, 211, 203, 1, 0, 0, 0, 211, 204, 1, 0, 0, 0, 211, 205, 1, 0, 0, 0, 211, - 206, 1, 0, 0, 0, 211, 207, 1, 0, 0, 0, 211, 208, 1, 0, 0, 0, 211, 209, - 1, 0, 0, 0, 211, 210, 1, 0, 0, 0, 212, 27, 1, 0, 0, 0, 213, 215, 5, 6, - 0, 0, 214, 216, 5, 40, 0, 0, 215, 214, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, - 216, 217, 1, 0, 0, 0, 217, 219, 3, 22, 11, 0, 218, 220, 5, 40, 0, 0, 219, - 218, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, - 5, 7, 0, 0, 222, 29, 1, 0, 0, 0, 223, 224, 3, 50, 25, 0, 224, 31, 1, 0, - 0, 0, 225, 231, 5, 39, 0, 0, 226, 231, 5, 16, 0, 0, 227, 231, 5, 17, 0, - 0, 228, 231, 5, 18, 0, 0, 229, 231, 3, 50, 25, 0, 230, 225, 1, 0, 0, 0, - 230, 226, 1, 0, 0, 0, 230, 227, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, - 229, 1, 0, 0, 0, 231, 33, 1, 0, 0, 0, 232, 249, 5, 12, 0, 0, 233, 235, - 5, 40, 0, 0, 234, 233, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 234, 1, 0, - 0, 0, 236, 237, 1, 0, 0, 0, 237, 246, 1, 0, 0, 0, 238, 240, 3, 36, 18, - 0, 239, 241, 5, 40, 0, 0, 240, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, - 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 245, 1, 0, 0, 0, 244, 238, - 1, 0, 0, 0, 245, 248, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 247, 1, 0, - 0, 0, 247, 250, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 249, 234, 1, 0, 0, 0, - 249, 250, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 5, 13, 0, 0, 252, - 35, 1, 0, 0, 0, 253, 256, 3, 50, 25, 0, 254, 256, 3, 20, 10, 0, 255, 253, - 1, 0, 0, 0, 255, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 258, 5, 10, - 0, 0, 258, 259, 3, 22, 11, 0, 259, 37, 1, 0, 0, 0, 260, 264, 5, 4, 0, 0, - 261, 263, 5, 40, 0, 0, 262, 261, 1, 0, 0, 0, 263, 266, 1, 0, 0, 0, 264, - 262, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 270, 1, 0, 0, 0, 266, 264, - 1, 0, 0, 0, 267, 269, 3, 40, 20, 0, 268, 267, 1, 0, 0, 0, 269, 272, 1, - 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 273, 1, 0, 0, - 0, 272, 270, 1, 0, 0, 0, 273, 274, 5, 5, 0, 0, 274, 39, 1, 0, 0, 0, 275, - 282, 3, 22, 11, 0, 276, 278, 5, 40, 0, 0, 277, 276, 1, 0, 0, 0, 278, 279, - 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 283, 1, 0, - 0, 0, 281, 283, 5, 3, 0, 0, 282, 277, 1, 0, 0, 0, 282, 281, 1, 0, 0, 0, - 282, 283, 1, 0, 0, 0, 283, 41, 1, 0, 0, 0, 284, 285, 5, 2, 0, 0, 285, 286, - 3, 44, 22, 0, 286, 287, 5, 40, 0, 0, 287, 43, 1, 0, 0, 0, 288, 294, 3, - 46, 23, 0, 289, 290, 3, 22, 11, 0, 290, 291, 5, 8, 0, 0, 291, 292, 3, 46, - 23, 0, 292, 294, 1, 0, 0, 0, 293, 288, 1, 0, 0, 0, 293, 289, 1, 0, 0, 0, - 294, 45, 1, 0, 0, 0, 295, 296, 3, 50, 25, 0, 296, 301, 5, 6, 0, 0, 297, - 299, 5, 40, 0, 0, 298, 297, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, - 1, 0, 0, 0, 300, 302, 3, 48, 24, 0, 301, 298, 1, 0, 0, 0, 301, 302, 1, - 0, 0, 0, 302, 304, 1, 0, 0, 0, 303, 305, 5, 40, 0, 0, 304, 303, 1, 0, 0, - 0, 304, 305, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 5, 7, 0, 0, 307, - 47, 1, 0, 0, 0, 308, 316, 3, 22, 11, 0, 309, 311, 5, 3, 0, 0, 310, 312, - 5, 40, 0, 0, 311, 310, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 313, 1, 0, - 0, 0, 313, 315, 3, 22, 11, 0, 314, 309, 1, 0, 0, 0, 315, 318, 1, 0, 0, - 0, 316, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 49, 1, 0, 0, 0, 318, - 316, 1, 0, 0, 0, 319, 320, 7, 1, 0, 0, 320, 51, 1, 0, 0, 0, 36, 55, 64, - 69, 76, 81, 83, 93, 105, 115, 127, 133, 142, 155, 163, 170, 196, 198, 211, - 215, 219, 230, 236, 242, 246, 249, 255, 264, 270, 279, 282, 293, 298, 301, - 304, 311, 316, + 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 201, 8, 11, 10, 11, 12, 11, 204, 9, + 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, + 3, 13, 216, 8, 13, 1, 14, 1, 14, 3, 14, 220, 8, 14, 1, 14, 1, 14, 3, 14, + 224, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 16, 3, 16, 235, 8, 16, 1, 17, 1, 17, 4, 17, 239, 8, 17, 11, 17, 12, 17, + 240, 1, 17, 1, 17, 4, 17, 245, 8, 17, 11, 17, 12, 17, 246, 5, 17, 249, + 8, 17, 10, 17, 12, 17, 252, 9, 17, 3, 17, 254, 8, 17, 1, 17, 1, 17, 1, + 18, 1, 18, 3, 18, 260, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, + 267, 8, 19, 10, 19, 12, 19, 270, 9, 19, 1, 19, 5, 19, 273, 8, 19, 10, 19, + 12, 19, 276, 9, 19, 1, 19, 1, 19, 1, 20, 1, 20, 4, 20, 282, 8, 20, 11, + 20, 12, 20, 283, 1, 20, 3, 20, 287, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, + 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 298, 8, 22, 1, 23, 1, 23, 1, + 23, 3, 23, 303, 8, 23, 1, 23, 3, 23, 306, 8, 23, 1, 23, 3, 23, 309, 8, + 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 3, 24, 316, 8, 24, 1, 24, 5, 24, + 319, 8, 24, 10, 24, 12, 24, 322, 9, 24, 1, 25, 1, 25, 1, 25, 0, 1, 22, + 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, + 36, 38, 40, 42, 44, 46, 48, 50, 0, 2, 1, 0, 32, 37, 3, 0, 14, 20, 25, 27, + 38, 38, 352, 0, 55, 1, 0, 0, 0, 2, 64, 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, + 87, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 105, 1, 0, 0, 0, 12, 119, 1, 0, + 0, 0, 14, 123, 1, 0, 0, 0, 16, 147, 1, 0, 0, 0, 18, 155, 1, 0, 0, 0, 20, + 170, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 205, 1, 0, 0, 0, 26, 215, 1, + 0, 0, 0, 28, 217, 1, 0, 0, 0, 30, 227, 1, 0, 0, 0, 32, 234, 1, 0, 0, 0, + 34, 236, 1, 0, 0, 0, 36, 259, 1, 0, 0, 0, 38, 264, 1, 0, 0, 0, 40, 279, + 1, 0, 0, 0, 42, 288, 1, 0, 0, 0, 44, 297, 1, 0, 0, 0, 46, 299, 1, 0, 0, + 0, 48, 312, 1, 0, 0, 0, 50, 323, 1, 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, + 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, + 56, 58, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 0, 0, 1, 59, 1, 1, 0, + 0, 0, 60, 65, 3, 4, 2, 0, 61, 65, 3, 8, 4, 0, 62, 65, 3, 10, 5, 0, 63, + 65, 5, 40, 0, 0, 64, 60, 1, 0, 0, 0, 64, 61, 1, 0, 0, 0, 64, 62, 1, 0, + 0, 0, 64, 63, 1, 0, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 42, 21, 0, 67, + 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, + 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 14, 0, 0, 73, 83, + 3, 50, 25, 0, 74, 76, 3, 30, 15, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, + 0, 76, 77, 1, 0, 0, 0, 77, 84, 1, 0, 0, 0, 78, 79, 5, 20, 0, 0, 79, 81, + 3, 20, 10, 0, 80, 82, 3, 6, 3, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, + 0, 82, 84, 1, 0, 0, 0, 83, 74, 1, 0, 0, 0, 83, 78, 1, 0, 0, 0, 84, 85, + 1, 0, 0, 0, 85, 86, 5, 40, 0, 0, 86, 5, 1, 0, 0, 0, 87, 88, 5, 11, 0, 0, + 88, 89, 3, 22, 11, 0, 89, 7, 1, 0, 0, 0, 90, 92, 3, 42, 21, 0, 91, 90, + 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, + 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 15, 0, 0, 97, 98, 3, + 50, 25, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 22, 11, 0, 100, 101, 5, 40, + 0, 0, 101, 9, 1, 0, 0, 0, 102, 104, 3, 42, 21, 0, 103, 102, 1, 0, 0, 0, + 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, + 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 5, 20, 0, 0, 109, 110, + 3, 50, 25, 0, 110, 111, 3, 20, 10, 0, 111, 115, 5, 11, 0, 0, 112, 116, + 3, 12, 6, 0, 113, 116, 3, 34, 17, 0, 114, 116, 3, 14, 7, 0, 115, 112, 1, + 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, + 0, 117, 118, 5, 40, 0, 0, 118, 11, 1, 0, 0, 0, 119, 120, 5, 28, 0, 0, 120, + 121, 3, 28, 14, 0, 121, 122, 3, 34, 17, 0, 122, 13, 1, 0, 0, 0, 123, 127, + 5, 4, 0, 0, 124, 126, 5, 40, 0, 0, 125, 124, 1, 0, 0, 0, 126, 129, 1, 0, + 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, + 129, 127, 1, 0, 0, 0, 130, 133, 5, 29, 0, 0, 131, 134, 3, 50, 25, 0, 132, + 134, 3, 16, 8, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, 134, 135, + 1, 0, 0, 0, 135, 136, 5, 30, 0, 0, 136, 137, 3, 22, 11, 0, 137, 138, 5, + 10, 0, 0, 138, 142, 3, 18, 9, 0, 139, 141, 5, 40, 0, 0, 140, 139, 1, 0, + 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, + 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 5, 5, 0, 0, 146, + 15, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, 3, 50, 25, 0, 149, 150, + 5, 3, 0, 0, 150, 151, 3, 50, 25, 0, 151, 152, 5, 7, 0, 0, 152, 17, 1, 0, + 0, 0, 153, 156, 3, 22, 11, 0, 154, 156, 3, 12, 6, 0, 155, 153, 1, 0, 0, + 0, 155, 154, 1, 0, 0, 0, 156, 19, 1, 0, 0, 0, 157, 163, 5, 21, 0, 0, 158, + 159, 3, 22, 11, 0, 159, 160, 5, 22, 0, 0, 160, 162, 1, 0, 0, 0, 161, 158, + 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, + 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 167, 3, 22, 11, + 0, 167, 168, 5, 23, 0, 0, 168, 171, 1, 0, 0, 0, 169, 171, 5, 24, 0, 0, + 170, 157, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, 21, 1, 0, 0, 0, 172, 173, + 6, 11, -1, 0, 173, 174, 3, 26, 13, 0, 174, 202, 1, 0, 0, 0, 175, 176, 10, + 6, 0, 0, 176, 177, 5, 31, 0, 0, 177, 178, 3, 22, 11, 0, 178, 179, 5, 10, + 0, 0, 179, 180, 3, 22, 11, 7, 180, 201, 1, 0, 0, 0, 181, 182, 10, 2, 0, + 0, 182, 183, 3, 24, 12, 0, 183, 184, 3, 22, 11, 3, 184, 201, 1, 0, 0, 0, + 185, 186, 10, 7, 0, 0, 186, 187, 5, 4, 0, 0, 187, 188, 3, 22, 11, 0, 188, + 189, 5, 5, 0, 0, 189, 201, 1, 0, 0, 0, 190, 191, 10, 5, 0, 0, 191, 192, + 5, 8, 0, 0, 192, 201, 3, 50, 25, 0, 193, 194, 10, 4, 0, 0, 194, 195, 5, + 10, 0, 0, 195, 201, 3, 50, 25, 0, 196, 197, 10, 3, 0, 0, 197, 198, 5, 10, + 0, 0, 198, 199, 5, 10, 0, 0, 199, 201, 3, 50, 25, 0, 200, 175, 1, 0, 0, + 0, 200, 181, 1, 0, 0, 0, 200, 185, 1, 0, 0, 0, 200, 190, 1, 0, 0, 0, 200, + 193, 1, 0, 0, 0, 200, 196, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, + 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 23, 1, 0, 0, 0, 204, 202, 1, 0, + 0, 0, 205, 206, 7, 0, 0, 0, 206, 25, 1, 0, 0, 0, 207, 216, 3, 32, 16, 0, + 208, 216, 3, 46, 23, 0, 209, 216, 3, 20, 10, 0, 210, 216, 5, 1, 0, 0, 211, + 216, 3, 38, 19, 0, 212, 216, 3, 34, 17, 0, 213, 216, 3, 14, 7, 0, 214, + 216, 3, 28, 14, 0, 215, 207, 1, 0, 0, 0, 215, 208, 1, 0, 0, 0, 215, 209, + 1, 0, 0, 0, 215, 210, 1, 0, 0, 0, 215, 211, 1, 0, 0, 0, 215, 212, 1, 0, + 0, 0, 215, 213, 1, 0, 0, 0, 215, 214, 1, 0, 0, 0, 216, 27, 1, 0, 0, 0, + 217, 219, 5, 6, 0, 0, 218, 220, 5, 40, 0, 0, 219, 218, 1, 0, 0, 0, 219, + 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 223, 3, 22, 11, 0, 222, 224, + 5, 40, 0, 0, 223, 222, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 1, 0, + 0, 0, 225, 226, 5, 7, 0, 0, 226, 29, 1, 0, 0, 0, 227, 228, 3, 50, 25, 0, + 228, 31, 1, 0, 0, 0, 229, 235, 5, 39, 0, 0, 230, 235, 5, 16, 0, 0, 231, + 235, 5, 17, 0, 0, 232, 235, 5, 18, 0, 0, 233, 235, 3, 50, 25, 0, 234, 229, + 1, 0, 0, 0, 234, 230, 1, 0, 0, 0, 234, 231, 1, 0, 0, 0, 234, 232, 1, 0, + 0, 0, 234, 233, 1, 0, 0, 0, 235, 33, 1, 0, 0, 0, 236, 253, 5, 12, 0, 0, + 237, 239, 5, 40, 0, 0, 238, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, + 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 250, 1, 0, 0, 0, 242, 244, + 3, 36, 18, 0, 243, 245, 5, 40, 0, 0, 244, 243, 1, 0, 0, 0, 245, 246, 1, + 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 249, 1, 0, 0, + 0, 248, 242, 1, 0, 0, 0, 249, 252, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, + 251, 1, 0, 0, 0, 251, 254, 1, 0, 0, 0, 252, 250, 1, 0, 0, 0, 253, 238, + 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 256, 5, 13, + 0, 0, 256, 35, 1, 0, 0, 0, 257, 260, 3, 50, 25, 0, 258, 260, 3, 20, 10, + 0, 259, 257, 1, 0, 0, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, + 262, 5, 10, 0, 0, 262, 263, 3, 22, 11, 0, 263, 37, 1, 0, 0, 0, 264, 268, + 5, 4, 0, 0, 265, 267, 5, 40, 0, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, 0, + 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 274, 1, 0, 0, 0, + 270, 268, 1, 0, 0, 0, 271, 273, 3, 40, 20, 0, 272, 271, 1, 0, 0, 0, 273, + 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, + 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 277, 278, 5, 5, 0, 0, 278, 39, 1, 0, + 0, 0, 279, 286, 3, 22, 11, 0, 280, 282, 5, 40, 0, 0, 281, 280, 1, 0, 0, + 0, 282, 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, + 287, 1, 0, 0, 0, 285, 287, 5, 3, 0, 0, 286, 281, 1, 0, 0, 0, 286, 285, + 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 41, 1, 0, 0, 0, 288, 289, 5, 2, + 0, 0, 289, 290, 3, 44, 22, 0, 290, 291, 5, 40, 0, 0, 291, 43, 1, 0, 0, + 0, 292, 298, 3, 46, 23, 0, 293, 294, 3, 22, 11, 0, 294, 295, 5, 8, 0, 0, + 295, 296, 3, 46, 23, 0, 296, 298, 1, 0, 0, 0, 297, 292, 1, 0, 0, 0, 297, + 293, 1, 0, 0, 0, 298, 45, 1, 0, 0, 0, 299, 300, 3, 50, 25, 0, 300, 305, + 5, 6, 0, 0, 301, 303, 5, 40, 0, 0, 302, 301, 1, 0, 0, 0, 302, 303, 1, 0, + 0, 0, 303, 304, 1, 0, 0, 0, 304, 306, 3, 48, 24, 0, 305, 302, 1, 0, 0, + 0, 305, 306, 1, 0, 0, 0, 306, 308, 1, 0, 0, 0, 307, 309, 5, 40, 0, 0, 308, + 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, + 5, 7, 0, 0, 311, 47, 1, 0, 0, 0, 312, 320, 3, 22, 11, 0, 313, 315, 5, 3, + 0, 0, 314, 316, 5, 40, 0, 0, 315, 314, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, + 316, 317, 1, 0, 0, 0, 317, 319, 3, 22, 11, 0, 318, 313, 1, 0, 0, 0, 319, + 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 49, 1, + 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 324, 7, 1, 0, 0, 324, 51, 1, 0, 0, + 0, 36, 55, 64, 69, 76, 81, 83, 93, 105, 115, 127, 133, 142, 155, 163, 170, + 200, 202, 215, 219, 223, 234, 240, 246, 250, 253, 259, 268, 274, 283, 286, + 297, 302, 305, 308, 315, 320, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -2737,7 +2739,8 @@ type IExpressionContext interface { AllExpression() []IExpressionContext Expression(i int) IExpressionContext QMARK() antlr.TerminalNode - COL() antlr.TerminalNode + AllCOL() []antlr.TerminalNode + COL(i int) antlr.TerminalNode LogicCharacter() ILogicCharacterContext OBRACK() antlr.TerminalNode CBRACK() antlr.TerminalNode @@ -2851,8 +2854,12 @@ func (s *ExpressionContext) QMARK() antlr.TerminalNode { return s.GetToken(bicepParserQMARK, 0) } -func (s *ExpressionContext) COL() antlr.TerminalNode { - return s.GetToken(bicepParserCOL, 0) +func (s *ExpressionContext) AllCOL() []antlr.TerminalNode { + return s.GetTokens(bicepParserCOL) +} + +func (s *ExpressionContext) COL(i int) antlr.TerminalNode { + return s.GetToken(bicepParserCOL, i) } func (s *ExpressionContext) LogicCharacter() ILogicCharacterContext { @@ -2939,7 +2946,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(198) + p.SetState(202) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2954,7 +2961,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(196) + p.SetState(200) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2966,8 +2973,8 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) p.SetState(175) - if !(p.Precpred(p.GetParserRuleContext(), 5)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 6)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) goto errorExit } { @@ -2992,7 +2999,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } { p.SetState(179) - p.expression(6) + p.expression(7) } case 2: @@ -3018,8 +3025,8 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) p.SetState(185) - if !(p.Precpred(p.GetParserRuleContext(), 6)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 7)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) goto errorExit } { @@ -3048,8 +3055,8 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) p.SetState(190) - if !(p.Precpred(p.GetParserRuleContext(), 4)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 5)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) goto errorExit } { @@ -3073,8 +3080,8 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) p.SetState(193) - if !(p.Precpred(p.GetParserRuleContext(), 3)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 4)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) goto errorExit } { @@ -3093,12 +3100,45 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { localctx.(*ExpressionContext).name = _x } + case 6: + localctx = NewExpressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) + p.SetState(196) + + if !(p.Precpred(p.GetParserRuleContext(), 3)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + goto errorExit + } + { + p.SetState(197) + p.Match(bicepParserCOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(198) + p.Match(bicepParserCOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(199) + + var _x = p.Identifier() + + localctx.(*ExpressionContext).name = _x + } + case antlr.ATNInvalidAltNumber: goto errorExit } } - p.SetState(200) + p.SetState(204) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3222,7 +3262,7 @@ func (p *bicepParser) LogicCharacter() (localctx ILogicCharacterContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(201) + p.SetState(205) _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&270582939648) != 0) { @@ -3436,7 +3476,7 @@ func (s *PrimaryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interf func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { localctx = NewPrimaryExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 26, bicepParserRULE_primaryExpression) - p.SetState(211) + p.SetState(215) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3446,28 +3486,28 @@ func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(203) + p.SetState(207) p.LiteralValue() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(204) + p.SetState(208) p.FunctionCall() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(205) + p.SetState(209) p.InterpString() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(206) + p.SetState(210) p.Match(bicepParserMULTILINE_STRING) if p.HasError() { // Recognition error - abort rule @@ -3478,28 +3518,28 @@ func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(207) + p.SetState(211) p.Array() } case 6: p.EnterOuterAlt(localctx, 6) { - p.SetState(208) + p.SetState(212) p.Object() } case 7: p.EnterOuterAlt(localctx, 7) { - p.SetState(209) + p.SetState(213) p.ForExpression() } case 8: p.EnterOuterAlt(localctx, 8) { - p.SetState(210) + p.SetState(214) p.ParenthesizedExpression() } @@ -3627,14 +3667,14 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi p.EnterOuterAlt(localctx, 1) { - p.SetState(213) + p.SetState(217) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(215) + p.SetState(219) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3643,7 +3683,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(214) + p.SetState(218) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3653,10 +3693,10 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(217) + p.SetState(221) p.expression(0) } - p.SetState(219) + p.SetState(223) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3665,7 +3705,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(218) + p.SetState(222) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3675,7 +3715,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(221) + p.SetState(225) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -3792,7 +3832,7 @@ func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { p.EnterRule(localctx, 30, bicepParserRULE_typeExpression) p.EnterOuterAlt(localctx, 1) { - p.SetState(223) + p.SetState(227) var _x = p.Identifier() @@ -3915,7 +3955,7 @@ func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { localctx = NewLiteralValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 32, bicepParserRULE_literalValue) - p.SetState(230) + p.SetState(234) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3925,7 +3965,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(225) + p.SetState(229) p.Match(bicepParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -3936,7 +3976,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(226) + p.SetState(230) p.Match(bicepParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -3947,7 +3987,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(227) + p.SetState(231) p.Match(bicepParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -3958,7 +3998,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(228) + p.SetState(232) p.Match(bicepParserNULL) if p.HasError() { // Recognition error - abort rule @@ -3969,7 +4009,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(229) + p.SetState(233) p.Identifier() } @@ -4123,14 +4163,14 @@ func (p *bicepParser) Object() (localctx IObjectContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(232) + p.SetState(236) p.Match(bicepParserOBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(249) + p.SetState(253) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4138,7 +4178,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) if _la == bicepParserNL { - p.SetState(234) + p.SetState(238) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4147,7 +4187,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(233) + p.SetState(237) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4155,14 +4195,14 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(236) + p.SetState(240) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(246) + p.SetState(250) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4171,10 +4211,10 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&275133743104) != 0 { { - p.SetState(238) + p.SetState(242) p.ObjectProperty() } - p.SetState(240) + p.SetState(244) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4183,7 +4223,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(239) + p.SetState(243) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4191,7 +4231,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(242) + p.SetState(246) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4199,7 +4239,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) } - p.SetState(248) + p.SetState(252) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4209,7 +4249,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } { - p.SetState(251) + p.SetState(255) p.Match(bicepParserCBRACE) if p.HasError() { // Recognition error - abort rule @@ -4364,7 +4404,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { localctx = NewObjectPropertyContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, bicepParserRULE_objectProperty) p.EnterOuterAlt(localctx, 1) - p.SetState(255) + p.SetState(259) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4373,7 +4413,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: { - p.SetState(253) + p.SetState(257) var _x = p.Identifier() @@ -4382,7 +4422,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: { - p.SetState(254) + p.SetState(258) p.InterpString() } @@ -4391,7 +4431,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { goto errorExit } { - p.SetState(257) + p.SetState(261) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -4399,7 +4439,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } } { - p.SetState(258) + p.SetState(262) p.expression(0) } @@ -4549,14 +4589,14 @@ func (p *bicepParser) Array() (localctx IArrayContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(260) + p.SetState(264) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(264) + p.SetState(268) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4565,7 +4605,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for _la == bicepParserNL { { - p.SetState(261) + p.SetState(265) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4573,14 +4613,14 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } } - p.SetState(266) + p.SetState(270) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(270) + p.SetState(274) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4589,11 +4629,11 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&824889561170) != 0 { { - p.SetState(267) + p.SetState(271) p.ArrayItem() } - p.SetState(272) + p.SetState(276) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4601,7 +4641,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(273) + p.SetState(277) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -4724,17 +4764,17 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(275) + p.SetState(279) p.expression(0) } - p.SetState(282) + p.SetState(286) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { case bicepParserNL: - p.SetState(277) + p.SetState(281) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4743,7 +4783,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(276) + p.SetState(280) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4751,7 +4791,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - p.SetState(279) + p.SetState(283) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4761,7 +4801,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { case bicepParserCOMMA: { - p.SetState(281) + p.SetState(285) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -4882,7 +4922,7 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { p.EnterRule(localctx, 42, bicepParserRULE_decorator) p.EnterOuterAlt(localctx, 1) { - p.SetState(284) + p.SetState(288) p.Match(bicepParserAT) if p.HasError() { // Recognition error - abort rule @@ -4890,11 +4930,11 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { } } { - p.SetState(285) + p.SetState(289) p.DecoratorExpression() } { - p.SetState(286) + p.SetState(290) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5020,7 +5060,7 @@ func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 44, bicepParserRULE_decoratorExpression) - p.SetState(293) + p.SetState(297) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5030,18 +5070,18 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(288) + p.SetState(292) p.FunctionCall() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(289) + p.SetState(293) p.expression(0) } { - p.SetState(290) + p.SetState(294) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -5049,7 +5089,7 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex } } { - p.SetState(291) + p.SetState(295) p.FunctionCall() } @@ -5194,22 +5234,22 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(295) + p.SetState(299) p.Identifier() } { - p.SetState(296) + p.SetState(300) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(301) + p.SetState(305) p.GetErrorHandler().Sync(p) if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 32, p.GetParserRuleContext()) == 1 { - p.SetState(298) + p.SetState(302) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5218,7 +5258,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(297) + p.SetState(301) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5228,14 +5268,14 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(300) + p.SetState(304) p.ArgumentList() } } else if p.HasError() { // JIM goto errorExit } - p.SetState(304) + p.SetState(308) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5244,7 +5284,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(303) + p.SetState(307) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5254,7 +5294,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(306) + p.SetState(310) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -5408,10 +5448,10 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(308) + p.SetState(312) p.expression(0) } - p.SetState(316) + p.SetState(320) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5420,14 +5460,14 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { for _la == bicepParserCOMMA { { - p.SetState(309) + p.SetState(313) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(311) + p.SetState(315) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5436,7 +5476,7 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { if _la == bicepParserNL { { - p.SetState(310) + p.SetState(314) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5446,11 +5486,11 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { } { - p.SetState(313) + p.SetState(317) p.expression(0) } - p.SetState(318) + p.SetState(322) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5596,7 +5636,7 @@ func (p *bicepParser) Identifier() (localctx IIdentifierContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(319) + p.SetState(323) _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&275114868736) != 0) { @@ -5637,18 +5677,21 @@ func (p *bicepParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex i func (p *bicepParser) Expression_Sempred(localctx antlr.RuleContext, predIndex int) bool { switch predIndex { case 0: - return p.Precpred(p.GetParserRuleContext(), 5) + return p.Precpred(p.GetParserRuleContext(), 6) case 1: return p.Precpred(p.GetParserRuleContext(), 2) case 2: - return p.Precpred(p.GetParserRuleContext(), 6) + return p.Precpred(p.GetParserRuleContext(), 7) case 3: - return p.Precpred(p.GetParserRuleContext(), 4) + return p.Precpred(p.GetParserRuleContext(), 5) case 4: + return p.Precpred(p.GetParserRuleContext(), 4) + + case 5: return p.Precpred(p.GetParserRuleContext(), 3) default: From 70416b243c5e7a375f6f325393fb999cf1322409 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Tue, 7 May 2024 17:24:16 +0100 Subject: [PATCH 092/130] update bicep grammar to parse comments correctly --- pkg/parser/bicep/antlr/bicep.g4 | 4 + pkg/parser/bicep/antlr/parser/bicep.interp | 6 +- pkg/parser/bicep/antlr/parser/bicep.tokens | 2 + .../bicep/antlr/parser/bicepLexer.interp | 8 +- .../bicep/antlr/parser/bicepLexer.tokens | 2 + pkg/parser/bicep/antlr/parser/bicep_lexer.go | 282 +++++++++--------- pkg/parser/bicep/antlr/parser/bicep_parser.go | 7 +- 7 files changed, 174 insertions(+), 137 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index 4b0b3221ddf..a9212b430bd 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -236,6 +236,10 @@ SPACES: [ \t]+ -> skip; UNKNOWN: .; +SINGLE_LINE_COMMENT: '//' ~[\r\n]* -> skip; + +MULTI_LINE_COMMENT: '/*' .*? '*/' -> skip; + fragment STRINGCHAR: ~[\\'\n\r\t$] | ESCAPE; fragment ESCAPE: '\\' ([\\'nrt$] | 'u{' HEX+ '}'); diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index 7c47d2a944d..975fa6a7811 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -42,6 +42,8 @@ null null null null +null +null token symbolic names: null @@ -87,6 +89,8 @@ NUMBER NL SPACES UNKNOWN +SINGLE_LINE_COMMENT +MULTI_LINE_COMMENT rule names: program @@ -118,4 +122,4 @@ identifier atn: -[4, 1, 42, 326, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 1, 0, 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 65, 8, 1, 1, 2, 5, 2, 68, 8, 2, 10, 2, 12, 2, 71, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 77, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 82, 8, 2, 3, 2, 84, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 92, 8, 4, 10, 4, 12, 4, 95, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 104, 8, 5, 10, 5, 12, 5, 107, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 5, 7, 126, 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 7, 1, 7, 1, 7, 3, 7, 134, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 141, 8, 7, 10, 7, 12, 7, 144, 9, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 156, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 171, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 201, 8, 11, 10, 11, 12, 11, 204, 9, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 216, 8, 13, 1, 14, 1, 14, 3, 14, 220, 8, 14, 1, 14, 1, 14, 3, 14, 224, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 235, 8, 16, 1, 17, 1, 17, 4, 17, 239, 8, 17, 11, 17, 12, 17, 240, 1, 17, 1, 17, 4, 17, 245, 8, 17, 11, 17, 12, 17, 246, 5, 17, 249, 8, 17, 10, 17, 12, 17, 252, 9, 17, 3, 17, 254, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 260, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 267, 8, 19, 10, 19, 12, 19, 270, 9, 19, 1, 19, 5, 19, 273, 8, 19, 10, 19, 12, 19, 276, 9, 19, 1, 19, 1, 19, 1, 20, 1, 20, 4, 20, 282, 8, 20, 11, 20, 12, 20, 283, 1, 20, 3, 20, 287, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 298, 8, 22, 1, 23, 1, 23, 1, 23, 3, 23, 303, 8, 23, 1, 23, 3, 23, 306, 8, 23, 1, 23, 3, 23, 309, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 3, 24, 316, 8, 24, 1, 24, 5, 24, 319, 8, 24, 10, 24, 12, 24, 322, 9, 24, 1, 25, 1, 25, 1, 25, 0, 1, 22, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, 2, 1, 0, 32, 37, 3, 0, 14, 20, 25, 27, 38, 38, 352, 0, 55, 1, 0, 0, 0, 2, 64, 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, 87, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 105, 1, 0, 0, 0, 12, 119, 1, 0, 0, 0, 14, 123, 1, 0, 0, 0, 16, 147, 1, 0, 0, 0, 18, 155, 1, 0, 0, 0, 20, 170, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 205, 1, 0, 0, 0, 26, 215, 1, 0, 0, 0, 28, 217, 1, 0, 0, 0, 30, 227, 1, 0, 0, 0, 32, 234, 1, 0, 0, 0, 34, 236, 1, 0, 0, 0, 36, 259, 1, 0, 0, 0, 38, 264, 1, 0, 0, 0, 40, 279, 1, 0, 0, 0, 42, 288, 1, 0, 0, 0, 44, 297, 1, 0, 0, 0, 46, 299, 1, 0, 0, 0, 48, 312, 1, 0, 0, 0, 50, 323, 1, 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 58, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 0, 0, 1, 59, 1, 1, 0, 0, 0, 60, 65, 3, 4, 2, 0, 61, 65, 3, 8, 4, 0, 62, 65, 3, 10, 5, 0, 63, 65, 5, 40, 0, 0, 64, 60, 1, 0, 0, 0, 64, 61, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 63, 1, 0, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 42, 21, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 14, 0, 0, 73, 83, 3, 50, 25, 0, 74, 76, 3, 30, 15, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 84, 1, 0, 0, 0, 78, 79, 5, 20, 0, 0, 79, 81, 3, 20, 10, 0, 80, 82, 3, 6, 3, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 74, 1, 0, 0, 0, 83, 78, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 5, 40, 0, 0, 86, 5, 1, 0, 0, 0, 87, 88, 5, 11, 0, 0, 88, 89, 3, 22, 11, 0, 89, 7, 1, 0, 0, 0, 90, 92, 3, 42, 21, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 15, 0, 0, 97, 98, 3, 50, 25, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 22, 11, 0, 100, 101, 5, 40, 0, 0, 101, 9, 1, 0, 0, 0, 102, 104, 3, 42, 21, 0, 103, 102, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 5, 20, 0, 0, 109, 110, 3, 50, 25, 0, 110, 111, 3, 20, 10, 0, 111, 115, 5, 11, 0, 0, 112, 116, 3, 12, 6, 0, 113, 116, 3, 34, 17, 0, 114, 116, 3, 14, 7, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 11, 1, 0, 0, 0, 119, 120, 5, 28, 0, 0, 120, 121, 3, 28, 14, 0, 121, 122, 3, 34, 17, 0, 122, 13, 1, 0, 0, 0, 123, 127, 5, 4, 0, 0, 124, 126, 5, 40, 0, 0, 125, 124, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 133, 5, 29, 0, 0, 131, 134, 3, 50, 25, 0, 132, 134, 3, 16, 8, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 30, 0, 0, 136, 137, 3, 22, 11, 0, 137, 138, 5, 10, 0, 0, 138, 142, 3, 18, 9, 0, 139, 141, 5, 40, 0, 0, 140, 139, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 5, 5, 0, 0, 146, 15, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, 3, 50, 25, 0, 149, 150, 5, 3, 0, 0, 150, 151, 3, 50, 25, 0, 151, 152, 5, 7, 0, 0, 152, 17, 1, 0, 0, 0, 153, 156, 3, 22, 11, 0, 154, 156, 3, 12, 6, 0, 155, 153, 1, 0, 0, 0, 155, 154, 1, 0, 0, 0, 156, 19, 1, 0, 0, 0, 157, 163, 5, 21, 0, 0, 158, 159, 3, 22, 11, 0, 159, 160, 5, 22, 0, 0, 160, 162, 1, 0, 0, 0, 161, 158, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 167, 3, 22, 11, 0, 167, 168, 5, 23, 0, 0, 168, 171, 1, 0, 0, 0, 169, 171, 5, 24, 0, 0, 170, 157, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, 21, 1, 0, 0, 0, 172, 173, 6, 11, -1, 0, 173, 174, 3, 26, 13, 0, 174, 202, 1, 0, 0, 0, 175, 176, 10, 6, 0, 0, 176, 177, 5, 31, 0, 0, 177, 178, 3, 22, 11, 0, 178, 179, 5, 10, 0, 0, 179, 180, 3, 22, 11, 7, 180, 201, 1, 0, 0, 0, 181, 182, 10, 2, 0, 0, 182, 183, 3, 24, 12, 0, 183, 184, 3, 22, 11, 3, 184, 201, 1, 0, 0, 0, 185, 186, 10, 7, 0, 0, 186, 187, 5, 4, 0, 0, 187, 188, 3, 22, 11, 0, 188, 189, 5, 5, 0, 0, 189, 201, 1, 0, 0, 0, 190, 191, 10, 5, 0, 0, 191, 192, 5, 8, 0, 0, 192, 201, 3, 50, 25, 0, 193, 194, 10, 4, 0, 0, 194, 195, 5, 10, 0, 0, 195, 201, 3, 50, 25, 0, 196, 197, 10, 3, 0, 0, 197, 198, 5, 10, 0, 0, 198, 199, 5, 10, 0, 0, 199, 201, 3, 50, 25, 0, 200, 175, 1, 0, 0, 0, 200, 181, 1, 0, 0, 0, 200, 185, 1, 0, 0, 0, 200, 190, 1, 0, 0, 0, 200, 193, 1, 0, 0, 0, 200, 196, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 23, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 205, 206, 7, 0, 0, 0, 206, 25, 1, 0, 0, 0, 207, 216, 3, 32, 16, 0, 208, 216, 3, 46, 23, 0, 209, 216, 3, 20, 10, 0, 210, 216, 5, 1, 0, 0, 211, 216, 3, 38, 19, 0, 212, 216, 3, 34, 17, 0, 213, 216, 3, 14, 7, 0, 214, 216, 3, 28, 14, 0, 215, 207, 1, 0, 0, 0, 215, 208, 1, 0, 0, 0, 215, 209, 1, 0, 0, 0, 215, 210, 1, 0, 0, 0, 215, 211, 1, 0, 0, 0, 215, 212, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 214, 1, 0, 0, 0, 216, 27, 1, 0, 0, 0, 217, 219, 5, 6, 0, 0, 218, 220, 5, 40, 0, 0, 219, 218, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 223, 3, 22, 11, 0, 222, 224, 5, 40, 0, 0, 223, 222, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 226, 5, 7, 0, 0, 226, 29, 1, 0, 0, 0, 227, 228, 3, 50, 25, 0, 228, 31, 1, 0, 0, 0, 229, 235, 5, 39, 0, 0, 230, 235, 5, 16, 0, 0, 231, 235, 5, 17, 0, 0, 232, 235, 5, 18, 0, 0, 233, 235, 3, 50, 25, 0, 234, 229, 1, 0, 0, 0, 234, 230, 1, 0, 0, 0, 234, 231, 1, 0, 0, 0, 234, 232, 1, 0, 0, 0, 234, 233, 1, 0, 0, 0, 235, 33, 1, 0, 0, 0, 236, 253, 5, 12, 0, 0, 237, 239, 5, 40, 0, 0, 238, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 250, 1, 0, 0, 0, 242, 244, 3, 36, 18, 0, 243, 245, 5, 40, 0, 0, 244, 243, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 249, 1, 0, 0, 0, 248, 242, 1, 0, 0, 0, 249, 252, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 254, 1, 0, 0, 0, 252, 250, 1, 0, 0, 0, 253, 238, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 256, 5, 13, 0, 0, 256, 35, 1, 0, 0, 0, 257, 260, 3, 50, 25, 0, 258, 260, 3, 20, 10, 0, 259, 257, 1, 0, 0, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 262, 5, 10, 0, 0, 262, 263, 3, 22, 11, 0, 263, 37, 1, 0, 0, 0, 264, 268, 5, 4, 0, 0, 265, 267, 5, 40, 0, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 274, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 271, 273, 3, 40, 20, 0, 272, 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 277, 278, 5, 5, 0, 0, 278, 39, 1, 0, 0, 0, 279, 286, 3, 22, 11, 0, 280, 282, 5, 40, 0, 0, 281, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 287, 5, 3, 0, 0, 286, 281, 1, 0, 0, 0, 286, 285, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 41, 1, 0, 0, 0, 288, 289, 5, 2, 0, 0, 289, 290, 3, 44, 22, 0, 290, 291, 5, 40, 0, 0, 291, 43, 1, 0, 0, 0, 292, 298, 3, 46, 23, 0, 293, 294, 3, 22, 11, 0, 294, 295, 5, 8, 0, 0, 295, 296, 3, 46, 23, 0, 296, 298, 1, 0, 0, 0, 297, 292, 1, 0, 0, 0, 297, 293, 1, 0, 0, 0, 298, 45, 1, 0, 0, 0, 299, 300, 3, 50, 25, 0, 300, 305, 5, 6, 0, 0, 301, 303, 5, 40, 0, 0, 302, 301, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 306, 3, 48, 24, 0, 305, 302, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 308, 1, 0, 0, 0, 307, 309, 5, 40, 0, 0, 308, 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, 5, 7, 0, 0, 311, 47, 1, 0, 0, 0, 312, 320, 3, 22, 11, 0, 313, 315, 5, 3, 0, 0, 314, 316, 5, 40, 0, 0, 315, 314, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 319, 3, 22, 11, 0, 318, 313, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 49, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 324, 7, 1, 0, 0, 324, 51, 1, 0, 0, 0, 36, 55, 64, 69, 76, 81, 83, 93, 105, 115, 127, 133, 142, 155, 163, 170, 200, 202, 215, 219, 223, 234, 240, 246, 250, 253, 259, 268, 274, 283, 286, 297, 302, 305, 308, 315, 320] \ No newline at end of file +[4, 1, 44, 326, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 1, 0, 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 65, 8, 1, 1, 2, 5, 2, 68, 8, 2, 10, 2, 12, 2, 71, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 77, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 82, 8, 2, 3, 2, 84, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 92, 8, 4, 10, 4, 12, 4, 95, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 104, 8, 5, 10, 5, 12, 5, 107, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 5, 7, 126, 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 7, 1, 7, 1, 7, 3, 7, 134, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 141, 8, 7, 10, 7, 12, 7, 144, 9, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 156, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 171, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 201, 8, 11, 10, 11, 12, 11, 204, 9, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 216, 8, 13, 1, 14, 1, 14, 3, 14, 220, 8, 14, 1, 14, 1, 14, 3, 14, 224, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 235, 8, 16, 1, 17, 1, 17, 4, 17, 239, 8, 17, 11, 17, 12, 17, 240, 1, 17, 1, 17, 4, 17, 245, 8, 17, 11, 17, 12, 17, 246, 5, 17, 249, 8, 17, 10, 17, 12, 17, 252, 9, 17, 3, 17, 254, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 260, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 267, 8, 19, 10, 19, 12, 19, 270, 9, 19, 1, 19, 5, 19, 273, 8, 19, 10, 19, 12, 19, 276, 9, 19, 1, 19, 1, 19, 1, 20, 1, 20, 4, 20, 282, 8, 20, 11, 20, 12, 20, 283, 1, 20, 3, 20, 287, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 298, 8, 22, 1, 23, 1, 23, 1, 23, 3, 23, 303, 8, 23, 1, 23, 3, 23, 306, 8, 23, 1, 23, 3, 23, 309, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 3, 24, 316, 8, 24, 1, 24, 5, 24, 319, 8, 24, 10, 24, 12, 24, 322, 9, 24, 1, 25, 1, 25, 1, 25, 0, 1, 22, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, 2, 1, 0, 32, 37, 3, 0, 14, 20, 25, 27, 38, 38, 352, 0, 55, 1, 0, 0, 0, 2, 64, 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, 87, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 105, 1, 0, 0, 0, 12, 119, 1, 0, 0, 0, 14, 123, 1, 0, 0, 0, 16, 147, 1, 0, 0, 0, 18, 155, 1, 0, 0, 0, 20, 170, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 205, 1, 0, 0, 0, 26, 215, 1, 0, 0, 0, 28, 217, 1, 0, 0, 0, 30, 227, 1, 0, 0, 0, 32, 234, 1, 0, 0, 0, 34, 236, 1, 0, 0, 0, 36, 259, 1, 0, 0, 0, 38, 264, 1, 0, 0, 0, 40, 279, 1, 0, 0, 0, 42, 288, 1, 0, 0, 0, 44, 297, 1, 0, 0, 0, 46, 299, 1, 0, 0, 0, 48, 312, 1, 0, 0, 0, 50, 323, 1, 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 58, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 0, 0, 1, 59, 1, 1, 0, 0, 0, 60, 65, 3, 4, 2, 0, 61, 65, 3, 8, 4, 0, 62, 65, 3, 10, 5, 0, 63, 65, 5, 40, 0, 0, 64, 60, 1, 0, 0, 0, 64, 61, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 63, 1, 0, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 42, 21, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 14, 0, 0, 73, 83, 3, 50, 25, 0, 74, 76, 3, 30, 15, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 84, 1, 0, 0, 0, 78, 79, 5, 20, 0, 0, 79, 81, 3, 20, 10, 0, 80, 82, 3, 6, 3, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 74, 1, 0, 0, 0, 83, 78, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 5, 40, 0, 0, 86, 5, 1, 0, 0, 0, 87, 88, 5, 11, 0, 0, 88, 89, 3, 22, 11, 0, 89, 7, 1, 0, 0, 0, 90, 92, 3, 42, 21, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 15, 0, 0, 97, 98, 3, 50, 25, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 22, 11, 0, 100, 101, 5, 40, 0, 0, 101, 9, 1, 0, 0, 0, 102, 104, 3, 42, 21, 0, 103, 102, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 5, 20, 0, 0, 109, 110, 3, 50, 25, 0, 110, 111, 3, 20, 10, 0, 111, 115, 5, 11, 0, 0, 112, 116, 3, 12, 6, 0, 113, 116, 3, 34, 17, 0, 114, 116, 3, 14, 7, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 11, 1, 0, 0, 0, 119, 120, 5, 28, 0, 0, 120, 121, 3, 28, 14, 0, 121, 122, 3, 34, 17, 0, 122, 13, 1, 0, 0, 0, 123, 127, 5, 4, 0, 0, 124, 126, 5, 40, 0, 0, 125, 124, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 133, 5, 29, 0, 0, 131, 134, 3, 50, 25, 0, 132, 134, 3, 16, 8, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 30, 0, 0, 136, 137, 3, 22, 11, 0, 137, 138, 5, 10, 0, 0, 138, 142, 3, 18, 9, 0, 139, 141, 5, 40, 0, 0, 140, 139, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 5, 5, 0, 0, 146, 15, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, 3, 50, 25, 0, 149, 150, 5, 3, 0, 0, 150, 151, 3, 50, 25, 0, 151, 152, 5, 7, 0, 0, 152, 17, 1, 0, 0, 0, 153, 156, 3, 22, 11, 0, 154, 156, 3, 12, 6, 0, 155, 153, 1, 0, 0, 0, 155, 154, 1, 0, 0, 0, 156, 19, 1, 0, 0, 0, 157, 163, 5, 21, 0, 0, 158, 159, 3, 22, 11, 0, 159, 160, 5, 22, 0, 0, 160, 162, 1, 0, 0, 0, 161, 158, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 167, 3, 22, 11, 0, 167, 168, 5, 23, 0, 0, 168, 171, 1, 0, 0, 0, 169, 171, 5, 24, 0, 0, 170, 157, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, 21, 1, 0, 0, 0, 172, 173, 6, 11, -1, 0, 173, 174, 3, 26, 13, 0, 174, 202, 1, 0, 0, 0, 175, 176, 10, 6, 0, 0, 176, 177, 5, 31, 0, 0, 177, 178, 3, 22, 11, 0, 178, 179, 5, 10, 0, 0, 179, 180, 3, 22, 11, 7, 180, 201, 1, 0, 0, 0, 181, 182, 10, 2, 0, 0, 182, 183, 3, 24, 12, 0, 183, 184, 3, 22, 11, 3, 184, 201, 1, 0, 0, 0, 185, 186, 10, 7, 0, 0, 186, 187, 5, 4, 0, 0, 187, 188, 3, 22, 11, 0, 188, 189, 5, 5, 0, 0, 189, 201, 1, 0, 0, 0, 190, 191, 10, 5, 0, 0, 191, 192, 5, 8, 0, 0, 192, 201, 3, 50, 25, 0, 193, 194, 10, 4, 0, 0, 194, 195, 5, 10, 0, 0, 195, 201, 3, 50, 25, 0, 196, 197, 10, 3, 0, 0, 197, 198, 5, 10, 0, 0, 198, 199, 5, 10, 0, 0, 199, 201, 3, 50, 25, 0, 200, 175, 1, 0, 0, 0, 200, 181, 1, 0, 0, 0, 200, 185, 1, 0, 0, 0, 200, 190, 1, 0, 0, 0, 200, 193, 1, 0, 0, 0, 200, 196, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 23, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 205, 206, 7, 0, 0, 0, 206, 25, 1, 0, 0, 0, 207, 216, 3, 32, 16, 0, 208, 216, 3, 46, 23, 0, 209, 216, 3, 20, 10, 0, 210, 216, 5, 1, 0, 0, 211, 216, 3, 38, 19, 0, 212, 216, 3, 34, 17, 0, 213, 216, 3, 14, 7, 0, 214, 216, 3, 28, 14, 0, 215, 207, 1, 0, 0, 0, 215, 208, 1, 0, 0, 0, 215, 209, 1, 0, 0, 0, 215, 210, 1, 0, 0, 0, 215, 211, 1, 0, 0, 0, 215, 212, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 214, 1, 0, 0, 0, 216, 27, 1, 0, 0, 0, 217, 219, 5, 6, 0, 0, 218, 220, 5, 40, 0, 0, 219, 218, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 223, 3, 22, 11, 0, 222, 224, 5, 40, 0, 0, 223, 222, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 226, 5, 7, 0, 0, 226, 29, 1, 0, 0, 0, 227, 228, 3, 50, 25, 0, 228, 31, 1, 0, 0, 0, 229, 235, 5, 39, 0, 0, 230, 235, 5, 16, 0, 0, 231, 235, 5, 17, 0, 0, 232, 235, 5, 18, 0, 0, 233, 235, 3, 50, 25, 0, 234, 229, 1, 0, 0, 0, 234, 230, 1, 0, 0, 0, 234, 231, 1, 0, 0, 0, 234, 232, 1, 0, 0, 0, 234, 233, 1, 0, 0, 0, 235, 33, 1, 0, 0, 0, 236, 253, 5, 12, 0, 0, 237, 239, 5, 40, 0, 0, 238, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 250, 1, 0, 0, 0, 242, 244, 3, 36, 18, 0, 243, 245, 5, 40, 0, 0, 244, 243, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 249, 1, 0, 0, 0, 248, 242, 1, 0, 0, 0, 249, 252, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 254, 1, 0, 0, 0, 252, 250, 1, 0, 0, 0, 253, 238, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 256, 5, 13, 0, 0, 256, 35, 1, 0, 0, 0, 257, 260, 3, 50, 25, 0, 258, 260, 3, 20, 10, 0, 259, 257, 1, 0, 0, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 262, 5, 10, 0, 0, 262, 263, 3, 22, 11, 0, 263, 37, 1, 0, 0, 0, 264, 268, 5, 4, 0, 0, 265, 267, 5, 40, 0, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 274, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 271, 273, 3, 40, 20, 0, 272, 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 277, 278, 5, 5, 0, 0, 278, 39, 1, 0, 0, 0, 279, 286, 3, 22, 11, 0, 280, 282, 5, 40, 0, 0, 281, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 287, 5, 3, 0, 0, 286, 281, 1, 0, 0, 0, 286, 285, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 41, 1, 0, 0, 0, 288, 289, 5, 2, 0, 0, 289, 290, 3, 44, 22, 0, 290, 291, 5, 40, 0, 0, 291, 43, 1, 0, 0, 0, 292, 298, 3, 46, 23, 0, 293, 294, 3, 22, 11, 0, 294, 295, 5, 8, 0, 0, 295, 296, 3, 46, 23, 0, 296, 298, 1, 0, 0, 0, 297, 292, 1, 0, 0, 0, 297, 293, 1, 0, 0, 0, 298, 45, 1, 0, 0, 0, 299, 300, 3, 50, 25, 0, 300, 305, 5, 6, 0, 0, 301, 303, 5, 40, 0, 0, 302, 301, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 306, 3, 48, 24, 0, 305, 302, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 308, 1, 0, 0, 0, 307, 309, 5, 40, 0, 0, 308, 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, 5, 7, 0, 0, 311, 47, 1, 0, 0, 0, 312, 320, 3, 22, 11, 0, 313, 315, 5, 3, 0, 0, 314, 316, 5, 40, 0, 0, 315, 314, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 319, 3, 22, 11, 0, 318, 313, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 49, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 324, 7, 1, 0, 0, 324, 51, 1, 0, 0, 0, 36, 55, 64, 69, 76, 81, 83, 93, 105, 115, 127, 133, 142, 155, 163, 170, 200, 202, 215, 219, 223, 234, 240, 246, 250, 253, 259, 268, 274, 283, 286, 297, 302, 305, 308, 315, 320] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep.tokens b/pkg/parser/bicep/antlr/parser/bicep.tokens index c1bbbeed110..4e879f5c346 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.tokens +++ b/pkg/parser/bicep/antlr/parser/bicep.tokens @@ -40,6 +40,8 @@ NUMBER=39 NL=40 SPACES=41 UNKNOWN=42 +SINGLE_LINE_COMMENT=43 +MULTI_LINE_COMMENT=44 '@'=2 ','=3 '['=4 diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.interp b/pkg/parser/bicep/antlr/parser/bicepLexer.interp index b945dd0e350..4ef7d269b6c 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.interp +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.interp @@ -42,6 +42,8 @@ null null null null +null +null token symbolic names: null @@ -87,6 +89,8 @@ NUMBER NL SPACES UNKNOWN +SINGLE_LINE_COMMENT +MULTI_LINE_COMMENT rule names: MULTILINE_STRING @@ -131,6 +135,8 @@ NUMBER NL SPACES UNKNOWN +SINGLE_LINE_COMMENT +MULTI_LINE_COMMENT STRINGCHAR ESCAPE HEX @@ -143,4 +149,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 42, 307, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 97, 8, 0, 10, 0, 12, 0, 100, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 174, 8, 20, 10, 20, 12, 20, 177, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 184, 8, 21, 10, 21, 12, 21, 187, 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 194, 8, 22, 10, 22, 12, 22, 197, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 203, 8, 23, 10, 23, 12, 23, 206, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 5, 37, 256, 8, 37, 10, 37, 12, 37, 259, 9, 37, 1, 38, 4, 38, 262, 8, 38, 11, 38, 12, 38, 263, 1, 38, 1, 38, 4, 38, 268, 8, 38, 11, 38, 12, 38, 269, 3, 38, 272, 8, 38, 1, 39, 4, 39, 275, 8, 39, 11, 39, 12, 39, 276, 1, 40, 4, 40, 280, 8, 40, 11, 40, 12, 40, 281, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 3, 42, 290, 8, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 298, 8, 43, 11, 43, 12, 43, 299, 1, 43, 1, 43, 3, 43, 304, 8, 43, 1, 44, 1, 44, 1, 98, 0, 45, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 0, 87, 0, 89, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 317, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 1, 91, 1, 0, 0, 0, 3, 105, 1, 0, 0, 0, 5, 107, 1, 0, 0, 0, 7, 109, 1, 0, 0, 0, 9, 111, 1, 0, 0, 0, 11, 113, 1, 0, 0, 0, 13, 115, 1, 0, 0, 0, 15, 117, 1, 0, 0, 0, 17, 119, 1, 0, 0, 0, 19, 121, 1, 0, 0, 0, 21, 123, 1, 0, 0, 0, 23, 125, 1, 0, 0, 0, 25, 127, 1, 0, 0, 0, 27, 129, 1, 0, 0, 0, 29, 135, 1, 0, 0, 0, 31, 139, 1, 0, 0, 0, 33, 144, 1, 0, 0, 0, 35, 150, 1, 0, 0, 0, 37, 155, 1, 0, 0, 0, 39, 162, 1, 0, 0, 0, 41, 171, 1, 0, 0, 0, 43, 181, 1, 0, 0, 0, 45, 191, 1, 0, 0, 0, 47, 200, 1, 0, 0, 0, 49, 209, 1, 0, 0, 0, 51, 216, 1, 0, 0, 0, 53, 220, 1, 0, 0, 0, 55, 225, 1, 0, 0, 0, 57, 228, 1, 0, 0, 0, 59, 232, 1, 0, 0, 0, 61, 235, 1, 0, 0, 0, 63, 237, 1, 0, 0, 0, 65, 239, 1, 0, 0, 0, 67, 242, 1, 0, 0, 0, 69, 244, 1, 0, 0, 0, 71, 247, 1, 0, 0, 0, 73, 250, 1, 0, 0, 0, 75, 253, 1, 0, 0, 0, 77, 261, 1, 0, 0, 0, 79, 274, 1, 0, 0, 0, 81, 279, 1, 0, 0, 0, 83, 285, 1, 0, 0, 0, 85, 289, 1, 0, 0, 0, 87, 291, 1, 0, 0, 0, 89, 305, 1, 0, 0, 0, 91, 92, 5, 39, 0, 0, 92, 93, 5, 39, 0, 0, 93, 94, 5, 39, 0, 0, 94, 98, 1, 0, 0, 0, 95, 97, 9, 0, 0, 0, 96, 95, 1, 0, 0, 0, 97, 100, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, 102, 5, 39, 0, 0, 102, 103, 5, 39, 0, 0, 103, 104, 5, 39, 0, 0, 104, 2, 1, 0, 0, 0, 105, 106, 5, 64, 0, 0, 106, 4, 1, 0, 0, 0, 107, 108, 5, 44, 0, 0, 108, 6, 1, 0, 0, 0, 109, 110, 5, 91, 0, 0, 110, 8, 1, 0, 0, 0, 111, 112, 5, 93, 0, 0, 112, 10, 1, 0, 0, 0, 113, 114, 5, 40, 0, 0, 114, 12, 1, 0, 0, 0, 115, 116, 5, 41, 0, 0, 116, 14, 1, 0, 0, 0, 117, 118, 5, 46, 0, 0, 118, 16, 1, 0, 0, 0, 119, 120, 5, 124, 0, 0, 120, 18, 1, 0, 0, 0, 121, 122, 5, 58, 0, 0, 122, 20, 1, 0, 0, 0, 123, 124, 5, 61, 0, 0, 124, 22, 1, 0, 0, 0, 125, 126, 5, 123, 0, 0, 126, 24, 1, 0, 0, 0, 127, 128, 5, 125, 0, 0, 128, 26, 1, 0, 0, 0, 129, 130, 5, 112, 0, 0, 130, 131, 5, 97, 0, 0, 131, 132, 5, 114, 0, 0, 132, 133, 5, 97, 0, 0, 133, 134, 5, 109, 0, 0, 134, 28, 1, 0, 0, 0, 135, 136, 5, 118, 0, 0, 136, 137, 5, 97, 0, 0, 137, 138, 5, 114, 0, 0, 138, 30, 1, 0, 0, 0, 139, 140, 5, 116, 0, 0, 140, 141, 5, 114, 0, 0, 141, 142, 5, 117, 0, 0, 142, 143, 5, 101, 0, 0, 143, 32, 1, 0, 0, 0, 144, 145, 5, 102, 0, 0, 145, 146, 5, 97, 0, 0, 146, 147, 5, 108, 0, 0, 147, 148, 5, 115, 0, 0, 148, 149, 5, 101, 0, 0, 149, 34, 1, 0, 0, 0, 150, 151, 5, 110, 0, 0, 151, 152, 5, 117, 0, 0, 152, 153, 5, 108, 0, 0, 153, 154, 5, 108, 0, 0, 154, 36, 1, 0, 0, 0, 155, 156, 5, 111, 0, 0, 156, 157, 5, 98, 0, 0, 157, 158, 5, 106, 0, 0, 158, 159, 5, 101, 0, 0, 159, 160, 5, 99, 0, 0, 160, 161, 5, 116, 0, 0, 161, 38, 1, 0, 0, 0, 162, 163, 5, 114, 0, 0, 163, 164, 5, 101, 0, 0, 164, 165, 5, 115, 0, 0, 165, 166, 5, 111, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, 5, 114, 0, 0, 168, 169, 5, 99, 0, 0, 169, 170, 5, 101, 0, 0, 170, 40, 1, 0, 0, 0, 171, 175, 5, 39, 0, 0, 172, 174, 3, 85, 42, 0, 173, 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 36, 0, 0, 179, 180, 5, 123, 0, 0, 180, 42, 1, 0, 0, 0, 181, 185, 5, 125, 0, 0, 182, 184, 3, 85, 42, 0, 183, 182, 1, 0, 0, 0, 184, 187, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 188, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 188, 189, 5, 36, 0, 0, 189, 190, 5, 123, 0, 0, 190, 44, 1, 0, 0, 0, 191, 195, 5, 125, 0, 0, 192, 194, 3, 85, 42, 0, 193, 192, 1, 0, 0, 0, 194, 197, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 198, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 199, 5, 39, 0, 0, 199, 46, 1, 0, 0, 0, 200, 204, 5, 39, 0, 0, 201, 203, 3, 85, 42, 0, 202, 201, 1, 0, 0, 0, 203, 206, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 207, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 207, 208, 5, 39, 0, 0, 208, 48, 1, 0, 0, 0, 209, 210, 5, 115, 0, 0, 210, 211, 5, 116, 0, 0, 211, 212, 5, 114, 0, 0, 212, 213, 5, 105, 0, 0, 213, 214, 5, 110, 0, 0, 214, 215, 5, 103, 0, 0, 215, 50, 1, 0, 0, 0, 216, 217, 5, 105, 0, 0, 217, 218, 5, 110, 0, 0, 218, 219, 5, 116, 0, 0, 219, 52, 1, 0, 0, 0, 220, 221, 5, 98, 0, 0, 221, 222, 5, 111, 0, 0, 222, 223, 5, 111, 0, 0, 223, 224, 5, 108, 0, 0, 224, 54, 1, 0, 0, 0, 225, 226, 5, 105, 0, 0, 226, 227, 5, 102, 0, 0, 227, 56, 1, 0, 0, 0, 228, 229, 5, 102, 0, 0, 229, 230, 5, 111, 0, 0, 230, 231, 5, 114, 0, 0, 231, 58, 1, 0, 0, 0, 232, 233, 5, 105, 0, 0, 233, 234, 5, 110, 0, 0, 234, 60, 1, 0, 0, 0, 235, 236, 5, 63, 0, 0, 236, 62, 1, 0, 0, 0, 237, 238, 5, 62, 0, 0, 238, 64, 1, 0, 0, 0, 239, 240, 5, 62, 0, 0, 240, 241, 5, 61, 0, 0, 241, 66, 1, 0, 0, 0, 242, 243, 5, 60, 0, 0, 243, 68, 1, 0, 0, 0, 244, 245, 5, 60, 0, 0, 245, 246, 5, 61, 0, 0, 246, 70, 1, 0, 0, 0, 247, 248, 5, 61, 0, 0, 248, 249, 5, 61, 0, 0, 249, 72, 1, 0, 0, 0, 250, 251, 5, 33, 0, 0, 251, 252, 5, 61, 0, 0, 252, 74, 1, 0, 0, 0, 253, 257, 7, 0, 0, 0, 254, 256, 7, 1, 0, 0, 255, 254, 1, 0, 0, 0, 256, 259, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 76, 1, 0, 0, 0, 259, 257, 1, 0, 0, 0, 260, 262, 7, 2, 0, 0, 261, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 271, 1, 0, 0, 0, 265, 267, 5, 46, 0, 0, 266, 268, 7, 2, 0, 0, 267, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 272, 1, 0, 0, 0, 271, 265, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 78, 1, 0, 0, 0, 273, 275, 7, 3, 0, 0, 274, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 80, 1, 0, 0, 0, 278, 280, 7, 4, 0, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, 6, 40, 0, 0, 284, 82, 1, 0, 0, 0, 285, 286, 9, 0, 0, 0, 286, 84, 1, 0, 0, 0, 287, 290, 8, 5, 0, 0, 288, 290, 3, 87, 43, 0, 289, 287, 1, 0, 0, 0, 289, 288, 1, 0, 0, 0, 290, 86, 1, 0, 0, 0, 291, 303, 5, 92, 0, 0, 292, 304, 7, 6, 0, 0, 293, 294, 5, 117, 0, 0, 294, 295, 5, 123, 0, 0, 295, 297, 1, 0, 0, 0, 296, 298, 3, 89, 44, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 302, 5, 125, 0, 0, 302, 304, 1, 0, 0, 0, 303, 292, 1, 0, 0, 0, 303, 293, 1, 0, 0, 0, 304, 88, 1, 0, 0, 0, 305, 306, 7, 7, 0, 0, 306, 90, 1, 0, 0, 0, 15, 0, 98, 175, 185, 195, 204, 257, 263, 269, 271, 276, 281, 289, 299, 303, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 44, 336, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 101, 8, 0, 10, 0, 12, 0, 104, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 178, 8, 20, 10, 20, 12, 20, 181, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 188, 8, 21, 10, 21, 12, 21, 191, 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 198, 8, 22, 10, 22, 12, 22, 201, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 207, 8, 23, 10, 23, 12, 23, 210, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 5, 37, 260, 8, 37, 10, 37, 12, 37, 263, 9, 37, 1, 38, 4, 38, 266, 8, 38, 11, 38, 12, 38, 267, 1, 38, 1, 38, 4, 38, 272, 8, 38, 11, 38, 12, 38, 273, 3, 38, 276, 8, 38, 1, 39, 4, 39, 279, 8, 39, 11, 39, 12, 39, 280, 1, 40, 4, 40, 284, 8, 40, 11, 40, 12, 40, 285, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 296, 8, 42, 10, 42, 12, 42, 299, 9, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 307, 8, 43, 10, 43, 12, 43, 310, 9, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 3, 44, 319, 8, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 4, 45, 327, 8, 45, 11, 45, 12, 45, 328, 1, 45, 1, 45, 3, 45, 333, 8, 45, 1, 46, 1, 46, 2, 102, 308, 0, 47, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 0, 91, 0, 93, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 348, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0, 3, 109, 1, 0, 0, 0, 5, 111, 1, 0, 0, 0, 7, 113, 1, 0, 0, 0, 9, 115, 1, 0, 0, 0, 11, 117, 1, 0, 0, 0, 13, 119, 1, 0, 0, 0, 15, 121, 1, 0, 0, 0, 17, 123, 1, 0, 0, 0, 19, 125, 1, 0, 0, 0, 21, 127, 1, 0, 0, 0, 23, 129, 1, 0, 0, 0, 25, 131, 1, 0, 0, 0, 27, 133, 1, 0, 0, 0, 29, 139, 1, 0, 0, 0, 31, 143, 1, 0, 0, 0, 33, 148, 1, 0, 0, 0, 35, 154, 1, 0, 0, 0, 37, 159, 1, 0, 0, 0, 39, 166, 1, 0, 0, 0, 41, 175, 1, 0, 0, 0, 43, 185, 1, 0, 0, 0, 45, 195, 1, 0, 0, 0, 47, 204, 1, 0, 0, 0, 49, 213, 1, 0, 0, 0, 51, 220, 1, 0, 0, 0, 53, 224, 1, 0, 0, 0, 55, 229, 1, 0, 0, 0, 57, 232, 1, 0, 0, 0, 59, 236, 1, 0, 0, 0, 61, 239, 1, 0, 0, 0, 63, 241, 1, 0, 0, 0, 65, 243, 1, 0, 0, 0, 67, 246, 1, 0, 0, 0, 69, 248, 1, 0, 0, 0, 71, 251, 1, 0, 0, 0, 73, 254, 1, 0, 0, 0, 75, 257, 1, 0, 0, 0, 77, 265, 1, 0, 0, 0, 79, 278, 1, 0, 0, 0, 81, 283, 1, 0, 0, 0, 83, 289, 1, 0, 0, 0, 85, 291, 1, 0, 0, 0, 87, 302, 1, 0, 0, 0, 89, 318, 1, 0, 0, 0, 91, 320, 1, 0, 0, 0, 93, 334, 1, 0, 0, 0, 95, 96, 5, 39, 0, 0, 96, 97, 5, 39, 0, 0, 97, 98, 5, 39, 0, 0, 98, 102, 1, 0, 0, 0, 99, 101, 9, 0, 0, 0, 100, 99, 1, 0, 0, 0, 101, 104, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 103, 105, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 105, 106, 5, 39, 0, 0, 106, 107, 5, 39, 0, 0, 107, 108, 5, 39, 0, 0, 108, 2, 1, 0, 0, 0, 109, 110, 5, 64, 0, 0, 110, 4, 1, 0, 0, 0, 111, 112, 5, 44, 0, 0, 112, 6, 1, 0, 0, 0, 113, 114, 5, 91, 0, 0, 114, 8, 1, 0, 0, 0, 115, 116, 5, 93, 0, 0, 116, 10, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 12, 1, 0, 0, 0, 119, 120, 5, 41, 0, 0, 120, 14, 1, 0, 0, 0, 121, 122, 5, 46, 0, 0, 122, 16, 1, 0, 0, 0, 123, 124, 5, 124, 0, 0, 124, 18, 1, 0, 0, 0, 125, 126, 5, 58, 0, 0, 126, 20, 1, 0, 0, 0, 127, 128, 5, 61, 0, 0, 128, 22, 1, 0, 0, 0, 129, 130, 5, 123, 0, 0, 130, 24, 1, 0, 0, 0, 131, 132, 5, 125, 0, 0, 132, 26, 1, 0, 0, 0, 133, 134, 5, 112, 0, 0, 134, 135, 5, 97, 0, 0, 135, 136, 5, 114, 0, 0, 136, 137, 5, 97, 0, 0, 137, 138, 5, 109, 0, 0, 138, 28, 1, 0, 0, 0, 139, 140, 5, 118, 0, 0, 140, 141, 5, 97, 0, 0, 141, 142, 5, 114, 0, 0, 142, 30, 1, 0, 0, 0, 143, 144, 5, 116, 0, 0, 144, 145, 5, 114, 0, 0, 145, 146, 5, 117, 0, 0, 146, 147, 5, 101, 0, 0, 147, 32, 1, 0, 0, 0, 148, 149, 5, 102, 0, 0, 149, 150, 5, 97, 0, 0, 150, 151, 5, 108, 0, 0, 151, 152, 5, 115, 0, 0, 152, 153, 5, 101, 0, 0, 153, 34, 1, 0, 0, 0, 154, 155, 5, 110, 0, 0, 155, 156, 5, 117, 0, 0, 156, 157, 5, 108, 0, 0, 157, 158, 5, 108, 0, 0, 158, 36, 1, 0, 0, 0, 159, 160, 5, 111, 0, 0, 160, 161, 5, 98, 0, 0, 161, 162, 5, 106, 0, 0, 162, 163, 5, 101, 0, 0, 163, 164, 5, 99, 0, 0, 164, 165, 5, 116, 0, 0, 165, 38, 1, 0, 0, 0, 166, 167, 5, 114, 0, 0, 167, 168, 5, 101, 0, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 111, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 114, 0, 0, 172, 173, 5, 99, 0, 0, 173, 174, 5, 101, 0, 0, 174, 40, 1, 0, 0, 0, 175, 179, 5, 39, 0, 0, 176, 178, 3, 89, 44, 0, 177, 176, 1, 0, 0, 0, 178, 181, 1, 0, 0, 0, 179, 177, 1, 0, 0, 0, 179, 180, 1, 0, 0, 0, 180, 182, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 182, 183, 5, 36, 0, 0, 183, 184, 5, 123, 0, 0, 184, 42, 1, 0, 0, 0, 185, 189, 5, 125, 0, 0, 186, 188, 3, 89, 44, 0, 187, 186, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 192, 193, 5, 36, 0, 0, 193, 194, 5, 123, 0, 0, 194, 44, 1, 0, 0, 0, 195, 199, 5, 125, 0, 0, 196, 198, 3, 89, 44, 0, 197, 196, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 202, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 5, 39, 0, 0, 203, 46, 1, 0, 0, 0, 204, 208, 5, 39, 0, 0, 205, 207, 3, 89, 44, 0, 206, 205, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 211, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 5, 39, 0, 0, 212, 48, 1, 0, 0, 0, 213, 214, 5, 115, 0, 0, 214, 215, 5, 116, 0, 0, 215, 216, 5, 114, 0, 0, 216, 217, 5, 105, 0, 0, 217, 218, 5, 110, 0, 0, 218, 219, 5, 103, 0, 0, 219, 50, 1, 0, 0, 0, 220, 221, 5, 105, 0, 0, 221, 222, 5, 110, 0, 0, 222, 223, 5, 116, 0, 0, 223, 52, 1, 0, 0, 0, 224, 225, 5, 98, 0, 0, 225, 226, 5, 111, 0, 0, 226, 227, 5, 111, 0, 0, 227, 228, 5, 108, 0, 0, 228, 54, 1, 0, 0, 0, 229, 230, 5, 105, 0, 0, 230, 231, 5, 102, 0, 0, 231, 56, 1, 0, 0, 0, 232, 233, 5, 102, 0, 0, 233, 234, 5, 111, 0, 0, 234, 235, 5, 114, 0, 0, 235, 58, 1, 0, 0, 0, 236, 237, 5, 105, 0, 0, 237, 238, 5, 110, 0, 0, 238, 60, 1, 0, 0, 0, 239, 240, 5, 63, 0, 0, 240, 62, 1, 0, 0, 0, 241, 242, 5, 62, 0, 0, 242, 64, 1, 0, 0, 0, 243, 244, 5, 62, 0, 0, 244, 245, 5, 61, 0, 0, 245, 66, 1, 0, 0, 0, 246, 247, 5, 60, 0, 0, 247, 68, 1, 0, 0, 0, 248, 249, 5, 60, 0, 0, 249, 250, 5, 61, 0, 0, 250, 70, 1, 0, 0, 0, 251, 252, 5, 61, 0, 0, 252, 253, 5, 61, 0, 0, 253, 72, 1, 0, 0, 0, 254, 255, 5, 33, 0, 0, 255, 256, 5, 61, 0, 0, 256, 74, 1, 0, 0, 0, 257, 261, 7, 0, 0, 0, 258, 260, 7, 1, 0, 0, 259, 258, 1, 0, 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 76, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 7, 2, 0, 0, 265, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 265, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 275, 1, 0, 0, 0, 269, 271, 5, 46, 0, 0, 270, 272, 7, 2, 0, 0, 271, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 276, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 78, 1, 0, 0, 0, 277, 279, 7, 3, 0, 0, 278, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 80, 1, 0, 0, 0, 282, 284, 7, 4, 0, 0, 283, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 288, 6, 40, 0, 0, 288, 82, 1, 0, 0, 0, 289, 290, 9, 0, 0, 0, 290, 84, 1, 0, 0, 0, 291, 292, 5, 47, 0, 0, 292, 293, 5, 47, 0, 0, 293, 297, 1, 0, 0, 0, 294, 296, 8, 3, 0, 0, 295, 294, 1, 0, 0, 0, 296, 299, 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 300, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 300, 301, 6, 42, 0, 0, 301, 86, 1, 0, 0, 0, 302, 303, 5, 47, 0, 0, 303, 304, 5, 42, 0, 0, 304, 308, 1, 0, 0, 0, 305, 307, 9, 0, 0, 0, 306, 305, 1, 0, 0, 0, 307, 310, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 311, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 311, 312, 5, 42, 0, 0, 312, 313, 5, 47, 0, 0, 313, 314, 1, 0, 0, 0, 314, 315, 6, 43, 0, 0, 315, 88, 1, 0, 0, 0, 316, 319, 8, 5, 0, 0, 317, 319, 3, 91, 45, 0, 318, 316, 1, 0, 0, 0, 318, 317, 1, 0, 0, 0, 319, 90, 1, 0, 0, 0, 320, 332, 5, 92, 0, 0, 321, 333, 7, 6, 0, 0, 322, 323, 5, 117, 0, 0, 323, 324, 5, 123, 0, 0, 324, 326, 1, 0, 0, 0, 325, 327, 3, 93, 46, 0, 326, 325, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 5, 125, 0, 0, 331, 333, 1, 0, 0, 0, 332, 321, 1, 0, 0, 0, 332, 322, 1, 0, 0, 0, 333, 92, 1, 0, 0, 0, 334, 335, 7, 7, 0, 0, 335, 94, 1, 0, 0, 0, 17, 0, 102, 179, 189, 199, 208, 261, 267, 273, 275, 280, 285, 297, 308, 318, 328, 332, 1, 6, 0, 0] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens index c1bbbeed110..4e879f5c346 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens @@ -40,6 +40,8 @@ NUMBER=39 NL=40 SPACES=41 UNKNOWN=42 +SINGLE_LINE_COMMENT=43 +MULTI_LINE_COMMENT=44 '@'=2 ','=3 '['=4 diff --git a/pkg/parser/bicep/antlr/parser/bicep_lexer.go b/pkg/parser/bicep/antlr/parser/bicep_lexer.go index 622bb84b36b..df013f6951f 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_lexer.go +++ b/pkg/parser/bicep/antlr/parser/bicep_lexer.go @@ -55,7 +55,8 @@ func biceplexerLexerInit() { "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", - "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", + "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "SINGLE_LINE_COMMENT", + "MULTI_LINE_COMMENT", } staticData.RuleNames = []string{ "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", @@ -63,12 +64,12 @@ func biceplexerLexerInit() { "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", - "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "STRINGCHAR", - "ESCAPE", "HEX", + "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "SINGLE_LINE_COMMENT", + "MULTI_LINE_COMMENT", "STRINGCHAR", "ESCAPE", "HEX", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 42, 307, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 44, 336, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, @@ -76,135 +77,148 @@ func biceplexerLexerInit() { 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, - 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 1, 0, 1, 0, 1, 0, 1, 0, 1, - 0, 5, 0, 97, 8, 0, 10, 0, 12, 0, 100, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, - 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, - 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, - 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, - 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, - 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, - 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, - 19, 1, 20, 1, 20, 5, 20, 174, 8, 20, 10, 20, 12, 20, 177, 9, 20, 1, 20, - 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 184, 8, 21, 10, 21, 12, 21, 187, 9, - 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 194, 8, 22, 10, 22, 12, 22, - 197, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 203, 8, 23, 10, 23, 12, - 23, 206, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, - 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, - 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, - 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, - 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 5, 37, 256, - 8, 37, 10, 37, 12, 37, 259, 9, 37, 1, 38, 4, 38, 262, 8, 38, 11, 38, 12, - 38, 263, 1, 38, 1, 38, 4, 38, 268, 8, 38, 11, 38, 12, 38, 269, 3, 38, 272, - 8, 38, 1, 39, 4, 39, 275, 8, 39, 11, 39, 12, 39, 276, 1, 40, 4, 40, 280, - 8, 40, 11, 40, 12, 40, 281, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 3, - 42, 290, 8, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 298, 8, - 43, 11, 43, 12, 43, 299, 1, 43, 1, 43, 3, 43, 304, 8, 43, 1, 44, 1, 44, - 1, 98, 0, 45, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, - 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, - 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, - 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, - 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 0, 87, 0, 89, 0, 1, - 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, - 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, - 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, - 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 317, 0, 1, 1, 0, 0, - 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, - 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, - 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, - 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, - 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, - 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, - 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, - 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, - 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, - 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, - 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 1, 91, 1, 0, 0, 0, 3, - 105, 1, 0, 0, 0, 5, 107, 1, 0, 0, 0, 7, 109, 1, 0, 0, 0, 9, 111, 1, 0, - 0, 0, 11, 113, 1, 0, 0, 0, 13, 115, 1, 0, 0, 0, 15, 117, 1, 0, 0, 0, 17, - 119, 1, 0, 0, 0, 19, 121, 1, 0, 0, 0, 21, 123, 1, 0, 0, 0, 23, 125, 1, - 0, 0, 0, 25, 127, 1, 0, 0, 0, 27, 129, 1, 0, 0, 0, 29, 135, 1, 0, 0, 0, - 31, 139, 1, 0, 0, 0, 33, 144, 1, 0, 0, 0, 35, 150, 1, 0, 0, 0, 37, 155, - 1, 0, 0, 0, 39, 162, 1, 0, 0, 0, 41, 171, 1, 0, 0, 0, 43, 181, 1, 0, 0, - 0, 45, 191, 1, 0, 0, 0, 47, 200, 1, 0, 0, 0, 49, 209, 1, 0, 0, 0, 51, 216, - 1, 0, 0, 0, 53, 220, 1, 0, 0, 0, 55, 225, 1, 0, 0, 0, 57, 228, 1, 0, 0, - 0, 59, 232, 1, 0, 0, 0, 61, 235, 1, 0, 0, 0, 63, 237, 1, 0, 0, 0, 65, 239, - 1, 0, 0, 0, 67, 242, 1, 0, 0, 0, 69, 244, 1, 0, 0, 0, 71, 247, 1, 0, 0, - 0, 73, 250, 1, 0, 0, 0, 75, 253, 1, 0, 0, 0, 77, 261, 1, 0, 0, 0, 79, 274, - 1, 0, 0, 0, 81, 279, 1, 0, 0, 0, 83, 285, 1, 0, 0, 0, 85, 289, 1, 0, 0, - 0, 87, 291, 1, 0, 0, 0, 89, 305, 1, 0, 0, 0, 91, 92, 5, 39, 0, 0, 92, 93, - 5, 39, 0, 0, 93, 94, 5, 39, 0, 0, 94, 98, 1, 0, 0, 0, 95, 97, 9, 0, 0, - 0, 96, 95, 1, 0, 0, 0, 97, 100, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 98, 96, - 1, 0, 0, 0, 99, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, 102, 5, 39, - 0, 0, 102, 103, 5, 39, 0, 0, 103, 104, 5, 39, 0, 0, 104, 2, 1, 0, 0, 0, - 105, 106, 5, 64, 0, 0, 106, 4, 1, 0, 0, 0, 107, 108, 5, 44, 0, 0, 108, - 6, 1, 0, 0, 0, 109, 110, 5, 91, 0, 0, 110, 8, 1, 0, 0, 0, 111, 112, 5, - 93, 0, 0, 112, 10, 1, 0, 0, 0, 113, 114, 5, 40, 0, 0, 114, 12, 1, 0, 0, - 0, 115, 116, 5, 41, 0, 0, 116, 14, 1, 0, 0, 0, 117, 118, 5, 46, 0, 0, 118, - 16, 1, 0, 0, 0, 119, 120, 5, 124, 0, 0, 120, 18, 1, 0, 0, 0, 121, 122, - 5, 58, 0, 0, 122, 20, 1, 0, 0, 0, 123, 124, 5, 61, 0, 0, 124, 22, 1, 0, - 0, 0, 125, 126, 5, 123, 0, 0, 126, 24, 1, 0, 0, 0, 127, 128, 5, 125, 0, - 0, 128, 26, 1, 0, 0, 0, 129, 130, 5, 112, 0, 0, 130, 131, 5, 97, 0, 0, - 131, 132, 5, 114, 0, 0, 132, 133, 5, 97, 0, 0, 133, 134, 5, 109, 0, 0, - 134, 28, 1, 0, 0, 0, 135, 136, 5, 118, 0, 0, 136, 137, 5, 97, 0, 0, 137, - 138, 5, 114, 0, 0, 138, 30, 1, 0, 0, 0, 139, 140, 5, 116, 0, 0, 140, 141, - 5, 114, 0, 0, 141, 142, 5, 117, 0, 0, 142, 143, 5, 101, 0, 0, 143, 32, - 1, 0, 0, 0, 144, 145, 5, 102, 0, 0, 145, 146, 5, 97, 0, 0, 146, 147, 5, - 108, 0, 0, 147, 148, 5, 115, 0, 0, 148, 149, 5, 101, 0, 0, 149, 34, 1, - 0, 0, 0, 150, 151, 5, 110, 0, 0, 151, 152, 5, 117, 0, 0, 152, 153, 5, 108, - 0, 0, 153, 154, 5, 108, 0, 0, 154, 36, 1, 0, 0, 0, 155, 156, 5, 111, 0, - 0, 156, 157, 5, 98, 0, 0, 157, 158, 5, 106, 0, 0, 158, 159, 5, 101, 0, - 0, 159, 160, 5, 99, 0, 0, 160, 161, 5, 116, 0, 0, 161, 38, 1, 0, 0, 0, - 162, 163, 5, 114, 0, 0, 163, 164, 5, 101, 0, 0, 164, 165, 5, 115, 0, 0, - 165, 166, 5, 111, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, 5, 114, 0, 0, - 168, 169, 5, 99, 0, 0, 169, 170, 5, 101, 0, 0, 170, 40, 1, 0, 0, 0, 171, - 175, 5, 39, 0, 0, 172, 174, 3, 85, 42, 0, 173, 172, 1, 0, 0, 0, 174, 177, - 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, - 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 36, 0, 0, 179, 180, 5, 123, 0, - 0, 180, 42, 1, 0, 0, 0, 181, 185, 5, 125, 0, 0, 182, 184, 3, 85, 42, 0, - 183, 182, 1, 0, 0, 0, 184, 187, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 185, - 186, 1, 0, 0, 0, 186, 188, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 188, 189, - 5, 36, 0, 0, 189, 190, 5, 123, 0, 0, 190, 44, 1, 0, 0, 0, 191, 195, 5, - 125, 0, 0, 192, 194, 3, 85, 42, 0, 193, 192, 1, 0, 0, 0, 194, 197, 1, 0, - 0, 0, 195, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 198, 1, 0, 0, 0, - 197, 195, 1, 0, 0, 0, 198, 199, 5, 39, 0, 0, 199, 46, 1, 0, 0, 0, 200, - 204, 5, 39, 0, 0, 201, 203, 3, 85, 42, 0, 202, 201, 1, 0, 0, 0, 203, 206, - 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 207, 1, 0, - 0, 0, 206, 204, 1, 0, 0, 0, 207, 208, 5, 39, 0, 0, 208, 48, 1, 0, 0, 0, - 209, 210, 5, 115, 0, 0, 210, 211, 5, 116, 0, 0, 211, 212, 5, 114, 0, 0, - 212, 213, 5, 105, 0, 0, 213, 214, 5, 110, 0, 0, 214, 215, 5, 103, 0, 0, - 215, 50, 1, 0, 0, 0, 216, 217, 5, 105, 0, 0, 217, 218, 5, 110, 0, 0, 218, - 219, 5, 116, 0, 0, 219, 52, 1, 0, 0, 0, 220, 221, 5, 98, 0, 0, 221, 222, - 5, 111, 0, 0, 222, 223, 5, 111, 0, 0, 223, 224, 5, 108, 0, 0, 224, 54, - 1, 0, 0, 0, 225, 226, 5, 105, 0, 0, 226, 227, 5, 102, 0, 0, 227, 56, 1, - 0, 0, 0, 228, 229, 5, 102, 0, 0, 229, 230, 5, 111, 0, 0, 230, 231, 5, 114, - 0, 0, 231, 58, 1, 0, 0, 0, 232, 233, 5, 105, 0, 0, 233, 234, 5, 110, 0, - 0, 234, 60, 1, 0, 0, 0, 235, 236, 5, 63, 0, 0, 236, 62, 1, 0, 0, 0, 237, - 238, 5, 62, 0, 0, 238, 64, 1, 0, 0, 0, 239, 240, 5, 62, 0, 0, 240, 241, - 5, 61, 0, 0, 241, 66, 1, 0, 0, 0, 242, 243, 5, 60, 0, 0, 243, 68, 1, 0, - 0, 0, 244, 245, 5, 60, 0, 0, 245, 246, 5, 61, 0, 0, 246, 70, 1, 0, 0, 0, - 247, 248, 5, 61, 0, 0, 248, 249, 5, 61, 0, 0, 249, 72, 1, 0, 0, 0, 250, - 251, 5, 33, 0, 0, 251, 252, 5, 61, 0, 0, 252, 74, 1, 0, 0, 0, 253, 257, - 7, 0, 0, 0, 254, 256, 7, 1, 0, 0, 255, 254, 1, 0, 0, 0, 256, 259, 1, 0, - 0, 0, 257, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 76, 1, 0, 0, 0, - 259, 257, 1, 0, 0, 0, 260, 262, 7, 2, 0, 0, 261, 260, 1, 0, 0, 0, 262, - 263, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 271, - 1, 0, 0, 0, 265, 267, 5, 46, 0, 0, 266, 268, 7, 2, 0, 0, 267, 266, 1, 0, - 0, 0, 268, 269, 1, 0, 0, 0, 269, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, - 270, 272, 1, 0, 0, 0, 271, 265, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, - 78, 1, 0, 0, 0, 273, 275, 7, 3, 0, 0, 274, 273, 1, 0, 0, 0, 275, 276, 1, - 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 80, 1, 0, 0, - 0, 278, 280, 7, 4, 0, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, - 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, - 6, 40, 0, 0, 284, 82, 1, 0, 0, 0, 285, 286, 9, 0, 0, 0, 286, 84, 1, 0, - 0, 0, 287, 290, 8, 5, 0, 0, 288, 290, 3, 87, 43, 0, 289, 287, 1, 0, 0, - 0, 289, 288, 1, 0, 0, 0, 290, 86, 1, 0, 0, 0, 291, 303, 5, 92, 0, 0, 292, - 304, 7, 6, 0, 0, 293, 294, 5, 117, 0, 0, 294, 295, 5, 123, 0, 0, 295, 297, - 1, 0, 0, 0, 296, 298, 3, 89, 44, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, - 0, 0, 0, 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 301, 1, 0, 0, - 0, 301, 302, 5, 125, 0, 0, 302, 304, 1, 0, 0, 0, 303, 292, 1, 0, 0, 0, - 303, 293, 1, 0, 0, 0, 304, 88, 1, 0, 0, 0, 305, 306, 7, 7, 0, 0, 306, 90, - 1, 0, 0, 0, 15, 0, 98, 175, 185, 195, 204, 257, 263, 269, 271, 276, 281, - 289, 299, 303, 1, 6, 0, 0, + 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 101, 8, 0, 10, 0, 12, 0, 104, 9, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, + 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, + 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, + 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, + 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, + 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, + 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 178, 8, 20, 10, 20, 12, + 20, 181, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 188, 8, 21, 10, + 21, 12, 21, 191, 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 198, + 8, 22, 10, 22, 12, 22, 201, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 207, + 8, 23, 10, 23, 12, 23, 210, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, + 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, + 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, + 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, + 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, + 37, 5, 37, 260, 8, 37, 10, 37, 12, 37, 263, 9, 37, 1, 38, 4, 38, 266, 8, + 38, 11, 38, 12, 38, 267, 1, 38, 1, 38, 4, 38, 272, 8, 38, 11, 38, 12, 38, + 273, 3, 38, 276, 8, 38, 1, 39, 4, 39, 279, 8, 39, 11, 39, 12, 39, 280, + 1, 40, 4, 40, 284, 8, 40, 11, 40, 12, 40, 285, 1, 40, 1, 40, 1, 41, 1, + 41, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 296, 8, 42, 10, 42, 12, 42, 299, + 9, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 307, 8, 43, 10, + 43, 12, 43, 310, 9, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, + 3, 44, 319, 8, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 4, 45, 327, + 8, 45, 11, 45, 12, 45, 328, 1, 45, 1, 45, 3, 45, 333, 8, 45, 1, 46, 1, + 46, 2, 102, 308, 0, 47, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, + 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, + 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, + 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, + 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, + 89, 0, 91, 0, 93, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, + 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, + 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, + 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, + 102, 348, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, + 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, + 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, + 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, + 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, + 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, + 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, + 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, + 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, + 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, + 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, + 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0, 3, 109, 1, + 0, 0, 0, 5, 111, 1, 0, 0, 0, 7, 113, 1, 0, 0, 0, 9, 115, 1, 0, 0, 0, 11, + 117, 1, 0, 0, 0, 13, 119, 1, 0, 0, 0, 15, 121, 1, 0, 0, 0, 17, 123, 1, + 0, 0, 0, 19, 125, 1, 0, 0, 0, 21, 127, 1, 0, 0, 0, 23, 129, 1, 0, 0, 0, + 25, 131, 1, 0, 0, 0, 27, 133, 1, 0, 0, 0, 29, 139, 1, 0, 0, 0, 31, 143, + 1, 0, 0, 0, 33, 148, 1, 0, 0, 0, 35, 154, 1, 0, 0, 0, 37, 159, 1, 0, 0, + 0, 39, 166, 1, 0, 0, 0, 41, 175, 1, 0, 0, 0, 43, 185, 1, 0, 0, 0, 45, 195, + 1, 0, 0, 0, 47, 204, 1, 0, 0, 0, 49, 213, 1, 0, 0, 0, 51, 220, 1, 0, 0, + 0, 53, 224, 1, 0, 0, 0, 55, 229, 1, 0, 0, 0, 57, 232, 1, 0, 0, 0, 59, 236, + 1, 0, 0, 0, 61, 239, 1, 0, 0, 0, 63, 241, 1, 0, 0, 0, 65, 243, 1, 0, 0, + 0, 67, 246, 1, 0, 0, 0, 69, 248, 1, 0, 0, 0, 71, 251, 1, 0, 0, 0, 73, 254, + 1, 0, 0, 0, 75, 257, 1, 0, 0, 0, 77, 265, 1, 0, 0, 0, 79, 278, 1, 0, 0, + 0, 81, 283, 1, 0, 0, 0, 83, 289, 1, 0, 0, 0, 85, 291, 1, 0, 0, 0, 87, 302, + 1, 0, 0, 0, 89, 318, 1, 0, 0, 0, 91, 320, 1, 0, 0, 0, 93, 334, 1, 0, 0, + 0, 95, 96, 5, 39, 0, 0, 96, 97, 5, 39, 0, 0, 97, 98, 5, 39, 0, 0, 98, 102, + 1, 0, 0, 0, 99, 101, 9, 0, 0, 0, 100, 99, 1, 0, 0, 0, 101, 104, 1, 0, 0, + 0, 102, 103, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 103, 105, 1, 0, 0, 0, 104, + 102, 1, 0, 0, 0, 105, 106, 5, 39, 0, 0, 106, 107, 5, 39, 0, 0, 107, 108, + 5, 39, 0, 0, 108, 2, 1, 0, 0, 0, 109, 110, 5, 64, 0, 0, 110, 4, 1, 0, 0, + 0, 111, 112, 5, 44, 0, 0, 112, 6, 1, 0, 0, 0, 113, 114, 5, 91, 0, 0, 114, + 8, 1, 0, 0, 0, 115, 116, 5, 93, 0, 0, 116, 10, 1, 0, 0, 0, 117, 118, 5, + 40, 0, 0, 118, 12, 1, 0, 0, 0, 119, 120, 5, 41, 0, 0, 120, 14, 1, 0, 0, + 0, 121, 122, 5, 46, 0, 0, 122, 16, 1, 0, 0, 0, 123, 124, 5, 124, 0, 0, + 124, 18, 1, 0, 0, 0, 125, 126, 5, 58, 0, 0, 126, 20, 1, 0, 0, 0, 127, 128, + 5, 61, 0, 0, 128, 22, 1, 0, 0, 0, 129, 130, 5, 123, 0, 0, 130, 24, 1, 0, + 0, 0, 131, 132, 5, 125, 0, 0, 132, 26, 1, 0, 0, 0, 133, 134, 5, 112, 0, + 0, 134, 135, 5, 97, 0, 0, 135, 136, 5, 114, 0, 0, 136, 137, 5, 97, 0, 0, + 137, 138, 5, 109, 0, 0, 138, 28, 1, 0, 0, 0, 139, 140, 5, 118, 0, 0, 140, + 141, 5, 97, 0, 0, 141, 142, 5, 114, 0, 0, 142, 30, 1, 0, 0, 0, 143, 144, + 5, 116, 0, 0, 144, 145, 5, 114, 0, 0, 145, 146, 5, 117, 0, 0, 146, 147, + 5, 101, 0, 0, 147, 32, 1, 0, 0, 0, 148, 149, 5, 102, 0, 0, 149, 150, 5, + 97, 0, 0, 150, 151, 5, 108, 0, 0, 151, 152, 5, 115, 0, 0, 152, 153, 5, + 101, 0, 0, 153, 34, 1, 0, 0, 0, 154, 155, 5, 110, 0, 0, 155, 156, 5, 117, + 0, 0, 156, 157, 5, 108, 0, 0, 157, 158, 5, 108, 0, 0, 158, 36, 1, 0, 0, + 0, 159, 160, 5, 111, 0, 0, 160, 161, 5, 98, 0, 0, 161, 162, 5, 106, 0, + 0, 162, 163, 5, 101, 0, 0, 163, 164, 5, 99, 0, 0, 164, 165, 5, 116, 0, + 0, 165, 38, 1, 0, 0, 0, 166, 167, 5, 114, 0, 0, 167, 168, 5, 101, 0, 0, + 168, 169, 5, 115, 0, 0, 169, 170, 5, 111, 0, 0, 170, 171, 5, 117, 0, 0, + 171, 172, 5, 114, 0, 0, 172, 173, 5, 99, 0, 0, 173, 174, 5, 101, 0, 0, + 174, 40, 1, 0, 0, 0, 175, 179, 5, 39, 0, 0, 176, 178, 3, 89, 44, 0, 177, + 176, 1, 0, 0, 0, 178, 181, 1, 0, 0, 0, 179, 177, 1, 0, 0, 0, 179, 180, + 1, 0, 0, 0, 180, 182, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 182, 183, 5, 36, + 0, 0, 183, 184, 5, 123, 0, 0, 184, 42, 1, 0, 0, 0, 185, 189, 5, 125, 0, + 0, 186, 188, 3, 89, 44, 0, 187, 186, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, + 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, 0, 0, 191, + 189, 1, 0, 0, 0, 192, 193, 5, 36, 0, 0, 193, 194, 5, 123, 0, 0, 194, 44, + 1, 0, 0, 0, 195, 199, 5, 125, 0, 0, 196, 198, 3, 89, 44, 0, 197, 196, 1, + 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, + 0, 200, 202, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 5, 39, 0, 0, 203, + 46, 1, 0, 0, 0, 204, 208, 5, 39, 0, 0, 205, 207, 3, 89, 44, 0, 206, 205, + 1, 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, + 0, 0, 209, 211, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 5, 39, 0, 0, + 212, 48, 1, 0, 0, 0, 213, 214, 5, 115, 0, 0, 214, 215, 5, 116, 0, 0, 215, + 216, 5, 114, 0, 0, 216, 217, 5, 105, 0, 0, 217, 218, 5, 110, 0, 0, 218, + 219, 5, 103, 0, 0, 219, 50, 1, 0, 0, 0, 220, 221, 5, 105, 0, 0, 221, 222, + 5, 110, 0, 0, 222, 223, 5, 116, 0, 0, 223, 52, 1, 0, 0, 0, 224, 225, 5, + 98, 0, 0, 225, 226, 5, 111, 0, 0, 226, 227, 5, 111, 0, 0, 227, 228, 5, + 108, 0, 0, 228, 54, 1, 0, 0, 0, 229, 230, 5, 105, 0, 0, 230, 231, 5, 102, + 0, 0, 231, 56, 1, 0, 0, 0, 232, 233, 5, 102, 0, 0, 233, 234, 5, 111, 0, + 0, 234, 235, 5, 114, 0, 0, 235, 58, 1, 0, 0, 0, 236, 237, 5, 105, 0, 0, + 237, 238, 5, 110, 0, 0, 238, 60, 1, 0, 0, 0, 239, 240, 5, 63, 0, 0, 240, + 62, 1, 0, 0, 0, 241, 242, 5, 62, 0, 0, 242, 64, 1, 0, 0, 0, 243, 244, 5, + 62, 0, 0, 244, 245, 5, 61, 0, 0, 245, 66, 1, 0, 0, 0, 246, 247, 5, 60, + 0, 0, 247, 68, 1, 0, 0, 0, 248, 249, 5, 60, 0, 0, 249, 250, 5, 61, 0, 0, + 250, 70, 1, 0, 0, 0, 251, 252, 5, 61, 0, 0, 252, 253, 5, 61, 0, 0, 253, + 72, 1, 0, 0, 0, 254, 255, 5, 33, 0, 0, 255, 256, 5, 61, 0, 0, 256, 74, + 1, 0, 0, 0, 257, 261, 7, 0, 0, 0, 258, 260, 7, 1, 0, 0, 259, 258, 1, 0, + 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, + 262, 76, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 7, 2, 0, 0, 265, 264, + 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 265, 1, 0, 0, 0, 267, 268, 1, 0, + 0, 0, 268, 275, 1, 0, 0, 0, 269, 271, 5, 46, 0, 0, 270, 272, 7, 2, 0, 0, + 271, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 273, + 274, 1, 0, 0, 0, 274, 276, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, 276, + 1, 0, 0, 0, 276, 78, 1, 0, 0, 0, 277, 279, 7, 3, 0, 0, 278, 277, 1, 0, + 0, 0, 279, 280, 1, 0, 0, 0, 280, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, + 281, 80, 1, 0, 0, 0, 282, 284, 7, 4, 0, 0, 283, 282, 1, 0, 0, 0, 284, 285, + 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 287, 1, 0, + 0, 0, 287, 288, 6, 40, 0, 0, 288, 82, 1, 0, 0, 0, 289, 290, 9, 0, 0, 0, + 290, 84, 1, 0, 0, 0, 291, 292, 5, 47, 0, 0, 292, 293, 5, 47, 0, 0, 293, + 297, 1, 0, 0, 0, 294, 296, 8, 3, 0, 0, 295, 294, 1, 0, 0, 0, 296, 299, + 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 300, 1, 0, + 0, 0, 299, 297, 1, 0, 0, 0, 300, 301, 6, 42, 0, 0, 301, 86, 1, 0, 0, 0, + 302, 303, 5, 47, 0, 0, 303, 304, 5, 42, 0, 0, 304, 308, 1, 0, 0, 0, 305, + 307, 9, 0, 0, 0, 306, 305, 1, 0, 0, 0, 307, 310, 1, 0, 0, 0, 308, 309, + 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 311, 1, 0, 0, 0, 310, 308, 1, 0, + 0, 0, 311, 312, 5, 42, 0, 0, 312, 313, 5, 47, 0, 0, 313, 314, 1, 0, 0, + 0, 314, 315, 6, 43, 0, 0, 315, 88, 1, 0, 0, 0, 316, 319, 8, 5, 0, 0, 317, + 319, 3, 91, 45, 0, 318, 316, 1, 0, 0, 0, 318, 317, 1, 0, 0, 0, 319, 90, + 1, 0, 0, 0, 320, 332, 5, 92, 0, 0, 321, 333, 7, 6, 0, 0, 322, 323, 5, 117, + 0, 0, 323, 324, 5, 123, 0, 0, 324, 326, 1, 0, 0, 0, 325, 327, 3, 93, 46, + 0, 326, 325, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 328, + 329, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 5, 125, 0, 0, 331, 333, + 1, 0, 0, 0, 332, 321, 1, 0, 0, 0, 332, 322, 1, 0, 0, 0, 333, 92, 1, 0, + 0, 0, 334, 335, 7, 7, 0, 0, 335, 94, 1, 0, 0, 0, 17, 0, 102, 179, 189, + 199, 208, 261, 267, 273, 275, 280, 285, 297, 308, 318, 328, 332, 1, 6, + 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -287,4 +301,6 @@ const ( bicepLexerNL = 40 bicepLexerSPACES = 41 bicepLexerUNKNOWN = 42 + bicepLexerSINGLE_LINE_COMMENT = 43 + bicepLexerMULTI_LINE_COMMENT = 44 ) diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index b4b4c6a3271..2178e3247a4 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -45,7 +45,8 @@ func bicepParserInit() { "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", - "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", + "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "SINGLE_LINE_COMMENT", + "MULTI_LINE_COMMENT", } staticData.RuleNames = []string{ "program", "statement", "parameterDecl", "parameterDefaultValue", "variableDecl", @@ -57,7 +58,7 @@ func bicepParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 42, 326, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 44, 326, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, @@ -283,6 +284,8 @@ const ( bicepParserNL = 40 bicepParserSPACES = 41 bicepParserUNKNOWN = 42 + bicepParserSINGLE_LINE_COMMENT = 43 + bicepParserMULTI_LINE_COMMENT = 44 ) // bicepParser rules. From dfb1d81900a88c4b5ed1b7c5032873a771f8b7d8 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Tue, 7 May 2024 17:31:09 +0100 Subject: [PATCH 093/130] update grammar to parse outputs --- pkg/parser/bicep/antlr/bicep.g4 | 7 +- pkg/parser/bicep/antlr/parser/bicep.interp | 5 +- pkg/parser/bicep/antlr/parser/bicep.tokens | 76 +- .../bicep/antlr/parser/bicepLexer.interp | 5 +- .../bicep/antlr/parser/bicepLexer.tokens | 76 +- .../bicep/antlr/parser/bicep_base_visitor.go | 4 + pkg/parser/bicep/antlr/parser/bicep_lexer.go | 343 ++--- pkg/parser/bicep/antlr/parser/bicep_parser.go | 1212 +++++++++++------ .../bicep/antlr/parser/bicep_visitor.go | 3 + 9 files changed, 1070 insertions(+), 661 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index a9212b430bd..64260cc24f2 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -3,7 +3,7 @@ grammar bicep; // program -> statement* EOF program: statement* EOF; -statement: parameterDecl | variableDecl | resourceDecl | NL; +statement: parameterDecl | variableDecl | resourceDecl | outputDecl | NL; // parameterDecl -> decorator* "parameter" IDENTIFIER(name) typeExpression parameterDefaultValue? NL // | decorator* "parameter" IDENTIFIER(name) "resource" interpString(type) parameterDefaultValue? NL @@ -29,6 +29,9 @@ resourceDecl: | forExpression ) NL; +outputDecl: + decorator* OUTPUT name = identifier (type1 = identifier | RESOURCE type2 = interpString) ASSIGN expression NL; + // ifCondition -> "if" parenthesizedExpression object ifCondition : IF parenthesizedExpression object @@ -167,6 +170,8 @@ OBJECT: 'object'; RESOURCE: 'resource'; +OUTPUT: 'output'; + // stringLeftPiece -> "'" STRINGCHAR* "${" STRING_LEFT_PIECE: '\'' STRINGCHAR* '${'; diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index 975fa6a7811..7c2e97fc5fb 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -20,6 +20,7 @@ null 'null' 'object' 'resource' +'output' null null null @@ -67,6 +68,7 @@ FALSE NULL OBJECT RESOURCE +OUTPUT STRING_LEFT_PIECE STRING_MIDDLE_PIECE STRING_RIGHT_PIECE @@ -99,6 +101,7 @@ parameterDecl parameterDefaultValue variableDecl resourceDecl +outputDecl ifCondition forExpression forVariableBlock @@ -122,4 +125,4 @@ identifier atn: -[4, 1, 44, 326, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 1, 0, 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 65, 8, 1, 1, 2, 5, 2, 68, 8, 2, 10, 2, 12, 2, 71, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 77, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 82, 8, 2, 3, 2, 84, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 92, 8, 4, 10, 4, 12, 4, 95, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 104, 8, 5, 10, 5, 12, 5, 107, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 5, 7, 126, 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 7, 1, 7, 1, 7, 3, 7, 134, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 141, 8, 7, 10, 7, 12, 7, 144, 9, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 156, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 171, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 201, 8, 11, 10, 11, 12, 11, 204, 9, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 216, 8, 13, 1, 14, 1, 14, 3, 14, 220, 8, 14, 1, 14, 1, 14, 3, 14, 224, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 235, 8, 16, 1, 17, 1, 17, 4, 17, 239, 8, 17, 11, 17, 12, 17, 240, 1, 17, 1, 17, 4, 17, 245, 8, 17, 11, 17, 12, 17, 246, 5, 17, 249, 8, 17, 10, 17, 12, 17, 252, 9, 17, 3, 17, 254, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 260, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 267, 8, 19, 10, 19, 12, 19, 270, 9, 19, 1, 19, 5, 19, 273, 8, 19, 10, 19, 12, 19, 276, 9, 19, 1, 19, 1, 19, 1, 20, 1, 20, 4, 20, 282, 8, 20, 11, 20, 12, 20, 283, 1, 20, 3, 20, 287, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 298, 8, 22, 1, 23, 1, 23, 1, 23, 3, 23, 303, 8, 23, 1, 23, 3, 23, 306, 8, 23, 1, 23, 3, 23, 309, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 3, 24, 316, 8, 24, 1, 24, 5, 24, 319, 8, 24, 10, 24, 12, 24, 322, 9, 24, 1, 25, 1, 25, 1, 25, 0, 1, 22, 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 0, 2, 1, 0, 32, 37, 3, 0, 14, 20, 25, 27, 38, 38, 352, 0, 55, 1, 0, 0, 0, 2, 64, 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, 87, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 105, 1, 0, 0, 0, 12, 119, 1, 0, 0, 0, 14, 123, 1, 0, 0, 0, 16, 147, 1, 0, 0, 0, 18, 155, 1, 0, 0, 0, 20, 170, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 205, 1, 0, 0, 0, 26, 215, 1, 0, 0, 0, 28, 217, 1, 0, 0, 0, 30, 227, 1, 0, 0, 0, 32, 234, 1, 0, 0, 0, 34, 236, 1, 0, 0, 0, 36, 259, 1, 0, 0, 0, 38, 264, 1, 0, 0, 0, 40, 279, 1, 0, 0, 0, 42, 288, 1, 0, 0, 0, 44, 297, 1, 0, 0, 0, 46, 299, 1, 0, 0, 0, 48, 312, 1, 0, 0, 0, 50, 323, 1, 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 58, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 0, 0, 1, 59, 1, 1, 0, 0, 0, 60, 65, 3, 4, 2, 0, 61, 65, 3, 8, 4, 0, 62, 65, 3, 10, 5, 0, 63, 65, 5, 40, 0, 0, 64, 60, 1, 0, 0, 0, 64, 61, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 63, 1, 0, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 42, 21, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 14, 0, 0, 73, 83, 3, 50, 25, 0, 74, 76, 3, 30, 15, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 84, 1, 0, 0, 0, 78, 79, 5, 20, 0, 0, 79, 81, 3, 20, 10, 0, 80, 82, 3, 6, 3, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 74, 1, 0, 0, 0, 83, 78, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 5, 40, 0, 0, 86, 5, 1, 0, 0, 0, 87, 88, 5, 11, 0, 0, 88, 89, 3, 22, 11, 0, 89, 7, 1, 0, 0, 0, 90, 92, 3, 42, 21, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 15, 0, 0, 97, 98, 3, 50, 25, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 22, 11, 0, 100, 101, 5, 40, 0, 0, 101, 9, 1, 0, 0, 0, 102, 104, 3, 42, 21, 0, 103, 102, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 5, 20, 0, 0, 109, 110, 3, 50, 25, 0, 110, 111, 3, 20, 10, 0, 111, 115, 5, 11, 0, 0, 112, 116, 3, 12, 6, 0, 113, 116, 3, 34, 17, 0, 114, 116, 3, 14, 7, 0, 115, 112, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 11, 1, 0, 0, 0, 119, 120, 5, 28, 0, 0, 120, 121, 3, 28, 14, 0, 121, 122, 3, 34, 17, 0, 122, 13, 1, 0, 0, 0, 123, 127, 5, 4, 0, 0, 124, 126, 5, 40, 0, 0, 125, 124, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 133, 5, 29, 0, 0, 131, 134, 3, 50, 25, 0, 132, 134, 3, 16, 8, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 30, 0, 0, 136, 137, 3, 22, 11, 0, 137, 138, 5, 10, 0, 0, 138, 142, 3, 18, 9, 0, 139, 141, 5, 40, 0, 0, 140, 139, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 5, 5, 0, 0, 146, 15, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, 3, 50, 25, 0, 149, 150, 5, 3, 0, 0, 150, 151, 3, 50, 25, 0, 151, 152, 5, 7, 0, 0, 152, 17, 1, 0, 0, 0, 153, 156, 3, 22, 11, 0, 154, 156, 3, 12, 6, 0, 155, 153, 1, 0, 0, 0, 155, 154, 1, 0, 0, 0, 156, 19, 1, 0, 0, 0, 157, 163, 5, 21, 0, 0, 158, 159, 3, 22, 11, 0, 159, 160, 5, 22, 0, 0, 160, 162, 1, 0, 0, 0, 161, 158, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 167, 3, 22, 11, 0, 167, 168, 5, 23, 0, 0, 168, 171, 1, 0, 0, 0, 169, 171, 5, 24, 0, 0, 170, 157, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, 21, 1, 0, 0, 0, 172, 173, 6, 11, -1, 0, 173, 174, 3, 26, 13, 0, 174, 202, 1, 0, 0, 0, 175, 176, 10, 6, 0, 0, 176, 177, 5, 31, 0, 0, 177, 178, 3, 22, 11, 0, 178, 179, 5, 10, 0, 0, 179, 180, 3, 22, 11, 7, 180, 201, 1, 0, 0, 0, 181, 182, 10, 2, 0, 0, 182, 183, 3, 24, 12, 0, 183, 184, 3, 22, 11, 3, 184, 201, 1, 0, 0, 0, 185, 186, 10, 7, 0, 0, 186, 187, 5, 4, 0, 0, 187, 188, 3, 22, 11, 0, 188, 189, 5, 5, 0, 0, 189, 201, 1, 0, 0, 0, 190, 191, 10, 5, 0, 0, 191, 192, 5, 8, 0, 0, 192, 201, 3, 50, 25, 0, 193, 194, 10, 4, 0, 0, 194, 195, 5, 10, 0, 0, 195, 201, 3, 50, 25, 0, 196, 197, 10, 3, 0, 0, 197, 198, 5, 10, 0, 0, 198, 199, 5, 10, 0, 0, 199, 201, 3, 50, 25, 0, 200, 175, 1, 0, 0, 0, 200, 181, 1, 0, 0, 0, 200, 185, 1, 0, 0, 0, 200, 190, 1, 0, 0, 0, 200, 193, 1, 0, 0, 0, 200, 196, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 23, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 205, 206, 7, 0, 0, 0, 206, 25, 1, 0, 0, 0, 207, 216, 3, 32, 16, 0, 208, 216, 3, 46, 23, 0, 209, 216, 3, 20, 10, 0, 210, 216, 5, 1, 0, 0, 211, 216, 3, 38, 19, 0, 212, 216, 3, 34, 17, 0, 213, 216, 3, 14, 7, 0, 214, 216, 3, 28, 14, 0, 215, 207, 1, 0, 0, 0, 215, 208, 1, 0, 0, 0, 215, 209, 1, 0, 0, 0, 215, 210, 1, 0, 0, 0, 215, 211, 1, 0, 0, 0, 215, 212, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 214, 1, 0, 0, 0, 216, 27, 1, 0, 0, 0, 217, 219, 5, 6, 0, 0, 218, 220, 5, 40, 0, 0, 219, 218, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 223, 3, 22, 11, 0, 222, 224, 5, 40, 0, 0, 223, 222, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 226, 5, 7, 0, 0, 226, 29, 1, 0, 0, 0, 227, 228, 3, 50, 25, 0, 228, 31, 1, 0, 0, 0, 229, 235, 5, 39, 0, 0, 230, 235, 5, 16, 0, 0, 231, 235, 5, 17, 0, 0, 232, 235, 5, 18, 0, 0, 233, 235, 3, 50, 25, 0, 234, 229, 1, 0, 0, 0, 234, 230, 1, 0, 0, 0, 234, 231, 1, 0, 0, 0, 234, 232, 1, 0, 0, 0, 234, 233, 1, 0, 0, 0, 235, 33, 1, 0, 0, 0, 236, 253, 5, 12, 0, 0, 237, 239, 5, 40, 0, 0, 238, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 250, 1, 0, 0, 0, 242, 244, 3, 36, 18, 0, 243, 245, 5, 40, 0, 0, 244, 243, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 249, 1, 0, 0, 0, 248, 242, 1, 0, 0, 0, 249, 252, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 254, 1, 0, 0, 0, 252, 250, 1, 0, 0, 0, 253, 238, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 256, 5, 13, 0, 0, 256, 35, 1, 0, 0, 0, 257, 260, 3, 50, 25, 0, 258, 260, 3, 20, 10, 0, 259, 257, 1, 0, 0, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 262, 5, 10, 0, 0, 262, 263, 3, 22, 11, 0, 263, 37, 1, 0, 0, 0, 264, 268, 5, 4, 0, 0, 265, 267, 5, 40, 0, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 274, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 271, 273, 3, 40, 20, 0, 272, 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 277, 278, 5, 5, 0, 0, 278, 39, 1, 0, 0, 0, 279, 286, 3, 22, 11, 0, 280, 282, 5, 40, 0, 0, 281, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 287, 5, 3, 0, 0, 286, 281, 1, 0, 0, 0, 286, 285, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 41, 1, 0, 0, 0, 288, 289, 5, 2, 0, 0, 289, 290, 3, 44, 22, 0, 290, 291, 5, 40, 0, 0, 291, 43, 1, 0, 0, 0, 292, 298, 3, 46, 23, 0, 293, 294, 3, 22, 11, 0, 294, 295, 5, 8, 0, 0, 295, 296, 3, 46, 23, 0, 296, 298, 1, 0, 0, 0, 297, 292, 1, 0, 0, 0, 297, 293, 1, 0, 0, 0, 298, 45, 1, 0, 0, 0, 299, 300, 3, 50, 25, 0, 300, 305, 5, 6, 0, 0, 301, 303, 5, 40, 0, 0, 302, 301, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 306, 3, 48, 24, 0, 305, 302, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 308, 1, 0, 0, 0, 307, 309, 5, 40, 0, 0, 308, 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, 5, 7, 0, 0, 311, 47, 1, 0, 0, 0, 312, 320, 3, 22, 11, 0, 313, 315, 5, 3, 0, 0, 314, 316, 5, 40, 0, 0, 315, 314, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 319, 3, 22, 11, 0, 318, 313, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 49, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 324, 7, 1, 0, 0, 324, 51, 1, 0, 0, 0, 36, 55, 64, 69, 76, 81, 83, 93, 105, 115, 127, 133, 142, 155, 163, 170, 200, 202, 215, 219, 223, 234, 240, 246, 250, 253, 259, 268, 274, 283, 286, 297, 302, 305, 308, 315, 320] \ No newline at end of file +[4, 1, 45, 346, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 1, 0, 5, 0, 56, 8, 0, 10, 0, 12, 0, 59, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 68, 8, 1, 1, 2, 5, 2, 71, 8, 2, 10, 2, 12, 2, 74, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 80, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 85, 8, 2, 3, 2, 87, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 95, 8, 4, 10, 4, 12, 4, 98, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 107, 8, 5, 10, 5, 12, 5, 110, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 119, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 124, 8, 6, 10, 6, 12, 6, 127, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 134, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 146, 8, 8, 10, 8, 12, 8, 149, 9, 8, 1, 8, 1, 8, 1, 8, 3, 8, 154, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 161, 8, 8, 10, 8, 12, 8, 164, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 176, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 182, 8, 11, 10, 11, 12, 11, 185, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 191, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 221, 8, 12, 10, 12, 12, 12, 224, 9, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 236, 8, 14, 1, 15, 1, 15, 3, 15, 240, 8, 15, 1, 15, 1, 15, 3, 15, 244, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 255, 8, 17, 1, 18, 1, 18, 4, 18, 259, 8, 18, 11, 18, 12, 18, 260, 1, 18, 1, 18, 4, 18, 265, 8, 18, 11, 18, 12, 18, 266, 5, 18, 269, 8, 18, 10, 18, 12, 18, 272, 9, 18, 3, 18, 274, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 3, 19, 280, 8, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 287, 8, 20, 10, 20, 12, 20, 290, 9, 20, 1, 20, 5, 20, 293, 8, 20, 10, 20, 12, 20, 296, 9, 20, 1, 20, 1, 20, 1, 21, 1, 21, 4, 21, 302, 8, 21, 11, 21, 12, 21, 303, 1, 21, 3, 21, 307, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 318, 8, 23, 1, 24, 1, 24, 1, 24, 3, 24, 323, 8, 24, 1, 24, 3, 24, 326, 8, 24, 1, 24, 3, 24, 329, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 336, 8, 25, 1, 25, 5, 25, 339, 8, 25, 10, 25, 12, 25, 342, 9, 25, 1, 26, 1, 26, 1, 26, 0, 1, 24, 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 2, 1, 0, 33, 38, 3, 0, 14, 20, 26, 28, 39, 39, 374, 0, 57, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, 0, 10, 108, 1, 0, 0, 0, 12, 125, 1, 0, 0, 0, 14, 139, 1, 0, 0, 0, 16, 143, 1, 0, 0, 0, 18, 167, 1, 0, 0, 0, 20, 175, 1, 0, 0, 0, 22, 190, 1, 0, 0, 0, 24, 192, 1, 0, 0, 0, 26, 225, 1, 0, 0, 0, 28, 235, 1, 0, 0, 0, 30, 237, 1, 0, 0, 0, 32, 247, 1, 0, 0, 0, 34, 254, 1, 0, 0, 0, 36, 256, 1, 0, 0, 0, 38, 279, 1, 0, 0, 0, 40, 284, 1, 0, 0, 0, 42, 299, 1, 0, 0, 0, 44, 308, 1, 0, 0, 0, 46, 317, 1, 0, 0, 0, 48, 319, 1, 0, 0, 0, 50, 332, 1, 0, 0, 0, 52, 343, 1, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 60, 61, 5, 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, 2, 0, 63, 68, 3, 8, 4, 0, 64, 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, 68, 5, 41, 0, 0, 67, 62, 1, 0, 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 89, 5, 41, 0, 0, 89, 5, 1, 0, 0, 0, 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 41, 0, 0, 104, 9, 1, 0, 0, 0, 105, 107, 3, 44, 22, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, 113, 114, 3, 22, 11, 0, 114, 118, 5, 11, 0, 0, 115, 119, 3, 14, 7, 0, 116, 119, 3, 36, 18, 0, 117, 119, 3, 16, 8, 0, 118, 115, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 5, 41, 0, 0, 121, 11, 1, 0, 0, 0, 122, 124, 3, 44, 22, 0, 123, 122, 1, 0, 0, 0, 124, 127, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, 129, 5, 21, 0, 0, 129, 133, 3, 52, 26, 0, 130, 134, 3, 52, 26, 0, 131, 132, 5, 20, 0, 0, 132, 134, 3, 22, 11, 0, 133, 130, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 11, 0, 0, 136, 137, 3, 24, 12, 0, 137, 138, 5, 41, 0, 0, 138, 13, 1, 0, 0, 0, 139, 140, 5, 29, 0, 0, 140, 141, 3, 30, 15, 0, 141, 142, 3, 36, 18, 0, 142, 15, 1, 0, 0, 0, 143, 147, 5, 4, 0, 0, 144, 146, 5, 41, 0, 0, 145, 144, 1, 0, 0, 0, 146, 149, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 147, 148, 1, 0, 0, 0, 148, 150, 1, 0, 0, 0, 149, 147, 1, 0, 0, 0, 150, 153, 5, 30, 0, 0, 151, 154, 3, 52, 26, 0, 152, 154, 3, 18, 9, 0, 153, 151, 1, 0, 0, 0, 153, 152, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 5, 31, 0, 0, 156, 157, 3, 24, 12, 0, 157, 158, 5, 10, 0, 0, 158, 162, 3, 20, 10, 0, 159, 161, 5, 41, 0, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 5, 5, 0, 0, 166, 17, 1, 0, 0, 0, 167, 168, 5, 6, 0, 0, 168, 169, 3, 52, 26, 0, 169, 170, 5, 3, 0, 0, 170, 171, 3, 52, 26, 0, 171, 172, 5, 7, 0, 0, 172, 19, 1, 0, 0, 0, 173, 176, 3, 24, 12, 0, 174, 176, 3, 14, 7, 0, 175, 173, 1, 0, 0, 0, 175, 174, 1, 0, 0, 0, 176, 21, 1, 0, 0, 0, 177, 183, 5, 22, 0, 0, 178, 179, 3, 24, 12, 0, 179, 180, 5, 23, 0, 0, 180, 182, 1, 0, 0, 0, 181, 178, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 187, 3, 24, 12, 0, 187, 188, 5, 24, 0, 0, 188, 191, 1, 0, 0, 0, 189, 191, 5, 25, 0, 0, 190, 177, 1, 0, 0, 0, 190, 189, 1, 0, 0, 0, 191, 23, 1, 0, 0, 0, 192, 193, 6, 12, -1, 0, 193, 194, 3, 28, 14, 0, 194, 222, 1, 0, 0, 0, 195, 196, 10, 6, 0, 0, 196, 197, 5, 32, 0, 0, 197, 198, 3, 24, 12, 0, 198, 199, 5, 10, 0, 0, 199, 200, 3, 24, 12, 7, 200, 221, 1, 0, 0, 0, 201, 202, 10, 2, 0, 0, 202, 203, 3, 26, 13, 0, 203, 204, 3, 24, 12, 3, 204, 221, 1, 0, 0, 0, 205, 206, 10, 7, 0, 0, 206, 207, 5, 4, 0, 0, 207, 208, 3, 24, 12, 0, 208, 209, 5, 5, 0, 0, 209, 221, 1, 0, 0, 0, 210, 211, 10, 5, 0, 0, 211, 212, 5, 8, 0, 0, 212, 221, 3, 52, 26, 0, 213, 214, 10, 4, 0, 0, 214, 215, 5, 10, 0, 0, 215, 221, 3, 52, 26, 0, 216, 217, 10, 3, 0, 0, 217, 218, 5, 10, 0, 0, 218, 219, 5, 10, 0, 0, 219, 221, 3, 52, 26, 0, 220, 195, 1, 0, 0, 0, 220, 201, 1, 0, 0, 0, 220, 205, 1, 0, 0, 0, 220, 210, 1, 0, 0, 0, 220, 213, 1, 0, 0, 0, 220, 216, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 25, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 225, 226, 7, 0, 0, 0, 226, 27, 1, 0, 0, 0, 227, 236, 3, 34, 17, 0, 228, 236, 3, 48, 24, 0, 229, 236, 3, 22, 11, 0, 230, 236, 5, 1, 0, 0, 231, 236, 3, 40, 20, 0, 232, 236, 3, 36, 18, 0, 233, 236, 3, 16, 8, 0, 234, 236, 3, 30, 15, 0, 235, 227, 1, 0, 0, 0, 235, 228, 1, 0, 0, 0, 235, 229, 1, 0, 0, 0, 235, 230, 1, 0, 0, 0, 235, 231, 1, 0, 0, 0, 235, 232, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 235, 234, 1, 0, 0, 0, 236, 29, 1, 0, 0, 0, 237, 239, 5, 6, 0, 0, 238, 240, 5, 41, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 3, 24, 12, 0, 242, 244, 5, 41, 0, 0, 243, 242, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, 5, 7, 0, 0, 246, 31, 1, 0, 0, 0, 247, 248, 3, 52, 26, 0, 248, 33, 1, 0, 0, 0, 249, 255, 5, 40, 0, 0, 250, 255, 5, 16, 0, 0, 251, 255, 5, 17, 0, 0, 252, 255, 5, 18, 0, 0, 253, 255, 3, 52, 26, 0, 254, 249, 1, 0, 0, 0, 254, 250, 1, 0, 0, 0, 254, 251, 1, 0, 0, 0, 254, 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, 0, 255, 35, 1, 0, 0, 0, 256, 273, 5, 12, 0, 0, 257, 259, 5, 41, 0, 0, 258, 257, 1, 0, 0, 0, 259, 260, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 270, 1, 0, 0, 0, 262, 264, 3, 38, 19, 0, 263, 265, 5, 41, 0, 0, 264, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 269, 1, 0, 0, 0, 268, 262, 1, 0, 0, 0, 269, 272, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 273, 258, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 276, 5, 13, 0, 0, 276, 37, 1, 0, 0, 0, 277, 280, 3, 52, 26, 0, 278, 280, 3, 22, 11, 0, 279, 277, 1, 0, 0, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 282, 5, 10, 0, 0, 282, 283, 3, 24, 12, 0, 283, 39, 1, 0, 0, 0, 284, 288, 5, 4, 0, 0, 285, 287, 5, 41, 0, 0, 286, 285, 1, 0, 0, 0, 287, 290, 1, 0, 0, 0, 288, 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 294, 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 291, 293, 3, 42, 21, 0, 292, 291, 1, 0, 0, 0, 293, 296, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 297, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 297, 298, 5, 5, 0, 0, 298, 41, 1, 0, 0, 0, 299, 306, 3, 24, 12, 0, 300, 302, 5, 41, 0, 0, 301, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 307, 1, 0, 0, 0, 305, 307, 5, 3, 0, 0, 306, 301, 1, 0, 0, 0, 306, 305, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 43, 1, 0, 0, 0, 308, 309, 5, 2, 0, 0, 309, 310, 3, 46, 23, 0, 310, 311, 5, 41, 0, 0, 311, 45, 1, 0, 0, 0, 312, 318, 3, 48, 24, 0, 313, 314, 3, 24, 12, 0, 314, 315, 5, 8, 0, 0, 315, 316, 3, 48, 24, 0, 316, 318, 1, 0, 0, 0, 317, 312, 1, 0, 0, 0, 317, 313, 1, 0, 0, 0, 318, 47, 1, 0, 0, 0, 319, 320, 3, 52, 26, 0, 320, 325, 5, 6, 0, 0, 321, 323, 5, 41, 0, 0, 322, 321, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 324, 1, 0, 0, 0, 324, 326, 3, 50, 25, 0, 325, 322, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 328, 1, 0, 0, 0, 327, 329, 5, 41, 0, 0, 328, 327, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 5, 7, 0, 0, 331, 49, 1, 0, 0, 0, 332, 340, 3, 24, 12, 0, 333, 335, 5, 3, 0, 0, 334, 336, 5, 41, 0, 0, 335, 334, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 339, 3, 24, 12, 0, 338, 333, 1, 0, 0, 0, 339, 342, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 51, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 343, 344, 7, 1, 0, 0, 344, 53, 1, 0, 0, 0, 38, 57, 67, 72, 79, 84, 86, 96, 108, 118, 125, 133, 147, 153, 162, 175, 183, 190, 220, 222, 235, 239, 243, 254, 260, 266, 270, 273, 279, 288, 294, 303, 306, 317, 322, 325, 328, 335, 340] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep.tokens b/pkg/parser/bicep/antlr/parser/bicep.tokens index 4e879f5c346..1acd1434f3b 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.tokens +++ b/pkg/parser/bicep/antlr/parser/bicep.tokens @@ -18,30 +18,31 @@ FALSE=17 NULL=18 OBJECT=19 RESOURCE=20 -STRING_LEFT_PIECE=21 -STRING_MIDDLE_PIECE=22 -STRING_RIGHT_PIECE=23 -STRING_COMPLETE=24 -STRING=25 -INT=26 -BOOL=27 -IF=28 -FOR=29 -IN=30 -QMARK=31 -GT=32 -GTE=33 -LT=34 -LTE=35 -EQ=36 -NEQ=37 -IDENTIFIER=38 -NUMBER=39 -NL=40 -SPACES=41 -UNKNOWN=42 -SINGLE_LINE_COMMENT=43 -MULTI_LINE_COMMENT=44 +OUTPUT=21 +STRING_LEFT_PIECE=22 +STRING_MIDDLE_PIECE=23 +STRING_RIGHT_PIECE=24 +STRING_COMPLETE=25 +STRING=26 +INT=27 +BOOL=28 +IF=29 +FOR=30 +IN=31 +QMARK=32 +GT=33 +GTE=34 +LT=35 +LTE=36 +EQ=37 +NEQ=38 +IDENTIFIER=39 +NUMBER=40 +NL=41 +SPACES=42 +UNKNOWN=43 +SINGLE_LINE_COMMENT=44 +MULTI_LINE_COMMENT=45 '@'=2 ','=3 '['=4 @@ -61,16 +62,17 @@ MULTI_LINE_COMMENT=44 'null'=18 'object'=19 'resource'=20 -'string'=25 -'int'=26 -'bool'=27 -'if'=28 -'for'=29 -'in'=30 -'?'=31 -'>'=32 -'>='=33 -'<'=34 -'<='=35 -'=='=36 -'!='=37 +'output'=21 +'string'=26 +'int'=27 +'bool'=28 +'if'=29 +'for'=30 +'in'=31 +'?'=32 +'>'=33 +'>='=34 +'<'=35 +'<='=36 +'=='=37 +'!='=38 diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.interp b/pkg/parser/bicep/antlr/parser/bicepLexer.interp index 4ef7d269b6c..5fc4858f06c 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.interp +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.interp @@ -20,6 +20,7 @@ null 'null' 'object' 'resource' +'output' null null null @@ -67,6 +68,7 @@ FALSE NULL OBJECT RESOURCE +OUTPUT STRING_LEFT_PIECE STRING_MIDDLE_PIECE STRING_RIGHT_PIECE @@ -113,6 +115,7 @@ FALSE NULL OBJECT RESOURCE +OUTPUT STRING_LEFT_PIECE STRING_MIDDLE_PIECE STRING_RIGHT_PIECE @@ -149,4 +152,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 44, 336, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 101, 8, 0, 10, 0, 12, 0, 104, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 178, 8, 20, 10, 20, 12, 20, 181, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 188, 8, 21, 10, 21, 12, 21, 191, 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 198, 8, 22, 10, 22, 12, 22, 201, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 207, 8, 23, 10, 23, 12, 23, 210, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 5, 37, 260, 8, 37, 10, 37, 12, 37, 263, 9, 37, 1, 38, 4, 38, 266, 8, 38, 11, 38, 12, 38, 267, 1, 38, 1, 38, 4, 38, 272, 8, 38, 11, 38, 12, 38, 273, 3, 38, 276, 8, 38, 1, 39, 4, 39, 279, 8, 39, 11, 39, 12, 39, 280, 1, 40, 4, 40, 284, 8, 40, 11, 40, 12, 40, 285, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 296, 8, 42, 10, 42, 12, 42, 299, 9, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 307, 8, 43, 10, 43, 12, 43, 310, 9, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 3, 44, 319, 8, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 4, 45, 327, 8, 45, 11, 45, 12, 45, 328, 1, 45, 1, 45, 3, 45, 333, 8, 45, 1, 46, 1, 46, 2, 102, 308, 0, 47, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 0, 91, 0, 93, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 348, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0, 3, 109, 1, 0, 0, 0, 5, 111, 1, 0, 0, 0, 7, 113, 1, 0, 0, 0, 9, 115, 1, 0, 0, 0, 11, 117, 1, 0, 0, 0, 13, 119, 1, 0, 0, 0, 15, 121, 1, 0, 0, 0, 17, 123, 1, 0, 0, 0, 19, 125, 1, 0, 0, 0, 21, 127, 1, 0, 0, 0, 23, 129, 1, 0, 0, 0, 25, 131, 1, 0, 0, 0, 27, 133, 1, 0, 0, 0, 29, 139, 1, 0, 0, 0, 31, 143, 1, 0, 0, 0, 33, 148, 1, 0, 0, 0, 35, 154, 1, 0, 0, 0, 37, 159, 1, 0, 0, 0, 39, 166, 1, 0, 0, 0, 41, 175, 1, 0, 0, 0, 43, 185, 1, 0, 0, 0, 45, 195, 1, 0, 0, 0, 47, 204, 1, 0, 0, 0, 49, 213, 1, 0, 0, 0, 51, 220, 1, 0, 0, 0, 53, 224, 1, 0, 0, 0, 55, 229, 1, 0, 0, 0, 57, 232, 1, 0, 0, 0, 59, 236, 1, 0, 0, 0, 61, 239, 1, 0, 0, 0, 63, 241, 1, 0, 0, 0, 65, 243, 1, 0, 0, 0, 67, 246, 1, 0, 0, 0, 69, 248, 1, 0, 0, 0, 71, 251, 1, 0, 0, 0, 73, 254, 1, 0, 0, 0, 75, 257, 1, 0, 0, 0, 77, 265, 1, 0, 0, 0, 79, 278, 1, 0, 0, 0, 81, 283, 1, 0, 0, 0, 83, 289, 1, 0, 0, 0, 85, 291, 1, 0, 0, 0, 87, 302, 1, 0, 0, 0, 89, 318, 1, 0, 0, 0, 91, 320, 1, 0, 0, 0, 93, 334, 1, 0, 0, 0, 95, 96, 5, 39, 0, 0, 96, 97, 5, 39, 0, 0, 97, 98, 5, 39, 0, 0, 98, 102, 1, 0, 0, 0, 99, 101, 9, 0, 0, 0, 100, 99, 1, 0, 0, 0, 101, 104, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 103, 105, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 105, 106, 5, 39, 0, 0, 106, 107, 5, 39, 0, 0, 107, 108, 5, 39, 0, 0, 108, 2, 1, 0, 0, 0, 109, 110, 5, 64, 0, 0, 110, 4, 1, 0, 0, 0, 111, 112, 5, 44, 0, 0, 112, 6, 1, 0, 0, 0, 113, 114, 5, 91, 0, 0, 114, 8, 1, 0, 0, 0, 115, 116, 5, 93, 0, 0, 116, 10, 1, 0, 0, 0, 117, 118, 5, 40, 0, 0, 118, 12, 1, 0, 0, 0, 119, 120, 5, 41, 0, 0, 120, 14, 1, 0, 0, 0, 121, 122, 5, 46, 0, 0, 122, 16, 1, 0, 0, 0, 123, 124, 5, 124, 0, 0, 124, 18, 1, 0, 0, 0, 125, 126, 5, 58, 0, 0, 126, 20, 1, 0, 0, 0, 127, 128, 5, 61, 0, 0, 128, 22, 1, 0, 0, 0, 129, 130, 5, 123, 0, 0, 130, 24, 1, 0, 0, 0, 131, 132, 5, 125, 0, 0, 132, 26, 1, 0, 0, 0, 133, 134, 5, 112, 0, 0, 134, 135, 5, 97, 0, 0, 135, 136, 5, 114, 0, 0, 136, 137, 5, 97, 0, 0, 137, 138, 5, 109, 0, 0, 138, 28, 1, 0, 0, 0, 139, 140, 5, 118, 0, 0, 140, 141, 5, 97, 0, 0, 141, 142, 5, 114, 0, 0, 142, 30, 1, 0, 0, 0, 143, 144, 5, 116, 0, 0, 144, 145, 5, 114, 0, 0, 145, 146, 5, 117, 0, 0, 146, 147, 5, 101, 0, 0, 147, 32, 1, 0, 0, 0, 148, 149, 5, 102, 0, 0, 149, 150, 5, 97, 0, 0, 150, 151, 5, 108, 0, 0, 151, 152, 5, 115, 0, 0, 152, 153, 5, 101, 0, 0, 153, 34, 1, 0, 0, 0, 154, 155, 5, 110, 0, 0, 155, 156, 5, 117, 0, 0, 156, 157, 5, 108, 0, 0, 157, 158, 5, 108, 0, 0, 158, 36, 1, 0, 0, 0, 159, 160, 5, 111, 0, 0, 160, 161, 5, 98, 0, 0, 161, 162, 5, 106, 0, 0, 162, 163, 5, 101, 0, 0, 163, 164, 5, 99, 0, 0, 164, 165, 5, 116, 0, 0, 165, 38, 1, 0, 0, 0, 166, 167, 5, 114, 0, 0, 167, 168, 5, 101, 0, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 111, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 114, 0, 0, 172, 173, 5, 99, 0, 0, 173, 174, 5, 101, 0, 0, 174, 40, 1, 0, 0, 0, 175, 179, 5, 39, 0, 0, 176, 178, 3, 89, 44, 0, 177, 176, 1, 0, 0, 0, 178, 181, 1, 0, 0, 0, 179, 177, 1, 0, 0, 0, 179, 180, 1, 0, 0, 0, 180, 182, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 182, 183, 5, 36, 0, 0, 183, 184, 5, 123, 0, 0, 184, 42, 1, 0, 0, 0, 185, 189, 5, 125, 0, 0, 186, 188, 3, 89, 44, 0, 187, 186, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 192, 193, 5, 36, 0, 0, 193, 194, 5, 123, 0, 0, 194, 44, 1, 0, 0, 0, 195, 199, 5, 125, 0, 0, 196, 198, 3, 89, 44, 0, 197, 196, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 202, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 5, 39, 0, 0, 203, 46, 1, 0, 0, 0, 204, 208, 5, 39, 0, 0, 205, 207, 3, 89, 44, 0, 206, 205, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 211, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 5, 39, 0, 0, 212, 48, 1, 0, 0, 0, 213, 214, 5, 115, 0, 0, 214, 215, 5, 116, 0, 0, 215, 216, 5, 114, 0, 0, 216, 217, 5, 105, 0, 0, 217, 218, 5, 110, 0, 0, 218, 219, 5, 103, 0, 0, 219, 50, 1, 0, 0, 0, 220, 221, 5, 105, 0, 0, 221, 222, 5, 110, 0, 0, 222, 223, 5, 116, 0, 0, 223, 52, 1, 0, 0, 0, 224, 225, 5, 98, 0, 0, 225, 226, 5, 111, 0, 0, 226, 227, 5, 111, 0, 0, 227, 228, 5, 108, 0, 0, 228, 54, 1, 0, 0, 0, 229, 230, 5, 105, 0, 0, 230, 231, 5, 102, 0, 0, 231, 56, 1, 0, 0, 0, 232, 233, 5, 102, 0, 0, 233, 234, 5, 111, 0, 0, 234, 235, 5, 114, 0, 0, 235, 58, 1, 0, 0, 0, 236, 237, 5, 105, 0, 0, 237, 238, 5, 110, 0, 0, 238, 60, 1, 0, 0, 0, 239, 240, 5, 63, 0, 0, 240, 62, 1, 0, 0, 0, 241, 242, 5, 62, 0, 0, 242, 64, 1, 0, 0, 0, 243, 244, 5, 62, 0, 0, 244, 245, 5, 61, 0, 0, 245, 66, 1, 0, 0, 0, 246, 247, 5, 60, 0, 0, 247, 68, 1, 0, 0, 0, 248, 249, 5, 60, 0, 0, 249, 250, 5, 61, 0, 0, 250, 70, 1, 0, 0, 0, 251, 252, 5, 61, 0, 0, 252, 253, 5, 61, 0, 0, 253, 72, 1, 0, 0, 0, 254, 255, 5, 33, 0, 0, 255, 256, 5, 61, 0, 0, 256, 74, 1, 0, 0, 0, 257, 261, 7, 0, 0, 0, 258, 260, 7, 1, 0, 0, 259, 258, 1, 0, 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 76, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 7, 2, 0, 0, 265, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 265, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 275, 1, 0, 0, 0, 269, 271, 5, 46, 0, 0, 270, 272, 7, 2, 0, 0, 271, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 276, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 78, 1, 0, 0, 0, 277, 279, 7, 3, 0, 0, 278, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 80, 1, 0, 0, 0, 282, 284, 7, 4, 0, 0, 283, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 288, 6, 40, 0, 0, 288, 82, 1, 0, 0, 0, 289, 290, 9, 0, 0, 0, 290, 84, 1, 0, 0, 0, 291, 292, 5, 47, 0, 0, 292, 293, 5, 47, 0, 0, 293, 297, 1, 0, 0, 0, 294, 296, 8, 3, 0, 0, 295, 294, 1, 0, 0, 0, 296, 299, 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 300, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 300, 301, 6, 42, 0, 0, 301, 86, 1, 0, 0, 0, 302, 303, 5, 47, 0, 0, 303, 304, 5, 42, 0, 0, 304, 308, 1, 0, 0, 0, 305, 307, 9, 0, 0, 0, 306, 305, 1, 0, 0, 0, 307, 310, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 311, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 311, 312, 5, 42, 0, 0, 312, 313, 5, 47, 0, 0, 313, 314, 1, 0, 0, 0, 314, 315, 6, 43, 0, 0, 315, 88, 1, 0, 0, 0, 316, 319, 8, 5, 0, 0, 317, 319, 3, 91, 45, 0, 318, 316, 1, 0, 0, 0, 318, 317, 1, 0, 0, 0, 319, 90, 1, 0, 0, 0, 320, 332, 5, 92, 0, 0, 321, 333, 7, 6, 0, 0, 322, 323, 5, 117, 0, 0, 323, 324, 5, 123, 0, 0, 324, 326, 1, 0, 0, 0, 325, 327, 3, 93, 46, 0, 326, 325, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 5, 125, 0, 0, 331, 333, 1, 0, 0, 0, 332, 321, 1, 0, 0, 0, 332, 322, 1, 0, 0, 0, 333, 92, 1, 0, 0, 0, 334, 335, 7, 7, 0, 0, 335, 94, 1, 0, 0, 0, 17, 0, 102, 179, 189, 199, 208, 261, 267, 273, 275, 280, 285, 297, 308, 318, 328, 332, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 45, 345, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 103, 8, 0, 10, 0, 12, 0, 106, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 187, 8, 21, 10, 21, 12, 21, 190, 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 197, 8, 22, 10, 22, 12, 22, 200, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 207, 8, 23, 10, 23, 12, 23, 210, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 216, 8, 24, 10, 24, 12, 24, 219, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 5, 38, 269, 8, 38, 10, 38, 12, 38, 272, 9, 38, 1, 39, 4, 39, 275, 8, 39, 11, 39, 12, 39, 276, 1, 39, 1, 39, 4, 39, 281, 8, 39, 11, 39, 12, 39, 282, 3, 39, 285, 8, 39, 1, 40, 4, 40, 288, 8, 40, 11, 40, 12, 40, 289, 1, 41, 4, 41, 293, 8, 41, 11, 41, 12, 41, 294, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 305, 8, 43, 10, 43, 12, 43, 308, 9, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 316, 8, 44, 10, 44, 12, 44, 319, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 3, 45, 328, 8, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 4, 46, 336, 8, 46, 11, 46, 12, 46, 337, 1, 46, 1, 46, 3, 46, 342, 8, 46, 1, 47, 1, 47, 2, 104, 317, 0, 48, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 0, 93, 0, 95, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 357, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 1, 97, 1, 0, 0, 0, 3, 111, 1, 0, 0, 0, 5, 113, 1, 0, 0, 0, 7, 115, 1, 0, 0, 0, 9, 117, 1, 0, 0, 0, 11, 119, 1, 0, 0, 0, 13, 121, 1, 0, 0, 0, 15, 123, 1, 0, 0, 0, 17, 125, 1, 0, 0, 0, 19, 127, 1, 0, 0, 0, 21, 129, 1, 0, 0, 0, 23, 131, 1, 0, 0, 0, 25, 133, 1, 0, 0, 0, 27, 135, 1, 0, 0, 0, 29, 141, 1, 0, 0, 0, 31, 145, 1, 0, 0, 0, 33, 150, 1, 0, 0, 0, 35, 156, 1, 0, 0, 0, 37, 161, 1, 0, 0, 0, 39, 168, 1, 0, 0, 0, 41, 177, 1, 0, 0, 0, 43, 184, 1, 0, 0, 0, 45, 194, 1, 0, 0, 0, 47, 204, 1, 0, 0, 0, 49, 213, 1, 0, 0, 0, 51, 222, 1, 0, 0, 0, 53, 229, 1, 0, 0, 0, 55, 233, 1, 0, 0, 0, 57, 238, 1, 0, 0, 0, 59, 241, 1, 0, 0, 0, 61, 245, 1, 0, 0, 0, 63, 248, 1, 0, 0, 0, 65, 250, 1, 0, 0, 0, 67, 252, 1, 0, 0, 0, 69, 255, 1, 0, 0, 0, 71, 257, 1, 0, 0, 0, 73, 260, 1, 0, 0, 0, 75, 263, 1, 0, 0, 0, 77, 266, 1, 0, 0, 0, 79, 274, 1, 0, 0, 0, 81, 287, 1, 0, 0, 0, 83, 292, 1, 0, 0, 0, 85, 298, 1, 0, 0, 0, 87, 300, 1, 0, 0, 0, 89, 311, 1, 0, 0, 0, 91, 327, 1, 0, 0, 0, 93, 329, 1, 0, 0, 0, 95, 343, 1, 0, 0, 0, 97, 98, 5, 39, 0, 0, 98, 99, 5, 39, 0, 0, 99, 100, 5, 39, 0, 0, 100, 104, 1, 0, 0, 0, 101, 103, 9, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 39, 0, 0, 108, 109, 5, 39, 0, 0, 109, 110, 5, 39, 0, 0, 110, 2, 1, 0, 0, 0, 111, 112, 5, 64, 0, 0, 112, 4, 1, 0, 0, 0, 113, 114, 5, 44, 0, 0, 114, 6, 1, 0, 0, 0, 115, 116, 5, 91, 0, 0, 116, 8, 1, 0, 0, 0, 117, 118, 5, 93, 0, 0, 118, 10, 1, 0, 0, 0, 119, 120, 5, 40, 0, 0, 120, 12, 1, 0, 0, 0, 121, 122, 5, 41, 0, 0, 122, 14, 1, 0, 0, 0, 123, 124, 5, 46, 0, 0, 124, 16, 1, 0, 0, 0, 125, 126, 5, 124, 0, 0, 126, 18, 1, 0, 0, 0, 127, 128, 5, 58, 0, 0, 128, 20, 1, 0, 0, 0, 129, 130, 5, 61, 0, 0, 130, 22, 1, 0, 0, 0, 131, 132, 5, 123, 0, 0, 132, 24, 1, 0, 0, 0, 133, 134, 5, 125, 0, 0, 134, 26, 1, 0, 0, 0, 135, 136, 5, 112, 0, 0, 136, 137, 5, 97, 0, 0, 137, 138, 5, 114, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 109, 0, 0, 140, 28, 1, 0, 0, 0, 141, 142, 5, 118, 0, 0, 142, 143, 5, 97, 0, 0, 143, 144, 5, 114, 0, 0, 144, 30, 1, 0, 0, 0, 145, 146, 5, 116, 0, 0, 146, 147, 5, 114, 0, 0, 147, 148, 5, 117, 0, 0, 148, 149, 5, 101, 0, 0, 149, 32, 1, 0, 0, 0, 150, 151, 5, 102, 0, 0, 151, 152, 5, 97, 0, 0, 152, 153, 5, 108, 0, 0, 153, 154, 5, 115, 0, 0, 154, 155, 5, 101, 0, 0, 155, 34, 1, 0, 0, 0, 156, 157, 5, 110, 0, 0, 157, 158, 5, 117, 0, 0, 158, 159, 5, 108, 0, 0, 159, 160, 5, 108, 0, 0, 160, 36, 1, 0, 0, 0, 161, 162, 5, 111, 0, 0, 162, 163, 5, 98, 0, 0, 163, 164, 5, 106, 0, 0, 164, 165, 5, 101, 0, 0, 165, 166, 5, 99, 0, 0, 166, 167, 5, 116, 0, 0, 167, 38, 1, 0, 0, 0, 168, 169, 5, 114, 0, 0, 169, 170, 5, 101, 0, 0, 170, 171, 5, 115, 0, 0, 171, 172, 5, 111, 0, 0, 172, 173, 5, 117, 0, 0, 173, 174, 5, 114, 0, 0, 174, 175, 5, 99, 0, 0, 175, 176, 5, 101, 0, 0, 176, 40, 1, 0, 0, 0, 177, 178, 5, 111, 0, 0, 178, 179, 5, 117, 0, 0, 179, 180, 5, 116, 0, 0, 180, 181, 5, 112, 0, 0, 181, 182, 5, 117, 0, 0, 182, 183, 5, 116, 0, 0, 183, 42, 1, 0, 0, 0, 184, 188, 5, 39, 0, 0, 185, 187, 3, 91, 45, 0, 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 191, 192, 5, 36, 0, 0, 192, 193, 5, 123, 0, 0, 193, 44, 1, 0, 0, 0, 194, 198, 5, 125, 0, 0, 195, 197, 3, 91, 45, 0, 196, 195, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 201, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 202, 5, 36, 0, 0, 202, 203, 5, 123, 0, 0, 203, 46, 1, 0, 0, 0, 204, 208, 5, 125, 0, 0, 205, 207, 3, 91, 45, 0, 206, 205, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 211, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 5, 39, 0, 0, 212, 48, 1, 0, 0, 0, 213, 217, 5, 39, 0, 0, 214, 216, 3, 91, 45, 0, 215, 214, 1, 0, 0, 0, 216, 219, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 220, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 220, 221, 5, 39, 0, 0, 221, 50, 1, 0, 0, 0, 222, 223, 5, 115, 0, 0, 223, 224, 5, 116, 0, 0, 224, 225, 5, 114, 0, 0, 225, 226, 5, 105, 0, 0, 226, 227, 5, 110, 0, 0, 227, 228, 5, 103, 0, 0, 228, 52, 1, 0, 0, 0, 229, 230, 5, 105, 0, 0, 230, 231, 5, 110, 0, 0, 231, 232, 5, 116, 0, 0, 232, 54, 1, 0, 0, 0, 233, 234, 5, 98, 0, 0, 234, 235, 5, 111, 0, 0, 235, 236, 5, 111, 0, 0, 236, 237, 5, 108, 0, 0, 237, 56, 1, 0, 0, 0, 238, 239, 5, 105, 0, 0, 239, 240, 5, 102, 0, 0, 240, 58, 1, 0, 0, 0, 241, 242, 5, 102, 0, 0, 242, 243, 5, 111, 0, 0, 243, 244, 5, 114, 0, 0, 244, 60, 1, 0, 0, 0, 245, 246, 5, 105, 0, 0, 246, 247, 5, 110, 0, 0, 247, 62, 1, 0, 0, 0, 248, 249, 5, 63, 0, 0, 249, 64, 1, 0, 0, 0, 250, 251, 5, 62, 0, 0, 251, 66, 1, 0, 0, 0, 252, 253, 5, 62, 0, 0, 253, 254, 5, 61, 0, 0, 254, 68, 1, 0, 0, 0, 255, 256, 5, 60, 0, 0, 256, 70, 1, 0, 0, 0, 257, 258, 5, 60, 0, 0, 258, 259, 5, 61, 0, 0, 259, 72, 1, 0, 0, 0, 260, 261, 5, 61, 0, 0, 261, 262, 5, 61, 0, 0, 262, 74, 1, 0, 0, 0, 263, 264, 5, 33, 0, 0, 264, 265, 5, 61, 0, 0, 265, 76, 1, 0, 0, 0, 266, 270, 7, 0, 0, 0, 267, 269, 7, 1, 0, 0, 268, 267, 1, 0, 0, 0, 269, 272, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 78, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 273, 275, 7, 2, 0, 0, 274, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 284, 1, 0, 0, 0, 278, 280, 5, 46, 0, 0, 279, 281, 7, 2, 0, 0, 280, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 278, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 80, 1, 0, 0, 0, 286, 288, 7, 3, 0, 0, 287, 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 82, 1, 0, 0, 0, 291, 293, 7, 4, 0, 0, 292, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 6, 41, 0, 0, 297, 84, 1, 0, 0, 0, 298, 299, 9, 0, 0, 0, 299, 86, 1, 0, 0, 0, 300, 301, 5, 47, 0, 0, 301, 302, 5, 47, 0, 0, 302, 306, 1, 0, 0, 0, 303, 305, 8, 3, 0, 0, 304, 303, 1, 0, 0, 0, 305, 308, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 310, 6, 43, 0, 0, 310, 88, 1, 0, 0, 0, 311, 312, 5, 47, 0, 0, 312, 313, 5, 42, 0, 0, 313, 317, 1, 0, 0, 0, 314, 316, 9, 0, 0, 0, 315, 314, 1, 0, 0, 0, 316, 319, 1, 0, 0, 0, 317, 318, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 320, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 320, 321, 5, 42, 0, 0, 321, 322, 5, 47, 0, 0, 322, 323, 1, 0, 0, 0, 323, 324, 6, 44, 0, 0, 324, 90, 1, 0, 0, 0, 325, 328, 8, 5, 0, 0, 326, 328, 3, 93, 46, 0, 327, 325, 1, 0, 0, 0, 327, 326, 1, 0, 0, 0, 328, 92, 1, 0, 0, 0, 329, 341, 5, 92, 0, 0, 330, 342, 7, 6, 0, 0, 331, 332, 5, 117, 0, 0, 332, 333, 5, 123, 0, 0, 333, 335, 1, 0, 0, 0, 334, 336, 3, 95, 47, 0, 335, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 340, 5, 125, 0, 0, 340, 342, 1, 0, 0, 0, 341, 330, 1, 0, 0, 0, 341, 331, 1, 0, 0, 0, 342, 94, 1, 0, 0, 0, 343, 344, 7, 7, 0, 0, 344, 96, 1, 0, 0, 0, 17, 0, 104, 188, 198, 208, 217, 270, 276, 282, 284, 289, 294, 306, 317, 327, 337, 341, 1, 6, 0, 0] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens index 4e879f5c346..1acd1434f3b 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens @@ -18,30 +18,31 @@ FALSE=17 NULL=18 OBJECT=19 RESOURCE=20 -STRING_LEFT_PIECE=21 -STRING_MIDDLE_PIECE=22 -STRING_RIGHT_PIECE=23 -STRING_COMPLETE=24 -STRING=25 -INT=26 -BOOL=27 -IF=28 -FOR=29 -IN=30 -QMARK=31 -GT=32 -GTE=33 -LT=34 -LTE=35 -EQ=36 -NEQ=37 -IDENTIFIER=38 -NUMBER=39 -NL=40 -SPACES=41 -UNKNOWN=42 -SINGLE_LINE_COMMENT=43 -MULTI_LINE_COMMENT=44 +OUTPUT=21 +STRING_LEFT_PIECE=22 +STRING_MIDDLE_PIECE=23 +STRING_RIGHT_PIECE=24 +STRING_COMPLETE=25 +STRING=26 +INT=27 +BOOL=28 +IF=29 +FOR=30 +IN=31 +QMARK=32 +GT=33 +GTE=34 +LT=35 +LTE=36 +EQ=37 +NEQ=38 +IDENTIFIER=39 +NUMBER=40 +NL=41 +SPACES=42 +UNKNOWN=43 +SINGLE_LINE_COMMENT=44 +MULTI_LINE_COMMENT=45 '@'=2 ','=3 '['=4 @@ -61,16 +62,17 @@ MULTI_LINE_COMMENT=44 'null'=18 'object'=19 'resource'=20 -'string'=25 -'int'=26 -'bool'=27 -'if'=28 -'for'=29 -'in'=30 -'?'=31 -'>'=32 -'>='=33 -'<'=34 -'<='=35 -'=='=36 -'!='=37 +'output'=21 +'string'=26 +'int'=27 +'bool'=28 +'if'=29 +'for'=30 +'in'=31 +'?'=32 +'>'=33 +'>='=34 +'<'=35 +'<='=36 +'=='=37 +'!='=38 diff --git a/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go index b344a2aaa6e..5dfa47bddcd 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go +++ b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go @@ -32,6 +32,10 @@ func (v *BasebicepVisitor) VisitResourceDecl(ctx *ResourceDeclContext) interface return v.VisitChildren(ctx) } +func (v *BasebicepVisitor) VisitOutputDecl(ctx *OutputDeclContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BasebicepVisitor) VisitIfCondition(ctx *IfConditionContext) interface{} { return v.VisitChildren(ctx) } diff --git a/pkg/parser/bicep/antlr/parser/bicep_lexer.go b/pkg/parser/bicep/antlr/parser/bicep_lexer.go index df013f6951f..ccb1cc6cb90 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_lexer.go +++ b/pkg/parser/bicep/antlr/parser/bicep_lexer.go @@ -45,14 +45,14 @@ func biceplexerLexerInit() { staticData.LiteralNames = []string{ "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", - "'object'", "'resource'", "", "", "", "", "'string'", "'int'", "'bool'", - "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", "'=='", - "'!='", + "'object'", "'resource'", "'output'", "", "", "", "", "'string'", "'int'", + "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", + "'=='", "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "SINGLE_LINE_COMMENT", @@ -61,7 +61,7 @@ func biceplexerLexerInit() { staticData.RuleNames = []string{ "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "SINGLE_LINE_COMMENT", @@ -69,7 +69,7 @@ func biceplexerLexerInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 44, 336, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 45, 345, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, @@ -78,147 +78,151 @@ func biceplexerLexerInit() { 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, - 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 101, 8, 0, 10, 0, 12, 0, 104, 9, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, - 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, - 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, - 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, - 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, - 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 178, 8, 20, 10, 20, 12, - 20, 181, 9, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 188, 8, 21, 10, - 21, 12, 21, 191, 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 198, - 8, 22, 10, 22, 12, 22, 201, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 207, - 8, 23, 10, 23, 12, 23, 210, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, - 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, - 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, - 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, - 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, - 37, 5, 37, 260, 8, 37, 10, 37, 12, 37, 263, 9, 37, 1, 38, 4, 38, 266, 8, - 38, 11, 38, 12, 38, 267, 1, 38, 1, 38, 4, 38, 272, 8, 38, 11, 38, 12, 38, - 273, 3, 38, 276, 8, 38, 1, 39, 4, 39, 279, 8, 39, 11, 39, 12, 39, 280, - 1, 40, 4, 40, 284, 8, 40, 11, 40, 12, 40, 285, 1, 40, 1, 40, 1, 41, 1, - 41, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 296, 8, 42, 10, 42, 12, 42, 299, - 9, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 307, 8, 43, 10, - 43, 12, 43, 310, 9, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, - 3, 44, 319, 8, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 4, 45, 327, - 8, 45, 11, 45, 12, 45, 328, 1, 45, 1, 45, 3, 45, 333, 8, 45, 1, 46, 1, - 46, 2, 102, 308, 0, 47, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, - 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, - 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, - 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, - 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, - 89, 0, 91, 0, 93, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, - 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, - 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, - 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, - 102, 348, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, - 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, - 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, - 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, - 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, - 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, - 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, - 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, - 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, - 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, - 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, - 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0, 3, 109, 1, - 0, 0, 0, 5, 111, 1, 0, 0, 0, 7, 113, 1, 0, 0, 0, 9, 115, 1, 0, 0, 0, 11, - 117, 1, 0, 0, 0, 13, 119, 1, 0, 0, 0, 15, 121, 1, 0, 0, 0, 17, 123, 1, - 0, 0, 0, 19, 125, 1, 0, 0, 0, 21, 127, 1, 0, 0, 0, 23, 129, 1, 0, 0, 0, - 25, 131, 1, 0, 0, 0, 27, 133, 1, 0, 0, 0, 29, 139, 1, 0, 0, 0, 31, 143, - 1, 0, 0, 0, 33, 148, 1, 0, 0, 0, 35, 154, 1, 0, 0, 0, 37, 159, 1, 0, 0, - 0, 39, 166, 1, 0, 0, 0, 41, 175, 1, 0, 0, 0, 43, 185, 1, 0, 0, 0, 45, 195, - 1, 0, 0, 0, 47, 204, 1, 0, 0, 0, 49, 213, 1, 0, 0, 0, 51, 220, 1, 0, 0, - 0, 53, 224, 1, 0, 0, 0, 55, 229, 1, 0, 0, 0, 57, 232, 1, 0, 0, 0, 59, 236, - 1, 0, 0, 0, 61, 239, 1, 0, 0, 0, 63, 241, 1, 0, 0, 0, 65, 243, 1, 0, 0, - 0, 67, 246, 1, 0, 0, 0, 69, 248, 1, 0, 0, 0, 71, 251, 1, 0, 0, 0, 73, 254, - 1, 0, 0, 0, 75, 257, 1, 0, 0, 0, 77, 265, 1, 0, 0, 0, 79, 278, 1, 0, 0, - 0, 81, 283, 1, 0, 0, 0, 83, 289, 1, 0, 0, 0, 85, 291, 1, 0, 0, 0, 87, 302, - 1, 0, 0, 0, 89, 318, 1, 0, 0, 0, 91, 320, 1, 0, 0, 0, 93, 334, 1, 0, 0, - 0, 95, 96, 5, 39, 0, 0, 96, 97, 5, 39, 0, 0, 97, 98, 5, 39, 0, 0, 98, 102, - 1, 0, 0, 0, 99, 101, 9, 0, 0, 0, 100, 99, 1, 0, 0, 0, 101, 104, 1, 0, 0, - 0, 102, 103, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 103, 105, 1, 0, 0, 0, 104, - 102, 1, 0, 0, 0, 105, 106, 5, 39, 0, 0, 106, 107, 5, 39, 0, 0, 107, 108, - 5, 39, 0, 0, 108, 2, 1, 0, 0, 0, 109, 110, 5, 64, 0, 0, 110, 4, 1, 0, 0, - 0, 111, 112, 5, 44, 0, 0, 112, 6, 1, 0, 0, 0, 113, 114, 5, 91, 0, 0, 114, - 8, 1, 0, 0, 0, 115, 116, 5, 93, 0, 0, 116, 10, 1, 0, 0, 0, 117, 118, 5, - 40, 0, 0, 118, 12, 1, 0, 0, 0, 119, 120, 5, 41, 0, 0, 120, 14, 1, 0, 0, - 0, 121, 122, 5, 46, 0, 0, 122, 16, 1, 0, 0, 0, 123, 124, 5, 124, 0, 0, - 124, 18, 1, 0, 0, 0, 125, 126, 5, 58, 0, 0, 126, 20, 1, 0, 0, 0, 127, 128, - 5, 61, 0, 0, 128, 22, 1, 0, 0, 0, 129, 130, 5, 123, 0, 0, 130, 24, 1, 0, - 0, 0, 131, 132, 5, 125, 0, 0, 132, 26, 1, 0, 0, 0, 133, 134, 5, 112, 0, - 0, 134, 135, 5, 97, 0, 0, 135, 136, 5, 114, 0, 0, 136, 137, 5, 97, 0, 0, - 137, 138, 5, 109, 0, 0, 138, 28, 1, 0, 0, 0, 139, 140, 5, 118, 0, 0, 140, - 141, 5, 97, 0, 0, 141, 142, 5, 114, 0, 0, 142, 30, 1, 0, 0, 0, 143, 144, - 5, 116, 0, 0, 144, 145, 5, 114, 0, 0, 145, 146, 5, 117, 0, 0, 146, 147, - 5, 101, 0, 0, 147, 32, 1, 0, 0, 0, 148, 149, 5, 102, 0, 0, 149, 150, 5, - 97, 0, 0, 150, 151, 5, 108, 0, 0, 151, 152, 5, 115, 0, 0, 152, 153, 5, - 101, 0, 0, 153, 34, 1, 0, 0, 0, 154, 155, 5, 110, 0, 0, 155, 156, 5, 117, - 0, 0, 156, 157, 5, 108, 0, 0, 157, 158, 5, 108, 0, 0, 158, 36, 1, 0, 0, - 0, 159, 160, 5, 111, 0, 0, 160, 161, 5, 98, 0, 0, 161, 162, 5, 106, 0, - 0, 162, 163, 5, 101, 0, 0, 163, 164, 5, 99, 0, 0, 164, 165, 5, 116, 0, - 0, 165, 38, 1, 0, 0, 0, 166, 167, 5, 114, 0, 0, 167, 168, 5, 101, 0, 0, - 168, 169, 5, 115, 0, 0, 169, 170, 5, 111, 0, 0, 170, 171, 5, 117, 0, 0, - 171, 172, 5, 114, 0, 0, 172, 173, 5, 99, 0, 0, 173, 174, 5, 101, 0, 0, - 174, 40, 1, 0, 0, 0, 175, 179, 5, 39, 0, 0, 176, 178, 3, 89, 44, 0, 177, - 176, 1, 0, 0, 0, 178, 181, 1, 0, 0, 0, 179, 177, 1, 0, 0, 0, 179, 180, - 1, 0, 0, 0, 180, 182, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 182, 183, 5, 36, - 0, 0, 183, 184, 5, 123, 0, 0, 184, 42, 1, 0, 0, 0, 185, 189, 5, 125, 0, - 0, 186, 188, 3, 89, 44, 0, 187, 186, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, - 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, 0, 0, 191, - 189, 1, 0, 0, 0, 192, 193, 5, 36, 0, 0, 193, 194, 5, 123, 0, 0, 194, 44, - 1, 0, 0, 0, 195, 199, 5, 125, 0, 0, 196, 198, 3, 89, 44, 0, 197, 196, 1, - 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, - 0, 200, 202, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 5, 39, 0, 0, 203, - 46, 1, 0, 0, 0, 204, 208, 5, 39, 0, 0, 205, 207, 3, 89, 44, 0, 206, 205, + 2, 47, 7, 47, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 103, 8, 0, 10, 0, 12, + 0, 106, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, + 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, + 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, + 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, + 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, + 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, + 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, + 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 187, 8, 21, 10, 21, 12, 21, 190, + 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 197, 8, 22, 10, 22, 12, + 22, 200, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 207, 8, 23, 10, + 23, 12, 23, 210, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 216, 8, 24, + 10, 24, 12, 24, 219, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, + 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, + 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, + 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, + 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 5, + 38, 269, 8, 38, 10, 38, 12, 38, 272, 9, 38, 1, 39, 4, 39, 275, 8, 39, 11, + 39, 12, 39, 276, 1, 39, 1, 39, 4, 39, 281, 8, 39, 11, 39, 12, 39, 282, + 3, 39, 285, 8, 39, 1, 40, 4, 40, 288, 8, 40, 11, 40, 12, 40, 289, 1, 41, + 4, 41, 293, 8, 41, 11, 41, 12, 41, 294, 1, 41, 1, 41, 1, 42, 1, 42, 1, + 43, 1, 43, 1, 43, 1, 43, 5, 43, 305, 8, 43, 10, 43, 12, 43, 308, 9, 43, + 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 316, 8, 44, 10, 44, 12, + 44, 319, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 3, 45, + 328, 8, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 4, 46, 336, 8, 46, + 11, 46, 12, 46, 337, 1, 46, 1, 46, 3, 46, 342, 8, 46, 1, 47, 1, 47, 2, + 104, 317, 0, 48, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, + 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, + 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, + 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, + 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, + 45, 91, 0, 93, 0, 95, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, + 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, + 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, + 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, + 97, 102, 357, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, + 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, + 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, + 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, + 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, + 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, + 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, + 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, + 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, + 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, + 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, + 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 1, 97, + 1, 0, 0, 0, 3, 111, 1, 0, 0, 0, 5, 113, 1, 0, 0, 0, 7, 115, 1, 0, 0, 0, + 9, 117, 1, 0, 0, 0, 11, 119, 1, 0, 0, 0, 13, 121, 1, 0, 0, 0, 15, 123, + 1, 0, 0, 0, 17, 125, 1, 0, 0, 0, 19, 127, 1, 0, 0, 0, 21, 129, 1, 0, 0, + 0, 23, 131, 1, 0, 0, 0, 25, 133, 1, 0, 0, 0, 27, 135, 1, 0, 0, 0, 29, 141, + 1, 0, 0, 0, 31, 145, 1, 0, 0, 0, 33, 150, 1, 0, 0, 0, 35, 156, 1, 0, 0, + 0, 37, 161, 1, 0, 0, 0, 39, 168, 1, 0, 0, 0, 41, 177, 1, 0, 0, 0, 43, 184, + 1, 0, 0, 0, 45, 194, 1, 0, 0, 0, 47, 204, 1, 0, 0, 0, 49, 213, 1, 0, 0, + 0, 51, 222, 1, 0, 0, 0, 53, 229, 1, 0, 0, 0, 55, 233, 1, 0, 0, 0, 57, 238, + 1, 0, 0, 0, 59, 241, 1, 0, 0, 0, 61, 245, 1, 0, 0, 0, 63, 248, 1, 0, 0, + 0, 65, 250, 1, 0, 0, 0, 67, 252, 1, 0, 0, 0, 69, 255, 1, 0, 0, 0, 71, 257, + 1, 0, 0, 0, 73, 260, 1, 0, 0, 0, 75, 263, 1, 0, 0, 0, 77, 266, 1, 0, 0, + 0, 79, 274, 1, 0, 0, 0, 81, 287, 1, 0, 0, 0, 83, 292, 1, 0, 0, 0, 85, 298, + 1, 0, 0, 0, 87, 300, 1, 0, 0, 0, 89, 311, 1, 0, 0, 0, 91, 327, 1, 0, 0, + 0, 93, 329, 1, 0, 0, 0, 95, 343, 1, 0, 0, 0, 97, 98, 5, 39, 0, 0, 98, 99, + 5, 39, 0, 0, 99, 100, 5, 39, 0, 0, 100, 104, 1, 0, 0, 0, 101, 103, 9, 0, + 0, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, + 104, 102, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, + 108, 5, 39, 0, 0, 108, 109, 5, 39, 0, 0, 109, 110, 5, 39, 0, 0, 110, 2, + 1, 0, 0, 0, 111, 112, 5, 64, 0, 0, 112, 4, 1, 0, 0, 0, 113, 114, 5, 44, + 0, 0, 114, 6, 1, 0, 0, 0, 115, 116, 5, 91, 0, 0, 116, 8, 1, 0, 0, 0, 117, + 118, 5, 93, 0, 0, 118, 10, 1, 0, 0, 0, 119, 120, 5, 40, 0, 0, 120, 12, + 1, 0, 0, 0, 121, 122, 5, 41, 0, 0, 122, 14, 1, 0, 0, 0, 123, 124, 5, 46, + 0, 0, 124, 16, 1, 0, 0, 0, 125, 126, 5, 124, 0, 0, 126, 18, 1, 0, 0, 0, + 127, 128, 5, 58, 0, 0, 128, 20, 1, 0, 0, 0, 129, 130, 5, 61, 0, 0, 130, + 22, 1, 0, 0, 0, 131, 132, 5, 123, 0, 0, 132, 24, 1, 0, 0, 0, 133, 134, + 5, 125, 0, 0, 134, 26, 1, 0, 0, 0, 135, 136, 5, 112, 0, 0, 136, 137, 5, + 97, 0, 0, 137, 138, 5, 114, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 109, + 0, 0, 140, 28, 1, 0, 0, 0, 141, 142, 5, 118, 0, 0, 142, 143, 5, 97, 0, + 0, 143, 144, 5, 114, 0, 0, 144, 30, 1, 0, 0, 0, 145, 146, 5, 116, 0, 0, + 146, 147, 5, 114, 0, 0, 147, 148, 5, 117, 0, 0, 148, 149, 5, 101, 0, 0, + 149, 32, 1, 0, 0, 0, 150, 151, 5, 102, 0, 0, 151, 152, 5, 97, 0, 0, 152, + 153, 5, 108, 0, 0, 153, 154, 5, 115, 0, 0, 154, 155, 5, 101, 0, 0, 155, + 34, 1, 0, 0, 0, 156, 157, 5, 110, 0, 0, 157, 158, 5, 117, 0, 0, 158, 159, + 5, 108, 0, 0, 159, 160, 5, 108, 0, 0, 160, 36, 1, 0, 0, 0, 161, 162, 5, + 111, 0, 0, 162, 163, 5, 98, 0, 0, 163, 164, 5, 106, 0, 0, 164, 165, 5, + 101, 0, 0, 165, 166, 5, 99, 0, 0, 166, 167, 5, 116, 0, 0, 167, 38, 1, 0, + 0, 0, 168, 169, 5, 114, 0, 0, 169, 170, 5, 101, 0, 0, 170, 171, 5, 115, + 0, 0, 171, 172, 5, 111, 0, 0, 172, 173, 5, 117, 0, 0, 173, 174, 5, 114, + 0, 0, 174, 175, 5, 99, 0, 0, 175, 176, 5, 101, 0, 0, 176, 40, 1, 0, 0, + 0, 177, 178, 5, 111, 0, 0, 178, 179, 5, 117, 0, 0, 179, 180, 5, 116, 0, + 0, 180, 181, 5, 112, 0, 0, 181, 182, 5, 117, 0, 0, 182, 183, 5, 116, 0, + 0, 183, 42, 1, 0, 0, 0, 184, 188, 5, 39, 0, 0, 185, 187, 3, 91, 45, 0, + 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, + 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 191, 192, + 5, 36, 0, 0, 192, 193, 5, 123, 0, 0, 193, 44, 1, 0, 0, 0, 194, 198, 5, + 125, 0, 0, 195, 197, 3, 91, 45, 0, 196, 195, 1, 0, 0, 0, 197, 200, 1, 0, + 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 201, 1, 0, 0, 0, + 200, 198, 1, 0, 0, 0, 201, 202, 5, 36, 0, 0, 202, 203, 5, 123, 0, 0, 203, + 46, 1, 0, 0, 0, 204, 208, 5, 125, 0, 0, 205, 207, 3, 91, 45, 0, 206, 205, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 211, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 5, 39, 0, 0, - 212, 48, 1, 0, 0, 0, 213, 214, 5, 115, 0, 0, 214, 215, 5, 116, 0, 0, 215, - 216, 5, 114, 0, 0, 216, 217, 5, 105, 0, 0, 217, 218, 5, 110, 0, 0, 218, - 219, 5, 103, 0, 0, 219, 50, 1, 0, 0, 0, 220, 221, 5, 105, 0, 0, 221, 222, - 5, 110, 0, 0, 222, 223, 5, 116, 0, 0, 223, 52, 1, 0, 0, 0, 224, 225, 5, - 98, 0, 0, 225, 226, 5, 111, 0, 0, 226, 227, 5, 111, 0, 0, 227, 228, 5, - 108, 0, 0, 228, 54, 1, 0, 0, 0, 229, 230, 5, 105, 0, 0, 230, 231, 5, 102, - 0, 0, 231, 56, 1, 0, 0, 0, 232, 233, 5, 102, 0, 0, 233, 234, 5, 111, 0, - 0, 234, 235, 5, 114, 0, 0, 235, 58, 1, 0, 0, 0, 236, 237, 5, 105, 0, 0, - 237, 238, 5, 110, 0, 0, 238, 60, 1, 0, 0, 0, 239, 240, 5, 63, 0, 0, 240, - 62, 1, 0, 0, 0, 241, 242, 5, 62, 0, 0, 242, 64, 1, 0, 0, 0, 243, 244, 5, - 62, 0, 0, 244, 245, 5, 61, 0, 0, 245, 66, 1, 0, 0, 0, 246, 247, 5, 60, - 0, 0, 247, 68, 1, 0, 0, 0, 248, 249, 5, 60, 0, 0, 249, 250, 5, 61, 0, 0, - 250, 70, 1, 0, 0, 0, 251, 252, 5, 61, 0, 0, 252, 253, 5, 61, 0, 0, 253, - 72, 1, 0, 0, 0, 254, 255, 5, 33, 0, 0, 255, 256, 5, 61, 0, 0, 256, 74, - 1, 0, 0, 0, 257, 261, 7, 0, 0, 0, 258, 260, 7, 1, 0, 0, 259, 258, 1, 0, - 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, - 262, 76, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 7, 2, 0, 0, 265, 264, - 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 265, 1, 0, 0, 0, 267, 268, 1, 0, - 0, 0, 268, 275, 1, 0, 0, 0, 269, 271, 5, 46, 0, 0, 270, 272, 7, 2, 0, 0, - 271, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 273, - 274, 1, 0, 0, 0, 274, 276, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, 276, - 1, 0, 0, 0, 276, 78, 1, 0, 0, 0, 277, 279, 7, 3, 0, 0, 278, 277, 1, 0, - 0, 0, 279, 280, 1, 0, 0, 0, 280, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, - 281, 80, 1, 0, 0, 0, 282, 284, 7, 4, 0, 0, 283, 282, 1, 0, 0, 0, 284, 285, - 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 287, 1, 0, - 0, 0, 287, 288, 6, 40, 0, 0, 288, 82, 1, 0, 0, 0, 289, 290, 9, 0, 0, 0, - 290, 84, 1, 0, 0, 0, 291, 292, 5, 47, 0, 0, 292, 293, 5, 47, 0, 0, 293, - 297, 1, 0, 0, 0, 294, 296, 8, 3, 0, 0, 295, 294, 1, 0, 0, 0, 296, 299, - 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 300, 1, 0, - 0, 0, 299, 297, 1, 0, 0, 0, 300, 301, 6, 42, 0, 0, 301, 86, 1, 0, 0, 0, - 302, 303, 5, 47, 0, 0, 303, 304, 5, 42, 0, 0, 304, 308, 1, 0, 0, 0, 305, - 307, 9, 0, 0, 0, 306, 305, 1, 0, 0, 0, 307, 310, 1, 0, 0, 0, 308, 309, - 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 311, 1, 0, 0, 0, 310, 308, 1, 0, - 0, 0, 311, 312, 5, 42, 0, 0, 312, 313, 5, 47, 0, 0, 313, 314, 1, 0, 0, - 0, 314, 315, 6, 43, 0, 0, 315, 88, 1, 0, 0, 0, 316, 319, 8, 5, 0, 0, 317, - 319, 3, 91, 45, 0, 318, 316, 1, 0, 0, 0, 318, 317, 1, 0, 0, 0, 319, 90, - 1, 0, 0, 0, 320, 332, 5, 92, 0, 0, 321, 333, 7, 6, 0, 0, 322, 323, 5, 117, - 0, 0, 323, 324, 5, 123, 0, 0, 324, 326, 1, 0, 0, 0, 325, 327, 3, 93, 46, - 0, 326, 325, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 328, - 329, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 5, 125, 0, 0, 331, 333, - 1, 0, 0, 0, 332, 321, 1, 0, 0, 0, 332, 322, 1, 0, 0, 0, 333, 92, 1, 0, - 0, 0, 334, 335, 7, 7, 0, 0, 335, 94, 1, 0, 0, 0, 17, 0, 102, 179, 189, - 199, 208, 261, 267, 273, 275, 280, 285, 297, 308, 318, 328, 332, 1, 6, - 0, 0, + 212, 48, 1, 0, 0, 0, 213, 217, 5, 39, 0, 0, 214, 216, 3, 91, 45, 0, 215, + 214, 1, 0, 0, 0, 216, 219, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 217, 218, + 1, 0, 0, 0, 218, 220, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 220, 221, 5, 39, + 0, 0, 221, 50, 1, 0, 0, 0, 222, 223, 5, 115, 0, 0, 223, 224, 5, 116, 0, + 0, 224, 225, 5, 114, 0, 0, 225, 226, 5, 105, 0, 0, 226, 227, 5, 110, 0, + 0, 227, 228, 5, 103, 0, 0, 228, 52, 1, 0, 0, 0, 229, 230, 5, 105, 0, 0, + 230, 231, 5, 110, 0, 0, 231, 232, 5, 116, 0, 0, 232, 54, 1, 0, 0, 0, 233, + 234, 5, 98, 0, 0, 234, 235, 5, 111, 0, 0, 235, 236, 5, 111, 0, 0, 236, + 237, 5, 108, 0, 0, 237, 56, 1, 0, 0, 0, 238, 239, 5, 105, 0, 0, 239, 240, + 5, 102, 0, 0, 240, 58, 1, 0, 0, 0, 241, 242, 5, 102, 0, 0, 242, 243, 5, + 111, 0, 0, 243, 244, 5, 114, 0, 0, 244, 60, 1, 0, 0, 0, 245, 246, 5, 105, + 0, 0, 246, 247, 5, 110, 0, 0, 247, 62, 1, 0, 0, 0, 248, 249, 5, 63, 0, + 0, 249, 64, 1, 0, 0, 0, 250, 251, 5, 62, 0, 0, 251, 66, 1, 0, 0, 0, 252, + 253, 5, 62, 0, 0, 253, 254, 5, 61, 0, 0, 254, 68, 1, 0, 0, 0, 255, 256, + 5, 60, 0, 0, 256, 70, 1, 0, 0, 0, 257, 258, 5, 60, 0, 0, 258, 259, 5, 61, + 0, 0, 259, 72, 1, 0, 0, 0, 260, 261, 5, 61, 0, 0, 261, 262, 5, 61, 0, 0, + 262, 74, 1, 0, 0, 0, 263, 264, 5, 33, 0, 0, 264, 265, 5, 61, 0, 0, 265, + 76, 1, 0, 0, 0, 266, 270, 7, 0, 0, 0, 267, 269, 7, 1, 0, 0, 268, 267, 1, + 0, 0, 0, 269, 272, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, + 0, 271, 78, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 273, 275, 7, 2, 0, 0, 274, + 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, + 1, 0, 0, 0, 277, 284, 1, 0, 0, 0, 278, 280, 5, 46, 0, 0, 279, 281, 7, 2, + 0, 0, 280, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, + 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 278, 1, 0, 0, 0, 284, + 285, 1, 0, 0, 0, 285, 80, 1, 0, 0, 0, 286, 288, 7, 3, 0, 0, 287, 286, 1, + 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, + 0, 290, 82, 1, 0, 0, 0, 291, 293, 7, 4, 0, 0, 292, 291, 1, 0, 0, 0, 293, + 294, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, + 1, 0, 0, 0, 296, 297, 6, 41, 0, 0, 297, 84, 1, 0, 0, 0, 298, 299, 9, 0, + 0, 0, 299, 86, 1, 0, 0, 0, 300, 301, 5, 47, 0, 0, 301, 302, 5, 47, 0, 0, + 302, 306, 1, 0, 0, 0, 303, 305, 8, 3, 0, 0, 304, 303, 1, 0, 0, 0, 305, + 308, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, + 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 310, 6, 43, 0, 0, 310, 88, 1, 0, + 0, 0, 311, 312, 5, 47, 0, 0, 312, 313, 5, 42, 0, 0, 313, 317, 1, 0, 0, + 0, 314, 316, 9, 0, 0, 0, 315, 314, 1, 0, 0, 0, 316, 319, 1, 0, 0, 0, 317, + 318, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 320, 1, 0, 0, 0, 319, 317, + 1, 0, 0, 0, 320, 321, 5, 42, 0, 0, 321, 322, 5, 47, 0, 0, 322, 323, 1, + 0, 0, 0, 323, 324, 6, 44, 0, 0, 324, 90, 1, 0, 0, 0, 325, 328, 8, 5, 0, + 0, 326, 328, 3, 93, 46, 0, 327, 325, 1, 0, 0, 0, 327, 326, 1, 0, 0, 0, + 328, 92, 1, 0, 0, 0, 329, 341, 5, 92, 0, 0, 330, 342, 7, 6, 0, 0, 331, + 332, 5, 117, 0, 0, 332, 333, 5, 123, 0, 0, 333, 335, 1, 0, 0, 0, 334, 336, + 3, 95, 47, 0, 335, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 335, 1, + 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 340, 5, 125, + 0, 0, 340, 342, 1, 0, 0, 0, 341, 330, 1, 0, 0, 0, 341, 331, 1, 0, 0, 0, + 342, 94, 1, 0, 0, 0, 343, 344, 7, 7, 0, 0, 344, 96, 1, 0, 0, 0, 17, 0, + 104, 188, 198, 208, 217, 270, 276, 282, 284, 289, 294, 306, 317, 327, 337, + 341, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -279,28 +283,29 @@ const ( bicepLexerNULL = 18 bicepLexerOBJECT = 19 bicepLexerRESOURCE = 20 - bicepLexerSTRING_LEFT_PIECE = 21 - bicepLexerSTRING_MIDDLE_PIECE = 22 - bicepLexerSTRING_RIGHT_PIECE = 23 - bicepLexerSTRING_COMPLETE = 24 - bicepLexerSTRING = 25 - bicepLexerINT = 26 - bicepLexerBOOL = 27 - bicepLexerIF = 28 - bicepLexerFOR = 29 - bicepLexerIN = 30 - bicepLexerQMARK = 31 - bicepLexerGT = 32 - bicepLexerGTE = 33 - bicepLexerLT = 34 - bicepLexerLTE = 35 - bicepLexerEQ = 36 - bicepLexerNEQ = 37 - bicepLexerIDENTIFIER = 38 - bicepLexerNUMBER = 39 - bicepLexerNL = 40 - bicepLexerSPACES = 41 - bicepLexerUNKNOWN = 42 - bicepLexerSINGLE_LINE_COMMENT = 43 - bicepLexerMULTI_LINE_COMMENT = 44 + bicepLexerOUTPUT = 21 + bicepLexerSTRING_LEFT_PIECE = 22 + bicepLexerSTRING_MIDDLE_PIECE = 23 + bicepLexerSTRING_RIGHT_PIECE = 24 + bicepLexerSTRING_COMPLETE = 25 + bicepLexerSTRING = 26 + bicepLexerINT = 27 + bicepLexerBOOL = 28 + bicepLexerIF = 29 + bicepLexerFOR = 30 + bicepLexerIN = 31 + bicepLexerQMARK = 32 + bicepLexerGT = 33 + bicepLexerGTE = 34 + bicepLexerLT = 35 + bicepLexerLTE = 36 + bicepLexerEQ = 37 + bicepLexerNEQ = 38 + bicepLexerIDENTIFIER = 39 + bicepLexerNUMBER = 40 + bicepLexerNL = 41 + bicepLexerSPACES = 42 + bicepLexerUNKNOWN = 43 + bicepLexerSINGLE_LINE_COMMENT = 44 + bicepLexerMULTI_LINE_COMMENT = 45 ) diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 2178e3247a4..8bef24a4ea8 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -35,14 +35,14 @@ func bicepParserInit() { staticData.LiteralNames = []string{ "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", - "'object'", "'resource'", "", "", "", "", "'string'", "'int'", "'bool'", - "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", "'=='", - "'!='", + "'object'", "'resource'", "'output'", "", "", "", "", "'string'", "'int'", + "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", + "'=='", "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "STRING_LEFT_PIECE", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "SINGLE_LINE_COMMENT", @@ -50,7 +50,7 @@ func bicepParserInit() { } staticData.RuleNames = []string{ "program", "statement", "parameterDecl", "parameterDefaultValue", "variableDecl", - "resourceDecl", "ifCondition", "forExpression", "forVariableBlock", + "resourceDecl", "outputDecl", "ifCondition", "forExpression", "forVariableBlock", "forBody", "interpString", "expression", "logicCharacter", "primaryExpression", "parenthesizedExpression", "typeExpression", "literalValue", "object", "objectProperty", "array", "arrayItem", "decorator", "decoratorExpression", @@ -58,152 +58,161 @@ func bicepParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 44, 326, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 45, 346, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, - 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 1, 0, - 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 65, 8, 1, 1, 2, 5, 2, 68, 8, 2, 10, 2, 12, 2, 71, 9, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 3, 2, 77, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 82, 8, 2, 3, - 2, 84, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 92, 8, 4, 10, 4, - 12, 4, 95, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 104, 8, - 5, 10, 5, 12, 5, 107, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, - 5, 116, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 5, 7, 126, - 8, 7, 10, 7, 12, 7, 129, 9, 7, 1, 7, 1, 7, 1, 7, 3, 7, 134, 8, 7, 1, 7, - 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 141, 8, 7, 10, 7, 12, 7, 144, 9, 7, 1, 7, - 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 156, 8, 9, - 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 162, 8, 10, 10, 10, 12, 10, 165, 9, - 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 171, 8, 10, 1, 11, 1, 11, 1, 11, - 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, - 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, - 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 201, 8, 11, 10, 11, 12, 11, 204, 9, - 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, - 3, 13, 216, 8, 13, 1, 14, 1, 14, 3, 14, 220, 8, 14, 1, 14, 1, 14, 3, 14, - 224, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, - 16, 3, 16, 235, 8, 16, 1, 17, 1, 17, 4, 17, 239, 8, 17, 11, 17, 12, 17, - 240, 1, 17, 1, 17, 4, 17, 245, 8, 17, 11, 17, 12, 17, 246, 5, 17, 249, - 8, 17, 10, 17, 12, 17, 252, 9, 17, 3, 17, 254, 8, 17, 1, 17, 1, 17, 1, - 18, 1, 18, 3, 18, 260, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, - 267, 8, 19, 10, 19, 12, 19, 270, 9, 19, 1, 19, 5, 19, 273, 8, 19, 10, 19, - 12, 19, 276, 9, 19, 1, 19, 1, 19, 1, 20, 1, 20, 4, 20, 282, 8, 20, 11, - 20, 12, 20, 283, 1, 20, 3, 20, 287, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, - 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 298, 8, 22, 1, 23, 1, 23, 1, - 23, 3, 23, 303, 8, 23, 1, 23, 3, 23, 306, 8, 23, 1, 23, 3, 23, 309, 8, - 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 3, 24, 316, 8, 24, 1, 24, 5, 24, - 319, 8, 24, 10, 24, 12, 24, 322, 9, 24, 1, 25, 1, 25, 1, 25, 0, 1, 22, - 26, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, - 36, 38, 40, 42, 44, 46, 48, 50, 0, 2, 1, 0, 32, 37, 3, 0, 14, 20, 25, 27, - 38, 38, 352, 0, 55, 1, 0, 0, 0, 2, 64, 1, 0, 0, 0, 4, 69, 1, 0, 0, 0, 6, - 87, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 105, 1, 0, 0, 0, 12, 119, 1, 0, - 0, 0, 14, 123, 1, 0, 0, 0, 16, 147, 1, 0, 0, 0, 18, 155, 1, 0, 0, 0, 20, - 170, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 205, 1, 0, 0, 0, 26, 215, 1, - 0, 0, 0, 28, 217, 1, 0, 0, 0, 30, 227, 1, 0, 0, 0, 32, 234, 1, 0, 0, 0, - 34, 236, 1, 0, 0, 0, 36, 259, 1, 0, 0, 0, 38, 264, 1, 0, 0, 0, 40, 279, - 1, 0, 0, 0, 42, 288, 1, 0, 0, 0, 44, 297, 1, 0, 0, 0, 46, 299, 1, 0, 0, - 0, 48, 312, 1, 0, 0, 0, 50, 323, 1, 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 52, - 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, - 56, 58, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 0, 0, 1, 59, 1, 1, 0, - 0, 0, 60, 65, 3, 4, 2, 0, 61, 65, 3, 8, 4, 0, 62, 65, 3, 10, 5, 0, 63, - 65, 5, 40, 0, 0, 64, 60, 1, 0, 0, 0, 64, 61, 1, 0, 0, 0, 64, 62, 1, 0, - 0, 0, 64, 63, 1, 0, 0, 0, 65, 3, 1, 0, 0, 0, 66, 68, 3, 42, 21, 0, 67, - 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, - 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 14, 0, 0, 73, 83, - 3, 50, 25, 0, 74, 76, 3, 30, 15, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, - 0, 76, 77, 1, 0, 0, 0, 77, 84, 1, 0, 0, 0, 78, 79, 5, 20, 0, 0, 79, 81, - 3, 20, 10, 0, 80, 82, 3, 6, 3, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, - 0, 82, 84, 1, 0, 0, 0, 83, 74, 1, 0, 0, 0, 83, 78, 1, 0, 0, 0, 84, 85, - 1, 0, 0, 0, 85, 86, 5, 40, 0, 0, 86, 5, 1, 0, 0, 0, 87, 88, 5, 11, 0, 0, - 88, 89, 3, 22, 11, 0, 89, 7, 1, 0, 0, 0, 90, 92, 3, 42, 21, 0, 91, 90, - 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, - 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 15, 0, 0, 97, 98, 3, - 50, 25, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 22, 11, 0, 100, 101, 5, 40, - 0, 0, 101, 9, 1, 0, 0, 0, 102, 104, 3, 42, 21, 0, 103, 102, 1, 0, 0, 0, - 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, - 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 5, 20, 0, 0, 109, 110, - 3, 50, 25, 0, 110, 111, 3, 20, 10, 0, 111, 115, 5, 11, 0, 0, 112, 116, - 3, 12, 6, 0, 113, 116, 3, 34, 17, 0, 114, 116, 3, 14, 7, 0, 115, 112, 1, - 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, - 0, 117, 118, 5, 40, 0, 0, 118, 11, 1, 0, 0, 0, 119, 120, 5, 28, 0, 0, 120, - 121, 3, 28, 14, 0, 121, 122, 3, 34, 17, 0, 122, 13, 1, 0, 0, 0, 123, 127, - 5, 4, 0, 0, 124, 126, 5, 40, 0, 0, 125, 124, 1, 0, 0, 0, 126, 129, 1, 0, - 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, - 129, 127, 1, 0, 0, 0, 130, 133, 5, 29, 0, 0, 131, 134, 3, 50, 25, 0, 132, - 134, 3, 16, 8, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, 134, 135, - 1, 0, 0, 0, 135, 136, 5, 30, 0, 0, 136, 137, 3, 22, 11, 0, 137, 138, 5, - 10, 0, 0, 138, 142, 3, 18, 9, 0, 139, 141, 5, 40, 0, 0, 140, 139, 1, 0, - 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, - 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 5, 5, 0, 0, 146, - 15, 1, 0, 0, 0, 147, 148, 5, 6, 0, 0, 148, 149, 3, 50, 25, 0, 149, 150, - 5, 3, 0, 0, 150, 151, 3, 50, 25, 0, 151, 152, 5, 7, 0, 0, 152, 17, 1, 0, - 0, 0, 153, 156, 3, 22, 11, 0, 154, 156, 3, 12, 6, 0, 155, 153, 1, 0, 0, - 0, 155, 154, 1, 0, 0, 0, 156, 19, 1, 0, 0, 0, 157, 163, 5, 21, 0, 0, 158, - 159, 3, 22, 11, 0, 159, 160, 5, 22, 0, 0, 160, 162, 1, 0, 0, 0, 161, 158, - 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, - 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 167, 3, 22, 11, - 0, 167, 168, 5, 23, 0, 0, 168, 171, 1, 0, 0, 0, 169, 171, 5, 24, 0, 0, - 170, 157, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, 21, 1, 0, 0, 0, 172, 173, - 6, 11, -1, 0, 173, 174, 3, 26, 13, 0, 174, 202, 1, 0, 0, 0, 175, 176, 10, - 6, 0, 0, 176, 177, 5, 31, 0, 0, 177, 178, 3, 22, 11, 0, 178, 179, 5, 10, - 0, 0, 179, 180, 3, 22, 11, 7, 180, 201, 1, 0, 0, 0, 181, 182, 10, 2, 0, - 0, 182, 183, 3, 24, 12, 0, 183, 184, 3, 22, 11, 3, 184, 201, 1, 0, 0, 0, - 185, 186, 10, 7, 0, 0, 186, 187, 5, 4, 0, 0, 187, 188, 3, 22, 11, 0, 188, - 189, 5, 5, 0, 0, 189, 201, 1, 0, 0, 0, 190, 191, 10, 5, 0, 0, 191, 192, - 5, 8, 0, 0, 192, 201, 3, 50, 25, 0, 193, 194, 10, 4, 0, 0, 194, 195, 5, - 10, 0, 0, 195, 201, 3, 50, 25, 0, 196, 197, 10, 3, 0, 0, 197, 198, 5, 10, - 0, 0, 198, 199, 5, 10, 0, 0, 199, 201, 3, 50, 25, 0, 200, 175, 1, 0, 0, - 0, 200, 181, 1, 0, 0, 0, 200, 185, 1, 0, 0, 0, 200, 190, 1, 0, 0, 0, 200, - 193, 1, 0, 0, 0, 200, 196, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, - 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 23, 1, 0, 0, 0, 204, 202, 1, 0, - 0, 0, 205, 206, 7, 0, 0, 0, 206, 25, 1, 0, 0, 0, 207, 216, 3, 32, 16, 0, - 208, 216, 3, 46, 23, 0, 209, 216, 3, 20, 10, 0, 210, 216, 5, 1, 0, 0, 211, - 216, 3, 38, 19, 0, 212, 216, 3, 34, 17, 0, 213, 216, 3, 14, 7, 0, 214, - 216, 3, 28, 14, 0, 215, 207, 1, 0, 0, 0, 215, 208, 1, 0, 0, 0, 215, 209, - 1, 0, 0, 0, 215, 210, 1, 0, 0, 0, 215, 211, 1, 0, 0, 0, 215, 212, 1, 0, - 0, 0, 215, 213, 1, 0, 0, 0, 215, 214, 1, 0, 0, 0, 216, 27, 1, 0, 0, 0, - 217, 219, 5, 6, 0, 0, 218, 220, 5, 40, 0, 0, 219, 218, 1, 0, 0, 0, 219, - 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 223, 3, 22, 11, 0, 222, 224, - 5, 40, 0, 0, 223, 222, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 1, 0, - 0, 0, 225, 226, 5, 7, 0, 0, 226, 29, 1, 0, 0, 0, 227, 228, 3, 50, 25, 0, - 228, 31, 1, 0, 0, 0, 229, 235, 5, 39, 0, 0, 230, 235, 5, 16, 0, 0, 231, - 235, 5, 17, 0, 0, 232, 235, 5, 18, 0, 0, 233, 235, 3, 50, 25, 0, 234, 229, - 1, 0, 0, 0, 234, 230, 1, 0, 0, 0, 234, 231, 1, 0, 0, 0, 234, 232, 1, 0, - 0, 0, 234, 233, 1, 0, 0, 0, 235, 33, 1, 0, 0, 0, 236, 253, 5, 12, 0, 0, - 237, 239, 5, 40, 0, 0, 238, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, - 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 250, 1, 0, 0, 0, 242, 244, - 3, 36, 18, 0, 243, 245, 5, 40, 0, 0, 244, 243, 1, 0, 0, 0, 245, 246, 1, - 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 249, 1, 0, 0, - 0, 248, 242, 1, 0, 0, 0, 249, 252, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, - 251, 1, 0, 0, 0, 251, 254, 1, 0, 0, 0, 252, 250, 1, 0, 0, 0, 253, 238, - 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 256, 5, 13, - 0, 0, 256, 35, 1, 0, 0, 0, 257, 260, 3, 50, 25, 0, 258, 260, 3, 20, 10, - 0, 259, 257, 1, 0, 0, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, - 262, 5, 10, 0, 0, 262, 263, 3, 22, 11, 0, 263, 37, 1, 0, 0, 0, 264, 268, - 5, 4, 0, 0, 265, 267, 5, 40, 0, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, 0, - 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 274, 1, 0, 0, 0, - 270, 268, 1, 0, 0, 0, 271, 273, 3, 40, 20, 0, 272, 271, 1, 0, 0, 0, 273, - 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, - 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 277, 278, 5, 5, 0, 0, 278, 39, 1, 0, - 0, 0, 279, 286, 3, 22, 11, 0, 280, 282, 5, 40, 0, 0, 281, 280, 1, 0, 0, - 0, 282, 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, - 287, 1, 0, 0, 0, 285, 287, 5, 3, 0, 0, 286, 281, 1, 0, 0, 0, 286, 285, - 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 41, 1, 0, 0, 0, 288, 289, 5, 2, - 0, 0, 289, 290, 3, 44, 22, 0, 290, 291, 5, 40, 0, 0, 291, 43, 1, 0, 0, - 0, 292, 298, 3, 46, 23, 0, 293, 294, 3, 22, 11, 0, 294, 295, 5, 8, 0, 0, - 295, 296, 3, 46, 23, 0, 296, 298, 1, 0, 0, 0, 297, 292, 1, 0, 0, 0, 297, - 293, 1, 0, 0, 0, 298, 45, 1, 0, 0, 0, 299, 300, 3, 50, 25, 0, 300, 305, - 5, 6, 0, 0, 301, 303, 5, 40, 0, 0, 302, 301, 1, 0, 0, 0, 302, 303, 1, 0, - 0, 0, 303, 304, 1, 0, 0, 0, 304, 306, 3, 48, 24, 0, 305, 302, 1, 0, 0, - 0, 305, 306, 1, 0, 0, 0, 306, 308, 1, 0, 0, 0, 307, 309, 5, 40, 0, 0, 308, - 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, - 5, 7, 0, 0, 311, 47, 1, 0, 0, 0, 312, 320, 3, 22, 11, 0, 313, 315, 5, 3, - 0, 0, 314, 316, 5, 40, 0, 0, 315, 314, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, - 316, 317, 1, 0, 0, 0, 317, 319, 3, 22, 11, 0, 318, 313, 1, 0, 0, 0, 319, - 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 49, 1, - 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 324, 7, 1, 0, 0, 324, 51, 1, 0, 0, - 0, 36, 55, 64, 69, 76, 81, 83, 93, 105, 115, 127, 133, 142, 155, 163, 170, - 200, 202, 215, 219, 223, 234, 240, 246, 250, 253, 259, 268, 274, 283, 286, - 297, 302, 305, 308, 315, 320, + 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, + 7, 26, 1, 0, 5, 0, 56, 8, 0, 10, 0, 12, 0, 59, 9, 0, 1, 0, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 68, 8, 1, 1, 2, 5, 2, 71, 8, 2, 10, 2, 12, + 2, 74, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 80, 8, 2, 1, 2, 1, 2, 1, 2, + 3, 2, 85, 8, 2, 3, 2, 87, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, + 4, 95, 8, 4, 10, 4, 12, 4, 98, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, + 1, 5, 5, 5, 107, 8, 5, 10, 5, 12, 5, 110, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, + 1, 5, 1, 5, 1, 5, 3, 5, 119, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 124, 8, 6, 10, + 6, 12, 6, 127, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 134, 8, 6, 1, + 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 146, 8, + 8, 10, 8, 12, 8, 149, 9, 8, 1, 8, 1, 8, 1, 8, 3, 8, 154, 8, 8, 1, 8, 1, + 8, 1, 8, 1, 8, 1, 8, 5, 8, 161, 8, 8, 10, 8, 12, 8, 164, 9, 8, 1, 8, 1, + 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 176, 8, 10, + 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 182, 8, 11, 10, 11, 12, 11, 185, 9, + 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 191, 8, 11, 1, 12, 1, 12, 1, 12, + 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, + 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, + 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 221, 8, 12, 10, 12, 12, 12, 224, 9, + 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, + 3, 14, 236, 8, 14, 1, 15, 1, 15, 3, 15, 240, 8, 15, 1, 15, 1, 15, 3, 15, + 244, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, + 17, 3, 17, 255, 8, 17, 1, 18, 1, 18, 4, 18, 259, 8, 18, 11, 18, 12, 18, + 260, 1, 18, 1, 18, 4, 18, 265, 8, 18, 11, 18, 12, 18, 266, 5, 18, 269, + 8, 18, 10, 18, 12, 18, 272, 9, 18, 3, 18, 274, 8, 18, 1, 18, 1, 18, 1, + 19, 1, 19, 3, 19, 280, 8, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, + 287, 8, 20, 10, 20, 12, 20, 290, 9, 20, 1, 20, 5, 20, 293, 8, 20, 10, 20, + 12, 20, 296, 9, 20, 1, 20, 1, 20, 1, 21, 1, 21, 4, 21, 302, 8, 21, 11, + 21, 12, 21, 303, 1, 21, 3, 21, 307, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, + 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 318, 8, 23, 1, 24, 1, 24, 1, + 24, 3, 24, 323, 8, 24, 1, 24, 3, 24, 326, 8, 24, 1, 24, 3, 24, 329, 8, + 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 336, 8, 25, 1, 25, 5, 25, + 339, 8, 25, 10, 25, 12, 25, 342, 9, 25, 1, 26, 1, 26, 1, 26, 0, 1, 24, + 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, + 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 2, 1, 0, 33, 38, 3, 0, 14, 20, 26, + 28, 39, 39, 374, 0, 57, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, + 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, 0, 10, 108, 1, 0, 0, 0, 12, 125, + 1, 0, 0, 0, 14, 139, 1, 0, 0, 0, 16, 143, 1, 0, 0, 0, 18, 167, 1, 0, 0, + 0, 20, 175, 1, 0, 0, 0, 22, 190, 1, 0, 0, 0, 24, 192, 1, 0, 0, 0, 26, 225, + 1, 0, 0, 0, 28, 235, 1, 0, 0, 0, 30, 237, 1, 0, 0, 0, 32, 247, 1, 0, 0, + 0, 34, 254, 1, 0, 0, 0, 36, 256, 1, 0, 0, 0, 38, 279, 1, 0, 0, 0, 40, 284, + 1, 0, 0, 0, 42, 299, 1, 0, 0, 0, 44, 308, 1, 0, 0, 0, 46, 317, 1, 0, 0, + 0, 48, 319, 1, 0, 0, 0, 50, 332, 1, 0, 0, 0, 52, 343, 1, 0, 0, 0, 54, 56, + 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, + 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 60, 61, 5, + 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, 2, 0, 63, 68, 3, 8, 4, 0, 64, + 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, 68, 5, 41, 0, 0, 67, 62, 1, 0, + 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, + 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, + 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, + 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, + 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, + 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, + 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, + 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, + 89, 5, 41, 0, 0, 89, 5, 1, 0, 0, 0, 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, + 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, + 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, + 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, + 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 41, 0, 0, 104, 9, + 1, 0, 0, 0, 105, 107, 3, 44, 22, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, + 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, + 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, + 113, 114, 3, 22, 11, 0, 114, 118, 5, 11, 0, 0, 115, 119, 3, 14, 7, 0, 116, + 119, 3, 36, 18, 0, 117, 119, 3, 16, 8, 0, 118, 115, 1, 0, 0, 0, 118, 116, + 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 5, 41, + 0, 0, 121, 11, 1, 0, 0, 0, 122, 124, 3, 44, 22, 0, 123, 122, 1, 0, 0, 0, + 124, 127, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, + 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, 129, 5, 21, 0, 0, 129, 133, + 3, 52, 26, 0, 130, 134, 3, 52, 26, 0, 131, 132, 5, 20, 0, 0, 132, 134, + 3, 22, 11, 0, 133, 130, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 134, 135, 1, + 0, 0, 0, 135, 136, 5, 11, 0, 0, 136, 137, 3, 24, 12, 0, 137, 138, 5, 41, + 0, 0, 138, 13, 1, 0, 0, 0, 139, 140, 5, 29, 0, 0, 140, 141, 3, 30, 15, + 0, 141, 142, 3, 36, 18, 0, 142, 15, 1, 0, 0, 0, 143, 147, 5, 4, 0, 0, 144, + 146, 5, 41, 0, 0, 145, 144, 1, 0, 0, 0, 146, 149, 1, 0, 0, 0, 147, 145, + 1, 0, 0, 0, 147, 148, 1, 0, 0, 0, 148, 150, 1, 0, 0, 0, 149, 147, 1, 0, + 0, 0, 150, 153, 5, 30, 0, 0, 151, 154, 3, 52, 26, 0, 152, 154, 3, 18, 9, + 0, 153, 151, 1, 0, 0, 0, 153, 152, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, + 156, 5, 31, 0, 0, 156, 157, 3, 24, 12, 0, 157, 158, 5, 10, 0, 0, 158, 162, + 3, 20, 10, 0, 159, 161, 5, 41, 0, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, + 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, + 0, 164, 162, 1, 0, 0, 0, 165, 166, 5, 5, 0, 0, 166, 17, 1, 0, 0, 0, 167, + 168, 5, 6, 0, 0, 168, 169, 3, 52, 26, 0, 169, 170, 5, 3, 0, 0, 170, 171, + 3, 52, 26, 0, 171, 172, 5, 7, 0, 0, 172, 19, 1, 0, 0, 0, 173, 176, 3, 24, + 12, 0, 174, 176, 3, 14, 7, 0, 175, 173, 1, 0, 0, 0, 175, 174, 1, 0, 0, + 0, 176, 21, 1, 0, 0, 0, 177, 183, 5, 22, 0, 0, 178, 179, 3, 24, 12, 0, + 179, 180, 5, 23, 0, 0, 180, 182, 1, 0, 0, 0, 181, 178, 1, 0, 0, 0, 182, + 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, + 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 187, 3, 24, 12, 0, 187, 188, 5, + 24, 0, 0, 188, 191, 1, 0, 0, 0, 189, 191, 5, 25, 0, 0, 190, 177, 1, 0, + 0, 0, 190, 189, 1, 0, 0, 0, 191, 23, 1, 0, 0, 0, 192, 193, 6, 12, -1, 0, + 193, 194, 3, 28, 14, 0, 194, 222, 1, 0, 0, 0, 195, 196, 10, 6, 0, 0, 196, + 197, 5, 32, 0, 0, 197, 198, 3, 24, 12, 0, 198, 199, 5, 10, 0, 0, 199, 200, + 3, 24, 12, 7, 200, 221, 1, 0, 0, 0, 201, 202, 10, 2, 0, 0, 202, 203, 3, + 26, 13, 0, 203, 204, 3, 24, 12, 3, 204, 221, 1, 0, 0, 0, 205, 206, 10, + 7, 0, 0, 206, 207, 5, 4, 0, 0, 207, 208, 3, 24, 12, 0, 208, 209, 5, 5, + 0, 0, 209, 221, 1, 0, 0, 0, 210, 211, 10, 5, 0, 0, 211, 212, 5, 8, 0, 0, + 212, 221, 3, 52, 26, 0, 213, 214, 10, 4, 0, 0, 214, 215, 5, 10, 0, 0, 215, + 221, 3, 52, 26, 0, 216, 217, 10, 3, 0, 0, 217, 218, 5, 10, 0, 0, 218, 219, + 5, 10, 0, 0, 219, 221, 3, 52, 26, 0, 220, 195, 1, 0, 0, 0, 220, 201, 1, + 0, 0, 0, 220, 205, 1, 0, 0, 0, 220, 210, 1, 0, 0, 0, 220, 213, 1, 0, 0, + 0, 220, 216, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, + 223, 1, 0, 0, 0, 223, 25, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 225, 226, 7, + 0, 0, 0, 226, 27, 1, 0, 0, 0, 227, 236, 3, 34, 17, 0, 228, 236, 3, 48, + 24, 0, 229, 236, 3, 22, 11, 0, 230, 236, 5, 1, 0, 0, 231, 236, 3, 40, 20, + 0, 232, 236, 3, 36, 18, 0, 233, 236, 3, 16, 8, 0, 234, 236, 3, 30, 15, + 0, 235, 227, 1, 0, 0, 0, 235, 228, 1, 0, 0, 0, 235, 229, 1, 0, 0, 0, 235, + 230, 1, 0, 0, 0, 235, 231, 1, 0, 0, 0, 235, 232, 1, 0, 0, 0, 235, 233, + 1, 0, 0, 0, 235, 234, 1, 0, 0, 0, 236, 29, 1, 0, 0, 0, 237, 239, 5, 6, + 0, 0, 238, 240, 5, 41, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, + 240, 241, 1, 0, 0, 0, 241, 243, 3, 24, 12, 0, 242, 244, 5, 41, 0, 0, 243, + 242, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, + 5, 7, 0, 0, 246, 31, 1, 0, 0, 0, 247, 248, 3, 52, 26, 0, 248, 33, 1, 0, + 0, 0, 249, 255, 5, 40, 0, 0, 250, 255, 5, 16, 0, 0, 251, 255, 5, 17, 0, + 0, 252, 255, 5, 18, 0, 0, 253, 255, 3, 52, 26, 0, 254, 249, 1, 0, 0, 0, + 254, 250, 1, 0, 0, 0, 254, 251, 1, 0, 0, 0, 254, 252, 1, 0, 0, 0, 254, + 253, 1, 0, 0, 0, 255, 35, 1, 0, 0, 0, 256, 273, 5, 12, 0, 0, 257, 259, + 5, 41, 0, 0, 258, 257, 1, 0, 0, 0, 259, 260, 1, 0, 0, 0, 260, 258, 1, 0, + 0, 0, 260, 261, 1, 0, 0, 0, 261, 270, 1, 0, 0, 0, 262, 264, 3, 38, 19, + 0, 263, 265, 5, 41, 0, 0, 264, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, + 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 269, 1, 0, 0, 0, 268, 262, + 1, 0, 0, 0, 269, 272, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, + 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 273, 258, 1, 0, 0, 0, + 273, 274, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 276, 5, 13, 0, 0, 276, + 37, 1, 0, 0, 0, 277, 280, 3, 52, 26, 0, 278, 280, 3, 22, 11, 0, 279, 277, + 1, 0, 0, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 282, 5, 10, + 0, 0, 282, 283, 3, 24, 12, 0, 283, 39, 1, 0, 0, 0, 284, 288, 5, 4, 0, 0, + 285, 287, 5, 41, 0, 0, 286, 285, 1, 0, 0, 0, 287, 290, 1, 0, 0, 0, 288, + 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 294, 1, 0, 0, 0, 290, 288, + 1, 0, 0, 0, 291, 293, 3, 42, 21, 0, 292, 291, 1, 0, 0, 0, 293, 296, 1, + 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 297, 1, 0, 0, + 0, 296, 294, 1, 0, 0, 0, 297, 298, 5, 5, 0, 0, 298, 41, 1, 0, 0, 0, 299, + 306, 3, 24, 12, 0, 300, 302, 5, 41, 0, 0, 301, 300, 1, 0, 0, 0, 302, 303, + 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 307, 1, 0, + 0, 0, 305, 307, 5, 3, 0, 0, 306, 301, 1, 0, 0, 0, 306, 305, 1, 0, 0, 0, + 306, 307, 1, 0, 0, 0, 307, 43, 1, 0, 0, 0, 308, 309, 5, 2, 0, 0, 309, 310, + 3, 46, 23, 0, 310, 311, 5, 41, 0, 0, 311, 45, 1, 0, 0, 0, 312, 318, 3, + 48, 24, 0, 313, 314, 3, 24, 12, 0, 314, 315, 5, 8, 0, 0, 315, 316, 3, 48, + 24, 0, 316, 318, 1, 0, 0, 0, 317, 312, 1, 0, 0, 0, 317, 313, 1, 0, 0, 0, + 318, 47, 1, 0, 0, 0, 319, 320, 3, 52, 26, 0, 320, 325, 5, 6, 0, 0, 321, + 323, 5, 41, 0, 0, 322, 321, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 324, + 1, 0, 0, 0, 324, 326, 3, 50, 25, 0, 325, 322, 1, 0, 0, 0, 325, 326, 1, + 0, 0, 0, 326, 328, 1, 0, 0, 0, 327, 329, 5, 41, 0, 0, 328, 327, 1, 0, 0, + 0, 328, 329, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 5, 7, 0, 0, 331, + 49, 1, 0, 0, 0, 332, 340, 3, 24, 12, 0, 333, 335, 5, 3, 0, 0, 334, 336, + 5, 41, 0, 0, 335, 334, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 337, 1, 0, + 0, 0, 337, 339, 3, 24, 12, 0, 338, 333, 1, 0, 0, 0, 339, 342, 1, 0, 0, + 0, 340, 338, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 51, 1, 0, 0, 0, 342, + 340, 1, 0, 0, 0, 343, 344, 7, 1, 0, 0, 344, 53, 1, 0, 0, 0, 38, 57, 67, + 72, 79, 84, 86, 96, 108, 118, 125, 133, 147, 153, 162, 175, 183, 190, 220, + 222, 235, 239, 243, 254, 260, 266, 270, 273, 279, 288, 294, 303, 306, 317, + 322, 325, 328, 335, 340, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -262,30 +271,31 @@ const ( bicepParserNULL = 18 bicepParserOBJECT = 19 bicepParserRESOURCE = 20 - bicepParserSTRING_LEFT_PIECE = 21 - bicepParserSTRING_MIDDLE_PIECE = 22 - bicepParserSTRING_RIGHT_PIECE = 23 - bicepParserSTRING_COMPLETE = 24 - bicepParserSTRING = 25 - bicepParserINT = 26 - bicepParserBOOL = 27 - bicepParserIF = 28 - bicepParserFOR = 29 - bicepParserIN = 30 - bicepParserQMARK = 31 - bicepParserGT = 32 - bicepParserGTE = 33 - bicepParserLT = 34 - bicepParserLTE = 35 - bicepParserEQ = 36 - bicepParserNEQ = 37 - bicepParserIDENTIFIER = 38 - bicepParserNUMBER = 39 - bicepParserNL = 40 - bicepParserSPACES = 41 - bicepParserUNKNOWN = 42 - bicepParserSINGLE_LINE_COMMENT = 43 - bicepParserMULTI_LINE_COMMENT = 44 + bicepParserOUTPUT = 21 + bicepParserSTRING_LEFT_PIECE = 22 + bicepParserSTRING_MIDDLE_PIECE = 23 + bicepParserSTRING_RIGHT_PIECE = 24 + bicepParserSTRING_COMPLETE = 25 + bicepParserSTRING = 26 + bicepParserINT = 27 + bicepParserBOOL = 28 + bicepParserIF = 29 + bicepParserFOR = 30 + bicepParserIN = 31 + bicepParserQMARK = 32 + bicepParserGT = 33 + bicepParserGTE = 34 + bicepParserLT = 35 + bicepParserLTE = 36 + bicepParserEQ = 37 + bicepParserNEQ = 38 + bicepParserIDENTIFIER = 39 + bicepParserNUMBER = 40 + bicepParserNL = 41 + bicepParserSPACES = 42 + bicepParserUNKNOWN = 43 + bicepParserSINGLE_LINE_COMMENT = 44 + bicepParserMULTI_LINE_COMMENT = 45 ) // bicepParser rules. @@ -296,26 +306,27 @@ const ( bicepParserRULE_parameterDefaultValue = 3 bicepParserRULE_variableDecl = 4 bicepParserRULE_resourceDecl = 5 - bicepParserRULE_ifCondition = 6 - bicepParserRULE_forExpression = 7 - bicepParserRULE_forVariableBlock = 8 - bicepParserRULE_forBody = 9 - bicepParserRULE_interpString = 10 - bicepParserRULE_expression = 11 - bicepParserRULE_logicCharacter = 12 - bicepParserRULE_primaryExpression = 13 - bicepParserRULE_parenthesizedExpression = 14 - bicepParserRULE_typeExpression = 15 - bicepParserRULE_literalValue = 16 - bicepParserRULE_object = 17 - bicepParserRULE_objectProperty = 18 - bicepParserRULE_array = 19 - bicepParserRULE_arrayItem = 20 - bicepParserRULE_decorator = 21 - bicepParserRULE_decoratorExpression = 22 - bicepParserRULE_functionCall = 23 - bicepParserRULE_argumentList = 24 - bicepParserRULE_identifier = 25 + bicepParserRULE_outputDecl = 6 + bicepParserRULE_ifCondition = 7 + bicepParserRULE_forExpression = 8 + bicepParserRULE_forVariableBlock = 9 + bicepParserRULE_forBody = 10 + bicepParserRULE_interpString = 11 + bicepParserRULE_expression = 12 + bicepParserRULE_logicCharacter = 13 + bicepParserRULE_primaryExpression = 14 + bicepParserRULE_parenthesizedExpression = 15 + bicepParserRULE_typeExpression = 16 + bicepParserRULE_literalValue = 17 + bicepParserRULE_object = 18 + bicepParserRULE_objectProperty = 19 + bicepParserRULE_array = 20 + bicepParserRULE_arrayItem = 21 + bicepParserRULE_decorator = 22 + bicepParserRULE_decoratorExpression = 23 + bicepParserRULE_functionCall = 24 + bicepParserRULE_argumentList = 25 + bicepParserRULE_identifier = 26 ) // IProgramContext is an interface to support dynamic dispatch. @@ -435,20 +446,20 @@ func (p *bicepParser) Program() (localctx IProgramContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(55) + p.SetState(57) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1099512725508) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&2199026450436) != 0 { { - p.SetState(52) + p.SetState(54) p.Statement() } - p.SetState(57) + p.SetState(59) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -456,7 +467,7 @@ func (p *bicepParser) Program() (localctx IProgramContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(58) + p.SetState(60) p.Match(bicepParserEOF) if p.HasError() { // Recognition error - abort rule @@ -488,6 +499,7 @@ type IStatementContext interface { ParameterDecl() IParameterDeclContext VariableDecl() IVariableDeclContext ResourceDecl() IResourceDeclContext + OutputDecl() IOutputDeclContext NL() antlr.TerminalNode // IsStatementContext differentiates from other interfaces. @@ -574,6 +586,22 @@ func (s *StatementContext) ResourceDecl() IResourceDeclContext { return t.(IResourceDeclContext) } +func (s *StatementContext) OutputDecl() IOutputDeclContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOutputDeclContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IOutputDeclContext) +} + func (s *StatementContext) NL() antlr.TerminalNode { return s.GetToken(bicepParserNL, 0) } @@ -599,7 +627,7 @@ func (s *StatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 2, bicepParserRULE_statement) - p.SetState(64) + p.SetState(67) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -609,28 +637,35 @@ func (p *bicepParser) Statement() (localctx IStatementContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(60) + p.SetState(62) p.ParameterDecl() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(61) + p.SetState(63) p.VariableDecl() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(62) + p.SetState(64) p.ResourceDecl() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(63) + p.SetState(65) + p.OutputDecl() + } + + case 5: + p.EnterOuterAlt(localctx, 5) + { + p.SetState(66) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -872,7 +907,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(69) + p.SetState(72) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -881,11 +916,11 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { for _la == bicepParserAT { { - p.SetState(66) + p.SetState(69) p.Decorator() } - p.SetState(71) + p.SetState(74) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -893,7 +928,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(72) + p.SetState(75) p.Match(bicepParserPARAM) if p.HasError() { // Recognition error - abort rule @@ -901,13 +936,13 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { } } { - p.SetState(73) + p.SetState(76) var _x = p.Identifier() localctx.(*ParameterDeclContext).name = _x } - p.SetState(83) + p.SetState(86) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -916,10 +951,10 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext()) { case 1: { - p.SetState(74) + p.SetState(77) p.TypeExpression() } - p.SetState(76) + p.SetState(79) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -928,7 +963,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { if _la == bicepParserASSIGN { { - p.SetState(75) + p.SetState(78) p.ParameterDefaultValue() } @@ -936,7 +971,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { case 2: { - p.SetState(78) + p.SetState(81) p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule @@ -944,13 +979,13 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { } } { - p.SetState(79) + p.SetState(82) var _x = p.InterpString() localctx.(*ParameterDeclContext).type_ = _x } - p.SetState(81) + p.SetState(84) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -959,7 +994,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { if _la == bicepParserASSIGN { { - p.SetState(80) + p.SetState(83) p.ParameterDefaultValue() } @@ -969,7 +1004,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { goto errorExit } { - p.SetState(85) + p.SetState(88) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1080,7 +1115,7 @@ func (p *bicepParser) ParameterDefaultValue() (localctx IParameterDefaultValueCo p.EnterRule(localctx, 6, bicepParserRULE_parameterDefaultValue) p.EnterOuterAlt(localctx, 1) { - p.SetState(87) + p.SetState(90) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -1088,7 +1123,7 @@ func (p *bicepParser) ParameterDefaultValue() (localctx IParameterDefaultValueCo } } { - p.SetState(88) + p.SetState(91) p.expression(0) } @@ -1277,7 +1312,7 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(93) + p.SetState(96) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1286,11 +1321,11 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { for _la == bicepParserAT { { - p.SetState(90) + p.SetState(93) p.Decorator() } - p.SetState(95) + p.SetState(98) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1298,7 +1333,7 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(96) + p.SetState(99) p.Match(bicepParserVAR) if p.HasError() { // Recognition error - abort rule @@ -1306,14 +1341,14 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { } } { - p.SetState(97) + p.SetState(100) var _x = p.Identifier() localctx.(*VariableDeclContext).name = _x } { - p.SetState(98) + p.SetState(101) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -1321,11 +1356,11 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { } } { - p.SetState(99) + p.SetState(102) p.expression(0) } { - p.SetState(100) + p.SetState(103) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1580,7 +1615,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(105) + p.SetState(108) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1589,11 +1624,11 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { for _la == bicepParserAT { { - p.SetState(102) + p.SetState(105) p.Decorator() } - p.SetState(107) + p.SetState(110) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1601,7 +1636,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(108) + p.SetState(111) p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule @@ -1609,28 +1644,28 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { } } { - p.SetState(109) + p.SetState(112) var _x = p.Identifier() localctx.(*ResourceDeclContext).name = _x } { - p.SetState(110) + p.SetState(113) var _x = p.InterpString() localctx.(*ResourceDeclContext).type_ = _x } { - p.SetState(111) + p.SetState(114) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(115) + p.SetState(118) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1639,19 +1674,19 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { switch p.GetTokenStream().LA(1) { case bicepParserIF: { - p.SetState(112) + p.SetState(115) p.IfCondition() } case bicepParserOBRACE: { - p.SetState(113) + p.SetState(116) p.Object() } case bicepParserOBRACK: { - p.SetState(114) + p.SetState(117) p.ForExpression() } @@ -1660,7 +1695,354 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { goto errorExit } { - p.SetState(117) + p.SetState(120) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IOutputDeclContext is an interface to support dynamic dispatch. +type IOutputDeclContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetName returns the name rule contexts. + GetName() IIdentifierContext + + // GetType1 returns the type1 rule contexts. + GetType1() IIdentifierContext + + // GetType2 returns the type2 rule contexts. + GetType2() IInterpStringContext + + // SetName sets the name rule contexts. + SetName(IIdentifierContext) + + // SetType1 sets the type1 rule contexts. + SetType1(IIdentifierContext) + + // SetType2 sets the type2 rule contexts. + SetType2(IInterpStringContext) + + // Getter signatures + OUTPUT() antlr.TerminalNode + ASSIGN() antlr.TerminalNode + Expression() IExpressionContext + NL() antlr.TerminalNode + AllIdentifier() []IIdentifierContext + Identifier(i int) IIdentifierContext + RESOURCE() antlr.TerminalNode + AllDecorator() []IDecoratorContext + Decorator(i int) IDecoratorContext + InterpString() IInterpStringContext + + // IsOutputDeclContext differentiates from other interfaces. + IsOutputDeclContext() +} + +type OutputDeclContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + name IIdentifierContext + type1 IIdentifierContext + type2 IInterpStringContext +} + +func NewEmptyOutputDeclContext() *OutputDeclContext { + var p = new(OutputDeclContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_outputDecl + return p +} + +func InitEmptyOutputDeclContext(p *OutputDeclContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_outputDecl +} + +func (*OutputDeclContext) IsOutputDeclContext() {} + +func NewOutputDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OutputDeclContext { + var p = new(OutputDeclContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_outputDecl + + return p +} + +func (s *OutputDeclContext) GetParser() antlr.Parser { return s.parser } + +func (s *OutputDeclContext) GetName() IIdentifierContext { return s.name } + +func (s *OutputDeclContext) GetType1() IIdentifierContext { return s.type1 } + +func (s *OutputDeclContext) GetType2() IInterpStringContext { return s.type2 } + +func (s *OutputDeclContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *OutputDeclContext) SetType1(v IIdentifierContext) { s.type1 = v } + +func (s *OutputDeclContext) SetType2(v IInterpStringContext) { s.type2 = v } + +func (s *OutputDeclContext) OUTPUT() antlr.TerminalNode { + return s.GetToken(bicepParserOUTPUT, 0) +} + +func (s *OutputDeclContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) +} + +func (s *OutputDeclContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *OutputDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *OutputDeclContext) AllIdentifier() []IIdentifierContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IIdentifierContext); ok { + len++ + } + } + + tst := make([]IIdentifierContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IIdentifierContext); ok { + tst[i] = t.(IIdentifierContext) + i++ + } + } + + return tst +} + +func (s *OutputDeclContext) Identifier(i int) IIdentifierContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *OutputDeclContext) RESOURCE() antlr.TerminalNode { + return s.GetToken(bicepParserRESOURCE, 0) +} + +func (s *OutputDeclContext) AllDecorator() []IDecoratorContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDecoratorContext); ok { + len++ + } + } + + tst := make([]IDecoratorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) + i++ + } + } + + return tst +} + +func (s *OutputDeclContext) Decorator(i int) IDecoratorContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecoratorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDecoratorContext) +} + +func (s *OutputDeclContext) InterpString() IInterpStringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInterpStringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInterpStringContext) +} + +func (s *OutputDeclContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *OutputDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *OutputDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitOutputDecl(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { + localctx = NewOutputDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 12, bicepParserRULE_outputDecl) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(125) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserAT { + { + p.SetState(122) + p.Decorator() + } + + p.SetState(127) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(128) + p.Match(bicepParserOUTPUT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(129) + + var _x = p.Identifier() + + localctx.(*OutputDeclContext).name = _x + } + p.SetState(133) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 10, p.GetParserRuleContext()) { + case 1: + { + p.SetState(130) + + var _x = p.Identifier() + + localctx.(*OutputDeclContext).type1 = _x + } + + case 2: + { + p.SetState(131) + p.Match(bicepParserRESOURCE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(132) + + var _x = p.InterpString() + + localctx.(*OutputDeclContext).type2 = _x + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + { + p.SetState(135) + p.Match(bicepParserASSIGN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(136) + p.expression(0) + } + { + p.SetState(137) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1785,10 +2167,10 @@ func (s *IfConditionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) IfCondition() (localctx IIfConditionContext) { localctx = NewIfConditionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 12, bicepParserRULE_ifCondition) + p.EnterRule(localctx, 14, bicepParserRULE_ifCondition) p.EnterOuterAlt(localctx, 1) { - p.SetState(119) + p.SetState(139) p.Match(bicepParserIF) if p.HasError() { // Recognition error - abort rule @@ -1796,11 +2178,11 @@ func (p *bicepParser) IfCondition() (localctx IIfConditionContext) { } } { - p.SetState(120) + p.SetState(140) p.ParenthesizedExpression() } { - p.SetState(121) + p.SetState(141) p.Object() } @@ -1996,19 +2378,19 @@ func (s *ForExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { localctx = NewForExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 14, bicepParserRULE_forExpression) + p.EnterRule(localctx, 16, bicepParserRULE_forExpression) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(123) + p.SetState(143) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(127) + p.SetState(147) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2017,7 +2399,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { for _la == bicepParserNL { { - p.SetState(124) + p.SetState(144) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2025,7 +2407,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } - p.SetState(129) + p.SetState(149) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2033,14 +2415,14 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(130) + p.SetState(150) p.Match(bicepParserFOR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(133) + p.SetState(153) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2049,7 +2431,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: { - p.SetState(131) + p.SetState(151) var _x = p.Identifier() @@ -2058,7 +2440,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { case bicepParserOPAR: { - p.SetState(132) + p.SetState(152) p.ForVariableBlock() } @@ -2067,7 +2449,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { goto errorExit } { - p.SetState(135) + p.SetState(155) p.Match(bicepParserIN) if p.HasError() { // Recognition error - abort rule @@ -2075,11 +2457,11 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } { - p.SetState(136) + p.SetState(156) p.expression(0) } { - p.SetState(137) + p.SetState(157) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -2087,10 +2469,10 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } { - p.SetState(138) + p.SetState(158) p.ForBody() } - p.SetState(142) + p.SetState(162) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2099,7 +2481,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { for _la == bicepParserNL { { - p.SetState(139) + p.SetState(159) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2107,7 +2489,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } - p.SetState(144) + p.SetState(164) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2115,7 +2497,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(145) + p.SetState(165) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -2281,10 +2663,10 @@ func (s *ForVariableBlockContext) Accept(visitor antlr.ParseTreeVisitor) interfa func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { localctx = NewForVariableBlockContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 16, bicepParserRULE_forVariableBlock) + p.EnterRule(localctx, 18, bicepParserRULE_forVariableBlock) p.EnterOuterAlt(localctx, 1) { - p.SetState(147) + p.SetState(167) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule @@ -2292,14 +2674,14 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { } } { - p.SetState(148) + p.SetState(168) var _x = p.Identifier() localctx.(*ForVariableBlockContext).item = _x } { - p.SetState(149) + p.SetState(169) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -2307,14 +2689,14 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { } } { - p.SetState(150) + p.SetState(170) var _x = p.Identifier() localctx.(*ForVariableBlockContext).index = _x } { - p.SetState(151) + p.SetState(171) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -2445,8 +2827,8 @@ func (s *ForBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) ForBody() (localctx IForBodyContext) { localctx = NewForBodyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 18, bicepParserRULE_forBody) - p.SetState(155) + p.EnterRule(localctx, 20, bicepParserRULE_forBody) + p.SetState(175) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2456,7 +2838,7 @@ func (p *bicepParser) ForBody() (localctx IForBodyContext) { case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER, bicepParserNUMBER: p.EnterOuterAlt(localctx, 1) { - p.SetState(153) + p.SetState(173) var _x = p.expression(0) @@ -2466,7 +2848,7 @@ func (p *bicepParser) ForBody() (localctx IForBodyContext) { case bicepParserIF: p.EnterOuterAlt(localctx, 2) { - p.SetState(154) + p.SetState(174) p.IfCondition() } @@ -2621,10 +3003,10 @@ func (s *InterpStringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) InterpString() (localctx IInterpStringContext) { localctx = NewInterpStringContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 20, bicepParserRULE_interpString) + p.EnterRule(localctx, 22, bicepParserRULE_interpString) var _alt int - p.SetState(170) + p.SetState(190) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2634,30 +3016,30 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_LEFT_PIECE: p.EnterOuterAlt(localctx, 1) { - p.SetState(157) + p.SetState(177) p.Match(bicepParserSTRING_LEFT_PIECE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(163) + p.SetState(183) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(158) + p.SetState(178) p.expression(0) } { - p.SetState(159) + p.SetState(179) p.Match(bicepParserSTRING_MIDDLE_PIECE) if p.HasError() { // Recognition error - abort rule @@ -2666,22 +3048,22 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { } } - p.SetState(165) + p.SetState(185) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } { - p.SetState(166) + p.SetState(186) p.expression(0) } { - p.SetState(167) + p.SetState(187) p.Match(bicepParserSTRING_RIGHT_PIECE) if p.HasError() { // Recognition error - abort rule @@ -2692,7 +3074,7 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_COMPLETE: p.EnterOuterAlt(localctx, 2) { - p.SetState(169) + p.SetState(189) p.Match(bicepParserSTRING_COMPLETE) if p.HasError() { // Recognition error - abort rule @@ -2938,23 +3320,23 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { localctx = NewExpressionContext(p, p.GetParserRuleContext(), _parentState) var _prevctx IExpressionContext = localctx var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. - _startState := 22 - p.EnterRecursionRule(localctx, 22, bicepParserRULE_expression, _p) + _startState := 24 + p.EnterRecursionRule(localctx, 24, bicepParserRULE_expression, _p) var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(173) + p.SetState(193) p.PrimaryExpression() } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(202) + p.SetState(222) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -2964,24 +3346,24 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(200) + p.SetState(220) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) { case 1: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(175) + p.SetState(195) if !(p.Precpred(p.GetParserRuleContext(), 6)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) goto errorExit } { - p.SetState(176) + p.SetState(196) p.Match(bicepParserQMARK) if p.HasError() { // Recognition error - abort rule @@ -2989,11 +3371,11 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(177) + p.SetState(197) p.expression(0) } { - p.SetState(178) + p.SetState(198) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3001,39 +3383,39 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(179) + p.SetState(199) p.expression(7) } case 2: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(181) + p.SetState(201) if !(p.Precpred(p.GetParserRuleContext(), 2)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) goto errorExit } { - p.SetState(182) + p.SetState(202) p.LogicCharacter() } { - p.SetState(183) + p.SetState(203) p.expression(3) } case 3: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(185) + p.SetState(205) if !(p.Precpred(p.GetParserRuleContext(), 7)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) goto errorExit } { - p.SetState(186) + p.SetState(206) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule @@ -3041,11 +3423,11 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(187) + p.SetState(207) p.expression(0) } { - p.SetState(188) + p.SetState(208) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -3056,14 +3438,14 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 4: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(190) + p.SetState(210) if !(p.Precpred(p.GetParserRuleContext(), 5)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) goto errorExit } { - p.SetState(191) + p.SetState(211) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -3071,7 +3453,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(192) + p.SetState(212) var _x = p.Identifier() @@ -3081,14 +3463,14 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 5: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(193) + p.SetState(213) if !(p.Precpred(p.GetParserRuleContext(), 4)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) goto errorExit } { - p.SetState(194) + p.SetState(214) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3096,7 +3478,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(195) + p.SetState(215) var _x = p.Identifier() @@ -3106,14 +3488,14 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 6: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(196) + p.SetState(216) if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(197) + p.SetState(217) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3121,7 +3503,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(198) + p.SetState(218) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3129,7 +3511,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(199) + p.SetState(219) var _x = p.Identifier() @@ -3141,12 +3523,12 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } - p.SetState(204) + p.SetState(224) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -3260,15 +3642,15 @@ func (s *LogicCharacterContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) LogicCharacter() (localctx ILogicCharacterContext) { localctx = NewLogicCharacterContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 24, bicepParserRULE_logicCharacter) + p.EnterRule(localctx, 26, bicepParserRULE_logicCharacter) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(205) + p.SetState(225) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&270582939648) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&541165879296) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -3478,39 +3860,39 @@ func (s *PrimaryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interf func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { localctx = NewPrimaryExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 26, bicepParserRULE_primaryExpression) - p.SetState(215) + p.EnterRule(localctx, 28, bicepParserRULE_primaryExpression) + p.SetState(235) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(207) + p.SetState(227) p.LiteralValue() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(208) + p.SetState(228) p.FunctionCall() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(209) + p.SetState(229) p.InterpString() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(210) + p.SetState(230) p.Match(bicepParserMULTILINE_STRING) if p.HasError() { // Recognition error - abort rule @@ -3521,28 +3903,28 @@ func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(211) + p.SetState(231) p.Array() } case 6: p.EnterOuterAlt(localctx, 6) { - p.SetState(212) + p.SetState(232) p.Object() } case 7: p.EnterOuterAlt(localctx, 7) { - p.SetState(213) + p.SetState(233) p.ForExpression() } case 8: p.EnterOuterAlt(localctx, 8) { - p.SetState(214) + p.SetState(234) p.ParenthesizedExpression() } @@ -3665,19 +4047,19 @@ func (s *ParenthesizedExpressionContext) Accept(visitor antlr.ParseTreeVisitor) func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressionContext) { localctx = NewParenthesizedExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 28, bicepParserRULE_parenthesizedExpression) + p.EnterRule(localctx, 30, bicepParserRULE_parenthesizedExpression) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(217) + p.SetState(237) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(219) + p.SetState(239) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3686,7 +4068,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(218) + p.SetState(238) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3696,10 +4078,10 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(221) + p.SetState(241) p.expression(0) } - p.SetState(223) + p.SetState(243) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3708,7 +4090,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(222) + p.SetState(242) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3718,7 +4100,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(225) + p.SetState(245) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -3832,10 +4214,10 @@ func (s *TypeExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { localctx = NewTypeExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 30, bicepParserRULE_typeExpression) + p.EnterRule(localctx, 32, bicepParserRULE_typeExpression) p.EnterOuterAlt(localctx, 1) { - p.SetState(227) + p.SetState(247) var _x = p.Identifier() @@ -3957,18 +4339,18 @@ func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { localctx = NewLiteralValueContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 32, bicepParserRULE_literalValue) - p.SetState(234) + p.EnterRule(localctx, 34, bicepParserRULE_literalValue) + p.SetState(254) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 20, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(229) + p.SetState(249) p.Match(bicepParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -3979,7 +4361,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(230) + p.SetState(250) p.Match(bicepParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -3990,7 +4372,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(231) + p.SetState(251) p.Match(bicepParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -4001,7 +4383,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(232) + p.SetState(252) p.Match(bicepParserNULL) if p.HasError() { // Recognition error - abort rule @@ -4012,7 +4394,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(233) + p.SetState(253) p.Identifier() } @@ -4161,19 +4543,19 @@ func (s *ObjectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Object() (localctx IObjectContext) { localctx = NewObjectContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 34, bicepParserRULE_object) + p.EnterRule(localctx, 36, bicepParserRULE_object) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(236) + p.SetState(256) p.Match(bicepParserOBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(253) + p.SetState(273) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4181,7 +4563,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) if _la == bicepParserNL { - p.SetState(238) + p.SetState(258) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4190,7 +4572,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(237) + p.SetState(257) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4198,26 +4580,26 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(240) + p.SetState(260) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(250) + p.SetState(270) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&275133743104) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&550265405440) != 0 { { - p.SetState(242) + p.SetState(262) p.ObjectProperty() } - p.SetState(244) + p.SetState(264) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4226,7 +4608,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(243) + p.SetState(263) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4234,7 +4616,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(246) + p.SetState(266) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4242,7 +4624,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) } - p.SetState(252) + p.SetState(272) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4252,7 +4634,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } { - p.SetState(255) + p.SetState(275) p.Match(bicepParserCBRACE) if p.HasError() { // Recognition error - abort rule @@ -4405,9 +4787,9 @@ func (s *ObjectPropertyContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { localctx = NewObjectPropertyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 36, bicepParserRULE_objectProperty) + p.EnterRule(localctx, 38, bicepParserRULE_objectProperty) p.EnterOuterAlt(localctx, 1) - p.SetState(259) + p.SetState(279) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4416,7 +4798,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: { - p.SetState(257) + p.SetState(277) var _x = p.Identifier() @@ -4425,7 +4807,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: { - p.SetState(258) + p.SetState(278) p.InterpString() } @@ -4434,7 +4816,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { goto errorExit } { - p.SetState(261) + p.SetState(281) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -4442,7 +4824,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } } { - p.SetState(262) + p.SetState(282) p.expression(0) } @@ -4587,19 +4969,19 @@ func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Array() (localctx IArrayContext) { localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 38, bicepParserRULE_array) + p.EnterRule(localctx, 40, bicepParserRULE_array) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(264) + p.SetState(284) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(268) + p.SetState(288) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4608,7 +4990,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for _la == bicepParserNL { { - p.SetState(265) + p.SetState(285) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4616,27 +4998,27 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } } - p.SetState(270) + p.SetState(290) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(274) + p.SetState(294) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&824889561170) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1649777037394) != 0 { { - p.SetState(271) + p.SetState(291) p.ArrayItem() } - p.SetState(276) + p.SetState(296) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4644,7 +5026,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(277) + p.SetState(297) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -4762,22 +5144,22 @@ func (s *ArrayItemContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { localctx = NewArrayItemContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 40, bicepParserRULE_arrayItem) + p.EnterRule(localctx, 42, bicepParserRULE_arrayItem) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(279) + p.SetState(299) p.expression(0) } - p.SetState(286) + p.SetState(306) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { case bicepParserNL: - p.SetState(281) + p.SetState(301) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4786,7 +5168,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(280) + p.SetState(300) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4794,7 +5176,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - p.SetState(283) + p.SetState(303) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4804,7 +5186,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { case bicepParserCOMMA: { - p.SetState(285) + p.SetState(305) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -4922,10 +5304,10 @@ func (s *DecoratorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Decorator() (localctx IDecoratorContext) { localctx = NewDecoratorContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 42, bicepParserRULE_decorator) + p.EnterRule(localctx, 44, bicepParserRULE_decorator) p.EnterOuterAlt(localctx, 1) { - p.SetState(288) + p.SetState(308) p.Match(bicepParserAT) if p.HasError() { // Recognition error - abort rule @@ -4933,11 +5315,11 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { } } { - p.SetState(289) + p.SetState(309) p.DecoratorExpression() } { - p.SetState(290) + p.SetState(310) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5062,29 +5444,29 @@ func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 44, bicepParserRULE_decoratorExpression) - p.SetState(297) + p.EnterRule(localctx, 46, bicepParserRULE_decoratorExpression) + p.SetState(317) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 32, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(292) + p.SetState(312) p.FunctionCall() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(293) + p.SetState(313) p.expression(0) } { - p.SetState(294) + p.SetState(314) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -5092,7 +5474,7 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex } } { - p.SetState(295) + p.SetState(315) p.FunctionCall() } @@ -5232,27 +5614,27 @@ func (s *FunctionCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { localctx = NewFunctionCallContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 46, bicepParserRULE_functionCall) + p.EnterRule(localctx, 48, bicepParserRULE_functionCall) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(299) + p.SetState(319) p.Identifier() } { - p.SetState(300) + p.SetState(320) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(305) + p.SetState(325) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 32, p.GetParserRuleContext()) == 1 { - p.SetState(302) + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 34, p.GetParserRuleContext()) == 1 { + p.SetState(322) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5261,7 +5643,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(301) + p.SetState(321) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5271,14 +5653,14 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(304) + p.SetState(324) p.ArgumentList() } } else if p.HasError() { // JIM goto errorExit } - p.SetState(308) + p.SetState(328) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5287,7 +5669,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(307) + p.SetState(327) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5297,7 +5679,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(310) + p.SetState(330) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -5446,15 +5828,15 @@ func (s *ArgumentListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { localctx = NewArgumentListContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 48, bicepParserRULE_argumentList) + p.EnterRule(localctx, 50, bicepParserRULE_argumentList) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(312) + p.SetState(332) p.expression(0) } - p.SetState(320) + p.SetState(340) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5463,14 +5845,14 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { for _la == bicepParserCOMMA { { - p.SetState(313) + p.SetState(333) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(315) + p.SetState(335) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5479,7 +5861,7 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { if _la == bicepParserNL { { - p.SetState(314) + p.SetState(334) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5489,11 +5871,11 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { } { - p.SetState(317) + p.SetState(337) p.expression(0) } - p.SetState(322) + p.SetState(342) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5634,15 +6016,15 @@ func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Identifier() (localctx IIdentifierContext) { localctx = NewIdentifierContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 50, bicepParserRULE_identifier) + p.EnterRule(localctx, 52, bicepParserRULE_identifier) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(323) + p.SetState(343) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&275114868736) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&550227656704) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -5665,7 +6047,7 @@ errorExit: func (p *bicepParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { switch ruleIndex { - case 11: + case 12: var t *ExpressionContext = nil if localctx != nil { t = localctx.(*ExpressionContext) diff --git a/pkg/parser/bicep/antlr/parser/bicep_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_visitor.go index 7b0ba415ce6..bd888927731 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_visitor.go +++ b/pkg/parser/bicep/antlr/parser/bicep_visitor.go @@ -26,6 +26,9 @@ type bicepVisitor interface { // Visit a parse tree produced by bicepParser#resourceDecl. VisitResourceDecl(ctx *ResourceDeclContext) interface{} + // Visit a parse tree produced by bicepParser#outputDecl. + VisitOutputDecl(ctx *OutputDeclContext) interface{} + // Visit a parse tree produced by bicepParser#ifCondition. VisitIfCondition(ctx *IfConditionContext) interface{} From b24eb43dc573cc37f7dac67c39b4a3327fe3450c Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 8 May 2024 11:21:46 +0100 Subject: [PATCH 094/130] added safety verifications to interpstring visitor --- pkg/parser/bicep/parser.go | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index be3f277d82d..18592f6a21e 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -475,7 +475,11 @@ func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interf func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interface{} { if ctx.GetChildCount() > 1 { interpString := []interface{}{} - interpString = append(interpString, ctx.STRING_LEFT_PIECE().GetText()) + leftPiece := "" + if ctx.STRING_LEFT_PIECE() != nil { + leftPiece = ctx.STRING_LEFT_PIECE().GetText() + } + interpString = append(interpString, leftPiece) if ctx.AllSTRING_MIDDLE_PIECE() != nil && (len(ctx.AllSTRING_MIDDLE_PIECE()) > 0) { for idx, val := range ctx.AllSTRING_MIDDLE_PIECE() { interpString = append(interpString, ctx.Expression(idx).Accept(s), val.GetText()) @@ -483,9 +487,22 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf } // Last expression with string right piece if len(ctx.AllExpression()) > 0 { + expression := "" + if ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())) != nil { + var ok bool + expression, ok = ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())).Accept(s).(string) + if !ok { + expression = "" + } + + } + rightPiece := "" + if ctx.STRING_RIGHT_PIECE() != nil { + rightPiece = ctx.STRING_RIGHT_PIECE().GetText() + } interpString = append(interpString, - ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())).Accept(s), - ctx.STRING_RIGHT_PIECE().GetText()) + expression, + rightPiece) } str := "" for _, v := range interpString { From fe81dc5ccd1c7388bc44a912c515627dae5f84b9 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 8 May 2024 11:22:24 +0100 Subject: [PATCH 095/130] added new elements to grammar to account for more possibilities --- pkg/parser/bicep/antlr/bicep.g4 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index fabfcdaa895..6f94a17eb38 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -3,7 +3,7 @@ grammar bicep; // program -> statement* EOF program: statement* EOF; -statement: parameterDecl | variableDecl | resourceDecl | NL; +statement: parameterDecl | variableDecl | resourceDecl | outputDecl | NL; // parameterDecl -> decorator* "parameter" IDENTIFIER(name) typeExpression parameterDefaultValue? NL // | decorator* "parameter" IDENTIFIER(name) "resource" interpString(type) parameterDefaultValue? NL @@ -23,12 +23,14 @@ variableDecl: // resourceDecl -> decorator* "resource" IDENTIFIER(name) interpString(type) "existing"? "=" (ifCondition | object | forExpression) NL resourceDecl: - decorator* RESOURCE name = identifier type = interpString ASSIGN ( + decorator* RESOURCE name = identifier type = interpString EXISTING? ASSIGN ( ifCondition | object | forExpression ) NL; +outputDecl: decorator* OUTPUT name = identifier (type1 = identifier | RESOURCE type2 = interpString) ASSIGN expression NL; + // ifCondition -> "if" parenthesizedExpression object ifCondition : IF parenthesizedExpression object @@ -61,6 +63,7 @@ expression: expression OBRACK expression CBRACK | expression QMARK expression COL expression | expression DOT property = identifier + | expression DOT functionCall | expression COL name = identifier | expression logicCharacter expression | primaryExpression; @@ -166,6 +169,9 @@ OBJECT: 'object'; RESOURCE: 'resource'; +OUTPUT: 'output'; + +EXISTING: 'existing'; // stringLeftPiece -> "'" STRINGCHAR* "${" STRING_LEFT_PIECE: '\'' STRINGCHAR* '${'; @@ -231,6 +237,10 @@ NUMBER: [0-9]+ ('.' [0-9]+)?; // NL -> ("\n" | "\r")+ NL: [\r\n]+; +SINGLE_LINE_COMMENT: '//' ~[\r\n]* -> skip; + +MULTI_LINE_COMMENT: '/*' .*? '*/' -> skip; + SPACES: [ \t]+ -> skip; UNKNOWN: .; @@ -239,4 +249,4 @@ fragment STRINGCHAR: ~[\\'\n\r\t$] | ESCAPE; fragment ESCAPE: '\\' ([\\'nrt$] | 'u{' HEX+ '}'); -fragment HEX: [0-9a-fA-F]; \ No newline at end of file +fragment HEX: [0-9a-fA-F]; From 279d8fac69d949b2ca8480ed9ae29685de54d707 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 8 May 2024 11:31:11 +0100 Subject: [PATCH 096/130] update bicep grammar to include new elements and safety verifications --- pkg/parser/bicep/antlr/parser/bicep.interp | 8 +- pkg/parser/bicep/antlr/parser/bicep.tokens | 76 +- .../bicep/antlr/parser/bicepLexer.interp | 13 +- .../bicep/antlr/parser/bicepLexer.tokens | 76 +- pkg/parser/bicep/antlr/parser/bicep_lexer.go | 345 ++++---- pkg/parser/bicep/antlr/parser/bicep_parser.go | 793 ++++++++++-------- 6 files changed, 697 insertions(+), 614 deletions(-) diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index 7c2e97fc5fb..98743fee1d5 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -21,6 +21,7 @@ null 'object' 'resource' 'output' +'existing' null null null @@ -69,6 +70,7 @@ NULL OBJECT RESOURCE OUTPUT +EXISTING STRING_LEFT_PIECE STRING_MIDDLE_PIECE STRING_RIGHT_PIECE @@ -89,10 +91,10 @@ NEQ IDENTIFIER NUMBER NL -SPACES -UNKNOWN SINGLE_LINE_COMMENT MULTI_LINE_COMMENT +SPACES +UNKNOWN rule names: program @@ -125,4 +127,4 @@ identifier atn: -[4, 1, 45, 346, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 1, 0, 5, 0, 56, 8, 0, 10, 0, 12, 0, 59, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 68, 8, 1, 1, 2, 5, 2, 71, 8, 2, 10, 2, 12, 2, 74, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 80, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 85, 8, 2, 3, 2, 87, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 95, 8, 4, 10, 4, 12, 4, 98, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 107, 8, 5, 10, 5, 12, 5, 110, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 119, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 124, 8, 6, 10, 6, 12, 6, 127, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 134, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 146, 8, 8, 10, 8, 12, 8, 149, 9, 8, 1, 8, 1, 8, 1, 8, 3, 8, 154, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 161, 8, 8, 10, 8, 12, 8, 164, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 176, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 182, 8, 11, 10, 11, 12, 11, 185, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 191, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 221, 8, 12, 10, 12, 12, 12, 224, 9, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 236, 8, 14, 1, 15, 1, 15, 3, 15, 240, 8, 15, 1, 15, 1, 15, 3, 15, 244, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 255, 8, 17, 1, 18, 1, 18, 4, 18, 259, 8, 18, 11, 18, 12, 18, 260, 1, 18, 1, 18, 4, 18, 265, 8, 18, 11, 18, 12, 18, 266, 5, 18, 269, 8, 18, 10, 18, 12, 18, 272, 9, 18, 3, 18, 274, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 3, 19, 280, 8, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 287, 8, 20, 10, 20, 12, 20, 290, 9, 20, 1, 20, 5, 20, 293, 8, 20, 10, 20, 12, 20, 296, 9, 20, 1, 20, 1, 20, 1, 21, 1, 21, 4, 21, 302, 8, 21, 11, 21, 12, 21, 303, 1, 21, 3, 21, 307, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 318, 8, 23, 1, 24, 1, 24, 1, 24, 3, 24, 323, 8, 24, 1, 24, 3, 24, 326, 8, 24, 1, 24, 3, 24, 329, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 336, 8, 25, 1, 25, 5, 25, 339, 8, 25, 10, 25, 12, 25, 342, 9, 25, 1, 26, 1, 26, 1, 26, 0, 1, 24, 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 2, 1, 0, 33, 38, 3, 0, 14, 20, 26, 28, 39, 39, 374, 0, 57, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, 0, 10, 108, 1, 0, 0, 0, 12, 125, 1, 0, 0, 0, 14, 139, 1, 0, 0, 0, 16, 143, 1, 0, 0, 0, 18, 167, 1, 0, 0, 0, 20, 175, 1, 0, 0, 0, 22, 190, 1, 0, 0, 0, 24, 192, 1, 0, 0, 0, 26, 225, 1, 0, 0, 0, 28, 235, 1, 0, 0, 0, 30, 237, 1, 0, 0, 0, 32, 247, 1, 0, 0, 0, 34, 254, 1, 0, 0, 0, 36, 256, 1, 0, 0, 0, 38, 279, 1, 0, 0, 0, 40, 284, 1, 0, 0, 0, 42, 299, 1, 0, 0, 0, 44, 308, 1, 0, 0, 0, 46, 317, 1, 0, 0, 0, 48, 319, 1, 0, 0, 0, 50, 332, 1, 0, 0, 0, 52, 343, 1, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 60, 61, 5, 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, 2, 0, 63, 68, 3, 8, 4, 0, 64, 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, 68, 5, 41, 0, 0, 67, 62, 1, 0, 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 89, 5, 41, 0, 0, 89, 5, 1, 0, 0, 0, 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 41, 0, 0, 104, 9, 1, 0, 0, 0, 105, 107, 3, 44, 22, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, 113, 114, 3, 22, 11, 0, 114, 118, 5, 11, 0, 0, 115, 119, 3, 14, 7, 0, 116, 119, 3, 36, 18, 0, 117, 119, 3, 16, 8, 0, 118, 115, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 5, 41, 0, 0, 121, 11, 1, 0, 0, 0, 122, 124, 3, 44, 22, 0, 123, 122, 1, 0, 0, 0, 124, 127, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, 129, 5, 21, 0, 0, 129, 133, 3, 52, 26, 0, 130, 134, 3, 52, 26, 0, 131, 132, 5, 20, 0, 0, 132, 134, 3, 22, 11, 0, 133, 130, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 11, 0, 0, 136, 137, 3, 24, 12, 0, 137, 138, 5, 41, 0, 0, 138, 13, 1, 0, 0, 0, 139, 140, 5, 29, 0, 0, 140, 141, 3, 30, 15, 0, 141, 142, 3, 36, 18, 0, 142, 15, 1, 0, 0, 0, 143, 147, 5, 4, 0, 0, 144, 146, 5, 41, 0, 0, 145, 144, 1, 0, 0, 0, 146, 149, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 147, 148, 1, 0, 0, 0, 148, 150, 1, 0, 0, 0, 149, 147, 1, 0, 0, 0, 150, 153, 5, 30, 0, 0, 151, 154, 3, 52, 26, 0, 152, 154, 3, 18, 9, 0, 153, 151, 1, 0, 0, 0, 153, 152, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 5, 31, 0, 0, 156, 157, 3, 24, 12, 0, 157, 158, 5, 10, 0, 0, 158, 162, 3, 20, 10, 0, 159, 161, 5, 41, 0, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 5, 5, 0, 0, 166, 17, 1, 0, 0, 0, 167, 168, 5, 6, 0, 0, 168, 169, 3, 52, 26, 0, 169, 170, 5, 3, 0, 0, 170, 171, 3, 52, 26, 0, 171, 172, 5, 7, 0, 0, 172, 19, 1, 0, 0, 0, 173, 176, 3, 24, 12, 0, 174, 176, 3, 14, 7, 0, 175, 173, 1, 0, 0, 0, 175, 174, 1, 0, 0, 0, 176, 21, 1, 0, 0, 0, 177, 183, 5, 22, 0, 0, 178, 179, 3, 24, 12, 0, 179, 180, 5, 23, 0, 0, 180, 182, 1, 0, 0, 0, 181, 178, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 187, 3, 24, 12, 0, 187, 188, 5, 24, 0, 0, 188, 191, 1, 0, 0, 0, 189, 191, 5, 25, 0, 0, 190, 177, 1, 0, 0, 0, 190, 189, 1, 0, 0, 0, 191, 23, 1, 0, 0, 0, 192, 193, 6, 12, -1, 0, 193, 194, 3, 28, 14, 0, 194, 222, 1, 0, 0, 0, 195, 196, 10, 6, 0, 0, 196, 197, 5, 32, 0, 0, 197, 198, 3, 24, 12, 0, 198, 199, 5, 10, 0, 0, 199, 200, 3, 24, 12, 7, 200, 221, 1, 0, 0, 0, 201, 202, 10, 2, 0, 0, 202, 203, 3, 26, 13, 0, 203, 204, 3, 24, 12, 3, 204, 221, 1, 0, 0, 0, 205, 206, 10, 7, 0, 0, 206, 207, 5, 4, 0, 0, 207, 208, 3, 24, 12, 0, 208, 209, 5, 5, 0, 0, 209, 221, 1, 0, 0, 0, 210, 211, 10, 5, 0, 0, 211, 212, 5, 8, 0, 0, 212, 221, 3, 52, 26, 0, 213, 214, 10, 4, 0, 0, 214, 215, 5, 10, 0, 0, 215, 221, 3, 52, 26, 0, 216, 217, 10, 3, 0, 0, 217, 218, 5, 10, 0, 0, 218, 219, 5, 10, 0, 0, 219, 221, 3, 52, 26, 0, 220, 195, 1, 0, 0, 0, 220, 201, 1, 0, 0, 0, 220, 205, 1, 0, 0, 0, 220, 210, 1, 0, 0, 0, 220, 213, 1, 0, 0, 0, 220, 216, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 25, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 225, 226, 7, 0, 0, 0, 226, 27, 1, 0, 0, 0, 227, 236, 3, 34, 17, 0, 228, 236, 3, 48, 24, 0, 229, 236, 3, 22, 11, 0, 230, 236, 5, 1, 0, 0, 231, 236, 3, 40, 20, 0, 232, 236, 3, 36, 18, 0, 233, 236, 3, 16, 8, 0, 234, 236, 3, 30, 15, 0, 235, 227, 1, 0, 0, 0, 235, 228, 1, 0, 0, 0, 235, 229, 1, 0, 0, 0, 235, 230, 1, 0, 0, 0, 235, 231, 1, 0, 0, 0, 235, 232, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 235, 234, 1, 0, 0, 0, 236, 29, 1, 0, 0, 0, 237, 239, 5, 6, 0, 0, 238, 240, 5, 41, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 3, 24, 12, 0, 242, 244, 5, 41, 0, 0, 243, 242, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, 5, 7, 0, 0, 246, 31, 1, 0, 0, 0, 247, 248, 3, 52, 26, 0, 248, 33, 1, 0, 0, 0, 249, 255, 5, 40, 0, 0, 250, 255, 5, 16, 0, 0, 251, 255, 5, 17, 0, 0, 252, 255, 5, 18, 0, 0, 253, 255, 3, 52, 26, 0, 254, 249, 1, 0, 0, 0, 254, 250, 1, 0, 0, 0, 254, 251, 1, 0, 0, 0, 254, 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, 0, 255, 35, 1, 0, 0, 0, 256, 273, 5, 12, 0, 0, 257, 259, 5, 41, 0, 0, 258, 257, 1, 0, 0, 0, 259, 260, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 270, 1, 0, 0, 0, 262, 264, 3, 38, 19, 0, 263, 265, 5, 41, 0, 0, 264, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 269, 1, 0, 0, 0, 268, 262, 1, 0, 0, 0, 269, 272, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 273, 258, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 276, 5, 13, 0, 0, 276, 37, 1, 0, 0, 0, 277, 280, 3, 52, 26, 0, 278, 280, 3, 22, 11, 0, 279, 277, 1, 0, 0, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 282, 5, 10, 0, 0, 282, 283, 3, 24, 12, 0, 283, 39, 1, 0, 0, 0, 284, 288, 5, 4, 0, 0, 285, 287, 5, 41, 0, 0, 286, 285, 1, 0, 0, 0, 287, 290, 1, 0, 0, 0, 288, 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 294, 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 291, 293, 3, 42, 21, 0, 292, 291, 1, 0, 0, 0, 293, 296, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 297, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 297, 298, 5, 5, 0, 0, 298, 41, 1, 0, 0, 0, 299, 306, 3, 24, 12, 0, 300, 302, 5, 41, 0, 0, 301, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 307, 1, 0, 0, 0, 305, 307, 5, 3, 0, 0, 306, 301, 1, 0, 0, 0, 306, 305, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 43, 1, 0, 0, 0, 308, 309, 5, 2, 0, 0, 309, 310, 3, 46, 23, 0, 310, 311, 5, 41, 0, 0, 311, 45, 1, 0, 0, 0, 312, 318, 3, 48, 24, 0, 313, 314, 3, 24, 12, 0, 314, 315, 5, 8, 0, 0, 315, 316, 3, 48, 24, 0, 316, 318, 1, 0, 0, 0, 317, 312, 1, 0, 0, 0, 317, 313, 1, 0, 0, 0, 318, 47, 1, 0, 0, 0, 319, 320, 3, 52, 26, 0, 320, 325, 5, 6, 0, 0, 321, 323, 5, 41, 0, 0, 322, 321, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 324, 1, 0, 0, 0, 324, 326, 3, 50, 25, 0, 325, 322, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 328, 1, 0, 0, 0, 327, 329, 5, 41, 0, 0, 328, 327, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 5, 7, 0, 0, 331, 49, 1, 0, 0, 0, 332, 340, 3, 24, 12, 0, 333, 335, 5, 3, 0, 0, 334, 336, 5, 41, 0, 0, 335, 334, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 339, 3, 24, 12, 0, 338, 333, 1, 0, 0, 0, 339, 342, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 51, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 343, 344, 7, 1, 0, 0, 344, 53, 1, 0, 0, 0, 38, 57, 67, 72, 79, 84, 86, 96, 108, 118, 125, 133, 147, 153, 162, 175, 183, 190, 220, 222, 235, 239, 243, 254, 260, 266, 270, 273, 279, 288, 294, 303, 306, 317, 322, 325, 328, 335, 340] \ No newline at end of file +[4, 1, 46, 352, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 1, 0, 5, 0, 56, 8, 0, 10, 0, 12, 0, 59, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 68, 8, 1, 1, 2, 5, 2, 71, 8, 2, 10, 2, 12, 2, 74, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 80, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 85, 8, 2, 3, 2, 87, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 95, 8, 4, 10, 4, 12, 4, 98, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 107, 8, 5, 10, 5, 12, 5, 110, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 122, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 127, 8, 6, 10, 6, 12, 6, 130, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 137, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 149, 8, 8, 10, 8, 12, 8, 152, 9, 8, 1, 8, 1, 8, 1, 8, 3, 8, 157, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 164, 8, 8, 10, 8, 12, 8, 167, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 179, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 185, 8, 11, 10, 11, 12, 11, 188, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 194, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 227, 8, 12, 10, 12, 12, 12, 230, 9, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 242, 8, 14, 1, 15, 1, 15, 3, 15, 246, 8, 15, 1, 15, 1, 15, 3, 15, 250, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 261, 8, 17, 1, 18, 1, 18, 4, 18, 265, 8, 18, 11, 18, 12, 18, 266, 1, 18, 1, 18, 4, 18, 271, 8, 18, 11, 18, 12, 18, 272, 5, 18, 275, 8, 18, 10, 18, 12, 18, 278, 9, 18, 3, 18, 280, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 3, 19, 286, 8, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 293, 8, 20, 10, 20, 12, 20, 296, 9, 20, 1, 20, 5, 20, 299, 8, 20, 10, 20, 12, 20, 302, 9, 20, 1, 20, 1, 20, 1, 21, 1, 21, 4, 21, 308, 8, 21, 11, 21, 12, 21, 309, 1, 21, 3, 21, 313, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 324, 8, 23, 1, 24, 1, 24, 1, 24, 3, 24, 329, 8, 24, 1, 24, 3, 24, 332, 8, 24, 1, 24, 3, 24, 335, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 342, 8, 25, 1, 25, 5, 25, 345, 8, 25, 10, 25, 12, 25, 348, 9, 25, 1, 26, 1, 26, 1, 26, 0, 1, 24, 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 2, 1, 0, 34, 39, 3, 0, 14, 20, 27, 29, 40, 40, 382, 0, 57, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, 0, 10, 108, 1, 0, 0, 0, 12, 128, 1, 0, 0, 0, 14, 142, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 170, 1, 0, 0, 0, 20, 178, 1, 0, 0, 0, 22, 193, 1, 0, 0, 0, 24, 195, 1, 0, 0, 0, 26, 231, 1, 0, 0, 0, 28, 241, 1, 0, 0, 0, 30, 243, 1, 0, 0, 0, 32, 253, 1, 0, 0, 0, 34, 260, 1, 0, 0, 0, 36, 262, 1, 0, 0, 0, 38, 285, 1, 0, 0, 0, 40, 290, 1, 0, 0, 0, 42, 305, 1, 0, 0, 0, 44, 314, 1, 0, 0, 0, 46, 323, 1, 0, 0, 0, 48, 325, 1, 0, 0, 0, 50, 338, 1, 0, 0, 0, 52, 349, 1, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 60, 61, 5, 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, 2, 0, 63, 68, 3, 8, 4, 0, 64, 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, 68, 5, 42, 0, 0, 67, 62, 1, 0, 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 89, 5, 42, 0, 0, 89, 5, 1, 0, 0, 0, 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 42, 0, 0, 104, 9, 1, 0, 0, 0, 105, 107, 3, 44, 22, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, 113, 115, 3, 22, 11, 0, 114, 116, 5, 22, 0, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 121, 5, 11, 0, 0, 118, 122, 3, 14, 7, 0, 119, 122, 3, 36, 18, 0, 120, 122, 3, 16, 8, 0, 121, 118, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 5, 42, 0, 0, 124, 11, 1, 0, 0, 0, 125, 127, 3, 44, 22, 0, 126, 125, 1, 0, 0, 0, 127, 130, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 131, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 132, 5, 21, 0, 0, 132, 136, 3, 52, 26, 0, 133, 137, 3, 52, 26, 0, 134, 135, 5, 20, 0, 0, 135, 137, 3, 22, 11, 0, 136, 133, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 11, 0, 0, 139, 140, 3, 24, 12, 0, 140, 141, 5, 42, 0, 0, 141, 13, 1, 0, 0, 0, 142, 143, 5, 30, 0, 0, 143, 144, 3, 30, 15, 0, 144, 145, 3, 36, 18, 0, 145, 15, 1, 0, 0, 0, 146, 150, 5, 4, 0, 0, 147, 149, 5, 42, 0, 0, 148, 147, 1, 0, 0, 0, 149, 152, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, 156, 5, 31, 0, 0, 154, 157, 3, 52, 26, 0, 155, 157, 3, 18, 9, 0, 156, 154, 1, 0, 0, 0, 156, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 159, 5, 32, 0, 0, 159, 160, 3, 24, 12, 0, 160, 161, 5, 10, 0, 0, 161, 165, 3, 20, 10, 0, 162, 164, 5, 42, 0, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 5, 0, 0, 169, 17, 1, 0, 0, 0, 170, 171, 5, 6, 0, 0, 171, 172, 3, 52, 26, 0, 172, 173, 5, 3, 0, 0, 173, 174, 3, 52, 26, 0, 174, 175, 5, 7, 0, 0, 175, 19, 1, 0, 0, 0, 176, 179, 3, 24, 12, 0, 177, 179, 3, 14, 7, 0, 178, 176, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 21, 1, 0, 0, 0, 180, 186, 5, 23, 0, 0, 181, 182, 3, 24, 12, 0, 182, 183, 5, 24, 0, 0, 183, 185, 1, 0, 0, 0, 184, 181, 1, 0, 0, 0, 185, 188, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 186, 187, 1, 0, 0, 0, 187, 189, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 189, 190, 3, 24, 12, 0, 190, 191, 5, 25, 0, 0, 191, 194, 1, 0, 0, 0, 192, 194, 5, 26, 0, 0, 193, 180, 1, 0, 0, 0, 193, 192, 1, 0, 0, 0, 194, 23, 1, 0, 0, 0, 195, 196, 6, 12, -1, 0, 196, 197, 3, 28, 14, 0, 197, 228, 1, 0, 0, 0, 198, 199, 10, 7, 0, 0, 199, 200, 5, 33, 0, 0, 200, 201, 3, 24, 12, 0, 201, 202, 5, 10, 0, 0, 202, 203, 3, 24, 12, 8, 203, 227, 1, 0, 0, 0, 204, 205, 10, 2, 0, 0, 205, 206, 3, 26, 13, 0, 206, 207, 3, 24, 12, 3, 207, 227, 1, 0, 0, 0, 208, 209, 10, 8, 0, 0, 209, 210, 5, 4, 0, 0, 210, 211, 3, 24, 12, 0, 211, 212, 5, 5, 0, 0, 212, 227, 1, 0, 0, 0, 213, 214, 10, 6, 0, 0, 214, 215, 5, 8, 0, 0, 215, 227, 3, 52, 26, 0, 216, 217, 10, 5, 0, 0, 217, 218, 5, 8, 0, 0, 218, 227, 3, 48, 24, 0, 219, 220, 10, 4, 0, 0, 220, 221, 5, 10, 0, 0, 221, 227, 3, 52, 26, 0, 222, 223, 10, 3, 0, 0, 223, 224, 5, 10, 0, 0, 224, 225, 5, 10, 0, 0, 225, 227, 3, 52, 26, 0, 226, 198, 1, 0, 0, 0, 226, 204, 1, 0, 0, 0, 226, 208, 1, 0, 0, 0, 226, 213, 1, 0, 0, 0, 226, 216, 1, 0, 0, 0, 226, 219, 1, 0, 0, 0, 226, 222, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 25, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, 7, 0, 0, 0, 232, 27, 1, 0, 0, 0, 233, 242, 3, 34, 17, 0, 234, 242, 3, 48, 24, 0, 235, 242, 3, 22, 11, 0, 236, 242, 5, 1, 0, 0, 237, 242, 3, 40, 20, 0, 238, 242, 3, 36, 18, 0, 239, 242, 3, 16, 8, 0, 240, 242, 3, 30, 15, 0, 241, 233, 1, 0, 0, 0, 241, 234, 1, 0, 0, 0, 241, 235, 1, 0, 0, 0, 241, 236, 1, 0, 0, 0, 241, 237, 1, 0, 0, 0, 241, 238, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 240, 1, 0, 0, 0, 242, 29, 1, 0, 0, 0, 243, 245, 5, 6, 0, 0, 244, 246, 5, 42, 0, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 249, 3, 24, 12, 0, 248, 250, 5, 42, 0, 0, 249, 248, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 5, 7, 0, 0, 252, 31, 1, 0, 0, 0, 253, 254, 3, 52, 26, 0, 254, 33, 1, 0, 0, 0, 255, 261, 5, 41, 0, 0, 256, 261, 5, 16, 0, 0, 257, 261, 5, 17, 0, 0, 258, 261, 5, 18, 0, 0, 259, 261, 3, 52, 26, 0, 260, 255, 1, 0, 0, 0, 260, 256, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, 259, 1, 0, 0, 0, 261, 35, 1, 0, 0, 0, 262, 279, 5, 12, 0, 0, 263, 265, 5, 42, 0, 0, 264, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 276, 1, 0, 0, 0, 268, 270, 3, 38, 19, 0, 269, 271, 5, 42, 0, 0, 270, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1, 0, 0, 0, 274, 268, 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 280, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 279, 264, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 282, 5, 13, 0, 0, 282, 37, 1, 0, 0, 0, 283, 286, 3, 52, 26, 0, 284, 286, 3, 22, 11, 0, 285, 283, 1, 0, 0, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 288, 5, 10, 0, 0, 288, 289, 3, 24, 12, 0, 289, 39, 1, 0, 0, 0, 290, 294, 5, 4, 0, 0, 291, 293, 5, 42, 0, 0, 292, 291, 1, 0, 0, 0, 293, 296, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 300, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 297, 299, 3, 42, 21, 0, 298, 297, 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 303, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 303, 304, 5, 5, 0, 0, 304, 41, 1, 0, 0, 0, 305, 312, 3, 24, 12, 0, 306, 308, 5, 42, 0, 0, 307, 306, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 307, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 313, 1, 0, 0, 0, 311, 313, 5, 3, 0, 0, 312, 307, 1, 0, 0, 0, 312, 311, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 43, 1, 0, 0, 0, 314, 315, 5, 2, 0, 0, 315, 316, 3, 46, 23, 0, 316, 317, 5, 42, 0, 0, 317, 45, 1, 0, 0, 0, 318, 324, 3, 48, 24, 0, 319, 320, 3, 24, 12, 0, 320, 321, 5, 8, 0, 0, 321, 322, 3, 48, 24, 0, 322, 324, 1, 0, 0, 0, 323, 318, 1, 0, 0, 0, 323, 319, 1, 0, 0, 0, 324, 47, 1, 0, 0, 0, 325, 326, 3, 52, 26, 0, 326, 331, 5, 6, 0, 0, 327, 329, 5, 42, 0, 0, 328, 327, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 332, 3, 50, 25, 0, 331, 328, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 334, 1, 0, 0, 0, 333, 335, 5, 42, 0, 0, 334, 333, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 337, 5, 7, 0, 0, 337, 49, 1, 0, 0, 0, 338, 346, 3, 24, 12, 0, 339, 341, 5, 3, 0, 0, 340, 342, 5, 42, 0, 0, 341, 340, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 345, 3, 24, 12, 0, 344, 339, 1, 0, 0, 0, 345, 348, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 51, 1, 0, 0, 0, 348, 346, 1, 0, 0, 0, 349, 350, 7, 1, 0, 0, 350, 53, 1, 0, 0, 0, 39, 57, 67, 72, 79, 84, 86, 96, 108, 115, 121, 128, 136, 150, 156, 165, 178, 186, 193, 226, 228, 241, 245, 249, 260, 266, 272, 276, 279, 285, 294, 300, 309, 312, 323, 328, 331, 334, 341, 346] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep.tokens b/pkg/parser/bicep/antlr/parser/bicep.tokens index 1acd1434f3b..cd100fb8ade 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.tokens +++ b/pkg/parser/bicep/antlr/parser/bicep.tokens @@ -19,30 +19,31 @@ NULL=18 OBJECT=19 RESOURCE=20 OUTPUT=21 -STRING_LEFT_PIECE=22 -STRING_MIDDLE_PIECE=23 -STRING_RIGHT_PIECE=24 -STRING_COMPLETE=25 -STRING=26 -INT=27 -BOOL=28 -IF=29 -FOR=30 -IN=31 -QMARK=32 -GT=33 -GTE=34 -LT=35 -LTE=36 -EQ=37 -NEQ=38 -IDENTIFIER=39 -NUMBER=40 -NL=41 -SPACES=42 -UNKNOWN=43 -SINGLE_LINE_COMMENT=44 -MULTI_LINE_COMMENT=45 +EXISTING=22 +STRING_LEFT_PIECE=23 +STRING_MIDDLE_PIECE=24 +STRING_RIGHT_PIECE=25 +STRING_COMPLETE=26 +STRING=27 +INT=28 +BOOL=29 +IF=30 +FOR=31 +IN=32 +QMARK=33 +GT=34 +GTE=35 +LT=36 +LTE=37 +EQ=38 +NEQ=39 +IDENTIFIER=40 +NUMBER=41 +NL=42 +SINGLE_LINE_COMMENT=43 +MULTI_LINE_COMMENT=44 +SPACES=45 +UNKNOWN=46 '@'=2 ','=3 '['=4 @@ -63,16 +64,17 @@ MULTI_LINE_COMMENT=45 'object'=19 'resource'=20 'output'=21 -'string'=26 -'int'=27 -'bool'=28 -'if'=29 -'for'=30 -'in'=31 -'?'=32 -'>'=33 -'>='=34 -'<'=35 -'<='=36 -'=='=37 -'!='=38 +'existing'=22 +'string'=27 +'int'=28 +'bool'=29 +'if'=30 +'for'=31 +'in'=32 +'?'=33 +'>'=34 +'>='=35 +'<'=36 +'<='=37 +'=='=38 +'!='=39 diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.interp b/pkg/parser/bicep/antlr/parser/bicepLexer.interp index 5fc4858f06c..5e7df48a0fe 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.interp +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.interp @@ -21,6 +21,7 @@ null 'object' 'resource' 'output' +'existing' null null null @@ -69,6 +70,7 @@ NULL OBJECT RESOURCE OUTPUT +EXISTING STRING_LEFT_PIECE STRING_MIDDLE_PIECE STRING_RIGHT_PIECE @@ -89,10 +91,10 @@ NEQ IDENTIFIER NUMBER NL -SPACES -UNKNOWN SINGLE_LINE_COMMENT MULTI_LINE_COMMENT +SPACES +UNKNOWN rule names: MULTILINE_STRING @@ -116,6 +118,7 @@ NULL OBJECT RESOURCE OUTPUT +EXISTING STRING_LEFT_PIECE STRING_MIDDLE_PIECE STRING_RIGHT_PIECE @@ -136,10 +139,10 @@ NEQ IDENTIFIER NUMBER NL -SPACES -UNKNOWN SINGLE_LINE_COMMENT MULTI_LINE_COMMENT +SPACES +UNKNOWN STRINGCHAR ESCAPE HEX @@ -152,4 +155,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 45, 345, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 103, 8, 0, 10, 0, 12, 0, 106, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 187, 8, 21, 10, 21, 12, 21, 190, 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 197, 8, 22, 10, 22, 12, 22, 200, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 207, 8, 23, 10, 23, 12, 23, 210, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 216, 8, 24, 10, 24, 12, 24, 219, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 5, 38, 269, 8, 38, 10, 38, 12, 38, 272, 9, 38, 1, 39, 4, 39, 275, 8, 39, 11, 39, 12, 39, 276, 1, 39, 1, 39, 4, 39, 281, 8, 39, 11, 39, 12, 39, 282, 3, 39, 285, 8, 39, 1, 40, 4, 40, 288, 8, 40, 11, 40, 12, 40, 289, 1, 41, 4, 41, 293, 8, 41, 11, 41, 12, 41, 294, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 305, 8, 43, 10, 43, 12, 43, 308, 9, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 316, 8, 44, 10, 44, 12, 44, 319, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 3, 45, 328, 8, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 4, 46, 336, 8, 46, 11, 46, 12, 46, 337, 1, 46, 1, 46, 3, 46, 342, 8, 46, 1, 47, 1, 47, 2, 104, 317, 0, 48, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 0, 93, 0, 95, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 357, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 1, 97, 1, 0, 0, 0, 3, 111, 1, 0, 0, 0, 5, 113, 1, 0, 0, 0, 7, 115, 1, 0, 0, 0, 9, 117, 1, 0, 0, 0, 11, 119, 1, 0, 0, 0, 13, 121, 1, 0, 0, 0, 15, 123, 1, 0, 0, 0, 17, 125, 1, 0, 0, 0, 19, 127, 1, 0, 0, 0, 21, 129, 1, 0, 0, 0, 23, 131, 1, 0, 0, 0, 25, 133, 1, 0, 0, 0, 27, 135, 1, 0, 0, 0, 29, 141, 1, 0, 0, 0, 31, 145, 1, 0, 0, 0, 33, 150, 1, 0, 0, 0, 35, 156, 1, 0, 0, 0, 37, 161, 1, 0, 0, 0, 39, 168, 1, 0, 0, 0, 41, 177, 1, 0, 0, 0, 43, 184, 1, 0, 0, 0, 45, 194, 1, 0, 0, 0, 47, 204, 1, 0, 0, 0, 49, 213, 1, 0, 0, 0, 51, 222, 1, 0, 0, 0, 53, 229, 1, 0, 0, 0, 55, 233, 1, 0, 0, 0, 57, 238, 1, 0, 0, 0, 59, 241, 1, 0, 0, 0, 61, 245, 1, 0, 0, 0, 63, 248, 1, 0, 0, 0, 65, 250, 1, 0, 0, 0, 67, 252, 1, 0, 0, 0, 69, 255, 1, 0, 0, 0, 71, 257, 1, 0, 0, 0, 73, 260, 1, 0, 0, 0, 75, 263, 1, 0, 0, 0, 77, 266, 1, 0, 0, 0, 79, 274, 1, 0, 0, 0, 81, 287, 1, 0, 0, 0, 83, 292, 1, 0, 0, 0, 85, 298, 1, 0, 0, 0, 87, 300, 1, 0, 0, 0, 89, 311, 1, 0, 0, 0, 91, 327, 1, 0, 0, 0, 93, 329, 1, 0, 0, 0, 95, 343, 1, 0, 0, 0, 97, 98, 5, 39, 0, 0, 98, 99, 5, 39, 0, 0, 99, 100, 5, 39, 0, 0, 100, 104, 1, 0, 0, 0, 101, 103, 9, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 39, 0, 0, 108, 109, 5, 39, 0, 0, 109, 110, 5, 39, 0, 0, 110, 2, 1, 0, 0, 0, 111, 112, 5, 64, 0, 0, 112, 4, 1, 0, 0, 0, 113, 114, 5, 44, 0, 0, 114, 6, 1, 0, 0, 0, 115, 116, 5, 91, 0, 0, 116, 8, 1, 0, 0, 0, 117, 118, 5, 93, 0, 0, 118, 10, 1, 0, 0, 0, 119, 120, 5, 40, 0, 0, 120, 12, 1, 0, 0, 0, 121, 122, 5, 41, 0, 0, 122, 14, 1, 0, 0, 0, 123, 124, 5, 46, 0, 0, 124, 16, 1, 0, 0, 0, 125, 126, 5, 124, 0, 0, 126, 18, 1, 0, 0, 0, 127, 128, 5, 58, 0, 0, 128, 20, 1, 0, 0, 0, 129, 130, 5, 61, 0, 0, 130, 22, 1, 0, 0, 0, 131, 132, 5, 123, 0, 0, 132, 24, 1, 0, 0, 0, 133, 134, 5, 125, 0, 0, 134, 26, 1, 0, 0, 0, 135, 136, 5, 112, 0, 0, 136, 137, 5, 97, 0, 0, 137, 138, 5, 114, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 109, 0, 0, 140, 28, 1, 0, 0, 0, 141, 142, 5, 118, 0, 0, 142, 143, 5, 97, 0, 0, 143, 144, 5, 114, 0, 0, 144, 30, 1, 0, 0, 0, 145, 146, 5, 116, 0, 0, 146, 147, 5, 114, 0, 0, 147, 148, 5, 117, 0, 0, 148, 149, 5, 101, 0, 0, 149, 32, 1, 0, 0, 0, 150, 151, 5, 102, 0, 0, 151, 152, 5, 97, 0, 0, 152, 153, 5, 108, 0, 0, 153, 154, 5, 115, 0, 0, 154, 155, 5, 101, 0, 0, 155, 34, 1, 0, 0, 0, 156, 157, 5, 110, 0, 0, 157, 158, 5, 117, 0, 0, 158, 159, 5, 108, 0, 0, 159, 160, 5, 108, 0, 0, 160, 36, 1, 0, 0, 0, 161, 162, 5, 111, 0, 0, 162, 163, 5, 98, 0, 0, 163, 164, 5, 106, 0, 0, 164, 165, 5, 101, 0, 0, 165, 166, 5, 99, 0, 0, 166, 167, 5, 116, 0, 0, 167, 38, 1, 0, 0, 0, 168, 169, 5, 114, 0, 0, 169, 170, 5, 101, 0, 0, 170, 171, 5, 115, 0, 0, 171, 172, 5, 111, 0, 0, 172, 173, 5, 117, 0, 0, 173, 174, 5, 114, 0, 0, 174, 175, 5, 99, 0, 0, 175, 176, 5, 101, 0, 0, 176, 40, 1, 0, 0, 0, 177, 178, 5, 111, 0, 0, 178, 179, 5, 117, 0, 0, 179, 180, 5, 116, 0, 0, 180, 181, 5, 112, 0, 0, 181, 182, 5, 117, 0, 0, 182, 183, 5, 116, 0, 0, 183, 42, 1, 0, 0, 0, 184, 188, 5, 39, 0, 0, 185, 187, 3, 91, 45, 0, 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 191, 192, 5, 36, 0, 0, 192, 193, 5, 123, 0, 0, 193, 44, 1, 0, 0, 0, 194, 198, 5, 125, 0, 0, 195, 197, 3, 91, 45, 0, 196, 195, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 201, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 202, 5, 36, 0, 0, 202, 203, 5, 123, 0, 0, 203, 46, 1, 0, 0, 0, 204, 208, 5, 125, 0, 0, 205, 207, 3, 91, 45, 0, 206, 205, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 211, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 5, 39, 0, 0, 212, 48, 1, 0, 0, 0, 213, 217, 5, 39, 0, 0, 214, 216, 3, 91, 45, 0, 215, 214, 1, 0, 0, 0, 216, 219, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 220, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 220, 221, 5, 39, 0, 0, 221, 50, 1, 0, 0, 0, 222, 223, 5, 115, 0, 0, 223, 224, 5, 116, 0, 0, 224, 225, 5, 114, 0, 0, 225, 226, 5, 105, 0, 0, 226, 227, 5, 110, 0, 0, 227, 228, 5, 103, 0, 0, 228, 52, 1, 0, 0, 0, 229, 230, 5, 105, 0, 0, 230, 231, 5, 110, 0, 0, 231, 232, 5, 116, 0, 0, 232, 54, 1, 0, 0, 0, 233, 234, 5, 98, 0, 0, 234, 235, 5, 111, 0, 0, 235, 236, 5, 111, 0, 0, 236, 237, 5, 108, 0, 0, 237, 56, 1, 0, 0, 0, 238, 239, 5, 105, 0, 0, 239, 240, 5, 102, 0, 0, 240, 58, 1, 0, 0, 0, 241, 242, 5, 102, 0, 0, 242, 243, 5, 111, 0, 0, 243, 244, 5, 114, 0, 0, 244, 60, 1, 0, 0, 0, 245, 246, 5, 105, 0, 0, 246, 247, 5, 110, 0, 0, 247, 62, 1, 0, 0, 0, 248, 249, 5, 63, 0, 0, 249, 64, 1, 0, 0, 0, 250, 251, 5, 62, 0, 0, 251, 66, 1, 0, 0, 0, 252, 253, 5, 62, 0, 0, 253, 254, 5, 61, 0, 0, 254, 68, 1, 0, 0, 0, 255, 256, 5, 60, 0, 0, 256, 70, 1, 0, 0, 0, 257, 258, 5, 60, 0, 0, 258, 259, 5, 61, 0, 0, 259, 72, 1, 0, 0, 0, 260, 261, 5, 61, 0, 0, 261, 262, 5, 61, 0, 0, 262, 74, 1, 0, 0, 0, 263, 264, 5, 33, 0, 0, 264, 265, 5, 61, 0, 0, 265, 76, 1, 0, 0, 0, 266, 270, 7, 0, 0, 0, 267, 269, 7, 1, 0, 0, 268, 267, 1, 0, 0, 0, 269, 272, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 78, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 273, 275, 7, 2, 0, 0, 274, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 284, 1, 0, 0, 0, 278, 280, 5, 46, 0, 0, 279, 281, 7, 2, 0, 0, 280, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 278, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 80, 1, 0, 0, 0, 286, 288, 7, 3, 0, 0, 287, 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 82, 1, 0, 0, 0, 291, 293, 7, 4, 0, 0, 292, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 6, 41, 0, 0, 297, 84, 1, 0, 0, 0, 298, 299, 9, 0, 0, 0, 299, 86, 1, 0, 0, 0, 300, 301, 5, 47, 0, 0, 301, 302, 5, 47, 0, 0, 302, 306, 1, 0, 0, 0, 303, 305, 8, 3, 0, 0, 304, 303, 1, 0, 0, 0, 305, 308, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 310, 6, 43, 0, 0, 310, 88, 1, 0, 0, 0, 311, 312, 5, 47, 0, 0, 312, 313, 5, 42, 0, 0, 313, 317, 1, 0, 0, 0, 314, 316, 9, 0, 0, 0, 315, 314, 1, 0, 0, 0, 316, 319, 1, 0, 0, 0, 317, 318, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 320, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 320, 321, 5, 42, 0, 0, 321, 322, 5, 47, 0, 0, 322, 323, 1, 0, 0, 0, 323, 324, 6, 44, 0, 0, 324, 90, 1, 0, 0, 0, 325, 328, 8, 5, 0, 0, 326, 328, 3, 93, 46, 0, 327, 325, 1, 0, 0, 0, 327, 326, 1, 0, 0, 0, 328, 92, 1, 0, 0, 0, 329, 341, 5, 92, 0, 0, 330, 342, 7, 6, 0, 0, 331, 332, 5, 117, 0, 0, 332, 333, 5, 123, 0, 0, 333, 335, 1, 0, 0, 0, 334, 336, 3, 95, 47, 0, 335, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 340, 5, 125, 0, 0, 340, 342, 1, 0, 0, 0, 341, 330, 1, 0, 0, 0, 341, 331, 1, 0, 0, 0, 342, 94, 1, 0, 0, 0, 343, 344, 7, 7, 0, 0, 344, 96, 1, 0, 0, 0, 17, 0, 104, 188, 198, 208, 217, 270, 276, 282, 284, 289, 294, 306, 317, 327, 337, 341, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 46, 356, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 105, 8, 0, 10, 0, 12, 0, 108, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 198, 8, 22, 10, 22, 12, 22, 201, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 208, 8, 23, 10, 23, 12, 23, 211, 9, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 218, 8, 24, 10, 24, 12, 24, 221, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 227, 8, 25, 10, 25, 12, 25, 230, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 5, 39, 280, 8, 39, 10, 39, 12, 39, 283, 9, 39, 1, 40, 4, 40, 286, 8, 40, 11, 40, 12, 40, 287, 1, 40, 1, 40, 4, 40, 292, 8, 40, 11, 40, 12, 40, 293, 3, 40, 296, 8, 40, 1, 41, 4, 41, 299, 8, 41, 11, 41, 12, 41, 300, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 307, 8, 42, 10, 42, 12, 42, 310, 9, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 318, 8, 43, 10, 43, 12, 43, 321, 9, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 4, 44, 329, 8, 44, 11, 44, 12, 44, 330, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 339, 8, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 4, 47, 347, 8, 47, 11, 47, 12, 47, 348, 1, 47, 1, 47, 3, 47, 353, 8, 47, 1, 48, 1, 48, 2, 106, 319, 0, 49, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 0, 95, 0, 97, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 368, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 1, 99, 1, 0, 0, 0, 3, 113, 1, 0, 0, 0, 5, 115, 1, 0, 0, 0, 7, 117, 1, 0, 0, 0, 9, 119, 1, 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 123, 1, 0, 0, 0, 15, 125, 1, 0, 0, 0, 17, 127, 1, 0, 0, 0, 19, 129, 1, 0, 0, 0, 21, 131, 1, 0, 0, 0, 23, 133, 1, 0, 0, 0, 25, 135, 1, 0, 0, 0, 27, 137, 1, 0, 0, 0, 29, 143, 1, 0, 0, 0, 31, 147, 1, 0, 0, 0, 33, 152, 1, 0, 0, 0, 35, 158, 1, 0, 0, 0, 37, 163, 1, 0, 0, 0, 39, 170, 1, 0, 0, 0, 41, 179, 1, 0, 0, 0, 43, 186, 1, 0, 0, 0, 45, 195, 1, 0, 0, 0, 47, 205, 1, 0, 0, 0, 49, 215, 1, 0, 0, 0, 51, 224, 1, 0, 0, 0, 53, 233, 1, 0, 0, 0, 55, 240, 1, 0, 0, 0, 57, 244, 1, 0, 0, 0, 59, 249, 1, 0, 0, 0, 61, 252, 1, 0, 0, 0, 63, 256, 1, 0, 0, 0, 65, 259, 1, 0, 0, 0, 67, 261, 1, 0, 0, 0, 69, 263, 1, 0, 0, 0, 71, 266, 1, 0, 0, 0, 73, 268, 1, 0, 0, 0, 75, 271, 1, 0, 0, 0, 77, 274, 1, 0, 0, 0, 79, 277, 1, 0, 0, 0, 81, 285, 1, 0, 0, 0, 83, 298, 1, 0, 0, 0, 85, 302, 1, 0, 0, 0, 87, 313, 1, 0, 0, 0, 89, 328, 1, 0, 0, 0, 91, 334, 1, 0, 0, 0, 93, 338, 1, 0, 0, 0, 95, 340, 1, 0, 0, 0, 97, 354, 1, 0, 0, 0, 99, 100, 5, 39, 0, 0, 100, 101, 5, 39, 0, 0, 101, 102, 5, 39, 0, 0, 102, 106, 1, 0, 0, 0, 103, 105, 9, 0, 0, 0, 104, 103, 1, 0, 0, 0, 105, 108, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 109, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, 5, 39, 0, 0, 111, 112, 5, 39, 0, 0, 112, 2, 1, 0, 0, 0, 113, 114, 5, 64, 0, 0, 114, 4, 1, 0, 0, 0, 115, 116, 5, 44, 0, 0, 116, 6, 1, 0, 0, 0, 117, 118, 5, 91, 0, 0, 118, 8, 1, 0, 0, 0, 119, 120, 5, 93, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, 40, 0, 0, 122, 12, 1, 0, 0, 0, 123, 124, 5, 41, 0, 0, 124, 14, 1, 0, 0, 0, 125, 126, 5, 46, 0, 0, 126, 16, 1, 0, 0, 0, 127, 128, 5, 124, 0, 0, 128, 18, 1, 0, 0, 0, 129, 130, 5, 58, 0, 0, 130, 20, 1, 0, 0, 0, 131, 132, 5, 61, 0, 0, 132, 22, 1, 0, 0, 0, 133, 134, 5, 123, 0, 0, 134, 24, 1, 0, 0, 0, 135, 136, 5, 125, 0, 0, 136, 26, 1, 0, 0, 0, 137, 138, 5, 112, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 114, 0, 0, 140, 141, 5, 97, 0, 0, 141, 142, 5, 109, 0, 0, 142, 28, 1, 0, 0, 0, 143, 144, 5, 118, 0, 0, 144, 145, 5, 97, 0, 0, 145, 146, 5, 114, 0, 0, 146, 30, 1, 0, 0, 0, 147, 148, 5, 116, 0, 0, 148, 149, 5, 114, 0, 0, 149, 150, 5, 117, 0, 0, 150, 151, 5, 101, 0, 0, 151, 32, 1, 0, 0, 0, 152, 153, 5, 102, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 108, 0, 0, 155, 156, 5, 115, 0, 0, 156, 157, 5, 101, 0, 0, 157, 34, 1, 0, 0, 0, 158, 159, 5, 110, 0, 0, 159, 160, 5, 117, 0, 0, 160, 161, 5, 108, 0, 0, 161, 162, 5, 108, 0, 0, 162, 36, 1, 0, 0, 0, 163, 164, 5, 111, 0, 0, 164, 165, 5, 98, 0, 0, 165, 166, 5, 106, 0, 0, 166, 167, 5, 101, 0, 0, 167, 168, 5, 99, 0, 0, 168, 169, 5, 116, 0, 0, 169, 38, 1, 0, 0, 0, 170, 171, 5, 114, 0, 0, 171, 172, 5, 101, 0, 0, 172, 173, 5, 115, 0, 0, 173, 174, 5, 111, 0, 0, 174, 175, 5, 117, 0, 0, 175, 176, 5, 114, 0, 0, 176, 177, 5, 99, 0, 0, 177, 178, 5, 101, 0, 0, 178, 40, 1, 0, 0, 0, 179, 180, 5, 111, 0, 0, 180, 181, 5, 117, 0, 0, 181, 182, 5, 116, 0, 0, 182, 183, 5, 112, 0, 0, 183, 184, 5, 117, 0, 0, 184, 185, 5, 116, 0, 0, 185, 42, 1, 0, 0, 0, 186, 187, 5, 101, 0, 0, 187, 188, 5, 120, 0, 0, 188, 189, 5, 105, 0, 0, 189, 190, 5, 115, 0, 0, 190, 191, 5, 116, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, 5, 110, 0, 0, 193, 194, 5, 103, 0, 0, 194, 44, 1, 0, 0, 0, 195, 199, 5, 39, 0, 0, 196, 198, 3, 93, 46, 0, 197, 196, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 202, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 5, 36, 0, 0, 203, 204, 5, 123, 0, 0, 204, 46, 1, 0, 0, 0, 205, 209, 5, 125, 0, 0, 206, 208, 3, 93, 46, 0, 207, 206, 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 212, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 212, 213, 5, 36, 0, 0, 213, 214, 5, 123, 0, 0, 214, 48, 1, 0, 0, 0, 215, 219, 5, 125, 0, 0, 216, 218, 3, 93, 46, 0, 217, 216, 1, 0, 0, 0, 218, 221, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 222, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 222, 223, 5, 39, 0, 0, 223, 50, 1, 0, 0, 0, 224, 228, 5, 39, 0, 0, 225, 227, 3, 93, 46, 0, 226, 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 231, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, 5, 39, 0, 0, 232, 52, 1, 0, 0, 0, 233, 234, 5, 115, 0, 0, 234, 235, 5, 116, 0, 0, 235, 236, 5, 114, 0, 0, 236, 237, 5, 105, 0, 0, 237, 238, 5, 110, 0, 0, 238, 239, 5, 103, 0, 0, 239, 54, 1, 0, 0, 0, 240, 241, 5, 105, 0, 0, 241, 242, 5, 110, 0, 0, 242, 243, 5, 116, 0, 0, 243, 56, 1, 0, 0, 0, 244, 245, 5, 98, 0, 0, 245, 246, 5, 111, 0, 0, 246, 247, 5, 111, 0, 0, 247, 248, 5, 108, 0, 0, 248, 58, 1, 0, 0, 0, 249, 250, 5, 105, 0, 0, 250, 251, 5, 102, 0, 0, 251, 60, 1, 0, 0, 0, 252, 253, 5, 102, 0, 0, 253, 254, 5, 111, 0, 0, 254, 255, 5, 114, 0, 0, 255, 62, 1, 0, 0, 0, 256, 257, 5, 105, 0, 0, 257, 258, 5, 110, 0, 0, 258, 64, 1, 0, 0, 0, 259, 260, 5, 63, 0, 0, 260, 66, 1, 0, 0, 0, 261, 262, 5, 62, 0, 0, 262, 68, 1, 0, 0, 0, 263, 264, 5, 62, 0, 0, 264, 265, 5, 61, 0, 0, 265, 70, 1, 0, 0, 0, 266, 267, 5, 60, 0, 0, 267, 72, 1, 0, 0, 0, 268, 269, 5, 60, 0, 0, 269, 270, 5, 61, 0, 0, 270, 74, 1, 0, 0, 0, 271, 272, 5, 61, 0, 0, 272, 273, 5, 61, 0, 0, 273, 76, 1, 0, 0, 0, 274, 275, 5, 33, 0, 0, 275, 276, 5, 61, 0, 0, 276, 78, 1, 0, 0, 0, 277, 281, 7, 0, 0, 0, 278, 280, 7, 1, 0, 0, 279, 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 80, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 284, 286, 7, 2, 0, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 295, 1, 0, 0, 0, 289, 291, 5, 46, 0, 0, 290, 292, 7, 2, 0, 0, 291, 290, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 296, 1, 0, 0, 0, 295, 289, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 82, 1, 0, 0, 0, 297, 299, 7, 3, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 84, 1, 0, 0, 0, 302, 303, 5, 47, 0, 0, 303, 304, 5, 47, 0, 0, 304, 308, 1, 0, 0, 0, 305, 307, 8, 3, 0, 0, 306, 305, 1, 0, 0, 0, 307, 310, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 311, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 311, 312, 6, 42, 0, 0, 312, 86, 1, 0, 0, 0, 313, 314, 5, 47, 0, 0, 314, 315, 5, 42, 0, 0, 315, 319, 1, 0, 0, 0, 316, 318, 9, 0, 0, 0, 317, 316, 1, 0, 0, 0, 318, 321, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 320, 322, 1, 0, 0, 0, 321, 319, 1, 0, 0, 0, 322, 323, 5, 42, 0, 0, 323, 324, 5, 47, 0, 0, 324, 325, 1, 0, 0, 0, 325, 326, 6, 43, 0, 0, 326, 88, 1, 0, 0, 0, 327, 329, 7, 4, 0, 0, 328, 327, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 333, 6, 44, 0, 0, 333, 90, 1, 0, 0, 0, 334, 335, 9, 0, 0, 0, 335, 92, 1, 0, 0, 0, 336, 339, 8, 5, 0, 0, 337, 339, 3, 95, 47, 0, 338, 336, 1, 0, 0, 0, 338, 337, 1, 0, 0, 0, 339, 94, 1, 0, 0, 0, 340, 352, 5, 92, 0, 0, 341, 353, 7, 6, 0, 0, 342, 343, 5, 117, 0, 0, 343, 344, 5, 123, 0, 0, 344, 346, 1, 0, 0, 0, 345, 347, 3, 97, 48, 0, 346, 345, 1, 0, 0, 0, 347, 348, 1, 0, 0, 0, 348, 346, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 5, 125, 0, 0, 351, 353, 1, 0, 0, 0, 352, 341, 1, 0, 0, 0, 352, 342, 1, 0, 0, 0, 353, 96, 1, 0, 0, 0, 354, 355, 7, 7, 0, 0, 355, 98, 1, 0, 0, 0, 17, 0, 106, 199, 209, 219, 228, 281, 287, 293, 295, 300, 308, 319, 330, 338, 348, 352, 1, 6, 0, 0] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens index 1acd1434f3b..cd100fb8ade 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens @@ -19,30 +19,31 @@ NULL=18 OBJECT=19 RESOURCE=20 OUTPUT=21 -STRING_LEFT_PIECE=22 -STRING_MIDDLE_PIECE=23 -STRING_RIGHT_PIECE=24 -STRING_COMPLETE=25 -STRING=26 -INT=27 -BOOL=28 -IF=29 -FOR=30 -IN=31 -QMARK=32 -GT=33 -GTE=34 -LT=35 -LTE=36 -EQ=37 -NEQ=38 -IDENTIFIER=39 -NUMBER=40 -NL=41 -SPACES=42 -UNKNOWN=43 -SINGLE_LINE_COMMENT=44 -MULTI_LINE_COMMENT=45 +EXISTING=22 +STRING_LEFT_PIECE=23 +STRING_MIDDLE_PIECE=24 +STRING_RIGHT_PIECE=25 +STRING_COMPLETE=26 +STRING=27 +INT=28 +BOOL=29 +IF=30 +FOR=31 +IN=32 +QMARK=33 +GT=34 +GTE=35 +LT=36 +LTE=37 +EQ=38 +NEQ=39 +IDENTIFIER=40 +NUMBER=41 +NL=42 +SINGLE_LINE_COMMENT=43 +MULTI_LINE_COMMENT=44 +SPACES=45 +UNKNOWN=46 '@'=2 ','=3 '['=4 @@ -63,16 +64,17 @@ MULTI_LINE_COMMENT=45 'object'=19 'resource'=20 'output'=21 -'string'=26 -'int'=27 -'bool'=28 -'if'=29 -'for'=30 -'in'=31 -'?'=32 -'>'=33 -'>='=34 -'<'=35 -'<='=36 -'=='=37 -'!='=38 +'existing'=22 +'string'=27 +'int'=28 +'bool'=29 +'if'=30 +'for'=31 +'in'=32 +'?'=33 +'>'=34 +'>='=35 +'<'=36 +'<='=37 +'=='=38 +'!='=39 diff --git a/pkg/parser/bicep/antlr/parser/bicep_lexer.go b/pkg/parser/bicep/antlr/parser/bicep_lexer.go index ccb1cc6cb90..529982e482f 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_lexer.go +++ b/pkg/parser/bicep/antlr/parser/bicep_lexer.go @@ -45,31 +45,31 @@ func biceplexerLexerInit() { staticData.LiteralNames = []string{ "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", - "'object'", "'resource'", "'output'", "", "", "", "", "'string'", "'int'", - "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", - "'=='", "'!='", + "'object'", "'resource'", "'output'", "'existing'", "", "", "", "", + "'string'", "'int'", "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", + "'>='", "'<'", "'<='", "'=='", "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "STRING_LEFT_PIECE", - "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", - "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", - "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "SINGLE_LINE_COMMENT", - "MULTI_LINE_COMMENT", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "EXISTING", + "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", + "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", + "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", + "MULTI_LINE_COMMENT", "SPACES", "UNKNOWN", } staticData.RuleNames = []string{ "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "STRING_LEFT_PIECE", - "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", - "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", - "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "SINGLE_LINE_COMMENT", - "MULTI_LINE_COMMENT", "STRINGCHAR", "ESCAPE", "HEX", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "EXISTING", + "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", + "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", + "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", + "MULTI_LINE_COMMENT", "SPACES", "UNKNOWN", "STRINGCHAR", "ESCAPE", "HEX", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 45, 345, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 46, 356, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, @@ -78,42 +78,43 @@ func biceplexerLexerInit() { 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, - 2, 47, 7, 47, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 103, 8, 0, 10, 0, 12, - 0, 106, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, - 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, - 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, - 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, - 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, - 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, - 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, - 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 5, 21, 187, 8, 21, 10, 21, 12, 21, 190, - 9, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 197, 8, 22, 10, 22, 12, - 22, 200, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 207, 8, 23, 10, - 23, 12, 23, 210, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 216, 8, 24, - 10, 24, 12, 24, 219, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, - 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, - 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, - 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, - 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 5, - 38, 269, 8, 38, 10, 38, 12, 38, 272, 9, 38, 1, 39, 4, 39, 275, 8, 39, 11, - 39, 12, 39, 276, 1, 39, 1, 39, 4, 39, 281, 8, 39, 11, 39, 12, 39, 282, - 3, 39, 285, 8, 39, 1, 40, 4, 40, 288, 8, 40, 11, 40, 12, 40, 289, 1, 41, - 4, 41, 293, 8, 41, 11, 41, 12, 41, 294, 1, 41, 1, 41, 1, 42, 1, 42, 1, - 43, 1, 43, 1, 43, 1, 43, 5, 43, 305, 8, 43, 10, 43, 12, 43, 308, 9, 43, - 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 316, 8, 44, 10, 44, 12, - 44, 319, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 3, 45, - 328, 8, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 4, 46, 336, 8, 46, - 11, 46, 12, 46, 337, 1, 46, 1, 46, 3, 46, 342, 8, 46, 1, 47, 1, 47, 2, - 104, 317, 0, 48, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, - 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, - 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, - 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, - 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, - 45, 91, 0, 93, 0, 95, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, + 2, 47, 7, 47, 2, 48, 7, 48, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 105, 8, + 0, 10, 0, 12, 0, 108, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, + 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, + 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, + 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, + 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, + 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, + 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, + 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, + 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 198, 8, 22, 10, 22, 12, 22, + 201, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 208, 8, 23, 10, 23, + 12, 23, 211, 9, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 218, 8, 24, + 10, 24, 12, 24, 221, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 227, 8, + 25, 10, 25, 12, 25, 230, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, + 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, + 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, + 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, + 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, + 5, 39, 280, 8, 39, 10, 39, 12, 39, 283, 9, 39, 1, 40, 4, 40, 286, 8, 40, + 11, 40, 12, 40, 287, 1, 40, 1, 40, 4, 40, 292, 8, 40, 11, 40, 12, 40, 293, + 3, 40, 296, 8, 40, 1, 41, 4, 41, 299, 8, 41, 11, 41, 12, 41, 300, 1, 42, + 1, 42, 1, 42, 1, 42, 5, 42, 307, 8, 42, 10, 42, 12, 42, 310, 9, 42, 1, + 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 318, 8, 43, 10, 43, 12, 43, + 321, 9, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 4, 44, 329, 8, 44, + 11, 44, 12, 44, 330, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 339, + 8, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 4, 47, 347, 8, 47, 11, + 47, 12, 47, 348, 1, 47, 1, 47, 3, 47, 353, 8, 47, 1, 48, 1, 48, 2, 106, + 319, 0, 49, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, + 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, + 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, + 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, + 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, + 46, 93, 0, 95, 0, 97, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, - 97, 102, 357, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, + 97, 102, 368, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, @@ -124,105 +125,108 @@ func biceplexerLexerInit() { 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, - 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 1, 97, - 1, 0, 0, 0, 3, 111, 1, 0, 0, 0, 5, 113, 1, 0, 0, 0, 7, 115, 1, 0, 0, 0, - 9, 117, 1, 0, 0, 0, 11, 119, 1, 0, 0, 0, 13, 121, 1, 0, 0, 0, 15, 123, - 1, 0, 0, 0, 17, 125, 1, 0, 0, 0, 19, 127, 1, 0, 0, 0, 21, 129, 1, 0, 0, - 0, 23, 131, 1, 0, 0, 0, 25, 133, 1, 0, 0, 0, 27, 135, 1, 0, 0, 0, 29, 141, - 1, 0, 0, 0, 31, 145, 1, 0, 0, 0, 33, 150, 1, 0, 0, 0, 35, 156, 1, 0, 0, - 0, 37, 161, 1, 0, 0, 0, 39, 168, 1, 0, 0, 0, 41, 177, 1, 0, 0, 0, 43, 184, - 1, 0, 0, 0, 45, 194, 1, 0, 0, 0, 47, 204, 1, 0, 0, 0, 49, 213, 1, 0, 0, - 0, 51, 222, 1, 0, 0, 0, 53, 229, 1, 0, 0, 0, 55, 233, 1, 0, 0, 0, 57, 238, - 1, 0, 0, 0, 59, 241, 1, 0, 0, 0, 61, 245, 1, 0, 0, 0, 63, 248, 1, 0, 0, - 0, 65, 250, 1, 0, 0, 0, 67, 252, 1, 0, 0, 0, 69, 255, 1, 0, 0, 0, 71, 257, - 1, 0, 0, 0, 73, 260, 1, 0, 0, 0, 75, 263, 1, 0, 0, 0, 77, 266, 1, 0, 0, - 0, 79, 274, 1, 0, 0, 0, 81, 287, 1, 0, 0, 0, 83, 292, 1, 0, 0, 0, 85, 298, - 1, 0, 0, 0, 87, 300, 1, 0, 0, 0, 89, 311, 1, 0, 0, 0, 91, 327, 1, 0, 0, - 0, 93, 329, 1, 0, 0, 0, 95, 343, 1, 0, 0, 0, 97, 98, 5, 39, 0, 0, 98, 99, - 5, 39, 0, 0, 99, 100, 5, 39, 0, 0, 100, 104, 1, 0, 0, 0, 101, 103, 9, 0, - 0, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, - 104, 102, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, - 108, 5, 39, 0, 0, 108, 109, 5, 39, 0, 0, 109, 110, 5, 39, 0, 0, 110, 2, - 1, 0, 0, 0, 111, 112, 5, 64, 0, 0, 112, 4, 1, 0, 0, 0, 113, 114, 5, 44, - 0, 0, 114, 6, 1, 0, 0, 0, 115, 116, 5, 91, 0, 0, 116, 8, 1, 0, 0, 0, 117, - 118, 5, 93, 0, 0, 118, 10, 1, 0, 0, 0, 119, 120, 5, 40, 0, 0, 120, 12, - 1, 0, 0, 0, 121, 122, 5, 41, 0, 0, 122, 14, 1, 0, 0, 0, 123, 124, 5, 46, - 0, 0, 124, 16, 1, 0, 0, 0, 125, 126, 5, 124, 0, 0, 126, 18, 1, 0, 0, 0, - 127, 128, 5, 58, 0, 0, 128, 20, 1, 0, 0, 0, 129, 130, 5, 61, 0, 0, 130, - 22, 1, 0, 0, 0, 131, 132, 5, 123, 0, 0, 132, 24, 1, 0, 0, 0, 133, 134, - 5, 125, 0, 0, 134, 26, 1, 0, 0, 0, 135, 136, 5, 112, 0, 0, 136, 137, 5, - 97, 0, 0, 137, 138, 5, 114, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 109, - 0, 0, 140, 28, 1, 0, 0, 0, 141, 142, 5, 118, 0, 0, 142, 143, 5, 97, 0, - 0, 143, 144, 5, 114, 0, 0, 144, 30, 1, 0, 0, 0, 145, 146, 5, 116, 0, 0, - 146, 147, 5, 114, 0, 0, 147, 148, 5, 117, 0, 0, 148, 149, 5, 101, 0, 0, - 149, 32, 1, 0, 0, 0, 150, 151, 5, 102, 0, 0, 151, 152, 5, 97, 0, 0, 152, - 153, 5, 108, 0, 0, 153, 154, 5, 115, 0, 0, 154, 155, 5, 101, 0, 0, 155, - 34, 1, 0, 0, 0, 156, 157, 5, 110, 0, 0, 157, 158, 5, 117, 0, 0, 158, 159, - 5, 108, 0, 0, 159, 160, 5, 108, 0, 0, 160, 36, 1, 0, 0, 0, 161, 162, 5, - 111, 0, 0, 162, 163, 5, 98, 0, 0, 163, 164, 5, 106, 0, 0, 164, 165, 5, - 101, 0, 0, 165, 166, 5, 99, 0, 0, 166, 167, 5, 116, 0, 0, 167, 38, 1, 0, - 0, 0, 168, 169, 5, 114, 0, 0, 169, 170, 5, 101, 0, 0, 170, 171, 5, 115, - 0, 0, 171, 172, 5, 111, 0, 0, 172, 173, 5, 117, 0, 0, 173, 174, 5, 114, - 0, 0, 174, 175, 5, 99, 0, 0, 175, 176, 5, 101, 0, 0, 176, 40, 1, 0, 0, - 0, 177, 178, 5, 111, 0, 0, 178, 179, 5, 117, 0, 0, 179, 180, 5, 116, 0, - 0, 180, 181, 5, 112, 0, 0, 181, 182, 5, 117, 0, 0, 182, 183, 5, 116, 0, - 0, 183, 42, 1, 0, 0, 0, 184, 188, 5, 39, 0, 0, 185, 187, 3, 91, 45, 0, - 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, - 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 191, 192, - 5, 36, 0, 0, 192, 193, 5, 123, 0, 0, 193, 44, 1, 0, 0, 0, 194, 198, 5, - 125, 0, 0, 195, 197, 3, 91, 45, 0, 196, 195, 1, 0, 0, 0, 197, 200, 1, 0, - 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 201, 1, 0, 0, 0, - 200, 198, 1, 0, 0, 0, 201, 202, 5, 36, 0, 0, 202, 203, 5, 123, 0, 0, 203, - 46, 1, 0, 0, 0, 204, 208, 5, 125, 0, 0, 205, 207, 3, 91, 45, 0, 206, 205, - 1, 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, - 0, 0, 209, 211, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 5, 39, 0, 0, - 212, 48, 1, 0, 0, 0, 213, 217, 5, 39, 0, 0, 214, 216, 3, 91, 45, 0, 215, - 214, 1, 0, 0, 0, 216, 219, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 217, 218, - 1, 0, 0, 0, 218, 220, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 220, 221, 5, 39, - 0, 0, 221, 50, 1, 0, 0, 0, 222, 223, 5, 115, 0, 0, 223, 224, 5, 116, 0, - 0, 224, 225, 5, 114, 0, 0, 225, 226, 5, 105, 0, 0, 226, 227, 5, 110, 0, - 0, 227, 228, 5, 103, 0, 0, 228, 52, 1, 0, 0, 0, 229, 230, 5, 105, 0, 0, - 230, 231, 5, 110, 0, 0, 231, 232, 5, 116, 0, 0, 232, 54, 1, 0, 0, 0, 233, - 234, 5, 98, 0, 0, 234, 235, 5, 111, 0, 0, 235, 236, 5, 111, 0, 0, 236, - 237, 5, 108, 0, 0, 237, 56, 1, 0, 0, 0, 238, 239, 5, 105, 0, 0, 239, 240, - 5, 102, 0, 0, 240, 58, 1, 0, 0, 0, 241, 242, 5, 102, 0, 0, 242, 243, 5, - 111, 0, 0, 243, 244, 5, 114, 0, 0, 244, 60, 1, 0, 0, 0, 245, 246, 5, 105, - 0, 0, 246, 247, 5, 110, 0, 0, 247, 62, 1, 0, 0, 0, 248, 249, 5, 63, 0, - 0, 249, 64, 1, 0, 0, 0, 250, 251, 5, 62, 0, 0, 251, 66, 1, 0, 0, 0, 252, - 253, 5, 62, 0, 0, 253, 254, 5, 61, 0, 0, 254, 68, 1, 0, 0, 0, 255, 256, - 5, 60, 0, 0, 256, 70, 1, 0, 0, 0, 257, 258, 5, 60, 0, 0, 258, 259, 5, 61, - 0, 0, 259, 72, 1, 0, 0, 0, 260, 261, 5, 61, 0, 0, 261, 262, 5, 61, 0, 0, - 262, 74, 1, 0, 0, 0, 263, 264, 5, 33, 0, 0, 264, 265, 5, 61, 0, 0, 265, - 76, 1, 0, 0, 0, 266, 270, 7, 0, 0, 0, 267, 269, 7, 1, 0, 0, 268, 267, 1, - 0, 0, 0, 269, 272, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, - 0, 271, 78, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 273, 275, 7, 2, 0, 0, 274, - 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, - 1, 0, 0, 0, 277, 284, 1, 0, 0, 0, 278, 280, 5, 46, 0, 0, 279, 281, 7, 2, - 0, 0, 280, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, - 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 278, 1, 0, 0, 0, 284, - 285, 1, 0, 0, 0, 285, 80, 1, 0, 0, 0, 286, 288, 7, 3, 0, 0, 287, 286, 1, - 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, - 0, 290, 82, 1, 0, 0, 0, 291, 293, 7, 4, 0, 0, 292, 291, 1, 0, 0, 0, 293, - 294, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, - 1, 0, 0, 0, 296, 297, 6, 41, 0, 0, 297, 84, 1, 0, 0, 0, 298, 299, 9, 0, - 0, 0, 299, 86, 1, 0, 0, 0, 300, 301, 5, 47, 0, 0, 301, 302, 5, 47, 0, 0, - 302, 306, 1, 0, 0, 0, 303, 305, 8, 3, 0, 0, 304, 303, 1, 0, 0, 0, 305, - 308, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, - 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 310, 6, 43, 0, 0, 310, 88, 1, 0, - 0, 0, 311, 312, 5, 47, 0, 0, 312, 313, 5, 42, 0, 0, 313, 317, 1, 0, 0, - 0, 314, 316, 9, 0, 0, 0, 315, 314, 1, 0, 0, 0, 316, 319, 1, 0, 0, 0, 317, - 318, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 320, 1, 0, 0, 0, 319, 317, - 1, 0, 0, 0, 320, 321, 5, 42, 0, 0, 321, 322, 5, 47, 0, 0, 322, 323, 1, - 0, 0, 0, 323, 324, 6, 44, 0, 0, 324, 90, 1, 0, 0, 0, 325, 328, 8, 5, 0, - 0, 326, 328, 3, 93, 46, 0, 327, 325, 1, 0, 0, 0, 327, 326, 1, 0, 0, 0, - 328, 92, 1, 0, 0, 0, 329, 341, 5, 92, 0, 0, 330, 342, 7, 6, 0, 0, 331, - 332, 5, 117, 0, 0, 332, 333, 5, 123, 0, 0, 333, 335, 1, 0, 0, 0, 334, 336, - 3, 95, 47, 0, 335, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 335, 1, - 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 340, 5, 125, - 0, 0, 340, 342, 1, 0, 0, 0, 341, 330, 1, 0, 0, 0, 341, 331, 1, 0, 0, 0, - 342, 94, 1, 0, 0, 0, 343, 344, 7, 7, 0, 0, 344, 96, 1, 0, 0, 0, 17, 0, - 104, 188, 198, 208, 217, 270, 276, 282, 284, 289, 294, 306, 317, 327, 337, - 341, 1, 6, 0, 0, + 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, + 1, 0, 0, 0, 1, 99, 1, 0, 0, 0, 3, 113, 1, 0, 0, 0, 5, 115, 1, 0, 0, 0, + 7, 117, 1, 0, 0, 0, 9, 119, 1, 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 123, 1, + 0, 0, 0, 15, 125, 1, 0, 0, 0, 17, 127, 1, 0, 0, 0, 19, 129, 1, 0, 0, 0, + 21, 131, 1, 0, 0, 0, 23, 133, 1, 0, 0, 0, 25, 135, 1, 0, 0, 0, 27, 137, + 1, 0, 0, 0, 29, 143, 1, 0, 0, 0, 31, 147, 1, 0, 0, 0, 33, 152, 1, 0, 0, + 0, 35, 158, 1, 0, 0, 0, 37, 163, 1, 0, 0, 0, 39, 170, 1, 0, 0, 0, 41, 179, + 1, 0, 0, 0, 43, 186, 1, 0, 0, 0, 45, 195, 1, 0, 0, 0, 47, 205, 1, 0, 0, + 0, 49, 215, 1, 0, 0, 0, 51, 224, 1, 0, 0, 0, 53, 233, 1, 0, 0, 0, 55, 240, + 1, 0, 0, 0, 57, 244, 1, 0, 0, 0, 59, 249, 1, 0, 0, 0, 61, 252, 1, 0, 0, + 0, 63, 256, 1, 0, 0, 0, 65, 259, 1, 0, 0, 0, 67, 261, 1, 0, 0, 0, 69, 263, + 1, 0, 0, 0, 71, 266, 1, 0, 0, 0, 73, 268, 1, 0, 0, 0, 75, 271, 1, 0, 0, + 0, 77, 274, 1, 0, 0, 0, 79, 277, 1, 0, 0, 0, 81, 285, 1, 0, 0, 0, 83, 298, + 1, 0, 0, 0, 85, 302, 1, 0, 0, 0, 87, 313, 1, 0, 0, 0, 89, 328, 1, 0, 0, + 0, 91, 334, 1, 0, 0, 0, 93, 338, 1, 0, 0, 0, 95, 340, 1, 0, 0, 0, 97, 354, + 1, 0, 0, 0, 99, 100, 5, 39, 0, 0, 100, 101, 5, 39, 0, 0, 101, 102, 5, 39, + 0, 0, 102, 106, 1, 0, 0, 0, 103, 105, 9, 0, 0, 0, 104, 103, 1, 0, 0, 0, + 105, 108, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, + 109, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, + 5, 39, 0, 0, 111, 112, 5, 39, 0, 0, 112, 2, 1, 0, 0, 0, 113, 114, 5, 64, + 0, 0, 114, 4, 1, 0, 0, 0, 115, 116, 5, 44, 0, 0, 116, 6, 1, 0, 0, 0, 117, + 118, 5, 91, 0, 0, 118, 8, 1, 0, 0, 0, 119, 120, 5, 93, 0, 0, 120, 10, 1, + 0, 0, 0, 121, 122, 5, 40, 0, 0, 122, 12, 1, 0, 0, 0, 123, 124, 5, 41, 0, + 0, 124, 14, 1, 0, 0, 0, 125, 126, 5, 46, 0, 0, 126, 16, 1, 0, 0, 0, 127, + 128, 5, 124, 0, 0, 128, 18, 1, 0, 0, 0, 129, 130, 5, 58, 0, 0, 130, 20, + 1, 0, 0, 0, 131, 132, 5, 61, 0, 0, 132, 22, 1, 0, 0, 0, 133, 134, 5, 123, + 0, 0, 134, 24, 1, 0, 0, 0, 135, 136, 5, 125, 0, 0, 136, 26, 1, 0, 0, 0, + 137, 138, 5, 112, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 114, 0, 0, + 140, 141, 5, 97, 0, 0, 141, 142, 5, 109, 0, 0, 142, 28, 1, 0, 0, 0, 143, + 144, 5, 118, 0, 0, 144, 145, 5, 97, 0, 0, 145, 146, 5, 114, 0, 0, 146, + 30, 1, 0, 0, 0, 147, 148, 5, 116, 0, 0, 148, 149, 5, 114, 0, 0, 149, 150, + 5, 117, 0, 0, 150, 151, 5, 101, 0, 0, 151, 32, 1, 0, 0, 0, 152, 153, 5, + 102, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 108, 0, 0, 155, 156, 5, + 115, 0, 0, 156, 157, 5, 101, 0, 0, 157, 34, 1, 0, 0, 0, 158, 159, 5, 110, + 0, 0, 159, 160, 5, 117, 0, 0, 160, 161, 5, 108, 0, 0, 161, 162, 5, 108, + 0, 0, 162, 36, 1, 0, 0, 0, 163, 164, 5, 111, 0, 0, 164, 165, 5, 98, 0, + 0, 165, 166, 5, 106, 0, 0, 166, 167, 5, 101, 0, 0, 167, 168, 5, 99, 0, + 0, 168, 169, 5, 116, 0, 0, 169, 38, 1, 0, 0, 0, 170, 171, 5, 114, 0, 0, + 171, 172, 5, 101, 0, 0, 172, 173, 5, 115, 0, 0, 173, 174, 5, 111, 0, 0, + 174, 175, 5, 117, 0, 0, 175, 176, 5, 114, 0, 0, 176, 177, 5, 99, 0, 0, + 177, 178, 5, 101, 0, 0, 178, 40, 1, 0, 0, 0, 179, 180, 5, 111, 0, 0, 180, + 181, 5, 117, 0, 0, 181, 182, 5, 116, 0, 0, 182, 183, 5, 112, 0, 0, 183, + 184, 5, 117, 0, 0, 184, 185, 5, 116, 0, 0, 185, 42, 1, 0, 0, 0, 186, 187, + 5, 101, 0, 0, 187, 188, 5, 120, 0, 0, 188, 189, 5, 105, 0, 0, 189, 190, + 5, 115, 0, 0, 190, 191, 5, 116, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, + 5, 110, 0, 0, 193, 194, 5, 103, 0, 0, 194, 44, 1, 0, 0, 0, 195, 199, 5, + 39, 0, 0, 196, 198, 3, 93, 46, 0, 197, 196, 1, 0, 0, 0, 198, 201, 1, 0, + 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 202, 1, 0, 0, 0, + 201, 199, 1, 0, 0, 0, 202, 203, 5, 36, 0, 0, 203, 204, 5, 123, 0, 0, 204, + 46, 1, 0, 0, 0, 205, 209, 5, 125, 0, 0, 206, 208, 3, 93, 46, 0, 207, 206, + 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, + 0, 0, 210, 212, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 212, 213, 5, 36, 0, 0, + 213, 214, 5, 123, 0, 0, 214, 48, 1, 0, 0, 0, 215, 219, 5, 125, 0, 0, 216, + 218, 3, 93, 46, 0, 217, 216, 1, 0, 0, 0, 218, 221, 1, 0, 0, 0, 219, 217, + 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 222, 1, 0, 0, 0, 221, 219, 1, 0, + 0, 0, 222, 223, 5, 39, 0, 0, 223, 50, 1, 0, 0, 0, 224, 228, 5, 39, 0, 0, + 225, 227, 3, 93, 46, 0, 226, 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, + 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 231, 1, 0, 0, 0, 230, 228, + 1, 0, 0, 0, 231, 232, 5, 39, 0, 0, 232, 52, 1, 0, 0, 0, 233, 234, 5, 115, + 0, 0, 234, 235, 5, 116, 0, 0, 235, 236, 5, 114, 0, 0, 236, 237, 5, 105, + 0, 0, 237, 238, 5, 110, 0, 0, 238, 239, 5, 103, 0, 0, 239, 54, 1, 0, 0, + 0, 240, 241, 5, 105, 0, 0, 241, 242, 5, 110, 0, 0, 242, 243, 5, 116, 0, + 0, 243, 56, 1, 0, 0, 0, 244, 245, 5, 98, 0, 0, 245, 246, 5, 111, 0, 0, + 246, 247, 5, 111, 0, 0, 247, 248, 5, 108, 0, 0, 248, 58, 1, 0, 0, 0, 249, + 250, 5, 105, 0, 0, 250, 251, 5, 102, 0, 0, 251, 60, 1, 0, 0, 0, 252, 253, + 5, 102, 0, 0, 253, 254, 5, 111, 0, 0, 254, 255, 5, 114, 0, 0, 255, 62, + 1, 0, 0, 0, 256, 257, 5, 105, 0, 0, 257, 258, 5, 110, 0, 0, 258, 64, 1, + 0, 0, 0, 259, 260, 5, 63, 0, 0, 260, 66, 1, 0, 0, 0, 261, 262, 5, 62, 0, + 0, 262, 68, 1, 0, 0, 0, 263, 264, 5, 62, 0, 0, 264, 265, 5, 61, 0, 0, 265, + 70, 1, 0, 0, 0, 266, 267, 5, 60, 0, 0, 267, 72, 1, 0, 0, 0, 268, 269, 5, + 60, 0, 0, 269, 270, 5, 61, 0, 0, 270, 74, 1, 0, 0, 0, 271, 272, 5, 61, + 0, 0, 272, 273, 5, 61, 0, 0, 273, 76, 1, 0, 0, 0, 274, 275, 5, 33, 0, 0, + 275, 276, 5, 61, 0, 0, 276, 78, 1, 0, 0, 0, 277, 281, 7, 0, 0, 0, 278, + 280, 7, 1, 0, 0, 279, 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, + 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 80, 1, 0, 0, 0, 283, 281, 1, 0, + 0, 0, 284, 286, 7, 2, 0, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, + 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 295, 1, 0, 0, 0, 289, + 291, 5, 46, 0, 0, 290, 292, 7, 2, 0, 0, 291, 290, 1, 0, 0, 0, 292, 293, + 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 296, 1, 0, + 0, 0, 295, 289, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 82, 1, 0, 0, 0, + 297, 299, 7, 3, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, + 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 84, 1, 0, 0, 0, 302, 303, 5, + 47, 0, 0, 303, 304, 5, 47, 0, 0, 304, 308, 1, 0, 0, 0, 305, 307, 8, 3, + 0, 0, 306, 305, 1, 0, 0, 0, 307, 310, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, + 308, 309, 1, 0, 0, 0, 309, 311, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 311, + 312, 6, 42, 0, 0, 312, 86, 1, 0, 0, 0, 313, 314, 5, 47, 0, 0, 314, 315, + 5, 42, 0, 0, 315, 319, 1, 0, 0, 0, 316, 318, 9, 0, 0, 0, 317, 316, 1, 0, + 0, 0, 318, 321, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, + 320, 322, 1, 0, 0, 0, 321, 319, 1, 0, 0, 0, 322, 323, 5, 42, 0, 0, 323, + 324, 5, 47, 0, 0, 324, 325, 1, 0, 0, 0, 325, 326, 6, 43, 0, 0, 326, 88, + 1, 0, 0, 0, 327, 329, 7, 4, 0, 0, 328, 327, 1, 0, 0, 0, 329, 330, 1, 0, + 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, + 332, 333, 6, 44, 0, 0, 333, 90, 1, 0, 0, 0, 334, 335, 9, 0, 0, 0, 335, + 92, 1, 0, 0, 0, 336, 339, 8, 5, 0, 0, 337, 339, 3, 95, 47, 0, 338, 336, + 1, 0, 0, 0, 338, 337, 1, 0, 0, 0, 339, 94, 1, 0, 0, 0, 340, 352, 5, 92, + 0, 0, 341, 353, 7, 6, 0, 0, 342, 343, 5, 117, 0, 0, 343, 344, 5, 123, 0, + 0, 344, 346, 1, 0, 0, 0, 345, 347, 3, 97, 48, 0, 346, 345, 1, 0, 0, 0, + 347, 348, 1, 0, 0, 0, 348, 346, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, + 350, 1, 0, 0, 0, 350, 351, 5, 125, 0, 0, 351, 353, 1, 0, 0, 0, 352, 341, + 1, 0, 0, 0, 352, 342, 1, 0, 0, 0, 353, 96, 1, 0, 0, 0, 354, 355, 7, 7, + 0, 0, 355, 98, 1, 0, 0, 0, 17, 0, 106, 199, 209, 219, 228, 281, 287, 293, + 295, 300, 308, 319, 330, 338, 348, 352, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -284,28 +288,29 @@ const ( bicepLexerOBJECT = 19 bicepLexerRESOURCE = 20 bicepLexerOUTPUT = 21 - bicepLexerSTRING_LEFT_PIECE = 22 - bicepLexerSTRING_MIDDLE_PIECE = 23 - bicepLexerSTRING_RIGHT_PIECE = 24 - bicepLexerSTRING_COMPLETE = 25 - bicepLexerSTRING = 26 - bicepLexerINT = 27 - bicepLexerBOOL = 28 - bicepLexerIF = 29 - bicepLexerFOR = 30 - bicepLexerIN = 31 - bicepLexerQMARK = 32 - bicepLexerGT = 33 - bicepLexerGTE = 34 - bicepLexerLT = 35 - bicepLexerLTE = 36 - bicepLexerEQ = 37 - bicepLexerNEQ = 38 - bicepLexerIDENTIFIER = 39 - bicepLexerNUMBER = 40 - bicepLexerNL = 41 - bicepLexerSPACES = 42 - bicepLexerUNKNOWN = 43 - bicepLexerSINGLE_LINE_COMMENT = 44 - bicepLexerMULTI_LINE_COMMENT = 45 + bicepLexerEXISTING = 22 + bicepLexerSTRING_LEFT_PIECE = 23 + bicepLexerSTRING_MIDDLE_PIECE = 24 + bicepLexerSTRING_RIGHT_PIECE = 25 + bicepLexerSTRING_COMPLETE = 26 + bicepLexerSTRING = 27 + bicepLexerINT = 28 + bicepLexerBOOL = 29 + bicepLexerIF = 30 + bicepLexerFOR = 31 + bicepLexerIN = 32 + bicepLexerQMARK = 33 + bicepLexerGT = 34 + bicepLexerGTE = 35 + bicepLexerLT = 36 + bicepLexerLTE = 37 + bicepLexerEQ = 38 + bicepLexerNEQ = 39 + bicepLexerIDENTIFIER = 40 + bicepLexerNUMBER = 41 + bicepLexerNL = 42 + bicepLexerSINGLE_LINE_COMMENT = 43 + bicepLexerMULTI_LINE_COMMENT = 44 + bicepLexerSPACES = 45 + bicepLexerUNKNOWN = 46 ) diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 8bef24a4ea8..12cf4f12faf 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -35,18 +35,18 @@ func bicepParserInit() { staticData.LiteralNames = []string{ "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", - "'object'", "'resource'", "'output'", "", "", "", "", "'string'", "'int'", - "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", - "'=='", "'!='", + "'object'", "'resource'", "'output'", "'existing'", "", "", "", "", + "'string'", "'int'", "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", + "'>='", "'<'", "'<='", "'=='", "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "STRING_LEFT_PIECE", - "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", - "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", - "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SPACES", "UNKNOWN", "SINGLE_LINE_COMMENT", - "MULTI_LINE_COMMENT", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "EXISTING", + "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", + "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", + "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", + "MULTI_LINE_COMMENT", "SPACES", "UNKNOWN", } staticData.RuleNames = []string{ "program", "statement", "parameterDecl", "parameterDefaultValue", "variableDecl", @@ -58,7 +58,7 @@ func bicepParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 45, 346, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 46, 352, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, @@ -69,150 +69,153 @@ func bicepParserInit() { 3, 2, 85, 8, 2, 3, 2, 87, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 95, 8, 4, 10, 4, 12, 4, 98, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 107, 8, 5, 10, 5, 12, 5, 110, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, - 1, 5, 1, 5, 1, 5, 3, 5, 119, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 124, 8, 6, 10, - 6, 12, 6, 127, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 134, 8, 6, 1, - 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 146, 8, - 8, 10, 8, 12, 8, 149, 9, 8, 1, 8, 1, 8, 1, 8, 3, 8, 154, 8, 8, 1, 8, 1, - 8, 1, 8, 1, 8, 1, 8, 5, 8, 161, 8, 8, 10, 8, 12, 8, 164, 9, 8, 1, 8, 1, - 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 176, 8, 10, - 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 182, 8, 11, 10, 11, 12, 11, 185, 9, - 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 191, 8, 11, 1, 12, 1, 12, 1, 12, + 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 122, 8, 5, 1, 5, 1, 5, 1, + 6, 5, 6, 127, 8, 6, 10, 6, 12, 6, 130, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, + 6, 3, 6, 137, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, + 8, 1, 8, 5, 8, 149, 8, 8, 10, 8, 12, 8, 152, 9, 8, 1, 8, 1, 8, 1, 8, 3, + 8, 157, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 164, 8, 8, 10, 8, 12, + 8, 167, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, + 10, 3, 10, 179, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 185, 8, 11, 10, + 11, 12, 11, 188, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 194, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, - 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 221, 8, 12, 10, 12, 12, 12, 224, 9, - 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, - 3, 14, 236, 8, 14, 1, 15, 1, 15, 3, 15, 240, 8, 15, 1, 15, 1, 15, 3, 15, - 244, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, - 17, 3, 17, 255, 8, 17, 1, 18, 1, 18, 4, 18, 259, 8, 18, 11, 18, 12, 18, - 260, 1, 18, 1, 18, 4, 18, 265, 8, 18, 11, 18, 12, 18, 266, 5, 18, 269, - 8, 18, 10, 18, 12, 18, 272, 9, 18, 3, 18, 274, 8, 18, 1, 18, 1, 18, 1, - 19, 1, 19, 3, 19, 280, 8, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, - 287, 8, 20, 10, 20, 12, 20, 290, 9, 20, 1, 20, 5, 20, 293, 8, 20, 10, 20, - 12, 20, 296, 9, 20, 1, 20, 1, 20, 1, 21, 1, 21, 4, 21, 302, 8, 21, 11, - 21, 12, 21, 303, 1, 21, 3, 21, 307, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, - 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 318, 8, 23, 1, 24, 1, 24, 1, - 24, 3, 24, 323, 8, 24, 1, 24, 3, 24, 326, 8, 24, 1, 24, 3, 24, 329, 8, - 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 336, 8, 25, 1, 25, 5, 25, - 339, 8, 25, 10, 25, 12, 25, 342, 9, 25, 1, 26, 1, 26, 1, 26, 0, 1, 24, - 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, - 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 2, 1, 0, 33, 38, 3, 0, 14, 20, 26, - 28, 39, 39, 374, 0, 57, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, - 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, 0, 10, 108, 1, 0, 0, 0, 12, 125, - 1, 0, 0, 0, 14, 139, 1, 0, 0, 0, 16, 143, 1, 0, 0, 0, 18, 167, 1, 0, 0, - 0, 20, 175, 1, 0, 0, 0, 22, 190, 1, 0, 0, 0, 24, 192, 1, 0, 0, 0, 26, 225, - 1, 0, 0, 0, 28, 235, 1, 0, 0, 0, 30, 237, 1, 0, 0, 0, 32, 247, 1, 0, 0, - 0, 34, 254, 1, 0, 0, 0, 36, 256, 1, 0, 0, 0, 38, 279, 1, 0, 0, 0, 40, 284, - 1, 0, 0, 0, 42, 299, 1, 0, 0, 0, 44, 308, 1, 0, 0, 0, 46, 317, 1, 0, 0, - 0, 48, 319, 1, 0, 0, 0, 50, 332, 1, 0, 0, 0, 52, 343, 1, 0, 0, 0, 54, 56, - 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, - 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 60, 61, 5, - 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, 2, 0, 63, 68, 3, 8, 4, 0, 64, - 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, 68, 5, 41, 0, 0, 67, 62, 1, 0, - 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, - 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, - 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, - 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, - 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, - 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, - 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, - 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, - 89, 5, 41, 0, 0, 89, 5, 1, 0, 0, 0, 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, - 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, - 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, - 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, - 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 41, 0, 0, 104, 9, - 1, 0, 0, 0, 105, 107, 3, 44, 22, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, - 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, - 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, - 113, 114, 3, 22, 11, 0, 114, 118, 5, 11, 0, 0, 115, 119, 3, 14, 7, 0, 116, - 119, 3, 36, 18, 0, 117, 119, 3, 16, 8, 0, 118, 115, 1, 0, 0, 0, 118, 116, - 1, 0, 0, 0, 118, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 5, 41, - 0, 0, 121, 11, 1, 0, 0, 0, 122, 124, 3, 44, 22, 0, 123, 122, 1, 0, 0, 0, - 124, 127, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, - 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, 129, 5, 21, 0, 0, 129, 133, - 3, 52, 26, 0, 130, 134, 3, 52, 26, 0, 131, 132, 5, 20, 0, 0, 132, 134, - 3, 22, 11, 0, 133, 130, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 134, 135, 1, - 0, 0, 0, 135, 136, 5, 11, 0, 0, 136, 137, 3, 24, 12, 0, 137, 138, 5, 41, - 0, 0, 138, 13, 1, 0, 0, 0, 139, 140, 5, 29, 0, 0, 140, 141, 3, 30, 15, - 0, 141, 142, 3, 36, 18, 0, 142, 15, 1, 0, 0, 0, 143, 147, 5, 4, 0, 0, 144, - 146, 5, 41, 0, 0, 145, 144, 1, 0, 0, 0, 146, 149, 1, 0, 0, 0, 147, 145, - 1, 0, 0, 0, 147, 148, 1, 0, 0, 0, 148, 150, 1, 0, 0, 0, 149, 147, 1, 0, - 0, 0, 150, 153, 5, 30, 0, 0, 151, 154, 3, 52, 26, 0, 152, 154, 3, 18, 9, - 0, 153, 151, 1, 0, 0, 0, 153, 152, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, - 156, 5, 31, 0, 0, 156, 157, 3, 24, 12, 0, 157, 158, 5, 10, 0, 0, 158, 162, - 3, 20, 10, 0, 159, 161, 5, 41, 0, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, - 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, - 0, 164, 162, 1, 0, 0, 0, 165, 166, 5, 5, 0, 0, 166, 17, 1, 0, 0, 0, 167, - 168, 5, 6, 0, 0, 168, 169, 3, 52, 26, 0, 169, 170, 5, 3, 0, 0, 170, 171, - 3, 52, 26, 0, 171, 172, 5, 7, 0, 0, 172, 19, 1, 0, 0, 0, 173, 176, 3, 24, - 12, 0, 174, 176, 3, 14, 7, 0, 175, 173, 1, 0, 0, 0, 175, 174, 1, 0, 0, - 0, 176, 21, 1, 0, 0, 0, 177, 183, 5, 22, 0, 0, 178, 179, 3, 24, 12, 0, - 179, 180, 5, 23, 0, 0, 180, 182, 1, 0, 0, 0, 181, 178, 1, 0, 0, 0, 182, - 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, - 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 187, 3, 24, 12, 0, 187, 188, 5, - 24, 0, 0, 188, 191, 1, 0, 0, 0, 189, 191, 5, 25, 0, 0, 190, 177, 1, 0, - 0, 0, 190, 189, 1, 0, 0, 0, 191, 23, 1, 0, 0, 0, 192, 193, 6, 12, -1, 0, - 193, 194, 3, 28, 14, 0, 194, 222, 1, 0, 0, 0, 195, 196, 10, 6, 0, 0, 196, - 197, 5, 32, 0, 0, 197, 198, 3, 24, 12, 0, 198, 199, 5, 10, 0, 0, 199, 200, - 3, 24, 12, 7, 200, 221, 1, 0, 0, 0, 201, 202, 10, 2, 0, 0, 202, 203, 3, - 26, 13, 0, 203, 204, 3, 24, 12, 3, 204, 221, 1, 0, 0, 0, 205, 206, 10, - 7, 0, 0, 206, 207, 5, 4, 0, 0, 207, 208, 3, 24, 12, 0, 208, 209, 5, 5, - 0, 0, 209, 221, 1, 0, 0, 0, 210, 211, 10, 5, 0, 0, 211, 212, 5, 8, 0, 0, - 212, 221, 3, 52, 26, 0, 213, 214, 10, 4, 0, 0, 214, 215, 5, 10, 0, 0, 215, - 221, 3, 52, 26, 0, 216, 217, 10, 3, 0, 0, 217, 218, 5, 10, 0, 0, 218, 219, - 5, 10, 0, 0, 219, 221, 3, 52, 26, 0, 220, 195, 1, 0, 0, 0, 220, 201, 1, - 0, 0, 0, 220, 205, 1, 0, 0, 0, 220, 210, 1, 0, 0, 0, 220, 213, 1, 0, 0, - 0, 220, 216, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, - 223, 1, 0, 0, 0, 223, 25, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 225, 226, 7, - 0, 0, 0, 226, 27, 1, 0, 0, 0, 227, 236, 3, 34, 17, 0, 228, 236, 3, 48, - 24, 0, 229, 236, 3, 22, 11, 0, 230, 236, 5, 1, 0, 0, 231, 236, 3, 40, 20, - 0, 232, 236, 3, 36, 18, 0, 233, 236, 3, 16, 8, 0, 234, 236, 3, 30, 15, - 0, 235, 227, 1, 0, 0, 0, 235, 228, 1, 0, 0, 0, 235, 229, 1, 0, 0, 0, 235, - 230, 1, 0, 0, 0, 235, 231, 1, 0, 0, 0, 235, 232, 1, 0, 0, 0, 235, 233, - 1, 0, 0, 0, 235, 234, 1, 0, 0, 0, 236, 29, 1, 0, 0, 0, 237, 239, 5, 6, - 0, 0, 238, 240, 5, 41, 0, 0, 239, 238, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, - 240, 241, 1, 0, 0, 0, 241, 243, 3, 24, 12, 0, 242, 244, 5, 41, 0, 0, 243, - 242, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, - 5, 7, 0, 0, 246, 31, 1, 0, 0, 0, 247, 248, 3, 52, 26, 0, 248, 33, 1, 0, - 0, 0, 249, 255, 5, 40, 0, 0, 250, 255, 5, 16, 0, 0, 251, 255, 5, 17, 0, - 0, 252, 255, 5, 18, 0, 0, 253, 255, 3, 52, 26, 0, 254, 249, 1, 0, 0, 0, - 254, 250, 1, 0, 0, 0, 254, 251, 1, 0, 0, 0, 254, 252, 1, 0, 0, 0, 254, - 253, 1, 0, 0, 0, 255, 35, 1, 0, 0, 0, 256, 273, 5, 12, 0, 0, 257, 259, - 5, 41, 0, 0, 258, 257, 1, 0, 0, 0, 259, 260, 1, 0, 0, 0, 260, 258, 1, 0, - 0, 0, 260, 261, 1, 0, 0, 0, 261, 270, 1, 0, 0, 0, 262, 264, 3, 38, 19, - 0, 263, 265, 5, 41, 0, 0, 264, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, - 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 269, 1, 0, 0, 0, 268, 262, - 1, 0, 0, 0, 269, 272, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 270, 271, 1, 0, - 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 273, 258, 1, 0, 0, 0, - 273, 274, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 276, 5, 13, 0, 0, 276, - 37, 1, 0, 0, 0, 277, 280, 3, 52, 26, 0, 278, 280, 3, 22, 11, 0, 279, 277, - 1, 0, 0, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 282, 5, 10, - 0, 0, 282, 283, 3, 24, 12, 0, 283, 39, 1, 0, 0, 0, 284, 288, 5, 4, 0, 0, - 285, 287, 5, 41, 0, 0, 286, 285, 1, 0, 0, 0, 287, 290, 1, 0, 0, 0, 288, - 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 294, 1, 0, 0, 0, 290, 288, - 1, 0, 0, 0, 291, 293, 3, 42, 21, 0, 292, 291, 1, 0, 0, 0, 293, 296, 1, - 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 297, 1, 0, 0, - 0, 296, 294, 1, 0, 0, 0, 297, 298, 5, 5, 0, 0, 298, 41, 1, 0, 0, 0, 299, - 306, 3, 24, 12, 0, 300, 302, 5, 41, 0, 0, 301, 300, 1, 0, 0, 0, 302, 303, - 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 307, 1, 0, - 0, 0, 305, 307, 5, 3, 0, 0, 306, 301, 1, 0, 0, 0, 306, 305, 1, 0, 0, 0, - 306, 307, 1, 0, 0, 0, 307, 43, 1, 0, 0, 0, 308, 309, 5, 2, 0, 0, 309, 310, - 3, 46, 23, 0, 310, 311, 5, 41, 0, 0, 311, 45, 1, 0, 0, 0, 312, 318, 3, - 48, 24, 0, 313, 314, 3, 24, 12, 0, 314, 315, 5, 8, 0, 0, 315, 316, 3, 48, - 24, 0, 316, 318, 1, 0, 0, 0, 317, 312, 1, 0, 0, 0, 317, 313, 1, 0, 0, 0, - 318, 47, 1, 0, 0, 0, 319, 320, 3, 52, 26, 0, 320, 325, 5, 6, 0, 0, 321, - 323, 5, 41, 0, 0, 322, 321, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 324, - 1, 0, 0, 0, 324, 326, 3, 50, 25, 0, 325, 322, 1, 0, 0, 0, 325, 326, 1, - 0, 0, 0, 326, 328, 1, 0, 0, 0, 327, 329, 5, 41, 0, 0, 328, 327, 1, 0, 0, - 0, 328, 329, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 5, 7, 0, 0, 331, - 49, 1, 0, 0, 0, 332, 340, 3, 24, 12, 0, 333, 335, 5, 3, 0, 0, 334, 336, - 5, 41, 0, 0, 335, 334, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 337, 1, 0, - 0, 0, 337, 339, 3, 24, 12, 0, 338, 333, 1, 0, 0, 0, 339, 342, 1, 0, 0, - 0, 340, 338, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 51, 1, 0, 0, 0, 342, - 340, 1, 0, 0, 0, 343, 344, 7, 1, 0, 0, 344, 53, 1, 0, 0, 0, 38, 57, 67, - 72, 79, 84, 86, 96, 108, 118, 125, 133, 147, 153, 162, 175, 183, 190, 220, - 222, 235, 239, 243, 254, 260, 266, 270, 273, 279, 288, 294, 303, 306, 317, - 322, 325, 328, 335, 340, + 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, + 12, 227, 8, 12, 10, 12, 12, 12, 230, 9, 12, 1, 13, 1, 13, 1, 14, 1, 14, + 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 242, 8, 14, 1, 15, 1, + 15, 3, 15, 246, 8, 15, 1, 15, 1, 15, 3, 15, 250, 8, 15, 1, 15, 1, 15, 1, + 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 261, 8, 17, 1, 18, + 1, 18, 4, 18, 265, 8, 18, 11, 18, 12, 18, 266, 1, 18, 1, 18, 4, 18, 271, + 8, 18, 11, 18, 12, 18, 272, 5, 18, 275, 8, 18, 10, 18, 12, 18, 278, 9, + 18, 3, 18, 280, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 3, 19, 286, 8, 19, 1, + 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 293, 8, 20, 10, 20, 12, 20, 296, + 9, 20, 1, 20, 5, 20, 299, 8, 20, 10, 20, 12, 20, 302, 9, 20, 1, 20, 1, + 20, 1, 21, 1, 21, 4, 21, 308, 8, 21, 11, 21, 12, 21, 309, 1, 21, 3, 21, + 313, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, + 23, 3, 23, 324, 8, 23, 1, 24, 1, 24, 1, 24, 3, 24, 329, 8, 24, 1, 24, 3, + 24, 332, 8, 24, 1, 24, 3, 24, 335, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, + 25, 3, 25, 342, 8, 25, 1, 25, 5, 25, 345, 8, 25, 10, 25, 12, 25, 348, 9, + 25, 1, 26, 1, 26, 1, 26, 0, 1, 24, 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, + 2, 1, 0, 34, 39, 3, 0, 14, 20, 27, 29, 40, 40, 382, 0, 57, 1, 0, 0, 0, + 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, + 0, 10, 108, 1, 0, 0, 0, 12, 128, 1, 0, 0, 0, 14, 142, 1, 0, 0, 0, 16, 146, + 1, 0, 0, 0, 18, 170, 1, 0, 0, 0, 20, 178, 1, 0, 0, 0, 22, 193, 1, 0, 0, + 0, 24, 195, 1, 0, 0, 0, 26, 231, 1, 0, 0, 0, 28, 241, 1, 0, 0, 0, 30, 243, + 1, 0, 0, 0, 32, 253, 1, 0, 0, 0, 34, 260, 1, 0, 0, 0, 36, 262, 1, 0, 0, + 0, 38, 285, 1, 0, 0, 0, 40, 290, 1, 0, 0, 0, 42, 305, 1, 0, 0, 0, 44, 314, + 1, 0, 0, 0, 46, 323, 1, 0, 0, 0, 48, 325, 1, 0, 0, 0, 50, 338, 1, 0, 0, + 0, 52, 349, 1, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, + 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, + 59, 57, 1, 0, 0, 0, 60, 61, 5, 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, + 2, 0, 63, 68, 3, 8, 4, 0, 64, 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, + 68, 5, 42, 0, 0, 67, 62, 1, 0, 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, + 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, + 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, + 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, + 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, + 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, + 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, + 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, + 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 89, 5, 42, 0, 0, 89, 5, 1, 0, 0, 0, + 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, + 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, + 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, + 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, + 12, 0, 103, 104, 5, 42, 0, 0, 104, 9, 1, 0, 0, 0, 105, 107, 3, 44, 22, + 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, + 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, + 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, 113, 115, 3, 22, 11, 0, 114, 116, + 5, 22, 0, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 1, 0, + 0, 0, 117, 121, 5, 11, 0, 0, 118, 122, 3, 14, 7, 0, 119, 122, 3, 36, 18, + 0, 120, 122, 3, 16, 8, 0, 121, 118, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, + 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 5, 42, 0, 0, 124, 11, + 1, 0, 0, 0, 125, 127, 3, 44, 22, 0, 126, 125, 1, 0, 0, 0, 127, 130, 1, + 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 131, 1, 0, 0, + 0, 130, 128, 1, 0, 0, 0, 131, 132, 5, 21, 0, 0, 132, 136, 3, 52, 26, 0, + 133, 137, 3, 52, 26, 0, 134, 135, 5, 20, 0, 0, 135, 137, 3, 22, 11, 0, + 136, 133, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, + 139, 5, 11, 0, 0, 139, 140, 3, 24, 12, 0, 140, 141, 5, 42, 0, 0, 141, 13, + 1, 0, 0, 0, 142, 143, 5, 30, 0, 0, 143, 144, 3, 30, 15, 0, 144, 145, 3, + 36, 18, 0, 145, 15, 1, 0, 0, 0, 146, 150, 5, 4, 0, 0, 147, 149, 5, 42, + 0, 0, 148, 147, 1, 0, 0, 0, 149, 152, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, + 150, 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, + 156, 5, 31, 0, 0, 154, 157, 3, 52, 26, 0, 155, 157, 3, 18, 9, 0, 156, 154, + 1, 0, 0, 0, 156, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 159, 5, 32, + 0, 0, 159, 160, 3, 24, 12, 0, 160, 161, 5, 10, 0, 0, 161, 165, 3, 20, 10, + 0, 162, 164, 5, 42, 0, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, + 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, + 1, 0, 0, 0, 168, 169, 5, 5, 0, 0, 169, 17, 1, 0, 0, 0, 170, 171, 5, 6, + 0, 0, 171, 172, 3, 52, 26, 0, 172, 173, 5, 3, 0, 0, 173, 174, 3, 52, 26, + 0, 174, 175, 5, 7, 0, 0, 175, 19, 1, 0, 0, 0, 176, 179, 3, 24, 12, 0, 177, + 179, 3, 14, 7, 0, 178, 176, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 21, + 1, 0, 0, 0, 180, 186, 5, 23, 0, 0, 181, 182, 3, 24, 12, 0, 182, 183, 5, + 24, 0, 0, 183, 185, 1, 0, 0, 0, 184, 181, 1, 0, 0, 0, 185, 188, 1, 0, 0, + 0, 186, 184, 1, 0, 0, 0, 186, 187, 1, 0, 0, 0, 187, 189, 1, 0, 0, 0, 188, + 186, 1, 0, 0, 0, 189, 190, 3, 24, 12, 0, 190, 191, 5, 25, 0, 0, 191, 194, + 1, 0, 0, 0, 192, 194, 5, 26, 0, 0, 193, 180, 1, 0, 0, 0, 193, 192, 1, 0, + 0, 0, 194, 23, 1, 0, 0, 0, 195, 196, 6, 12, -1, 0, 196, 197, 3, 28, 14, + 0, 197, 228, 1, 0, 0, 0, 198, 199, 10, 7, 0, 0, 199, 200, 5, 33, 0, 0, + 200, 201, 3, 24, 12, 0, 201, 202, 5, 10, 0, 0, 202, 203, 3, 24, 12, 8, + 203, 227, 1, 0, 0, 0, 204, 205, 10, 2, 0, 0, 205, 206, 3, 26, 13, 0, 206, + 207, 3, 24, 12, 3, 207, 227, 1, 0, 0, 0, 208, 209, 10, 8, 0, 0, 209, 210, + 5, 4, 0, 0, 210, 211, 3, 24, 12, 0, 211, 212, 5, 5, 0, 0, 212, 227, 1, + 0, 0, 0, 213, 214, 10, 6, 0, 0, 214, 215, 5, 8, 0, 0, 215, 227, 3, 52, + 26, 0, 216, 217, 10, 5, 0, 0, 217, 218, 5, 8, 0, 0, 218, 227, 3, 48, 24, + 0, 219, 220, 10, 4, 0, 0, 220, 221, 5, 10, 0, 0, 221, 227, 3, 52, 26, 0, + 222, 223, 10, 3, 0, 0, 223, 224, 5, 10, 0, 0, 224, 225, 5, 10, 0, 0, 225, + 227, 3, 52, 26, 0, 226, 198, 1, 0, 0, 0, 226, 204, 1, 0, 0, 0, 226, 208, + 1, 0, 0, 0, 226, 213, 1, 0, 0, 0, 226, 216, 1, 0, 0, 0, 226, 219, 1, 0, + 0, 0, 226, 222, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, + 228, 229, 1, 0, 0, 0, 229, 25, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, + 7, 0, 0, 0, 232, 27, 1, 0, 0, 0, 233, 242, 3, 34, 17, 0, 234, 242, 3, 48, + 24, 0, 235, 242, 3, 22, 11, 0, 236, 242, 5, 1, 0, 0, 237, 242, 3, 40, 20, + 0, 238, 242, 3, 36, 18, 0, 239, 242, 3, 16, 8, 0, 240, 242, 3, 30, 15, + 0, 241, 233, 1, 0, 0, 0, 241, 234, 1, 0, 0, 0, 241, 235, 1, 0, 0, 0, 241, + 236, 1, 0, 0, 0, 241, 237, 1, 0, 0, 0, 241, 238, 1, 0, 0, 0, 241, 239, + 1, 0, 0, 0, 241, 240, 1, 0, 0, 0, 242, 29, 1, 0, 0, 0, 243, 245, 5, 6, + 0, 0, 244, 246, 5, 42, 0, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, + 246, 247, 1, 0, 0, 0, 247, 249, 3, 24, 12, 0, 248, 250, 5, 42, 0, 0, 249, + 248, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, + 5, 7, 0, 0, 252, 31, 1, 0, 0, 0, 253, 254, 3, 52, 26, 0, 254, 33, 1, 0, + 0, 0, 255, 261, 5, 41, 0, 0, 256, 261, 5, 16, 0, 0, 257, 261, 5, 17, 0, + 0, 258, 261, 5, 18, 0, 0, 259, 261, 3, 52, 26, 0, 260, 255, 1, 0, 0, 0, + 260, 256, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, + 259, 1, 0, 0, 0, 261, 35, 1, 0, 0, 0, 262, 279, 5, 12, 0, 0, 263, 265, + 5, 42, 0, 0, 264, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 264, 1, 0, + 0, 0, 266, 267, 1, 0, 0, 0, 267, 276, 1, 0, 0, 0, 268, 270, 3, 38, 19, + 0, 269, 271, 5, 42, 0, 0, 270, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, + 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1, 0, 0, 0, 274, 268, + 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, + 0, 0, 277, 280, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 279, 264, 1, 0, 0, 0, + 279, 280, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 282, 5, 13, 0, 0, 282, + 37, 1, 0, 0, 0, 283, 286, 3, 52, 26, 0, 284, 286, 3, 22, 11, 0, 285, 283, + 1, 0, 0, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 288, 5, 10, + 0, 0, 288, 289, 3, 24, 12, 0, 289, 39, 1, 0, 0, 0, 290, 294, 5, 4, 0, 0, + 291, 293, 5, 42, 0, 0, 292, 291, 1, 0, 0, 0, 293, 296, 1, 0, 0, 0, 294, + 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 300, 1, 0, 0, 0, 296, 294, + 1, 0, 0, 0, 297, 299, 3, 42, 21, 0, 298, 297, 1, 0, 0, 0, 299, 302, 1, + 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 303, 1, 0, 0, + 0, 302, 300, 1, 0, 0, 0, 303, 304, 5, 5, 0, 0, 304, 41, 1, 0, 0, 0, 305, + 312, 3, 24, 12, 0, 306, 308, 5, 42, 0, 0, 307, 306, 1, 0, 0, 0, 308, 309, + 1, 0, 0, 0, 309, 307, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 313, 1, 0, + 0, 0, 311, 313, 5, 3, 0, 0, 312, 307, 1, 0, 0, 0, 312, 311, 1, 0, 0, 0, + 312, 313, 1, 0, 0, 0, 313, 43, 1, 0, 0, 0, 314, 315, 5, 2, 0, 0, 315, 316, + 3, 46, 23, 0, 316, 317, 5, 42, 0, 0, 317, 45, 1, 0, 0, 0, 318, 324, 3, + 48, 24, 0, 319, 320, 3, 24, 12, 0, 320, 321, 5, 8, 0, 0, 321, 322, 3, 48, + 24, 0, 322, 324, 1, 0, 0, 0, 323, 318, 1, 0, 0, 0, 323, 319, 1, 0, 0, 0, + 324, 47, 1, 0, 0, 0, 325, 326, 3, 52, 26, 0, 326, 331, 5, 6, 0, 0, 327, + 329, 5, 42, 0, 0, 328, 327, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 330, + 1, 0, 0, 0, 330, 332, 3, 50, 25, 0, 331, 328, 1, 0, 0, 0, 331, 332, 1, + 0, 0, 0, 332, 334, 1, 0, 0, 0, 333, 335, 5, 42, 0, 0, 334, 333, 1, 0, 0, + 0, 334, 335, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 337, 5, 7, 0, 0, 337, + 49, 1, 0, 0, 0, 338, 346, 3, 24, 12, 0, 339, 341, 5, 3, 0, 0, 340, 342, + 5, 42, 0, 0, 341, 340, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 343, 1, 0, + 0, 0, 343, 345, 3, 24, 12, 0, 344, 339, 1, 0, 0, 0, 345, 348, 1, 0, 0, + 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 51, 1, 0, 0, 0, 348, + 346, 1, 0, 0, 0, 349, 350, 7, 1, 0, 0, 350, 53, 1, 0, 0, 0, 39, 57, 67, + 72, 79, 84, 86, 96, 108, 115, 121, 128, 136, 150, 156, 165, 178, 186, 193, + 226, 228, 241, 245, 249, 260, 266, 272, 276, 279, 285, 294, 300, 309, 312, + 323, 328, 331, 334, 341, 346, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -272,30 +275,31 @@ const ( bicepParserOBJECT = 19 bicepParserRESOURCE = 20 bicepParserOUTPUT = 21 - bicepParserSTRING_LEFT_PIECE = 22 - bicepParserSTRING_MIDDLE_PIECE = 23 - bicepParserSTRING_RIGHT_PIECE = 24 - bicepParserSTRING_COMPLETE = 25 - bicepParserSTRING = 26 - bicepParserINT = 27 - bicepParserBOOL = 28 - bicepParserIF = 29 - bicepParserFOR = 30 - bicepParserIN = 31 - bicepParserQMARK = 32 - bicepParserGT = 33 - bicepParserGTE = 34 - bicepParserLT = 35 - bicepParserLTE = 36 - bicepParserEQ = 37 - bicepParserNEQ = 38 - bicepParserIDENTIFIER = 39 - bicepParserNUMBER = 40 - bicepParserNL = 41 - bicepParserSPACES = 42 - bicepParserUNKNOWN = 43 - bicepParserSINGLE_LINE_COMMENT = 44 - bicepParserMULTI_LINE_COMMENT = 45 + bicepParserEXISTING = 22 + bicepParserSTRING_LEFT_PIECE = 23 + bicepParserSTRING_MIDDLE_PIECE = 24 + bicepParserSTRING_RIGHT_PIECE = 25 + bicepParserSTRING_COMPLETE = 26 + bicepParserSTRING = 27 + bicepParserINT = 28 + bicepParserBOOL = 29 + bicepParserIF = 30 + bicepParserFOR = 31 + bicepParserIN = 32 + bicepParserQMARK = 33 + bicepParserGT = 34 + bicepParserGTE = 35 + bicepParserLT = 36 + bicepParserLTE = 37 + bicepParserEQ = 38 + bicepParserNEQ = 39 + bicepParserIDENTIFIER = 40 + bicepParserNUMBER = 41 + bicepParserNL = 42 + bicepParserSINGLE_LINE_COMMENT = 43 + bicepParserMULTI_LINE_COMMENT = 44 + bicepParserSPACES = 45 + bicepParserUNKNOWN = 46 ) // bicepParser rules. @@ -453,7 +457,7 @@ func (p *bicepParser) Program() (localctx IProgramContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&2199026450436) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4398049705988) != 0 { { p.SetState(54) p.Statement() @@ -1411,6 +1415,7 @@ type IResourceDeclContext interface { ForExpression() IForExpressionContext AllDecorator() []IDecoratorContext Decorator(i int) IDecoratorContext + EXISTING() antlr.TerminalNode // IsResourceDeclContext differentiates from other interfaces. IsResourceDeclContext() @@ -1591,6 +1596,10 @@ func (s *ResourceDeclContext) Decorator(i int) IDecoratorContext { return t.(IDecoratorContext) } +func (s *ResourceDeclContext) EXISTING() antlr.TerminalNode { + return s.GetToken(bicepParserEXISTING, 0) +} + func (s *ResourceDeclContext) GetRuleContext() antlr.RuleContext { return s } @@ -1657,15 +1666,33 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { localctx.(*ResourceDeclContext).type_ = _x } + p.SetState(115) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == bicepParserEXISTING { + { + p.SetState(114) + p.Match(bicepParserEXISTING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } { - p.SetState(114) + p.SetState(117) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(118) + p.SetState(121) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1674,19 +1701,19 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { switch p.GetTokenStream().LA(1) { case bicepParserIF: { - p.SetState(115) + p.SetState(118) p.IfCondition() } case bicepParserOBRACE: { - p.SetState(116) + p.SetState(119) p.Object() } case bicepParserOBRACK: { - p.SetState(117) + p.SetState(120) p.ForExpression() } @@ -1695,7 +1722,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { goto errorExit } { - p.SetState(120) + p.SetState(123) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1958,7 +1985,7 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(125) + p.SetState(128) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1967,11 +1994,11 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { for _la == bicepParserAT { { - p.SetState(122) + p.SetState(125) p.Decorator() } - p.SetState(127) + p.SetState(130) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1979,7 +2006,7 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(128) + p.SetState(131) p.Match(bicepParserOUTPUT) if p.HasError() { // Recognition error - abort rule @@ -1987,22 +2014,22 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { } } { - p.SetState(129) + p.SetState(132) var _x = p.Identifier() localctx.(*OutputDeclContext).name = _x } - p.SetState(133) + p.SetState(136) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 10, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) { case 1: { - p.SetState(130) + p.SetState(133) var _x = p.Identifier() @@ -2011,7 +2038,7 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { case 2: { - p.SetState(131) + p.SetState(134) p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule @@ -2019,7 +2046,7 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { } } { - p.SetState(132) + p.SetState(135) var _x = p.InterpString() @@ -2030,7 +2057,7 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { goto errorExit } { - p.SetState(135) + p.SetState(138) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -2038,11 +2065,11 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { } } { - p.SetState(136) + p.SetState(139) p.expression(0) } { - p.SetState(137) + p.SetState(140) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2170,7 +2197,7 @@ func (p *bicepParser) IfCondition() (localctx IIfConditionContext) { p.EnterRule(localctx, 14, bicepParserRULE_ifCondition) p.EnterOuterAlt(localctx, 1) { - p.SetState(139) + p.SetState(142) p.Match(bicepParserIF) if p.HasError() { // Recognition error - abort rule @@ -2178,11 +2205,11 @@ func (p *bicepParser) IfCondition() (localctx IIfConditionContext) { } } { - p.SetState(140) + p.SetState(143) p.ParenthesizedExpression() } { - p.SetState(141) + p.SetState(144) p.Object() } @@ -2383,14 +2410,14 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(143) + p.SetState(146) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(147) + p.SetState(150) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2399,7 +2426,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { for _la == bicepParserNL { { - p.SetState(144) + p.SetState(147) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2407,7 +2434,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } - p.SetState(149) + p.SetState(152) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2415,14 +2442,14 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(150) + p.SetState(153) p.Match(bicepParserFOR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(153) + p.SetState(156) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2431,7 +2458,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: { - p.SetState(151) + p.SetState(154) var _x = p.Identifier() @@ -2440,7 +2467,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { case bicepParserOPAR: { - p.SetState(152) + p.SetState(155) p.ForVariableBlock() } @@ -2449,7 +2476,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { goto errorExit } { - p.SetState(155) + p.SetState(158) p.Match(bicepParserIN) if p.HasError() { // Recognition error - abort rule @@ -2457,11 +2484,11 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } { - p.SetState(156) + p.SetState(159) p.expression(0) } { - p.SetState(157) + p.SetState(160) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -2469,10 +2496,10 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } { - p.SetState(158) + p.SetState(161) p.ForBody() } - p.SetState(162) + p.SetState(165) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2481,7 +2508,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { for _la == bicepParserNL { { - p.SetState(159) + p.SetState(162) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2489,7 +2516,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } - p.SetState(164) + p.SetState(167) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2497,7 +2524,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(165) + p.SetState(168) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -2666,7 +2693,7 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { p.EnterRule(localctx, 18, bicepParserRULE_forVariableBlock) p.EnterOuterAlt(localctx, 1) { - p.SetState(167) + p.SetState(170) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule @@ -2674,14 +2701,14 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { } } { - p.SetState(168) + p.SetState(171) var _x = p.Identifier() localctx.(*ForVariableBlockContext).item = _x } { - p.SetState(169) + p.SetState(172) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -2689,14 +2716,14 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { } } { - p.SetState(170) + p.SetState(173) var _x = p.Identifier() localctx.(*ForVariableBlockContext).index = _x } { - p.SetState(171) + p.SetState(174) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -2828,7 +2855,7 @@ func (s *ForBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) ForBody() (localctx IForBodyContext) { localctx = NewForBodyContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 20, bicepParserRULE_forBody) - p.SetState(175) + p.SetState(178) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2838,7 +2865,7 @@ func (p *bicepParser) ForBody() (localctx IForBodyContext) { case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER, bicepParserNUMBER: p.EnterOuterAlt(localctx, 1) { - p.SetState(173) + p.SetState(176) var _x = p.expression(0) @@ -2848,7 +2875,7 @@ func (p *bicepParser) ForBody() (localctx IForBodyContext) { case bicepParserIF: p.EnterOuterAlt(localctx, 2) { - p.SetState(174) + p.SetState(177) p.IfCondition() } @@ -3006,7 +3033,7 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { p.EnterRule(localctx, 22, bicepParserRULE_interpString) var _alt int - p.SetState(190) + p.SetState(193) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3016,30 +3043,30 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_LEFT_PIECE: p.EnterOuterAlt(localctx, 1) { - p.SetState(177) + p.SetState(180) p.Match(bicepParserSTRING_LEFT_PIECE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(183) + p.SetState(186) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(178) + p.SetState(181) p.expression(0) } { - p.SetState(179) + p.SetState(182) p.Match(bicepParserSTRING_MIDDLE_PIECE) if p.HasError() { // Recognition error - abort rule @@ -3048,22 +3075,22 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { } } - p.SetState(185) + p.SetState(188) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } { - p.SetState(186) + p.SetState(189) p.expression(0) } { - p.SetState(187) + p.SetState(190) p.Match(bicepParserSTRING_RIGHT_PIECE) if p.HasError() { // Recognition error - abort rule @@ -3074,7 +3101,7 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_COMPLETE: p.EnterOuterAlt(localctx, 2) { - p.SetState(189) + p.SetState(192) p.Match(bicepParserSTRING_COMPLETE) if p.HasError() { // Recognition error - abort rule @@ -3131,6 +3158,7 @@ type IExpressionContext interface { CBRACK() antlr.TerminalNode DOT() antlr.TerminalNode Identifier() IIdentifierContext + FunctionCall() IFunctionCallContext // IsExpressionContext differentiates from other interfaces. IsExpressionContext() @@ -3291,6 +3319,22 @@ func (s *ExpressionContext) Identifier() IIdentifierContext { return t.(IIdentifierContext) } +func (s *ExpressionContext) FunctionCall() IFunctionCallContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFunctionCallContext) +} + func (s *ExpressionContext) GetRuleContext() antlr.RuleContext { return s } @@ -3326,17 +3370,17 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(193) + p.SetState(196) p.PrimaryExpression() } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(222) + p.SetState(228) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -3346,24 +3390,24 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(220) + p.SetState(226) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { case 1: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(195) + p.SetState(198) - if !(p.Precpred(p.GetParserRuleContext(), 6)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 7)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) goto errorExit } { - p.SetState(196) + p.SetState(199) p.Match(bicepParserQMARK) if p.HasError() { // Recognition error - abort rule @@ -3371,11 +3415,11 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(197) + p.SetState(200) p.expression(0) } { - p.SetState(198) + p.SetState(201) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3383,39 +3427,39 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(199) - p.expression(7) + p.SetState(202) + p.expression(8) } case 2: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(201) + p.SetState(204) if !(p.Precpred(p.GetParserRuleContext(), 2)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) goto errorExit } { - p.SetState(202) + p.SetState(205) p.LogicCharacter() } { - p.SetState(203) + p.SetState(206) p.expression(3) } case 3: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(205) + p.SetState(208) - if !(p.Precpred(p.GetParserRuleContext(), 7)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 8)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 8)", "")) goto errorExit } { - p.SetState(206) + p.SetState(209) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule @@ -3423,11 +3467,11 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(207) + p.SetState(210) p.expression(0) } { - p.SetState(208) + p.SetState(211) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -3438,14 +3482,14 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 4: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(210) + p.SetState(213) - if !(p.Precpred(p.GetParserRuleContext(), 5)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 6)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) goto errorExit } { - p.SetState(211) + p.SetState(214) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -3453,7 +3497,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(212) + p.SetState(215) var _x = p.Identifier() @@ -3463,14 +3507,36 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 5: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(213) + p.SetState(216) + + if !(p.Precpred(p.GetParserRuleContext(), 5)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) + goto errorExit + } + { + p.SetState(217) + p.Match(bicepParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(218) + p.FunctionCall() + } + + case 6: + localctx = NewExpressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) + p.SetState(219) if !(p.Precpred(p.GetParserRuleContext(), 4)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) goto errorExit } { - p.SetState(214) + p.SetState(220) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3478,24 +3544,24 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(215) + p.SetState(221) var _x = p.Identifier() localctx.(*ExpressionContext).name = _x } - case 6: + case 7: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(216) + p.SetState(222) if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(217) + p.SetState(223) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3503,7 +3569,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(218) + p.SetState(224) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3511,7 +3577,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(219) + p.SetState(225) var _x = p.Identifier() @@ -3523,12 +3589,12 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } - p.SetState(224) + p.SetState(230) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -3647,10 +3713,10 @@ func (p *bicepParser) LogicCharacter() (localctx ILogicCharacterContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(225) + p.SetState(231) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&541165879296) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1082331758592) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -3861,38 +3927,38 @@ func (s *PrimaryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interf func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { localctx = NewPrimaryExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 28, bicepParserRULE_primaryExpression) - p.SetState(235) + p.SetState(241) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 20, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(227) + p.SetState(233) p.LiteralValue() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(228) + p.SetState(234) p.FunctionCall() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(229) + p.SetState(235) p.InterpString() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(230) + p.SetState(236) p.Match(bicepParserMULTILINE_STRING) if p.HasError() { // Recognition error - abort rule @@ -3903,28 +3969,28 @@ func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(231) + p.SetState(237) p.Array() } case 6: p.EnterOuterAlt(localctx, 6) { - p.SetState(232) + p.SetState(238) p.Object() } case 7: p.EnterOuterAlt(localctx, 7) { - p.SetState(233) + p.SetState(239) p.ForExpression() } case 8: p.EnterOuterAlt(localctx, 8) { - p.SetState(234) + p.SetState(240) p.ParenthesizedExpression() } @@ -4052,14 +4118,14 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi p.EnterOuterAlt(localctx, 1) { - p.SetState(237) + p.SetState(243) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(239) + p.SetState(245) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4068,7 +4134,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(238) + p.SetState(244) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4078,10 +4144,10 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(241) + p.SetState(247) p.expression(0) } - p.SetState(243) + p.SetState(249) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4090,7 +4156,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(242) + p.SetState(248) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4100,7 +4166,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(245) + p.SetState(251) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -4217,7 +4283,7 @@ func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { p.EnterRule(localctx, 32, bicepParserRULE_typeExpression) p.EnterOuterAlt(localctx, 1) { - p.SetState(247) + p.SetState(253) var _x = p.Identifier() @@ -4340,17 +4406,17 @@ func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { localctx = NewLiteralValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, bicepParserRULE_literalValue) - p.SetState(254) + p.SetState(260) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(249) + p.SetState(255) p.Match(bicepParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -4361,7 +4427,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(250) + p.SetState(256) p.Match(bicepParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -4372,7 +4438,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(251) + p.SetState(257) p.Match(bicepParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -4383,7 +4449,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(252) + p.SetState(258) p.Match(bicepParserNULL) if p.HasError() { // Recognition error - abort rule @@ -4394,7 +4460,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(253) + p.SetState(259) p.Identifier() } @@ -4548,14 +4614,14 @@ func (p *bicepParser) Object() (localctx IObjectContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(256) + p.SetState(262) p.Match(bicepParserOBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(273) + p.SetState(279) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4563,7 +4629,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) if _la == bicepParserNL { - p.SetState(258) + p.SetState(264) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4572,7 +4638,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(257) + p.SetState(263) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4580,26 +4646,26 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(260) + p.SetState(266) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(270) + p.SetState(276) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&550265405440) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1100528730112) != 0 { { - p.SetState(262) + p.SetState(268) p.ObjectProperty() } - p.SetState(264) + p.SetState(270) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4608,7 +4674,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(263) + p.SetState(269) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4616,7 +4682,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(266) + p.SetState(272) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4624,7 +4690,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) } - p.SetState(272) + p.SetState(278) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4634,7 +4700,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } { - p.SetState(275) + p.SetState(281) p.Match(bicepParserCBRACE) if p.HasError() { // Recognition error - abort rule @@ -4789,7 +4855,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { localctx = NewObjectPropertyContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 38, bicepParserRULE_objectProperty) p.EnterOuterAlt(localctx, 1) - p.SetState(279) + p.SetState(285) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4798,7 +4864,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: { - p.SetState(277) + p.SetState(283) var _x = p.Identifier() @@ -4807,7 +4873,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: { - p.SetState(278) + p.SetState(284) p.InterpString() } @@ -4816,7 +4882,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { goto errorExit } { - p.SetState(281) + p.SetState(287) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -4824,7 +4890,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } } { - p.SetState(282) + p.SetState(288) p.expression(0) } @@ -4974,14 +5040,14 @@ func (p *bicepParser) Array() (localctx IArrayContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(284) + p.SetState(290) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(288) + p.SetState(294) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4990,7 +5056,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for _la == bicepParserNL { { - p.SetState(285) + p.SetState(291) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4998,27 +5064,27 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } } - p.SetState(290) + p.SetState(296) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(294) + p.SetState(300) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1649777037394) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&3299551989842) != 0 { { - p.SetState(291) + p.SetState(297) p.ArrayItem() } - p.SetState(296) + p.SetState(302) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5026,7 +5092,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(297) + p.SetState(303) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -5149,17 +5215,17 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(299) + p.SetState(305) p.expression(0) } - p.SetState(306) + p.SetState(312) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { case bicepParserNL: - p.SetState(301) + p.SetState(307) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5168,7 +5234,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(300) + p.SetState(306) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5176,7 +5242,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - p.SetState(303) + p.SetState(309) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5186,7 +5252,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { case bicepParserCOMMA: { - p.SetState(305) + p.SetState(311) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -5307,7 +5373,7 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { p.EnterRule(localctx, 44, bicepParserRULE_decorator) p.EnterOuterAlt(localctx, 1) { - p.SetState(308) + p.SetState(314) p.Match(bicepParserAT) if p.HasError() { // Recognition error - abort rule @@ -5315,11 +5381,11 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { } } { - p.SetState(309) + p.SetState(315) p.DecoratorExpression() } { - p.SetState(310) + p.SetState(316) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5445,28 +5511,28 @@ func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 46, bicepParserRULE_decoratorExpression) - p.SetState(317) + p.SetState(323) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 32, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 33, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(312) + p.SetState(318) p.FunctionCall() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(313) + p.SetState(319) p.expression(0) } { - p.SetState(314) + p.SetState(320) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -5474,7 +5540,7 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex } } { - p.SetState(315) + p.SetState(321) p.FunctionCall() } @@ -5619,22 +5685,22 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(319) + p.SetState(325) p.Identifier() } { - p.SetState(320) + p.SetState(326) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(325) + p.SetState(331) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 34, p.GetParserRuleContext()) == 1 { - p.SetState(322) + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 35, p.GetParserRuleContext()) == 1 { + p.SetState(328) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5643,7 +5709,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(321) + p.SetState(327) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5653,14 +5719,14 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(324) + p.SetState(330) p.ArgumentList() } } else if p.HasError() { // JIM goto errorExit } - p.SetState(328) + p.SetState(334) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5669,7 +5735,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(327) + p.SetState(333) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5679,7 +5745,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(330) + p.SetState(336) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -5833,10 +5899,10 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(332) + p.SetState(338) p.expression(0) } - p.SetState(340) + p.SetState(346) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5845,14 +5911,14 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { for _la == bicepParserCOMMA { { - p.SetState(333) + p.SetState(339) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(335) + p.SetState(341) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5861,7 +5927,7 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { if _la == bicepParserNL { { - p.SetState(334) + p.SetState(340) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5871,11 +5937,11 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { } { - p.SetState(337) + p.SetState(343) p.expression(0) } - p.SetState(342) + p.SetState(348) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6021,10 +6087,10 @@ func (p *bicepParser) Identifier() (localctx IIdentifierContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(343) + p.SetState(349) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&550227656704) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1100453232640) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -6062,21 +6128,24 @@ func (p *bicepParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex i func (p *bicepParser) Expression_Sempred(localctx antlr.RuleContext, predIndex int) bool { switch predIndex { case 0: - return p.Precpred(p.GetParserRuleContext(), 6) + return p.Precpred(p.GetParserRuleContext(), 7) case 1: return p.Precpred(p.GetParserRuleContext(), 2) case 2: - return p.Precpred(p.GetParserRuleContext(), 7) + return p.Precpred(p.GetParserRuleContext(), 8) case 3: - return p.Precpred(p.GetParserRuleContext(), 5) + return p.Precpred(p.GetParserRuleContext(), 6) case 4: - return p.Precpred(p.GetParserRuleContext(), 4) + return p.Precpred(p.GetParserRuleContext(), 5) case 5: + return p.Precpred(p.GetParserRuleContext(), 4) + + case 6: return p.Precpred(p.GetParserRuleContext(), 3) default: From 973eb5b6db87c36feb836217d73c633fbf426b70 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 8 May 2024 11:55:33 +0100 Subject: [PATCH 097/130] fixed issues with interpstring --- pkg/parser/bicep/parser.go | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 18592f6a21e..be3f277d82d 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -475,11 +475,7 @@ func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interf func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interface{} { if ctx.GetChildCount() > 1 { interpString := []interface{}{} - leftPiece := "" - if ctx.STRING_LEFT_PIECE() != nil { - leftPiece = ctx.STRING_LEFT_PIECE().GetText() - } - interpString = append(interpString, leftPiece) + interpString = append(interpString, ctx.STRING_LEFT_PIECE().GetText()) if ctx.AllSTRING_MIDDLE_PIECE() != nil && (len(ctx.AllSTRING_MIDDLE_PIECE()) > 0) { for idx, val := range ctx.AllSTRING_MIDDLE_PIECE() { interpString = append(interpString, ctx.Expression(idx).Accept(s), val.GetText()) @@ -487,22 +483,9 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf } // Last expression with string right piece if len(ctx.AllExpression()) > 0 { - expression := "" - if ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())) != nil { - var ok bool - expression, ok = ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())).Accept(s).(string) - if !ok { - expression = "" - } - - } - rightPiece := "" - if ctx.STRING_RIGHT_PIECE() != nil { - rightPiece = ctx.STRING_RIGHT_PIECE().GetText() - } interpString = append(interpString, - expression, - rightPiece) + ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())).Accept(s), + ctx.STRING_RIGHT_PIECE().GetText()) } str := "" for _, v := range interpString { From 53d87c9e8486d240f0a577008d42b21cfe86a947 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 8 May 2024 12:16:14 +0100 Subject: [PATCH 098/130] changed expression with COL to accept more use cases --- pkg/parser/bicep/antlr/bicep.g4 | 5 +- pkg/parser/bicep/antlr/parser/bicep.interp | 4 +- pkg/parser/bicep/antlr/parser/bicep.tokens | 1 - .../bicep/antlr/parser/bicepLexer.interp | 4 +- .../bicep/antlr/parser/bicepLexer.tokens | 1 - pkg/parser/bicep/antlr/parser/bicep_lexer.go | 298 +++++----- pkg/parser/bicep/antlr/parser/bicep_parser.go | 517 ++++++++---------- 7 files changed, 393 insertions(+), 437 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index 9fa76c30a62..afcb1e6c38b 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -63,9 +63,8 @@ expression: expression OBRACK expression CBRACK | expression QMARK expression COL expression | expression DOT property = identifier - | expression DOT functionCall + | expression DOT functionCall | expression COL name = identifier - | expression COL COL name = identifier | expression logicCharacter expression | primaryExpression; @@ -148,7 +147,7 @@ DOT: '.'; PIPE: '|'; -COL: ':'; +COL: ':' | '::'; ASSIGN: '='; diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index 98743fee1d5..f3a75154b85 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -9,7 +9,7 @@ null ')' '.' '|' -':' +null '=' '{' '}' @@ -127,4 +127,4 @@ identifier atn: -[4, 1, 46, 352, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 1, 0, 5, 0, 56, 8, 0, 10, 0, 12, 0, 59, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 68, 8, 1, 1, 2, 5, 2, 71, 8, 2, 10, 2, 12, 2, 74, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 80, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 85, 8, 2, 3, 2, 87, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 95, 8, 4, 10, 4, 12, 4, 98, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 107, 8, 5, 10, 5, 12, 5, 110, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 122, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 127, 8, 6, 10, 6, 12, 6, 130, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 137, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 149, 8, 8, 10, 8, 12, 8, 152, 9, 8, 1, 8, 1, 8, 1, 8, 3, 8, 157, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 164, 8, 8, 10, 8, 12, 8, 167, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 179, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 185, 8, 11, 10, 11, 12, 11, 188, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 194, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 227, 8, 12, 10, 12, 12, 12, 230, 9, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 242, 8, 14, 1, 15, 1, 15, 3, 15, 246, 8, 15, 1, 15, 1, 15, 3, 15, 250, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 261, 8, 17, 1, 18, 1, 18, 4, 18, 265, 8, 18, 11, 18, 12, 18, 266, 1, 18, 1, 18, 4, 18, 271, 8, 18, 11, 18, 12, 18, 272, 5, 18, 275, 8, 18, 10, 18, 12, 18, 278, 9, 18, 3, 18, 280, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 3, 19, 286, 8, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 293, 8, 20, 10, 20, 12, 20, 296, 9, 20, 1, 20, 5, 20, 299, 8, 20, 10, 20, 12, 20, 302, 9, 20, 1, 20, 1, 20, 1, 21, 1, 21, 4, 21, 308, 8, 21, 11, 21, 12, 21, 309, 1, 21, 3, 21, 313, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 324, 8, 23, 1, 24, 1, 24, 1, 24, 3, 24, 329, 8, 24, 1, 24, 3, 24, 332, 8, 24, 1, 24, 3, 24, 335, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 342, 8, 25, 1, 25, 5, 25, 345, 8, 25, 10, 25, 12, 25, 348, 9, 25, 1, 26, 1, 26, 1, 26, 0, 1, 24, 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 2, 1, 0, 34, 39, 3, 0, 14, 20, 27, 29, 40, 40, 382, 0, 57, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, 0, 10, 108, 1, 0, 0, 0, 12, 128, 1, 0, 0, 0, 14, 142, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 170, 1, 0, 0, 0, 20, 178, 1, 0, 0, 0, 22, 193, 1, 0, 0, 0, 24, 195, 1, 0, 0, 0, 26, 231, 1, 0, 0, 0, 28, 241, 1, 0, 0, 0, 30, 243, 1, 0, 0, 0, 32, 253, 1, 0, 0, 0, 34, 260, 1, 0, 0, 0, 36, 262, 1, 0, 0, 0, 38, 285, 1, 0, 0, 0, 40, 290, 1, 0, 0, 0, 42, 305, 1, 0, 0, 0, 44, 314, 1, 0, 0, 0, 46, 323, 1, 0, 0, 0, 48, 325, 1, 0, 0, 0, 50, 338, 1, 0, 0, 0, 52, 349, 1, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 60, 61, 5, 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, 2, 0, 63, 68, 3, 8, 4, 0, 64, 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, 68, 5, 42, 0, 0, 67, 62, 1, 0, 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 89, 5, 42, 0, 0, 89, 5, 1, 0, 0, 0, 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 42, 0, 0, 104, 9, 1, 0, 0, 0, 105, 107, 3, 44, 22, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, 113, 115, 3, 22, 11, 0, 114, 116, 5, 22, 0, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 121, 5, 11, 0, 0, 118, 122, 3, 14, 7, 0, 119, 122, 3, 36, 18, 0, 120, 122, 3, 16, 8, 0, 121, 118, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 5, 42, 0, 0, 124, 11, 1, 0, 0, 0, 125, 127, 3, 44, 22, 0, 126, 125, 1, 0, 0, 0, 127, 130, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 131, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 132, 5, 21, 0, 0, 132, 136, 3, 52, 26, 0, 133, 137, 3, 52, 26, 0, 134, 135, 5, 20, 0, 0, 135, 137, 3, 22, 11, 0, 136, 133, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 11, 0, 0, 139, 140, 3, 24, 12, 0, 140, 141, 5, 42, 0, 0, 141, 13, 1, 0, 0, 0, 142, 143, 5, 30, 0, 0, 143, 144, 3, 30, 15, 0, 144, 145, 3, 36, 18, 0, 145, 15, 1, 0, 0, 0, 146, 150, 5, 4, 0, 0, 147, 149, 5, 42, 0, 0, 148, 147, 1, 0, 0, 0, 149, 152, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, 156, 5, 31, 0, 0, 154, 157, 3, 52, 26, 0, 155, 157, 3, 18, 9, 0, 156, 154, 1, 0, 0, 0, 156, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 159, 5, 32, 0, 0, 159, 160, 3, 24, 12, 0, 160, 161, 5, 10, 0, 0, 161, 165, 3, 20, 10, 0, 162, 164, 5, 42, 0, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 5, 0, 0, 169, 17, 1, 0, 0, 0, 170, 171, 5, 6, 0, 0, 171, 172, 3, 52, 26, 0, 172, 173, 5, 3, 0, 0, 173, 174, 3, 52, 26, 0, 174, 175, 5, 7, 0, 0, 175, 19, 1, 0, 0, 0, 176, 179, 3, 24, 12, 0, 177, 179, 3, 14, 7, 0, 178, 176, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 21, 1, 0, 0, 0, 180, 186, 5, 23, 0, 0, 181, 182, 3, 24, 12, 0, 182, 183, 5, 24, 0, 0, 183, 185, 1, 0, 0, 0, 184, 181, 1, 0, 0, 0, 185, 188, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 186, 187, 1, 0, 0, 0, 187, 189, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 189, 190, 3, 24, 12, 0, 190, 191, 5, 25, 0, 0, 191, 194, 1, 0, 0, 0, 192, 194, 5, 26, 0, 0, 193, 180, 1, 0, 0, 0, 193, 192, 1, 0, 0, 0, 194, 23, 1, 0, 0, 0, 195, 196, 6, 12, -1, 0, 196, 197, 3, 28, 14, 0, 197, 228, 1, 0, 0, 0, 198, 199, 10, 7, 0, 0, 199, 200, 5, 33, 0, 0, 200, 201, 3, 24, 12, 0, 201, 202, 5, 10, 0, 0, 202, 203, 3, 24, 12, 8, 203, 227, 1, 0, 0, 0, 204, 205, 10, 2, 0, 0, 205, 206, 3, 26, 13, 0, 206, 207, 3, 24, 12, 3, 207, 227, 1, 0, 0, 0, 208, 209, 10, 8, 0, 0, 209, 210, 5, 4, 0, 0, 210, 211, 3, 24, 12, 0, 211, 212, 5, 5, 0, 0, 212, 227, 1, 0, 0, 0, 213, 214, 10, 6, 0, 0, 214, 215, 5, 8, 0, 0, 215, 227, 3, 52, 26, 0, 216, 217, 10, 5, 0, 0, 217, 218, 5, 8, 0, 0, 218, 227, 3, 48, 24, 0, 219, 220, 10, 4, 0, 0, 220, 221, 5, 10, 0, 0, 221, 227, 3, 52, 26, 0, 222, 223, 10, 3, 0, 0, 223, 224, 5, 10, 0, 0, 224, 225, 5, 10, 0, 0, 225, 227, 3, 52, 26, 0, 226, 198, 1, 0, 0, 0, 226, 204, 1, 0, 0, 0, 226, 208, 1, 0, 0, 0, 226, 213, 1, 0, 0, 0, 226, 216, 1, 0, 0, 0, 226, 219, 1, 0, 0, 0, 226, 222, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 25, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, 7, 0, 0, 0, 232, 27, 1, 0, 0, 0, 233, 242, 3, 34, 17, 0, 234, 242, 3, 48, 24, 0, 235, 242, 3, 22, 11, 0, 236, 242, 5, 1, 0, 0, 237, 242, 3, 40, 20, 0, 238, 242, 3, 36, 18, 0, 239, 242, 3, 16, 8, 0, 240, 242, 3, 30, 15, 0, 241, 233, 1, 0, 0, 0, 241, 234, 1, 0, 0, 0, 241, 235, 1, 0, 0, 0, 241, 236, 1, 0, 0, 0, 241, 237, 1, 0, 0, 0, 241, 238, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 240, 1, 0, 0, 0, 242, 29, 1, 0, 0, 0, 243, 245, 5, 6, 0, 0, 244, 246, 5, 42, 0, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 249, 3, 24, 12, 0, 248, 250, 5, 42, 0, 0, 249, 248, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 5, 7, 0, 0, 252, 31, 1, 0, 0, 0, 253, 254, 3, 52, 26, 0, 254, 33, 1, 0, 0, 0, 255, 261, 5, 41, 0, 0, 256, 261, 5, 16, 0, 0, 257, 261, 5, 17, 0, 0, 258, 261, 5, 18, 0, 0, 259, 261, 3, 52, 26, 0, 260, 255, 1, 0, 0, 0, 260, 256, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, 259, 1, 0, 0, 0, 261, 35, 1, 0, 0, 0, 262, 279, 5, 12, 0, 0, 263, 265, 5, 42, 0, 0, 264, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 276, 1, 0, 0, 0, 268, 270, 3, 38, 19, 0, 269, 271, 5, 42, 0, 0, 270, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1, 0, 0, 0, 274, 268, 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 280, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 279, 264, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 282, 5, 13, 0, 0, 282, 37, 1, 0, 0, 0, 283, 286, 3, 52, 26, 0, 284, 286, 3, 22, 11, 0, 285, 283, 1, 0, 0, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 288, 5, 10, 0, 0, 288, 289, 3, 24, 12, 0, 289, 39, 1, 0, 0, 0, 290, 294, 5, 4, 0, 0, 291, 293, 5, 42, 0, 0, 292, 291, 1, 0, 0, 0, 293, 296, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 300, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 297, 299, 3, 42, 21, 0, 298, 297, 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 303, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 303, 304, 5, 5, 0, 0, 304, 41, 1, 0, 0, 0, 305, 312, 3, 24, 12, 0, 306, 308, 5, 42, 0, 0, 307, 306, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 307, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 313, 1, 0, 0, 0, 311, 313, 5, 3, 0, 0, 312, 307, 1, 0, 0, 0, 312, 311, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 43, 1, 0, 0, 0, 314, 315, 5, 2, 0, 0, 315, 316, 3, 46, 23, 0, 316, 317, 5, 42, 0, 0, 317, 45, 1, 0, 0, 0, 318, 324, 3, 48, 24, 0, 319, 320, 3, 24, 12, 0, 320, 321, 5, 8, 0, 0, 321, 322, 3, 48, 24, 0, 322, 324, 1, 0, 0, 0, 323, 318, 1, 0, 0, 0, 323, 319, 1, 0, 0, 0, 324, 47, 1, 0, 0, 0, 325, 326, 3, 52, 26, 0, 326, 331, 5, 6, 0, 0, 327, 329, 5, 42, 0, 0, 328, 327, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 332, 3, 50, 25, 0, 331, 328, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 334, 1, 0, 0, 0, 333, 335, 5, 42, 0, 0, 334, 333, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 337, 5, 7, 0, 0, 337, 49, 1, 0, 0, 0, 338, 346, 3, 24, 12, 0, 339, 341, 5, 3, 0, 0, 340, 342, 5, 42, 0, 0, 341, 340, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 345, 3, 24, 12, 0, 344, 339, 1, 0, 0, 0, 345, 348, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 51, 1, 0, 0, 0, 348, 346, 1, 0, 0, 0, 349, 350, 7, 1, 0, 0, 350, 53, 1, 0, 0, 0, 39, 57, 67, 72, 79, 84, 86, 96, 108, 115, 121, 128, 136, 150, 156, 165, 178, 186, 193, 226, 228, 241, 245, 249, 260, 266, 272, 276, 279, 285, 294, 300, 309, 312, 323, 328, 331, 334, 341, 346] \ No newline at end of file +[4, 1, 46, 348, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 1, 0, 5, 0, 56, 8, 0, 10, 0, 12, 0, 59, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 68, 8, 1, 1, 2, 5, 2, 71, 8, 2, 10, 2, 12, 2, 74, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 80, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 85, 8, 2, 3, 2, 87, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 95, 8, 4, 10, 4, 12, 4, 98, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 107, 8, 5, 10, 5, 12, 5, 110, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 122, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 127, 8, 6, 10, 6, 12, 6, 130, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 137, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 149, 8, 8, 10, 8, 12, 8, 152, 9, 8, 1, 8, 1, 8, 1, 8, 3, 8, 157, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 164, 8, 8, 10, 8, 12, 8, 167, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 179, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 185, 8, 11, 10, 11, 12, 11, 188, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 194, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 223, 8, 12, 10, 12, 12, 12, 226, 9, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 238, 8, 14, 1, 15, 1, 15, 3, 15, 242, 8, 15, 1, 15, 1, 15, 3, 15, 246, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 257, 8, 17, 1, 18, 1, 18, 4, 18, 261, 8, 18, 11, 18, 12, 18, 262, 1, 18, 1, 18, 4, 18, 267, 8, 18, 11, 18, 12, 18, 268, 5, 18, 271, 8, 18, 10, 18, 12, 18, 274, 9, 18, 3, 18, 276, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 3, 19, 282, 8, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 289, 8, 20, 10, 20, 12, 20, 292, 9, 20, 1, 20, 5, 20, 295, 8, 20, 10, 20, 12, 20, 298, 9, 20, 1, 20, 1, 20, 1, 21, 1, 21, 4, 21, 304, 8, 21, 11, 21, 12, 21, 305, 1, 21, 3, 21, 309, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 320, 8, 23, 1, 24, 1, 24, 1, 24, 3, 24, 325, 8, 24, 1, 24, 3, 24, 328, 8, 24, 1, 24, 3, 24, 331, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 338, 8, 25, 1, 25, 5, 25, 341, 8, 25, 10, 25, 12, 25, 344, 9, 25, 1, 26, 1, 26, 1, 26, 0, 1, 24, 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 2, 1, 0, 34, 39, 3, 0, 14, 20, 27, 29, 40, 40, 377, 0, 57, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, 0, 10, 108, 1, 0, 0, 0, 12, 128, 1, 0, 0, 0, 14, 142, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 170, 1, 0, 0, 0, 20, 178, 1, 0, 0, 0, 22, 193, 1, 0, 0, 0, 24, 195, 1, 0, 0, 0, 26, 227, 1, 0, 0, 0, 28, 237, 1, 0, 0, 0, 30, 239, 1, 0, 0, 0, 32, 249, 1, 0, 0, 0, 34, 256, 1, 0, 0, 0, 36, 258, 1, 0, 0, 0, 38, 281, 1, 0, 0, 0, 40, 286, 1, 0, 0, 0, 42, 301, 1, 0, 0, 0, 44, 310, 1, 0, 0, 0, 46, 319, 1, 0, 0, 0, 48, 321, 1, 0, 0, 0, 50, 334, 1, 0, 0, 0, 52, 345, 1, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 60, 61, 5, 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, 2, 0, 63, 68, 3, 8, 4, 0, 64, 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, 68, 5, 42, 0, 0, 67, 62, 1, 0, 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 89, 5, 42, 0, 0, 89, 5, 1, 0, 0, 0, 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 42, 0, 0, 104, 9, 1, 0, 0, 0, 105, 107, 3, 44, 22, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, 113, 115, 3, 22, 11, 0, 114, 116, 5, 22, 0, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 121, 5, 11, 0, 0, 118, 122, 3, 14, 7, 0, 119, 122, 3, 36, 18, 0, 120, 122, 3, 16, 8, 0, 121, 118, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 5, 42, 0, 0, 124, 11, 1, 0, 0, 0, 125, 127, 3, 44, 22, 0, 126, 125, 1, 0, 0, 0, 127, 130, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 131, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 132, 5, 21, 0, 0, 132, 136, 3, 52, 26, 0, 133, 137, 3, 52, 26, 0, 134, 135, 5, 20, 0, 0, 135, 137, 3, 22, 11, 0, 136, 133, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 11, 0, 0, 139, 140, 3, 24, 12, 0, 140, 141, 5, 42, 0, 0, 141, 13, 1, 0, 0, 0, 142, 143, 5, 30, 0, 0, 143, 144, 3, 30, 15, 0, 144, 145, 3, 36, 18, 0, 145, 15, 1, 0, 0, 0, 146, 150, 5, 4, 0, 0, 147, 149, 5, 42, 0, 0, 148, 147, 1, 0, 0, 0, 149, 152, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, 156, 5, 31, 0, 0, 154, 157, 3, 52, 26, 0, 155, 157, 3, 18, 9, 0, 156, 154, 1, 0, 0, 0, 156, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 159, 5, 32, 0, 0, 159, 160, 3, 24, 12, 0, 160, 161, 5, 10, 0, 0, 161, 165, 3, 20, 10, 0, 162, 164, 5, 42, 0, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 5, 0, 0, 169, 17, 1, 0, 0, 0, 170, 171, 5, 6, 0, 0, 171, 172, 3, 52, 26, 0, 172, 173, 5, 3, 0, 0, 173, 174, 3, 52, 26, 0, 174, 175, 5, 7, 0, 0, 175, 19, 1, 0, 0, 0, 176, 179, 3, 24, 12, 0, 177, 179, 3, 14, 7, 0, 178, 176, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 21, 1, 0, 0, 0, 180, 186, 5, 23, 0, 0, 181, 182, 3, 24, 12, 0, 182, 183, 5, 24, 0, 0, 183, 185, 1, 0, 0, 0, 184, 181, 1, 0, 0, 0, 185, 188, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 186, 187, 1, 0, 0, 0, 187, 189, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 189, 190, 3, 24, 12, 0, 190, 191, 5, 25, 0, 0, 191, 194, 1, 0, 0, 0, 192, 194, 5, 26, 0, 0, 193, 180, 1, 0, 0, 0, 193, 192, 1, 0, 0, 0, 194, 23, 1, 0, 0, 0, 195, 196, 6, 12, -1, 0, 196, 197, 3, 28, 14, 0, 197, 224, 1, 0, 0, 0, 198, 199, 10, 6, 0, 0, 199, 200, 5, 33, 0, 0, 200, 201, 3, 24, 12, 0, 201, 202, 5, 10, 0, 0, 202, 203, 3, 24, 12, 7, 203, 223, 1, 0, 0, 0, 204, 205, 10, 2, 0, 0, 205, 206, 3, 26, 13, 0, 206, 207, 3, 24, 12, 3, 207, 223, 1, 0, 0, 0, 208, 209, 10, 7, 0, 0, 209, 210, 5, 4, 0, 0, 210, 211, 3, 24, 12, 0, 211, 212, 5, 5, 0, 0, 212, 223, 1, 0, 0, 0, 213, 214, 10, 5, 0, 0, 214, 215, 5, 8, 0, 0, 215, 223, 3, 52, 26, 0, 216, 217, 10, 4, 0, 0, 217, 218, 5, 8, 0, 0, 218, 223, 3, 48, 24, 0, 219, 220, 10, 3, 0, 0, 220, 221, 5, 10, 0, 0, 221, 223, 3, 52, 26, 0, 222, 198, 1, 0, 0, 0, 222, 204, 1, 0, 0, 0, 222, 208, 1, 0, 0, 0, 222, 213, 1, 0, 0, 0, 222, 216, 1, 0, 0, 0, 222, 219, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 25, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 228, 7, 0, 0, 0, 228, 27, 1, 0, 0, 0, 229, 238, 3, 34, 17, 0, 230, 238, 3, 48, 24, 0, 231, 238, 3, 22, 11, 0, 232, 238, 5, 1, 0, 0, 233, 238, 3, 40, 20, 0, 234, 238, 3, 36, 18, 0, 235, 238, 3, 16, 8, 0, 236, 238, 3, 30, 15, 0, 237, 229, 1, 0, 0, 0, 237, 230, 1, 0, 0, 0, 237, 231, 1, 0, 0, 0, 237, 232, 1, 0, 0, 0, 237, 233, 1, 0, 0, 0, 237, 234, 1, 0, 0, 0, 237, 235, 1, 0, 0, 0, 237, 236, 1, 0, 0, 0, 238, 29, 1, 0, 0, 0, 239, 241, 5, 6, 0, 0, 240, 242, 5, 42, 0, 0, 241, 240, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 245, 3, 24, 12, 0, 244, 246, 5, 42, 0, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 5, 7, 0, 0, 248, 31, 1, 0, 0, 0, 249, 250, 3, 52, 26, 0, 250, 33, 1, 0, 0, 0, 251, 257, 5, 41, 0, 0, 252, 257, 5, 16, 0, 0, 253, 257, 5, 17, 0, 0, 254, 257, 5, 18, 0, 0, 255, 257, 3, 52, 26, 0, 256, 251, 1, 0, 0, 0, 256, 252, 1, 0, 0, 0, 256, 253, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257, 35, 1, 0, 0, 0, 258, 275, 5, 12, 0, 0, 259, 261, 5, 42, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 272, 1, 0, 0, 0, 264, 266, 3, 38, 19, 0, 265, 267, 5, 42, 0, 0, 266, 265, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 264, 1, 0, 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 275, 260, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 278, 5, 13, 0, 0, 278, 37, 1, 0, 0, 0, 279, 282, 3, 52, 26, 0, 280, 282, 3, 22, 11, 0, 281, 279, 1, 0, 0, 0, 281, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, 5, 10, 0, 0, 284, 285, 3, 24, 12, 0, 285, 39, 1, 0, 0, 0, 286, 290, 5, 4, 0, 0, 287, 289, 5, 42, 0, 0, 288, 287, 1, 0, 0, 0, 289, 292, 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 296, 1, 0, 0, 0, 292, 290, 1, 0, 0, 0, 293, 295, 3, 42, 21, 0, 294, 293, 1, 0, 0, 0, 295, 298, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 299, 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 299, 300, 5, 5, 0, 0, 300, 41, 1, 0, 0, 0, 301, 308, 3, 24, 12, 0, 302, 304, 5, 42, 0, 0, 303, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 309, 1, 0, 0, 0, 307, 309, 5, 3, 0, 0, 308, 303, 1, 0, 0, 0, 308, 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 43, 1, 0, 0, 0, 310, 311, 5, 2, 0, 0, 311, 312, 3, 46, 23, 0, 312, 313, 5, 42, 0, 0, 313, 45, 1, 0, 0, 0, 314, 320, 3, 48, 24, 0, 315, 316, 3, 24, 12, 0, 316, 317, 5, 8, 0, 0, 317, 318, 3, 48, 24, 0, 318, 320, 1, 0, 0, 0, 319, 314, 1, 0, 0, 0, 319, 315, 1, 0, 0, 0, 320, 47, 1, 0, 0, 0, 321, 322, 3, 52, 26, 0, 322, 327, 5, 6, 0, 0, 323, 325, 5, 42, 0, 0, 324, 323, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 328, 3, 50, 25, 0, 327, 324, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 330, 1, 0, 0, 0, 329, 331, 5, 42, 0, 0, 330, 329, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 333, 5, 7, 0, 0, 333, 49, 1, 0, 0, 0, 334, 342, 3, 24, 12, 0, 335, 337, 5, 3, 0, 0, 336, 338, 5, 42, 0, 0, 337, 336, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 341, 3, 24, 12, 0, 340, 335, 1, 0, 0, 0, 341, 344, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 51, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 345, 346, 7, 1, 0, 0, 346, 53, 1, 0, 0, 0, 39, 57, 67, 72, 79, 84, 86, 96, 108, 115, 121, 128, 136, 150, 156, 165, 178, 186, 193, 222, 224, 237, 241, 245, 256, 262, 268, 272, 275, 281, 290, 296, 305, 308, 319, 324, 327, 330, 337, 342] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep.tokens b/pkg/parser/bicep/antlr/parser/bicep.tokens index cd100fb8ade..cef1c62deb6 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.tokens +++ b/pkg/parser/bicep/antlr/parser/bicep.tokens @@ -52,7 +52,6 @@ UNKNOWN=46 ')'=7 '.'=8 '|'=9 -':'=10 '='=11 '{'=12 '}'=13 diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.interp b/pkg/parser/bicep/antlr/parser/bicepLexer.interp index 5e7df48a0fe..03bf5e028a6 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.interp +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.interp @@ -9,7 +9,7 @@ null ')' '.' '|' -':' +null '=' '{' '}' @@ -155,4 +155,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 46, 356, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 105, 8, 0, 10, 0, 12, 0, 108, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 198, 8, 22, 10, 22, 12, 22, 201, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 208, 8, 23, 10, 23, 12, 23, 211, 9, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 218, 8, 24, 10, 24, 12, 24, 221, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 227, 8, 25, 10, 25, 12, 25, 230, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 5, 39, 280, 8, 39, 10, 39, 12, 39, 283, 9, 39, 1, 40, 4, 40, 286, 8, 40, 11, 40, 12, 40, 287, 1, 40, 1, 40, 4, 40, 292, 8, 40, 11, 40, 12, 40, 293, 3, 40, 296, 8, 40, 1, 41, 4, 41, 299, 8, 41, 11, 41, 12, 41, 300, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 307, 8, 42, 10, 42, 12, 42, 310, 9, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 318, 8, 43, 10, 43, 12, 43, 321, 9, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 4, 44, 329, 8, 44, 11, 44, 12, 44, 330, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 339, 8, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 4, 47, 347, 8, 47, 11, 47, 12, 47, 348, 1, 47, 1, 47, 3, 47, 353, 8, 47, 1, 48, 1, 48, 2, 106, 319, 0, 49, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 0, 95, 0, 97, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 368, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 1, 99, 1, 0, 0, 0, 3, 113, 1, 0, 0, 0, 5, 115, 1, 0, 0, 0, 7, 117, 1, 0, 0, 0, 9, 119, 1, 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 123, 1, 0, 0, 0, 15, 125, 1, 0, 0, 0, 17, 127, 1, 0, 0, 0, 19, 129, 1, 0, 0, 0, 21, 131, 1, 0, 0, 0, 23, 133, 1, 0, 0, 0, 25, 135, 1, 0, 0, 0, 27, 137, 1, 0, 0, 0, 29, 143, 1, 0, 0, 0, 31, 147, 1, 0, 0, 0, 33, 152, 1, 0, 0, 0, 35, 158, 1, 0, 0, 0, 37, 163, 1, 0, 0, 0, 39, 170, 1, 0, 0, 0, 41, 179, 1, 0, 0, 0, 43, 186, 1, 0, 0, 0, 45, 195, 1, 0, 0, 0, 47, 205, 1, 0, 0, 0, 49, 215, 1, 0, 0, 0, 51, 224, 1, 0, 0, 0, 53, 233, 1, 0, 0, 0, 55, 240, 1, 0, 0, 0, 57, 244, 1, 0, 0, 0, 59, 249, 1, 0, 0, 0, 61, 252, 1, 0, 0, 0, 63, 256, 1, 0, 0, 0, 65, 259, 1, 0, 0, 0, 67, 261, 1, 0, 0, 0, 69, 263, 1, 0, 0, 0, 71, 266, 1, 0, 0, 0, 73, 268, 1, 0, 0, 0, 75, 271, 1, 0, 0, 0, 77, 274, 1, 0, 0, 0, 79, 277, 1, 0, 0, 0, 81, 285, 1, 0, 0, 0, 83, 298, 1, 0, 0, 0, 85, 302, 1, 0, 0, 0, 87, 313, 1, 0, 0, 0, 89, 328, 1, 0, 0, 0, 91, 334, 1, 0, 0, 0, 93, 338, 1, 0, 0, 0, 95, 340, 1, 0, 0, 0, 97, 354, 1, 0, 0, 0, 99, 100, 5, 39, 0, 0, 100, 101, 5, 39, 0, 0, 101, 102, 5, 39, 0, 0, 102, 106, 1, 0, 0, 0, 103, 105, 9, 0, 0, 0, 104, 103, 1, 0, 0, 0, 105, 108, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 109, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, 5, 39, 0, 0, 111, 112, 5, 39, 0, 0, 112, 2, 1, 0, 0, 0, 113, 114, 5, 64, 0, 0, 114, 4, 1, 0, 0, 0, 115, 116, 5, 44, 0, 0, 116, 6, 1, 0, 0, 0, 117, 118, 5, 91, 0, 0, 118, 8, 1, 0, 0, 0, 119, 120, 5, 93, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, 40, 0, 0, 122, 12, 1, 0, 0, 0, 123, 124, 5, 41, 0, 0, 124, 14, 1, 0, 0, 0, 125, 126, 5, 46, 0, 0, 126, 16, 1, 0, 0, 0, 127, 128, 5, 124, 0, 0, 128, 18, 1, 0, 0, 0, 129, 130, 5, 58, 0, 0, 130, 20, 1, 0, 0, 0, 131, 132, 5, 61, 0, 0, 132, 22, 1, 0, 0, 0, 133, 134, 5, 123, 0, 0, 134, 24, 1, 0, 0, 0, 135, 136, 5, 125, 0, 0, 136, 26, 1, 0, 0, 0, 137, 138, 5, 112, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 114, 0, 0, 140, 141, 5, 97, 0, 0, 141, 142, 5, 109, 0, 0, 142, 28, 1, 0, 0, 0, 143, 144, 5, 118, 0, 0, 144, 145, 5, 97, 0, 0, 145, 146, 5, 114, 0, 0, 146, 30, 1, 0, 0, 0, 147, 148, 5, 116, 0, 0, 148, 149, 5, 114, 0, 0, 149, 150, 5, 117, 0, 0, 150, 151, 5, 101, 0, 0, 151, 32, 1, 0, 0, 0, 152, 153, 5, 102, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 108, 0, 0, 155, 156, 5, 115, 0, 0, 156, 157, 5, 101, 0, 0, 157, 34, 1, 0, 0, 0, 158, 159, 5, 110, 0, 0, 159, 160, 5, 117, 0, 0, 160, 161, 5, 108, 0, 0, 161, 162, 5, 108, 0, 0, 162, 36, 1, 0, 0, 0, 163, 164, 5, 111, 0, 0, 164, 165, 5, 98, 0, 0, 165, 166, 5, 106, 0, 0, 166, 167, 5, 101, 0, 0, 167, 168, 5, 99, 0, 0, 168, 169, 5, 116, 0, 0, 169, 38, 1, 0, 0, 0, 170, 171, 5, 114, 0, 0, 171, 172, 5, 101, 0, 0, 172, 173, 5, 115, 0, 0, 173, 174, 5, 111, 0, 0, 174, 175, 5, 117, 0, 0, 175, 176, 5, 114, 0, 0, 176, 177, 5, 99, 0, 0, 177, 178, 5, 101, 0, 0, 178, 40, 1, 0, 0, 0, 179, 180, 5, 111, 0, 0, 180, 181, 5, 117, 0, 0, 181, 182, 5, 116, 0, 0, 182, 183, 5, 112, 0, 0, 183, 184, 5, 117, 0, 0, 184, 185, 5, 116, 0, 0, 185, 42, 1, 0, 0, 0, 186, 187, 5, 101, 0, 0, 187, 188, 5, 120, 0, 0, 188, 189, 5, 105, 0, 0, 189, 190, 5, 115, 0, 0, 190, 191, 5, 116, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, 5, 110, 0, 0, 193, 194, 5, 103, 0, 0, 194, 44, 1, 0, 0, 0, 195, 199, 5, 39, 0, 0, 196, 198, 3, 93, 46, 0, 197, 196, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 202, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 5, 36, 0, 0, 203, 204, 5, 123, 0, 0, 204, 46, 1, 0, 0, 0, 205, 209, 5, 125, 0, 0, 206, 208, 3, 93, 46, 0, 207, 206, 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 212, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 212, 213, 5, 36, 0, 0, 213, 214, 5, 123, 0, 0, 214, 48, 1, 0, 0, 0, 215, 219, 5, 125, 0, 0, 216, 218, 3, 93, 46, 0, 217, 216, 1, 0, 0, 0, 218, 221, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 222, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 222, 223, 5, 39, 0, 0, 223, 50, 1, 0, 0, 0, 224, 228, 5, 39, 0, 0, 225, 227, 3, 93, 46, 0, 226, 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 231, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, 5, 39, 0, 0, 232, 52, 1, 0, 0, 0, 233, 234, 5, 115, 0, 0, 234, 235, 5, 116, 0, 0, 235, 236, 5, 114, 0, 0, 236, 237, 5, 105, 0, 0, 237, 238, 5, 110, 0, 0, 238, 239, 5, 103, 0, 0, 239, 54, 1, 0, 0, 0, 240, 241, 5, 105, 0, 0, 241, 242, 5, 110, 0, 0, 242, 243, 5, 116, 0, 0, 243, 56, 1, 0, 0, 0, 244, 245, 5, 98, 0, 0, 245, 246, 5, 111, 0, 0, 246, 247, 5, 111, 0, 0, 247, 248, 5, 108, 0, 0, 248, 58, 1, 0, 0, 0, 249, 250, 5, 105, 0, 0, 250, 251, 5, 102, 0, 0, 251, 60, 1, 0, 0, 0, 252, 253, 5, 102, 0, 0, 253, 254, 5, 111, 0, 0, 254, 255, 5, 114, 0, 0, 255, 62, 1, 0, 0, 0, 256, 257, 5, 105, 0, 0, 257, 258, 5, 110, 0, 0, 258, 64, 1, 0, 0, 0, 259, 260, 5, 63, 0, 0, 260, 66, 1, 0, 0, 0, 261, 262, 5, 62, 0, 0, 262, 68, 1, 0, 0, 0, 263, 264, 5, 62, 0, 0, 264, 265, 5, 61, 0, 0, 265, 70, 1, 0, 0, 0, 266, 267, 5, 60, 0, 0, 267, 72, 1, 0, 0, 0, 268, 269, 5, 60, 0, 0, 269, 270, 5, 61, 0, 0, 270, 74, 1, 0, 0, 0, 271, 272, 5, 61, 0, 0, 272, 273, 5, 61, 0, 0, 273, 76, 1, 0, 0, 0, 274, 275, 5, 33, 0, 0, 275, 276, 5, 61, 0, 0, 276, 78, 1, 0, 0, 0, 277, 281, 7, 0, 0, 0, 278, 280, 7, 1, 0, 0, 279, 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 80, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 284, 286, 7, 2, 0, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 295, 1, 0, 0, 0, 289, 291, 5, 46, 0, 0, 290, 292, 7, 2, 0, 0, 291, 290, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 296, 1, 0, 0, 0, 295, 289, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 82, 1, 0, 0, 0, 297, 299, 7, 3, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 84, 1, 0, 0, 0, 302, 303, 5, 47, 0, 0, 303, 304, 5, 47, 0, 0, 304, 308, 1, 0, 0, 0, 305, 307, 8, 3, 0, 0, 306, 305, 1, 0, 0, 0, 307, 310, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 311, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 311, 312, 6, 42, 0, 0, 312, 86, 1, 0, 0, 0, 313, 314, 5, 47, 0, 0, 314, 315, 5, 42, 0, 0, 315, 319, 1, 0, 0, 0, 316, 318, 9, 0, 0, 0, 317, 316, 1, 0, 0, 0, 318, 321, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 320, 322, 1, 0, 0, 0, 321, 319, 1, 0, 0, 0, 322, 323, 5, 42, 0, 0, 323, 324, 5, 47, 0, 0, 324, 325, 1, 0, 0, 0, 325, 326, 6, 43, 0, 0, 326, 88, 1, 0, 0, 0, 327, 329, 7, 4, 0, 0, 328, 327, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 333, 6, 44, 0, 0, 333, 90, 1, 0, 0, 0, 334, 335, 9, 0, 0, 0, 335, 92, 1, 0, 0, 0, 336, 339, 8, 5, 0, 0, 337, 339, 3, 95, 47, 0, 338, 336, 1, 0, 0, 0, 338, 337, 1, 0, 0, 0, 339, 94, 1, 0, 0, 0, 340, 352, 5, 92, 0, 0, 341, 353, 7, 6, 0, 0, 342, 343, 5, 117, 0, 0, 343, 344, 5, 123, 0, 0, 344, 346, 1, 0, 0, 0, 345, 347, 3, 97, 48, 0, 346, 345, 1, 0, 0, 0, 347, 348, 1, 0, 0, 0, 348, 346, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 5, 125, 0, 0, 351, 353, 1, 0, 0, 0, 352, 341, 1, 0, 0, 0, 352, 342, 1, 0, 0, 0, 353, 96, 1, 0, 0, 0, 354, 355, 7, 7, 0, 0, 355, 98, 1, 0, 0, 0, 17, 0, 106, 199, 209, 219, 228, 281, 287, 293, 295, 300, 308, 319, 330, 338, 348, 352, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 46, 359, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 105, 8, 0, 10, 0, 12, 0, 108, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 133, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 201, 8, 22, 10, 22, 12, 22, 204, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 211, 8, 23, 10, 23, 12, 23, 214, 9, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 221, 8, 24, 10, 24, 12, 24, 224, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 230, 8, 25, 10, 25, 12, 25, 233, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 5, 39, 283, 8, 39, 10, 39, 12, 39, 286, 9, 39, 1, 40, 4, 40, 289, 8, 40, 11, 40, 12, 40, 290, 1, 40, 1, 40, 4, 40, 295, 8, 40, 11, 40, 12, 40, 296, 3, 40, 299, 8, 40, 1, 41, 4, 41, 302, 8, 41, 11, 41, 12, 41, 303, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 310, 8, 42, 10, 42, 12, 42, 313, 9, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 321, 8, 43, 10, 43, 12, 43, 324, 9, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 4, 44, 332, 8, 44, 11, 44, 12, 44, 333, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 342, 8, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 4, 47, 350, 8, 47, 11, 47, 12, 47, 351, 1, 47, 1, 47, 3, 47, 356, 8, 47, 1, 48, 1, 48, 2, 106, 322, 0, 49, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 0, 95, 0, 97, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 372, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 1, 99, 1, 0, 0, 0, 3, 113, 1, 0, 0, 0, 5, 115, 1, 0, 0, 0, 7, 117, 1, 0, 0, 0, 9, 119, 1, 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 123, 1, 0, 0, 0, 15, 125, 1, 0, 0, 0, 17, 127, 1, 0, 0, 0, 19, 132, 1, 0, 0, 0, 21, 134, 1, 0, 0, 0, 23, 136, 1, 0, 0, 0, 25, 138, 1, 0, 0, 0, 27, 140, 1, 0, 0, 0, 29, 146, 1, 0, 0, 0, 31, 150, 1, 0, 0, 0, 33, 155, 1, 0, 0, 0, 35, 161, 1, 0, 0, 0, 37, 166, 1, 0, 0, 0, 39, 173, 1, 0, 0, 0, 41, 182, 1, 0, 0, 0, 43, 189, 1, 0, 0, 0, 45, 198, 1, 0, 0, 0, 47, 208, 1, 0, 0, 0, 49, 218, 1, 0, 0, 0, 51, 227, 1, 0, 0, 0, 53, 236, 1, 0, 0, 0, 55, 243, 1, 0, 0, 0, 57, 247, 1, 0, 0, 0, 59, 252, 1, 0, 0, 0, 61, 255, 1, 0, 0, 0, 63, 259, 1, 0, 0, 0, 65, 262, 1, 0, 0, 0, 67, 264, 1, 0, 0, 0, 69, 266, 1, 0, 0, 0, 71, 269, 1, 0, 0, 0, 73, 271, 1, 0, 0, 0, 75, 274, 1, 0, 0, 0, 77, 277, 1, 0, 0, 0, 79, 280, 1, 0, 0, 0, 81, 288, 1, 0, 0, 0, 83, 301, 1, 0, 0, 0, 85, 305, 1, 0, 0, 0, 87, 316, 1, 0, 0, 0, 89, 331, 1, 0, 0, 0, 91, 337, 1, 0, 0, 0, 93, 341, 1, 0, 0, 0, 95, 343, 1, 0, 0, 0, 97, 357, 1, 0, 0, 0, 99, 100, 5, 39, 0, 0, 100, 101, 5, 39, 0, 0, 101, 102, 5, 39, 0, 0, 102, 106, 1, 0, 0, 0, 103, 105, 9, 0, 0, 0, 104, 103, 1, 0, 0, 0, 105, 108, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 109, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, 5, 39, 0, 0, 111, 112, 5, 39, 0, 0, 112, 2, 1, 0, 0, 0, 113, 114, 5, 64, 0, 0, 114, 4, 1, 0, 0, 0, 115, 116, 5, 44, 0, 0, 116, 6, 1, 0, 0, 0, 117, 118, 5, 91, 0, 0, 118, 8, 1, 0, 0, 0, 119, 120, 5, 93, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, 40, 0, 0, 122, 12, 1, 0, 0, 0, 123, 124, 5, 41, 0, 0, 124, 14, 1, 0, 0, 0, 125, 126, 5, 46, 0, 0, 126, 16, 1, 0, 0, 0, 127, 128, 5, 124, 0, 0, 128, 18, 1, 0, 0, 0, 129, 133, 5, 58, 0, 0, 130, 131, 5, 58, 0, 0, 131, 133, 5, 58, 0, 0, 132, 129, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 133, 20, 1, 0, 0, 0, 134, 135, 5, 61, 0, 0, 135, 22, 1, 0, 0, 0, 136, 137, 5, 123, 0, 0, 137, 24, 1, 0, 0, 0, 138, 139, 5, 125, 0, 0, 139, 26, 1, 0, 0, 0, 140, 141, 5, 112, 0, 0, 141, 142, 5, 97, 0, 0, 142, 143, 5, 114, 0, 0, 143, 144, 5, 97, 0, 0, 144, 145, 5, 109, 0, 0, 145, 28, 1, 0, 0, 0, 146, 147, 5, 118, 0, 0, 147, 148, 5, 97, 0, 0, 148, 149, 5, 114, 0, 0, 149, 30, 1, 0, 0, 0, 150, 151, 5, 116, 0, 0, 151, 152, 5, 114, 0, 0, 152, 153, 5, 117, 0, 0, 153, 154, 5, 101, 0, 0, 154, 32, 1, 0, 0, 0, 155, 156, 5, 102, 0, 0, 156, 157, 5, 97, 0, 0, 157, 158, 5, 108, 0, 0, 158, 159, 5, 115, 0, 0, 159, 160, 5, 101, 0, 0, 160, 34, 1, 0, 0, 0, 161, 162, 5, 110, 0, 0, 162, 163, 5, 117, 0, 0, 163, 164, 5, 108, 0, 0, 164, 165, 5, 108, 0, 0, 165, 36, 1, 0, 0, 0, 166, 167, 5, 111, 0, 0, 167, 168, 5, 98, 0, 0, 168, 169, 5, 106, 0, 0, 169, 170, 5, 101, 0, 0, 170, 171, 5, 99, 0, 0, 171, 172, 5, 116, 0, 0, 172, 38, 1, 0, 0, 0, 173, 174, 5, 114, 0, 0, 174, 175, 5, 101, 0, 0, 175, 176, 5, 115, 0, 0, 176, 177, 5, 111, 0, 0, 177, 178, 5, 117, 0, 0, 178, 179, 5, 114, 0, 0, 179, 180, 5, 99, 0, 0, 180, 181, 5, 101, 0, 0, 181, 40, 1, 0, 0, 0, 182, 183, 5, 111, 0, 0, 183, 184, 5, 117, 0, 0, 184, 185, 5, 116, 0, 0, 185, 186, 5, 112, 0, 0, 186, 187, 5, 117, 0, 0, 187, 188, 5, 116, 0, 0, 188, 42, 1, 0, 0, 0, 189, 190, 5, 101, 0, 0, 190, 191, 5, 120, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, 5, 115, 0, 0, 193, 194, 5, 116, 0, 0, 194, 195, 5, 105, 0, 0, 195, 196, 5, 110, 0, 0, 196, 197, 5, 103, 0, 0, 197, 44, 1, 0, 0, 0, 198, 202, 5, 39, 0, 0, 199, 201, 3, 93, 46, 0, 200, 199, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 205, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 205, 206, 5, 36, 0, 0, 206, 207, 5, 123, 0, 0, 207, 46, 1, 0, 0, 0, 208, 212, 5, 125, 0, 0, 209, 211, 3, 93, 46, 0, 210, 209, 1, 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 215, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 215, 216, 5, 36, 0, 0, 216, 217, 5, 123, 0, 0, 217, 48, 1, 0, 0, 0, 218, 222, 5, 125, 0, 0, 219, 221, 3, 93, 46, 0, 220, 219, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 225, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 225, 226, 5, 39, 0, 0, 226, 50, 1, 0, 0, 0, 227, 231, 5, 39, 0, 0, 228, 230, 3, 93, 46, 0, 229, 228, 1, 0, 0, 0, 230, 233, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 234, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 234, 235, 5, 39, 0, 0, 235, 52, 1, 0, 0, 0, 236, 237, 5, 115, 0, 0, 237, 238, 5, 116, 0, 0, 238, 239, 5, 114, 0, 0, 239, 240, 5, 105, 0, 0, 240, 241, 5, 110, 0, 0, 241, 242, 5, 103, 0, 0, 242, 54, 1, 0, 0, 0, 243, 244, 5, 105, 0, 0, 244, 245, 5, 110, 0, 0, 245, 246, 5, 116, 0, 0, 246, 56, 1, 0, 0, 0, 247, 248, 5, 98, 0, 0, 248, 249, 5, 111, 0, 0, 249, 250, 5, 111, 0, 0, 250, 251, 5, 108, 0, 0, 251, 58, 1, 0, 0, 0, 252, 253, 5, 105, 0, 0, 253, 254, 5, 102, 0, 0, 254, 60, 1, 0, 0, 0, 255, 256, 5, 102, 0, 0, 256, 257, 5, 111, 0, 0, 257, 258, 5, 114, 0, 0, 258, 62, 1, 0, 0, 0, 259, 260, 5, 105, 0, 0, 260, 261, 5, 110, 0, 0, 261, 64, 1, 0, 0, 0, 262, 263, 5, 63, 0, 0, 263, 66, 1, 0, 0, 0, 264, 265, 5, 62, 0, 0, 265, 68, 1, 0, 0, 0, 266, 267, 5, 62, 0, 0, 267, 268, 5, 61, 0, 0, 268, 70, 1, 0, 0, 0, 269, 270, 5, 60, 0, 0, 270, 72, 1, 0, 0, 0, 271, 272, 5, 60, 0, 0, 272, 273, 5, 61, 0, 0, 273, 74, 1, 0, 0, 0, 274, 275, 5, 61, 0, 0, 275, 276, 5, 61, 0, 0, 276, 76, 1, 0, 0, 0, 277, 278, 5, 33, 0, 0, 278, 279, 5, 61, 0, 0, 279, 78, 1, 0, 0, 0, 280, 284, 7, 0, 0, 0, 281, 283, 7, 1, 0, 0, 282, 281, 1, 0, 0, 0, 283, 286, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 80, 1, 0, 0, 0, 286, 284, 1, 0, 0, 0, 287, 289, 7, 2, 0, 0, 288, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 298, 1, 0, 0, 0, 292, 294, 5, 46, 0, 0, 293, 295, 7, 2, 0, 0, 294, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 299, 1, 0, 0, 0, 298, 292, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 82, 1, 0, 0, 0, 300, 302, 7, 3, 0, 0, 301, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 84, 1, 0, 0, 0, 305, 306, 5, 47, 0, 0, 306, 307, 5, 47, 0, 0, 307, 311, 1, 0, 0, 0, 308, 310, 8, 3, 0, 0, 309, 308, 1, 0, 0, 0, 310, 313, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 314, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 314, 315, 6, 42, 0, 0, 315, 86, 1, 0, 0, 0, 316, 317, 5, 47, 0, 0, 317, 318, 5, 42, 0, 0, 318, 322, 1, 0, 0, 0, 319, 321, 9, 0, 0, 0, 320, 319, 1, 0, 0, 0, 321, 324, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 325, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 325, 326, 5, 42, 0, 0, 326, 327, 5, 47, 0, 0, 327, 328, 1, 0, 0, 0, 328, 329, 6, 43, 0, 0, 329, 88, 1, 0, 0, 0, 330, 332, 7, 4, 0, 0, 331, 330, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 336, 6, 44, 0, 0, 336, 90, 1, 0, 0, 0, 337, 338, 9, 0, 0, 0, 338, 92, 1, 0, 0, 0, 339, 342, 8, 5, 0, 0, 340, 342, 3, 95, 47, 0, 341, 339, 1, 0, 0, 0, 341, 340, 1, 0, 0, 0, 342, 94, 1, 0, 0, 0, 343, 355, 5, 92, 0, 0, 344, 356, 7, 6, 0, 0, 345, 346, 5, 117, 0, 0, 346, 347, 5, 123, 0, 0, 347, 349, 1, 0, 0, 0, 348, 350, 3, 97, 48, 0, 349, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, 353, 354, 5, 125, 0, 0, 354, 356, 1, 0, 0, 0, 355, 344, 1, 0, 0, 0, 355, 345, 1, 0, 0, 0, 356, 96, 1, 0, 0, 0, 357, 358, 7, 7, 0, 0, 358, 98, 1, 0, 0, 0, 18, 0, 106, 132, 202, 212, 222, 231, 284, 290, 296, 298, 303, 311, 322, 333, 341, 351, 355, 1, 6, 0, 0] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens index cd100fb8ade..cef1c62deb6 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens @@ -52,7 +52,6 @@ UNKNOWN=46 ')'=7 '.'=8 '|'=9 -':'=10 '='=11 '{'=12 '}'=13 diff --git a/pkg/parser/bicep/antlr/parser/bicep_lexer.go b/pkg/parser/bicep/antlr/parser/bicep_lexer.go index 529982e482f..33379172caf 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_lexer.go +++ b/pkg/parser/bicep/antlr/parser/bicep_lexer.go @@ -43,7 +43,7 @@ func biceplexerLexerInit() { "DEFAULT_MODE", } staticData.LiteralNames = []string{ - "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", + "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", "'object'", "'resource'", "'output'", "'existing'", "", "", "", "", "'string'", "'int'", "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", @@ -69,7 +69,7 @@ func biceplexerLexerInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 46, 356, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 46, 359, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, @@ -81,152 +81,154 @@ func biceplexerLexerInit() { 2, 47, 7, 47, 2, 48, 7, 48, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 105, 8, 0, 10, 0, 12, 0, 108, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, - 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, - 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, - 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, - 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, - 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, - 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, - 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 198, 8, 22, 10, 22, 12, 22, - 201, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 208, 8, 23, 10, 23, - 12, 23, 211, 9, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 218, 8, 24, - 10, 24, 12, 24, 221, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 227, 8, - 25, 10, 25, 12, 25, 230, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, - 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, - 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, - 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, - 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, - 5, 39, 280, 8, 39, 10, 39, 12, 39, 283, 9, 39, 1, 40, 4, 40, 286, 8, 40, - 11, 40, 12, 40, 287, 1, 40, 1, 40, 4, 40, 292, 8, 40, 11, 40, 12, 40, 293, - 3, 40, 296, 8, 40, 1, 41, 4, 41, 299, 8, 41, 11, 41, 12, 41, 300, 1, 42, - 1, 42, 1, 42, 1, 42, 5, 42, 307, 8, 42, 10, 42, 12, 42, 310, 9, 42, 1, - 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 318, 8, 43, 10, 43, 12, 43, - 321, 9, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 4, 44, 329, 8, 44, - 11, 44, 12, 44, 330, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 339, - 8, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 4, 47, 347, 8, 47, 11, - 47, 12, 47, 348, 1, 47, 1, 47, 3, 47, 353, 8, 47, 1, 48, 1, 48, 2, 106, - 319, 0, 49, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, - 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, - 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, - 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, - 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, - 46, 93, 0, 95, 0, 97, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, - 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, - 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, - 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, - 97, 102, 368, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, - 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, - 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, - 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, - 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, - 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, - 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, - 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, - 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, - 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, - 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, - 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, - 1, 0, 0, 0, 1, 99, 1, 0, 0, 0, 3, 113, 1, 0, 0, 0, 5, 115, 1, 0, 0, 0, - 7, 117, 1, 0, 0, 0, 9, 119, 1, 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 123, 1, - 0, 0, 0, 15, 125, 1, 0, 0, 0, 17, 127, 1, 0, 0, 0, 19, 129, 1, 0, 0, 0, - 21, 131, 1, 0, 0, 0, 23, 133, 1, 0, 0, 0, 25, 135, 1, 0, 0, 0, 27, 137, - 1, 0, 0, 0, 29, 143, 1, 0, 0, 0, 31, 147, 1, 0, 0, 0, 33, 152, 1, 0, 0, - 0, 35, 158, 1, 0, 0, 0, 37, 163, 1, 0, 0, 0, 39, 170, 1, 0, 0, 0, 41, 179, - 1, 0, 0, 0, 43, 186, 1, 0, 0, 0, 45, 195, 1, 0, 0, 0, 47, 205, 1, 0, 0, - 0, 49, 215, 1, 0, 0, 0, 51, 224, 1, 0, 0, 0, 53, 233, 1, 0, 0, 0, 55, 240, - 1, 0, 0, 0, 57, 244, 1, 0, 0, 0, 59, 249, 1, 0, 0, 0, 61, 252, 1, 0, 0, - 0, 63, 256, 1, 0, 0, 0, 65, 259, 1, 0, 0, 0, 67, 261, 1, 0, 0, 0, 69, 263, - 1, 0, 0, 0, 71, 266, 1, 0, 0, 0, 73, 268, 1, 0, 0, 0, 75, 271, 1, 0, 0, - 0, 77, 274, 1, 0, 0, 0, 79, 277, 1, 0, 0, 0, 81, 285, 1, 0, 0, 0, 83, 298, - 1, 0, 0, 0, 85, 302, 1, 0, 0, 0, 87, 313, 1, 0, 0, 0, 89, 328, 1, 0, 0, - 0, 91, 334, 1, 0, 0, 0, 93, 338, 1, 0, 0, 0, 95, 340, 1, 0, 0, 0, 97, 354, - 1, 0, 0, 0, 99, 100, 5, 39, 0, 0, 100, 101, 5, 39, 0, 0, 101, 102, 5, 39, - 0, 0, 102, 106, 1, 0, 0, 0, 103, 105, 9, 0, 0, 0, 104, 103, 1, 0, 0, 0, - 105, 108, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, - 109, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, - 5, 39, 0, 0, 111, 112, 5, 39, 0, 0, 112, 2, 1, 0, 0, 0, 113, 114, 5, 64, - 0, 0, 114, 4, 1, 0, 0, 0, 115, 116, 5, 44, 0, 0, 116, 6, 1, 0, 0, 0, 117, - 118, 5, 91, 0, 0, 118, 8, 1, 0, 0, 0, 119, 120, 5, 93, 0, 0, 120, 10, 1, - 0, 0, 0, 121, 122, 5, 40, 0, 0, 122, 12, 1, 0, 0, 0, 123, 124, 5, 41, 0, - 0, 124, 14, 1, 0, 0, 0, 125, 126, 5, 46, 0, 0, 126, 16, 1, 0, 0, 0, 127, - 128, 5, 124, 0, 0, 128, 18, 1, 0, 0, 0, 129, 130, 5, 58, 0, 0, 130, 20, - 1, 0, 0, 0, 131, 132, 5, 61, 0, 0, 132, 22, 1, 0, 0, 0, 133, 134, 5, 123, - 0, 0, 134, 24, 1, 0, 0, 0, 135, 136, 5, 125, 0, 0, 136, 26, 1, 0, 0, 0, - 137, 138, 5, 112, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 114, 0, 0, - 140, 141, 5, 97, 0, 0, 141, 142, 5, 109, 0, 0, 142, 28, 1, 0, 0, 0, 143, - 144, 5, 118, 0, 0, 144, 145, 5, 97, 0, 0, 145, 146, 5, 114, 0, 0, 146, - 30, 1, 0, 0, 0, 147, 148, 5, 116, 0, 0, 148, 149, 5, 114, 0, 0, 149, 150, - 5, 117, 0, 0, 150, 151, 5, 101, 0, 0, 151, 32, 1, 0, 0, 0, 152, 153, 5, - 102, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 108, 0, 0, 155, 156, 5, - 115, 0, 0, 156, 157, 5, 101, 0, 0, 157, 34, 1, 0, 0, 0, 158, 159, 5, 110, - 0, 0, 159, 160, 5, 117, 0, 0, 160, 161, 5, 108, 0, 0, 161, 162, 5, 108, - 0, 0, 162, 36, 1, 0, 0, 0, 163, 164, 5, 111, 0, 0, 164, 165, 5, 98, 0, - 0, 165, 166, 5, 106, 0, 0, 166, 167, 5, 101, 0, 0, 167, 168, 5, 99, 0, - 0, 168, 169, 5, 116, 0, 0, 169, 38, 1, 0, 0, 0, 170, 171, 5, 114, 0, 0, - 171, 172, 5, 101, 0, 0, 172, 173, 5, 115, 0, 0, 173, 174, 5, 111, 0, 0, - 174, 175, 5, 117, 0, 0, 175, 176, 5, 114, 0, 0, 176, 177, 5, 99, 0, 0, - 177, 178, 5, 101, 0, 0, 178, 40, 1, 0, 0, 0, 179, 180, 5, 111, 0, 0, 180, - 181, 5, 117, 0, 0, 181, 182, 5, 116, 0, 0, 182, 183, 5, 112, 0, 0, 183, - 184, 5, 117, 0, 0, 184, 185, 5, 116, 0, 0, 185, 42, 1, 0, 0, 0, 186, 187, - 5, 101, 0, 0, 187, 188, 5, 120, 0, 0, 188, 189, 5, 105, 0, 0, 189, 190, - 5, 115, 0, 0, 190, 191, 5, 116, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, - 5, 110, 0, 0, 193, 194, 5, 103, 0, 0, 194, 44, 1, 0, 0, 0, 195, 199, 5, - 39, 0, 0, 196, 198, 3, 93, 46, 0, 197, 196, 1, 0, 0, 0, 198, 201, 1, 0, - 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 202, 1, 0, 0, 0, - 201, 199, 1, 0, 0, 0, 202, 203, 5, 36, 0, 0, 203, 204, 5, 123, 0, 0, 204, - 46, 1, 0, 0, 0, 205, 209, 5, 125, 0, 0, 206, 208, 3, 93, 46, 0, 207, 206, - 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, - 0, 0, 210, 212, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 212, 213, 5, 36, 0, 0, - 213, 214, 5, 123, 0, 0, 214, 48, 1, 0, 0, 0, 215, 219, 5, 125, 0, 0, 216, - 218, 3, 93, 46, 0, 217, 216, 1, 0, 0, 0, 218, 221, 1, 0, 0, 0, 219, 217, - 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 222, 1, 0, 0, 0, 221, 219, 1, 0, - 0, 0, 222, 223, 5, 39, 0, 0, 223, 50, 1, 0, 0, 0, 224, 228, 5, 39, 0, 0, - 225, 227, 3, 93, 46, 0, 226, 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, - 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 231, 1, 0, 0, 0, 230, 228, - 1, 0, 0, 0, 231, 232, 5, 39, 0, 0, 232, 52, 1, 0, 0, 0, 233, 234, 5, 115, - 0, 0, 234, 235, 5, 116, 0, 0, 235, 236, 5, 114, 0, 0, 236, 237, 5, 105, - 0, 0, 237, 238, 5, 110, 0, 0, 238, 239, 5, 103, 0, 0, 239, 54, 1, 0, 0, - 0, 240, 241, 5, 105, 0, 0, 241, 242, 5, 110, 0, 0, 242, 243, 5, 116, 0, - 0, 243, 56, 1, 0, 0, 0, 244, 245, 5, 98, 0, 0, 245, 246, 5, 111, 0, 0, - 246, 247, 5, 111, 0, 0, 247, 248, 5, 108, 0, 0, 248, 58, 1, 0, 0, 0, 249, - 250, 5, 105, 0, 0, 250, 251, 5, 102, 0, 0, 251, 60, 1, 0, 0, 0, 252, 253, - 5, 102, 0, 0, 253, 254, 5, 111, 0, 0, 254, 255, 5, 114, 0, 0, 255, 62, - 1, 0, 0, 0, 256, 257, 5, 105, 0, 0, 257, 258, 5, 110, 0, 0, 258, 64, 1, - 0, 0, 0, 259, 260, 5, 63, 0, 0, 260, 66, 1, 0, 0, 0, 261, 262, 5, 62, 0, - 0, 262, 68, 1, 0, 0, 0, 263, 264, 5, 62, 0, 0, 264, 265, 5, 61, 0, 0, 265, - 70, 1, 0, 0, 0, 266, 267, 5, 60, 0, 0, 267, 72, 1, 0, 0, 0, 268, 269, 5, - 60, 0, 0, 269, 270, 5, 61, 0, 0, 270, 74, 1, 0, 0, 0, 271, 272, 5, 61, - 0, 0, 272, 273, 5, 61, 0, 0, 273, 76, 1, 0, 0, 0, 274, 275, 5, 33, 0, 0, - 275, 276, 5, 61, 0, 0, 276, 78, 1, 0, 0, 0, 277, 281, 7, 0, 0, 0, 278, - 280, 7, 1, 0, 0, 279, 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, - 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 80, 1, 0, 0, 0, 283, 281, 1, 0, - 0, 0, 284, 286, 7, 2, 0, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, - 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 295, 1, 0, 0, 0, 289, - 291, 5, 46, 0, 0, 290, 292, 7, 2, 0, 0, 291, 290, 1, 0, 0, 0, 292, 293, - 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 296, 1, 0, - 0, 0, 295, 289, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 82, 1, 0, 0, 0, - 297, 299, 7, 3, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, - 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 84, 1, 0, 0, 0, 302, 303, 5, - 47, 0, 0, 303, 304, 5, 47, 0, 0, 304, 308, 1, 0, 0, 0, 305, 307, 8, 3, - 0, 0, 306, 305, 1, 0, 0, 0, 307, 310, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, - 308, 309, 1, 0, 0, 0, 309, 311, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 311, - 312, 6, 42, 0, 0, 312, 86, 1, 0, 0, 0, 313, 314, 5, 47, 0, 0, 314, 315, - 5, 42, 0, 0, 315, 319, 1, 0, 0, 0, 316, 318, 9, 0, 0, 0, 317, 316, 1, 0, - 0, 0, 318, 321, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, - 320, 322, 1, 0, 0, 0, 321, 319, 1, 0, 0, 0, 322, 323, 5, 42, 0, 0, 323, - 324, 5, 47, 0, 0, 324, 325, 1, 0, 0, 0, 325, 326, 6, 43, 0, 0, 326, 88, - 1, 0, 0, 0, 327, 329, 7, 4, 0, 0, 328, 327, 1, 0, 0, 0, 329, 330, 1, 0, - 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, - 332, 333, 6, 44, 0, 0, 333, 90, 1, 0, 0, 0, 334, 335, 9, 0, 0, 0, 335, - 92, 1, 0, 0, 0, 336, 339, 8, 5, 0, 0, 337, 339, 3, 95, 47, 0, 338, 336, - 1, 0, 0, 0, 338, 337, 1, 0, 0, 0, 339, 94, 1, 0, 0, 0, 340, 352, 5, 92, - 0, 0, 341, 353, 7, 6, 0, 0, 342, 343, 5, 117, 0, 0, 343, 344, 5, 123, 0, - 0, 344, 346, 1, 0, 0, 0, 345, 347, 3, 97, 48, 0, 346, 345, 1, 0, 0, 0, - 347, 348, 1, 0, 0, 0, 348, 346, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, - 350, 1, 0, 0, 0, 350, 351, 5, 125, 0, 0, 351, 353, 1, 0, 0, 0, 352, 341, - 1, 0, 0, 0, 352, 342, 1, 0, 0, 0, 353, 96, 1, 0, 0, 0, 354, 355, 7, 7, - 0, 0, 355, 98, 1, 0, 0, 0, 17, 0, 106, 199, 209, 219, 228, 281, 287, 293, - 295, 300, 308, 319, 330, 338, 348, 352, 1, 6, 0, 0, + 8, 1, 9, 1, 9, 1, 9, 3, 9, 133, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, + 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, + 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, + 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, + 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, + 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, + 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 201, + 8, 22, 10, 22, 12, 22, 204, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, + 23, 211, 8, 23, 10, 23, 12, 23, 214, 9, 23, 1, 23, 1, 23, 1, 23, 1, 24, + 1, 24, 5, 24, 221, 8, 24, 10, 24, 12, 24, 224, 9, 24, 1, 24, 1, 24, 1, + 25, 1, 25, 5, 25, 230, 8, 25, 10, 25, 12, 25, 233, 9, 25, 1, 25, 1, 25, + 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, + 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, + 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, + 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, + 1, 38, 1, 38, 1, 39, 1, 39, 5, 39, 283, 8, 39, 10, 39, 12, 39, 286, 9, + 39, 1, 40, 4, 40, 289, 8, 40, 11, 40, 12, 40, 290, 1, 40, 1, 40, 4, 40, + 295, 8, 40, 11, 40, 12, 40, 296, 3, 40, 299, 8, 40, 1, 41, 4, 41, 302, + 8, 41, 11, 41, 12, 41, 303, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 310, 8, + 42, 10, 42, 12, 42, 313, 9, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, + 5, 43, 321, 8, 43, 10, 43, 12, 43, 324, 9, 43, 1, 43, 1, 43, 1, 43, 1, + 43, 1, 43, 1, 44, 4, 44, 332, 8, 44, 11, 44, 12, 44, 333, 1, 44, 1, 44, + 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 342, 8, 46, 1, 47, 1, 47, 1, 47, 1, + 47, 1, 47, 1, 47, 4, 47, 350, 8, 47, 11, 47, 12, 47, 351, 1, 47, 1, 47, + 3, 47, 356, 8, 47, 1, 48, 1, 48, 2, 106, 322, 0, 49, 1, 1, 3, 2, 5, 3, + 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, + 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, + 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, + 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, + 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 0, 95, 0, 97, 0, 1, + 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, + 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, + 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, + 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 372, 0, 1, 1, 0, 0, + 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, + 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, + 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, + 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, + 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, + 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, + 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, + 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, + 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, + 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, + 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, + 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 1, 99, 1, 0, 0, 0, + 3, 113, 1, 0, 0, 0, 5, 115, 1, 0, 0, 0, 7, 117, 1, 0, 0, 0, 9, 119, 1, + 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 123, 1, 0, 0, 0, 15, 125, 1, 0, 0, 0, + 17, 127, 1, 0, 0, 0, 19, 132, 1, 0, 0, 0, 21, 134, 1, 0, 0, 0, 23, 136, + 1, 0, 0, 0, 25, 138, 1, 0, 0, 0, 27, 140, 1, 0, 0, 0, 29, 146, 1, 0, 0, + 0, 31, 150, 1, 0, 0, 0, 33, 155, 1, 0, 0, 0, 35, 161, 1, 0, 0, 0, 37, 166, + 1, 0, 0, 0, 39, 173, 1, 0, 0, 0, 41, 182, 1, 0, 0, 0, 43, 189, 1, 0, 0, + 0, 45, 198, 1, 0, 0, 0, 47, 208, 1, 0, 0, 0, 49, 218, 1, 0, 0, 0, 51, 227, + 1, 0, 0, 0, 53, 236, 1, 0, 0, 0, 55, 243, 1, 0, 0, 0, 57, 247, 1, 0, 0, + 0, 59, 252, 1, 0, 0, 0, 61, 255, 1, 0, 0, 0, 63, 259, 1, 0, 0, 0, 65, 262, + 1, 0, 0, 0, 67, 264, 1, 0, 0, 0, 69, 266, 1, 0, 0, 0, 71, 269, 1, 0, 0, + 0, 73, 271, 1, 0, 0, 0, 75, 274, 1, 0, 0, 0, 77, 277, 1, 0, 0, 0, 79, 280, + 1, 0, 0, 0, 81, 288, 1, 0, 0, 0, 83, 301, 1, 0, 0, 0, 85, 305, 1, 0, 0, + 0, 87, 316, 1, 0, 0, 0, 89, 331, 1, 0, 0, 0, 91, 337, 1, 0, 0, 0, 93, 341, + 1, 0, 0, 0, 95, 343, 1, 0, 0, 0, 97, 357, 1, 0, 0, 0, 99, 100, 5, 39, 0, + 0, 100, 101, 5, 39, 0, 0, 101, 102, 5, 39, 0, 0, 102, 106, 1, 0, 0, 0, + 103, 105, 9, 0, 0, 0, 104, 103, 1, 0, 0, 0, 105, 108, 1, 0, 0, 0, 106, + 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 109, 1, 0, 0, 0, 108, 106, + 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, 5, 39, 0, 0, 111, 112, 5, + 39, 0, 0, 112, 2, 1, 0, 0, 0, 113, 114, 5, 64, 0, 0, 114, 4, 1, 0, 0, 0, + 115, 116, 5, 44, 0, 0, 116, 6, 1, 0, 0, 0, 117, 118, 5, 91, 0, 0, 118, + 8, 1, 0, 0, 0, 119, 120, 5, 93, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, + 40, 0, 0, 122, 12, 1, 0, 0, 0, 123, 124, 5, 41, 0, 0, 124, 14, 1, 0, 0, + 0, 125, 126, 5, 46, 0, 0, 126, 16, 1, 0, 0, 0, 127, 128, 5, 124, 0, 0, + 128, 18, 1, 0, 0, 0, 129, 133, 5, 58, 0, 0, 130, 131, 5, 58, 0, 0, 131, + 133, 5, 58, 0, 0, 132, 129, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 133, 20, + 1, 0, 0, 0, 134, 135, 5, 61, 0, 0, 135, 22, 1, 0, 0, 0, 136, 137, 5, 123, + 0, 0, 137, 24, 1, 0, 0, 0, 138, 139, 5, 125, 0, 0, 139, 26, 1, 0, 0, 0, + 140, 141, 5, 112, 0, 0, 141, 142, 5, 97, 0, 0, 142, 143, 5, 114, 0, 0, + 143, 144, 5, 97, 0, 0, 144, 145, 5, 109, 0, 0, 145, 28, 1, 0, 0, 0, 146, + 147, 5, 118, 0, 0, 147, 148, 5, 97, 0, 0, 148, 149, 5, 114, 0, 0, 149, + 30, 1, 0, 0, 0, 150, 151, 5, 116, 0, 0, 151, 152, 5, 114, 0, 0, 152, 153, + 5, 117, 0, 0, 153, 154, 5, 101, 0, 0, 154, 32, 1, 0, 0, 0, 155, 156, 5, + 102, 0, 0, 156, 157, 5, 97, 0, 0, 157, 158, 5, 108, 0, 0, 158, 159, 5, + 115, 0, 0, 159, 160, 5, 101, 0, 0, 160, 34, 1, 0, 0, 0, 161, 162, 5, 110, + 0, 0, 162, 163, 5, 117, 0, 0, 163, 164, 5, 108, 0, 0, 164, 165, 5, 108, + 0, 0, 165, 36, 1, 0, 0, 0, 166, 167, 5, 111, 0, 0, 167, 168, 5, 98, 0, + 0, 168, 169, 5, 106, 0, 0, 169, 170, 5, 101, 0, 0, 170, 171, 5, 99, 0, + 0, 171, 172, 5, 116, 0, 0, 172, 38, 1, 0, 0, 0, 173, 174, 5, 114, 0, 0, + 174, 175, 5, 101, 0, 0, 175, 176, 5, 115, 0, 0, 176, 177, 5, 111, 0, 0, + 177, 178, 5, 117, 0, 0, 178, 179, 5, 114, 0, 0, 179, 180, 5, 99, 0, 0, + 180, 181, 5, 101, 0, 0, 181, 40, 1, 0, 0, 0, 182, 183, 5, 111, 0, 0, 183, + 184, 5, 117, 0, 0, 184, 185, 5, 116, 0, 0, 185, 186, 5, 112, 0, 0, 186, + 187, 5, 117, 0, 0, 187, 188, 5, 116, 0, 0, 188, 42, 1, 0, 0, 0, 189, 190, + 5, 101, 0, 0, 190, 191, 5, 120, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, + 5, 115, 0, 0, 193, 194, 5, 116, 0, 0, 194, 195, 5, 105, 0, 0, 195, 196, + 5, 110, 0, 0, 196, 197, 5, 103, 0, 0, 197, 44, 1, 0, 0, 0, 198, 202, 5, + 39, 0, 0, 199, 201, 3, 93, 46, 0, 200, 199, 1, 0, 0, 0, 201, 204, 1, 0, + 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 205, 1, 0, 0, 0, + 204, 202, 1, 0, 0, 0, 205, 206, 5, 36, 0, 0, 206, 207, 5, 123, 0, 0, 207, + 46, 1, 0, 0, 0, 208, 212, 5, 125, 0, 0, 209, 211, 3, 93, 46, 0, 210, 209, + 1, 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, + 0, 0, 213, 215, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 215, 216, 5, 36, 0, 0, + 216, 217, 5, 123, 0, 0, 217, 48, 1, 0, 0, 0, 218, 222, 5, 125, 0, 0, 219, + 221, 3, 93, 46, 0, 220, 219, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, + 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 225, 1, 0, 0, 0, 224, 222, 1, 0, + 0, 0, 225, 226, 5, 39, 0, 0, 226, 50, 1, 0, 0, 0, 227, 231, 5, 39, 0, 0, + 228, 230, 3, 93, 46, 0, 229, 228, 1, 0, 0, 0, 230, 233, 1, 0, 0, 0, 231, + 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 234, 1, 0, 0, 0, 233, 231, + 1, 0, 0, 0, 234, 235, 5, 39, 0, 0, 235, 52, 1, 0, 0, 0, 236, 237, 5, 115, + 0, 0, 237, 238, 5, 116, 0, 0, 238, 239, 5, 114, 0, 0, 239, 240, 5, 105, + 0, 0, 240, 241, 5, 110, 0, 0, 241, 242, 5, 103, 0, 0, 242, 54, 1, 0, 0, + 0, 243, 244, 5, 105, 0, 0, 244, 245, 5, 110, 0, 0, 245, 246, 5, 116, 0, + 0, 246, 56, 1, 0, 0, 0, 247, 248, 5, 98, 0, 0, 248, 249, 5, 111, 0, 0, + 249, 250, 5, 111, 0, 0, 250, 251, 5, 108, 0, 0, 251, 58, 1, 0, 0, 0, 252, + 253, 5, 105, 0, 0, 253, 254, 5, 102, 0, 0, 254, 60, 1, 0, 0, 0, 255, 256, + 5, 102, 0, 0, 256, 257, 5, 111, 0, 0, 257, 258, 5, 114, 0, 0, 258, 62, + 1, 0, 0, 0, 259, 260, 5, 105, 0, 0, 260, 261, 5, 110, 0, 0, 261, 64, 1, + 0, 0, 0, 262, 263, 5, 63, 0, 0, 263, 66, 1, 0, 0, 0, 264, 265, 5, 62, 0, + 0, 265, 68, 1, 0, 0, 0, 266, 267, 5, 62, 0, 0, 267, 268, 5, 61, 0, 0, 268, + 70, 1, 0, 0, 0, 269, 270, 5, 60, 0, 0, 270, 72, 1, 0, 0, 0, 271, 272, 5, + 60, 0, 0, 272, 273, 5, 61, 0, 0, 273, 74, 1, 0, 0, 0, 274, 275, 5, 61, + 0, 0, 275, 276, 5, 61, 0, 0, 276, 76, 1, 0, 0, 0, 277, 278, 5, 33, 0, 0, + 278, 279, 5, 61, 0, 0, 279, 78, 1, 0, 0, 0, 280, 284, 7, 0, 0, 0, 281, + 283, 7, 1, 0, 0, 282, 281, 1, 0, 0, 0, 283, 286, 1, 0, 0, 0, 284, 282, + 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 80, 1, 0, 0, 0, 286, 284, 1, 0, + 0, 0, 287, 289, 7, 2, 0, 0, 288, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, + 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 298, 1, 0, 0, 0, 292, + 294, 5, 46, 0, 0, 293, 295, 7, 2, 0, 0, 294, 293, 1, 0, 0, 0, 295, 296, + 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 299, 1, 0, + 0, 0, 298, 292, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 82, 1, 0, 0, 0, + 300, 302, 7, 3, 0, 0, 301, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, + 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 84, 1, 0, 0, 0, 305, 306, 5, + 47, 0, 0, 306, 307, 5, 47, 0, 0, 307, 311, 1, 0, 0, 0, 308, 310, 8, 3, + 0, 0, 309, 308, 1, 0, 0, 0, 310, 313, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, + 311, 312, 1, 0, 0, 0, 312, 314, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 314, + 315, 6, 42, 0, 0, 315, 86, 1, 0, 0, 0, 316, 317, 5, 47, 0, 0, 317, 318, + 5, 42, 0, 0, 318, 322, 1, 0, 0, 0, 319, 321, 9, 0, 0, 0, 320, 319, 1, 0, + 0, 0, 321, 324, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, + 323, 325, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 325, 326, 5, 42, 0, 0, 326, + 327, 5, 47, 0, 0, 327, 328, 1, 0, 0, 0, 328, 329, 6, 43, 0, 0, 329, 88, + 1, 0, 0, 0, 330, 332, 7, 4, 0, 0, 331, 330, 1, 0, 0, 0, 332, 333, 1, 0, + 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, + 335, 336, 6, 44, 0, 0, 336, 90, 1, 0, 0, 0, 337, 338, 9, 0, 0, 0, 338, + 92, 1, 0, 0, 0, 339, 342, 8, 5, 0, 0, 340, 342, 3, 95, 47, 0, 341, 339, + 1, 0, 0, 0, 341, 340, 1, 0, 0, 0, 342, 94, 1, 0, 0, 0, 343, 355, 5, 92, + 0, 0, 344, 356, 7, 6, 0, 0, 345, 346, 5, 117, 0, 0, 346, 347, 5, 123, 0, + 0, 347, 349, 1, 0, 0, 0, 348, 350, 3, 97, 48, 0, 349, 348, 1, 0, 0, 0, + 350, 351, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, + 353, 1, 0, 0, 0, 353, 354, 5, 125, 0, 0, 354, 356, 1, 0, 0, 0, 355, 344, + 1, 0, 0, 0, 355, 345, 1, 0, 0, 0, 356, 96, 1, 0, 0, 0, 357, 358, 7, 7, + 0, 0, 358, 98, 1, 0, 0, 0, 18, 0, 106, 132, 202, 212, 222, 231, 284, 290, + 296, 298, 303, 311, 322, 333, 341, 351, 355, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 12cf4f12faf..5366cd8c259 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -33,7 +33,7 @@ var BicepParserStaticData struct { func bicepParserInit() { staticData := &BicepParserStaticData staticData.LiteralNames = []string{ - "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "':'", + "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", "'object'", "'resource'", "'output'", "'existing'", "", "", "", "", "'string'", "'int'", "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", @@ -58,7 +58,7 @@ func bicepParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 46, 352, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 46, 348, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, @@ -79,143 +79,141 @@ func bicepParserInit() { 11, 12, 11, 188, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 194, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, - 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, - 12, 227, 8, 12, 10, 12, 12, 12, 230, 9, 12, 1, 13, 1, 13, 1, 14, 1, 14, - 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 242, 8, 14, 1, 15, 1, - 15, 3, 15, 246, 8, 15, 1, 15, 1, 15, 3, 15, 250, 8, 15, 1, 15, 1, 15, 1, - 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 261, 8, 17, 1, 18, - 1, 18, 4, 18, 265, 8, 18, 11, 18, 12, 18, 266, 1, 18, 1, 18, 4, 18, 271, - 8, 18, 11, 18, 12, 18, 272, 5, 18, 275, 8, 18, 10, 18, 12, 18, 278, 9, - 18, 3, 18, 280, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 3, 19, 286, 8, 19, 1, - 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 293, 8, 20, 10, 20, 12, 20, 296, - 9, 20, 1, 20, 5, 20, 299, 8, 20, 10, 20, 12, 20, 302, 9, 20, 1, 20, 1, - 20, 1, 21, 1, 21, 4, 21, 308, 8, 21, 11, 21, 12, 21, 309, 1, 21, 3, 21, - 313, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, - 23, 3, 23, 324, 8, 23, 1, 24, 1, 24, 1, 24, 3, 24, 329, 8, 24, 1, 24, 3, - 24, 332, 8, 24, 1, 24, 3, 24, 335, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, - 25, 3, 25, 342, 8, 25, 1, 25, 5, 25, 345, 8, 25, 10, 25, 12, 25, 348, 9, - 25, 1, 26, 1, 26, 1, 26, 0, 1, 24, 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, - 2, 1, 0, 34, 39, 3, 0, 14, 20, 27, 29, 40, 40, 382, 0, 57, 1, 0, 0, 0, - 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, - 0, 10, 108, 1, 0, 0, 0, 12, 128, 1, 0, 0, 0, 14, 142, 1, 0, 0, 0, 16, 146, - 1, 0, 0, 0, 18, 170, 1, 0, 0, 0, 20, 178, 1, 0, 0, 0, 22, 193, 1, 0, 0, - 0, 24, 195, 1, 0, 0, 0, 26, 231, 1, 0, 0, 0, 28, 241, 1, 0, 0, 0, 30, 243, - 1, 0, 0, 0, 32, 253, 1, 0, 0, 0, 34, 260, 1, 0, 0, 0, 36, 262, 1, 0, 0, - 0, 38, 285, 1, 0, 0, 0, 40, 290, 1, 0, 0, 0, 42, 305, 1, 0, 0, 0, 44, 314, - 1, 0, 0, 0, 46, 323, 1, 0, 0, 0, 48, 325, 1, 0, 0, 0, 50, 338, 1, 0, 0, - 0, 52, 349, 1, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, - 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, - 59, 57, 1, 0, 0, 0, 60, 61, 5, 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, - 2, 0, 63, 68, 3, 8, 4, 0, 64, 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, - 68, 5, 42, 0, 0, 67, 62, 1, 0, 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, - 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, - 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, - 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, - 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, - 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, - 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, - 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, - 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 89, 5, 42, 0, 0, 89, 5, 1, 0, 0, 0, - 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, - 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, - 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, - 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, - 12, 0, 103, 104, 5, 42, 0, 0, 104, 9, 1, 0, 0, 0, 105, 107, 3, 44, 22, - 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, - 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, - 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, 113, 115, 3, 22, 11, 0, 114, 116, - 5, 22, 0, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 1, 0, - 0, 0, 117, 121, 5, 11, 0, 0, 118, 122, 3, 14, 7, 0, 119, 122, 3, 36, 18, - 0, 120, 122, 3, 16, 8, 0, 121, 118, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, - 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 5, 42, 0, 0, 124, 11, - 1, 0, 0, 0, 125, 127, 3, 44, 22, 0, 126, 125, 1, 0, 0, 0, 127, 130, 1, - 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 131, 1, 0, 0, - 0, 130, 128, 1, 0, 0, 0, 131, 132, 5, 21, 0, 0, 132, 136, 3, 52, 26, 0, - 133, 137, 3, 52, 26, 0, 134, 135, 5, 20, 0, 0, 135, 137, 3, 22, 11, 0, - 136, 133, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, - 139, 5, 11, 0, 0, 139, 140, 3, 24, 12, 0, 140, 141, 5, 42, 0, 0, 141, 13, - 1, 0, 0, 0, 142, 143, 5, 30, 0, 0, 143, 144, 3, 30, 15, 0, 144, 145, 3, - 36, 18, 0, 145, 15, 1, 0, 0, 0, 146, 150, 5, 4, 0, 0, 147, 149, 5, 42, - 0, 0, 148, 147, 1, 0, 0, 0, 149, 152, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, - 150, 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, - 156, 5, 31, 0, 0, 154, 157, 3, 52, 26, 0, 155, 157, 3, 18, 9, 0, 156, 154, - 1, 0, 0, 0, 156, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 159, 5, 32, - 0, 0, 159, 160, 3, 24, 12, 0, 160, 161, 5, 10, 0, 0, 161, 165, 3, 20, 10, - 0, 162, 164, 5, 42, 0, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, - 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, - 1, 0, 0, 0, 168, 169, 5, 5, 0, 0, 169, 17, 1, 0, 0, 0, 170, 171, 5, 6, - 0, 0, 171, 172, 3, 52, 26, 0, 172, 173, 5, 3, 0, 0, 173, 174, 3, 52, 26, - 0, 174, 175, 5, 7, 0, 0, 175, 19, 1, 0, 0, 0, 176, 179, 3, 24, 12, 0, 177, - 179, 3, 14, 7, 0, 178, 176, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 21, - 1, 0, 0, 0, 180, 186, 5, 23, 0, 0, 181, 182, 3, 24, 12, 0, 182, 183, 5, - 24, 0, 0, 183, 185, 1, 0, 0, 0, 184, 181, 1, 0, 0, 0, 185, 188, 1, 0, 0, - 0, 186, 184, 1, 0, 0, 0, 186, 187, 1, 0, 0, 0, 187, 189, 1, 0, 0, 0, 188, - 186, 1, 0, 0, 0, 189, 190, 3, 24, 12, 0, 190, 191, 5, 25, 0, 0, 191, 194, - 1, 0, 0, 0, 192, 194, 5, 26, 0, 0, 193, 180, 1, 0, 0, 0, 193, 192, 1, 0, - 0, 0, 194, 23, 1, 0, 0, 0, 195, 196, 6, 12, -1, 0, 196, 197, 3, 28, 14, - 0, 197, 228, 1, 0, 0, 0, 198, 199, 10, 7, 0, 0, 199, 200, 5, 33, 0, 0, - 200, 201, 3, 24, 12, 0, 201, 202, 5, 10, 0, 0, 202, 203, 3, 24, 12, 8, - 203, 227, 1, 0, 0, 0, 204, 205, 10, 2, 0, 0, 205, 206, 3, 26, 13, 0, 206, - 207, 3, 24, 12, 3, 207, 227, 1, 0, 0, 0, 208, 209, 10, 8, 0, 0, 209, 210, - 5, 4, 0, 0, 210, 211, 3, 24, 12, 0, 211, 212, 5, 5, 0, 0, 212, 227, 1, - 0, 0, 0, 213, 214, 10, 6, 0, 0, 214, 215, 5, 8, 0, 0, 215, 227, 3, 52, - 26, 0, 216, 217, 10, 5, 0, 0, 217, 218, 5, 8, 0, 0, 218, 227, 3, 48, 24, - 0, 219, 220, 10, 4, 0, 0, 220, 221, 5, 10, 0, 0, 221, 227, 3, 52, 26, 0, - 222, 223, 10, 3, 0, 0, 223, 224, 5, 10, 0, 0, 224, 225, 5, 10, 0, 0, 225, - 227, 3, 52, 26, 0, 226, 198, 1, 0, 0, 0, 226, 204, 1, 0, 0, 0, 226, 208, - 1, 0, 0, 0, 226, 213, 1, 0, 0, 0, 226, 216, 1, 0, 0, 0, 226, 219, 1, 0, - 0, 0, 226, 222, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, - 228, 229, 1, 0, 0, 0, 229, 25, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, - 7, 0, 0, 0, 232, 27, 1, 0, 0, 0, 233, 242, 3, 34, 17, 0, 234, 242, 3, 48, - 24, 0, 235, 242, 3, 22, 11, 0, 236, 242, 5, 1, 0, 0, 237, 242, 3, 40, 20, - 0, 238, 242, 3, 36, 18, 0, 239, 242, 3, 16, 8, 0, 240, 242, 3, 30, 15, - 0, 241, 233, 1, 0, 0, 0, 241, 234, 1, 0, 0, 0, 241, 235, 1, 0, 0, 0, 241, - 236, 1, 0, 0, 0, 241, 237, 1, 0, 0, 0, 241, 238, 1, 0, 0, 0, 241, 239, - 1, 0, 0, 0, 241, 240, 1, 0, 0, 0, 242, 29, 1, 0, 0, 0, 243, 245, 5, 6, - 0, 0, 244, 246, 5, 42, 0, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, - 246, 247, 1, 0, 0, 0, 247, 249, 3, 24, 12, 0, 248, 250, 5, 42, 0, 0, 249, - 248, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, - 5, 7, 0, 0, 252, 31, 1, 0, 0, 0, 253, 254, 3, 52, 26, 0, 254, 33, 1, 0, - 0, 0, 255, 261, 5, 41, 0, 0, 256, 261, 5, 16, 0, 0, 257, 261, 5, 17, 0, - 0, 258, 261, 5, 18, 0, 0, 259, 261, 3, 52, 26, 0, 260, 255, 1, 0, 0, 0, - 260, 256, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, - 259, 1, 0, 0, 0, 261, 35, 1, 0, 0, 0, 262, 279, 5, 12, 0, 0, 263, 265, - 5, 42, 0, 0, 264, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 264, 1, 0, - 0, 0, 266, 267, 1, 0, 0, 0, 267, 276, 1, 0, 0, 0, 268, 270, 3, 38, 19, - 0, 269, 271, 5, 42, 0, 0, 270, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, - 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1, 0, 0, 0, 274, 268, - 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, - 0, 0, 277, 280, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 279, 264, 1, 0, 0, 0, - 279, 280, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 282, 5, 13, 0, 0, 282, - 37, 1, 0, 0, 0, 283, 286, 3, 52, 26, 0, 284, 286, 3, 22, 11, 0, 285, 283, - 1, 0, 0, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 288, 5, 10, - 0, 0, 288, 289, 3, 24, 12, 0, 289, 39, 1, 0, 0, 0, 290, 294, 5, 4, 0, 0, - 291, 293, 5, 42, 0, 0, 292, 291, 1, 0, 0, 0, 293, 296, 1, 0, 0, 0, 294, - 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 300, 1, 0, 0, 0, 296, 294, - 1, 0, 0, 0, 297, 299, 3, 42, 21, 0, 298, 297, 1, 0, 0, 0, 299, 302, 1, - 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 303, 1, 0, 0, - 0, 302, 300, 1, 0, 0, 0, 303, 304, 5, 5, 0, 0, 304, 41, 1, 0, 0, 0, 305, - 312, 3, 24, 12, 0, 306, 308, 5, 42, 0, 0, 307, 306, 1, 0, 0, 0, 308, 309, - 1, 0, 0, 0, 309, 307, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 313, 1, 0, - 0, 0, 311, 313, 5, 3, 0, 0, 312, 307, 1, 0, 0, 0, 312, 311, 1, 0, 0, 0, - 312, 313, 1, 0, 0, 0, 313, 43, 1, 0, 0, 0, 314, 315, 5, 2, 0, 0, 315, 316, - 3, 46, 23, 0, 316, 317, 5, 42, 0, 0, 317, 45, 1, 0, 0, 0, 318, 324, 3, - 48, 24, 0, 319, 320, 3, 24, 12, 0, 320, 321, 5, 8, 0, 0, 321, 322, 3, 48, - 24, 0, 322, 324, 1, 0, 0, 0, 323, 318, 1, 0, 0, 0, 323, 319, 1, 0, 0, 0, - 324, 47, 1, 0, 0, 0, 325, 326, 3, 52, 26, 0, 326, 331, 5, 6, 0, 0, 327, - 329, 5, 42, 0, 0, 328, 327, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 330, - 1, 0, 0, 0, 330, 332, 3, 50, 25, 0, 331, 328, 1, 0, 0, 0, 331, 332, 1, - 0, 0, 0, 332, 334, 1, 0, 0, 0, 333, 335, 5, 42, 0, 0, 334, 333, 1, 0, 0, - 0, 334, 335, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 337, 5, 7, 0, 0, 337, - 49, 1, 0, 0, 0, 338, 346, 3, 24, 12, 0, 339, 341, 5, 3, 0, 0, 340, 342, - 5, 42, 0, 0, 341, 340, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 343, 1, 0, - 0, 0, 343, 345, 3, 24, 12, 0, 344, 339, 1, 0, 0, 0, 345, 348, 1, 0, 0, - 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 51, 1, 0, 0, 0, 348, - 346, 1, 0, 0, 0, 349, 350, 7, 1, 0, 0, 350, 53, 1, 0, 0, 0, 39, 57, 67, + 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 223, 8, 12, 10, 12, 12, + 12, 226, 9, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, + 1, 14, 1, 14, 3, 14, 238, 8, 14, 1, 15, 1, 15, 3, 15, 242, 8, 15, 1, 15, + 1, 15, 3, 15, 246, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, + 17, 1, 17, 1, 17, 3, 17, 257, 8, 17, 1, 18, 1, 18, 4, 18, 261, 8, 18, 11, + 18, 12, 18, 262, 1, 18, 1, 18, 4, 18, 267, 8, 18, 11, 18, 12, 18, 268, + 5, 18, 271, 8, 18, 10, 18, 12, 18, 274, 9, 18, 3, 18, 276, 8, 18, 1, 18, + 1, 18, 1, 19, 1, 19, 3, 19, 282, 8, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, + 20, 5, 20, 289, 8, 20, 10, 20, 12, 20, 292, 9, 20, 1, 20, 5, 20, 295, 8, + 20, 10, 20, 12, 20, 298, 9, 20, 1, 20, 1, 20, 1, 21, 1, 21, 4, 21, 304, + 8, 21, 11, 21, 12, 21, 305, 1, 21, 3, 21, 309, 8, 21, 1, 22, 1, 22, 1, + 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 320, 8, 23, 1, 24, + 1, 24, 1, 24, 3, 24, 325, 8, 24, 1, 24, 3, 24, 328, 8, 24, 1, 24, 3, 24, + 331, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 338, 8, 25, 1, 25, + 5, 25, 341, 8, 25, 10, 25, 12, 25, 344, 9, 25, 1, 26, 1, 26, 1, 26, 0, + 1, 24, 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, + 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 2, 1, 0, 34, 39, 3, 0, 14, 20, + 27, 29, 40, 40, 377, 0, 57, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, + 0, 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, 0, 10, 108, 1, 0, 0, 0, 12, 128, + 1, 0, 0, 0, 14, 142, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 170, 1, 0, 0, + 0, 20, 178, 1, 0, 0, 0, 22, 193, 1, 0, 0, 0, 24, 195, 1, 0, 0, 0, 26, 227, + 1, 0, 0, 0, 28, 237, 1, 0, 0, 0, 30, 239, 1, 0, 0, 0, 32, 249, 1, 0, 0, + 0, 34, 256, 1, 0, 0, 0, 36, 258, 1, 0, 0, 0, 38, 281, 1, 0, 0, 0, 40, 286, + 1, 0, 0, 0, 42, 301, 1, 0, 0, 0, 44, 310, 1, 0, 0, 0, 46, 319, 1, 0, 0, + 0, 48, 321, 1, 0, 0, 0, 50, 334, 1, 0, 0, 0, 52, 345, 1, 0, 0, 0, 54, 56, + 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, + 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 60, 61, 5, + 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, 2, 0, 63, 68, 3, 8, 4, 0, 64, + 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, 68, 5, 42, 0, 0, 67, 62, 1, 0, + 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, + 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, + 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, + 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, + 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, + 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, + 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, + 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, + 89, 5, 42, 0, 0, 89, 5, 1, 0, 0, 0, 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, + 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, + 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, + 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, + 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 42, 0, 0, 104, 9, + 1, 0, 0, 0, 105, 107, 3, 44, 22, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, + 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, + 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, + 113, 115, 3, 22, 11, 0, 114, 116, 5, 22, 0, 0, 115, 114, 1, 0, 0, 0, 115, + 116, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 121, 5, 11, 0, 0, 118, 122, + 3, 14, 7, 0, 119, 122, 3, 36, 18, 0, 120, 122, 3, 16, 8, 0, 121, 118, 1, + 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, + 0, 123, 124, 5, 42, 0, 0, 124, 11, 1, 0, 0, 0, 125, 127, 3, 44, 22, 0, + 126, 125, 1, 0, 0, 0, 127, 130, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, + 129, 1, 0, 0, 0, 129, 131, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 132, + 5, 21, 0, 0, 132, 136, 3, 52, 26, 0, 133, 137, 3, 52, 26, 0, 134, 135, + 5, 20, 0, 0, 135, 137, 3, 22, 11, 0, 136, 133, 1, 0, 0, 0, 136, 134, 1, + 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 11, 0, 0, 139, 140, 3, 24, + 12, 0, 140, 141, 5, 42, 0, 0, 141, 13, 1, 0, 0, 0, 142, 143, 5, 30, 0, + 0, 143, 144, 3, 30, 15, 0, 144, 145, 3, 36, 18, 0, 145, 15, 1, 0, 0, 0, + 146, 150, 5, 4, 0, 0, 147, 149, 5, 42, 0, 0, 148, 147, 1, 0, 0, 0, 149, + 152, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 153, + 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, 156, 5, 31, 0, 0, 154, 157, 3, 52, + 26, 0, 155, 157, 3, 18, 9, 0, 156, 154, 1, 0, 0, 0, 156, 155, 1, 0, 0, + 0, 157, 158, 1, 0, 0, 0, 158, 159, 5, 32, 0, 0, 159, 160, 3, 24, 12, 0, + 160, 161, 5, 10, 0, 0, 161, 165, 3, 20, 10, 0, 162, 164, 5, 42, 0, 0, 163, + 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, + 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 5, + 0, 0, 169, 17, 1, 0, 0, 0, 170, 171, 5, 6, 0, 0, 171, 172, 3, 52, 26, 0, + 172, 173, 5, 3, 0, 0, 173, 174, 3, 52, 26, 0, 174, 175, 5, 7, 0, 0, 175, + 19, 1, 0, 0, 0, 176, 179, 3, 24, 12, 0, 177, 179, 3, 14, 7, 0, 178, 176, + 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 21, 1, 0, 0, 0, 180, 186, 5, 23, + 0, 0, 181, 182, 3, 24, 12, 0, 182, 183, 5, 24, 0, 0, 183, 185, 1, 0, 0, + 0, 184, 181, 1, 0, 0, 0, 185, 188, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 186, + 187, 1, 0, 0, 0, 187, 189, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 189, 190, + 3, 24, 12, 0, 190, 191, 5, 25, 0, 0, 191, 194, 1, 0, 0, 0, 192, 194, 5, + 26, 0, 0, 193, 180, 1, 0, 0, 0, 193, 192, 1, 0, 0, 0, 194, 23, 1, 0, 0, + 0, 195, 196, 6, 12, -1, 0, 196, 197, 3, 28, 14, 0, 197, 224, 1, 0, 0, 0, + 198, 199, 10, 6, 0, 0, 199, 200, 5, 33, 0, 0, 200, 201, 3, 24, 12, 0, 201, + 202, 5, 10, 0, 0, 202, 203, 3, 24, 12, 7, 203, 223, 1, 0, 0, 0, 204, 205, + 10, 2, 0, 0, 205, 206, 3, 26, 13, 0, 206, 207, 3, 24, 12, 3, 207, 223, + 1, 0, 0, 0, 208, 209, 10, 7, 0, 0, 209, 210, 5, 4, 0, 0, 210, 211, 3, 24, + 12, 0, 211, 212, 5, 5, 0, 0, 212, 223, 1, 0, 0, 0, 213, 214, 10, 5, 0, + 0, 214, 215, 5, 8, 0, 0, 215, 223, 3, 52, 26, 0, 216, 217, 10, 4, 0, 0, + 217, 218, 5, 8, 0, 0, 218, 223, 3, 48, 24, 0, 219, 220, 10, 3, 0, 0, 220, + 221, 5, 10, 0, 0, 221, 223, 3, 52, 26, 0, 222, 198, 1, 0, 0, 0, 222, 204, + 1, 0, 0, 0, 222, 208, 1, 0, 0, 0, 222, 213, 1, 0, 0, 0, 222, 216, 1, 0, + 0, 0, 222, 219, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, + 224, 225, 1, 0, 0, 0, 225, 25, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 228, + 7, 0, 0, 0, 228, 27, 1, 0, 0, 0, 229, 238, 3, 34, 17, 0, 230, 238, 3, 48, + 24, 0, 231, 238, 3, 22, 11, 0, 232, 238, 5, 1, 0, 0, 233, 238, 3, 40, 20, + 0, 234, 238, 3, 36, 18, 0, 235, 238, 3, 16, 8, 0, 236, 238, 3, 30, 15, + 0, 237, 229, 1, 0, 0, 0, 237, 230, 1, 0, 0, 0, 237, 231, 1, 0, 0, 0, 237, + 232, 1, 0, 0, 0, 237, 233, 1, 0, 0, 0, 237, 234, 1, 0, 0, 0, 237, 235, + 1, 0, 0, 0, 237, 236, 1, 0, 0, 0, 238, 29, 1, 0, 0, 0, 239, 241, 5, 6, + 0, 0, 240, 242, 5, 42, 0, 0, 241, 240, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, + 242, 243, 1, 0, 0, 0, 243, 245, 3, 24, 12, 0, 244, 246, 5, 42, 0, 0, 245, + 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, + 5, 7, 0, 0, 248, 31, 1, 0, 0, 0, 249, 250, 3, 52, 26, 0, 250, 33, 1, 0, + 0, 0, 251, 257, 5, 41, 0, 0, 252, 257, 5, 16, 0, 0, 253, 257, 5, 17, 0, + 0, 254, 257, 5, 18, 0, 0, 255, 257, 3, 52, 26, 0, 256, 251, 1, 0, 0, 0, + 256, 252, 1, 0, 0, 0, 256, 253, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, + 255, 1, 0, 0, 0, 257, 35, 1, 0, 0, 0, 258, 275, 5, 12, 0, 0, 259, 261, + 5, 42, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, + 0, 0, 262, 263, 1, 0, 0, 0, 263, 272, 1, 0, 0, 0, 264, 266, 3, 38, 19, + 0, 265, 267, 5, 42, 0, 0, 266, 265, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, + 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 264, + 1, 0, 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, 273, 1, 0, + 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 275, 260, 1, 0, 0, 0, + 275, 276, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 278, 5, 13, 0, 0, 278, + 37, 1, 0, 0, 0, 279, 282, 3, 52, 26, 0, 280, 282, 3, 22, 11, 0, 281, 279, + 1, 0, 0, 0, 281, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, 5, 10, + 0, 0, 284, 285, 3, 24, 12, 0, 285, 39, 1, 0, 0, 0, 286, 290, 5, 4, 0, 0, + 287, 289, 5, 42, 0, 0, 288, 287, 1, 0, 0, 0, 289, 292, 1, 0, 0, 0, 290, + 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 296, 1, 0, 0, 0, 292, 290, + 1, 0, 0, 0, 293, 295, 3, 42, 21, 0, 294, 293, 1, 0, 0, 0, 295, 298, 1, + 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 299, 1, 0, 0, + 0, 298, 296, 1, 0, 0, 0, 299, 300, 5, 5, 0, 0, 300, 41, 1, 0, 0, 0, 301, + 308, 3, 24, 12, 0, 302, 304, 5, 42, 0, 0, 303, 302, 1, 0, 0, 0, 304, 305, + 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 309, 1, 0, + 0, 0, 307, 309, 5, 3, 0, 0, 308, 303, 1, 0, 0, 0, 308, 307, 1, 0, 0, 0, + 308, 309, 1, 0, 0, 0, 309, 43, 1, 0, 0, 0, 310, 311, 5, 2, 0, 0, 311, 312, + 3, 46, 23, 0, 312, 313, 5, 42, 0, 0, 313, 45, 1, 0, 0, 0, 314, 320, 3, + 48, 24, 0, 315, 316, 3, 24, 12, 0, 316, 317, 5, 8, 0, 0, 317, 318, 3, 48, + 24, 0, 318, 320, 1, 0, 0, 0, 319, 314, 1, 0, 0, 0, 319, 315, 1, 0, 0, 0, + 320, 47, 1, 0, 0, 0, 321, 322, 3, 52, 26, 0, 322, 327, 5, 6, 0, 0, 323, + 325, 5, 42, 0, 0, 324, 323, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 326, + 1, 0, 0, 0, 326, 328, 3, 50, 25, 0, 327, 324, 1, 0, 0, 0, 327, 328, 1, + 0, 0, 0, 328, 330, 1, 0, 0, 0, 329, 331, 5, 42, 0, 0, 330, 329, 1, 0, 0, + 0, 330, 331, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 333, 5, 7, 0, 0, 333, + 49, 1, 0, 0, 0, 334, 342, 3, 24, 12, 0, 335, 337, 5, 3, 0, 0, 336, 338, + 5, 42, 0, 0, 337, 336, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 339, 1, 0, + 0, 0, 339, 341, 3, 24, 12, 0, 340, 335, 1, 0, 0, 0, 341, 344, 1, 0, 0, + 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 51, 1, 0, 0, 0, 344, + 342, 1, 0, 0, 0, 345, 346, 7, 1, 0, 0, 346, 53, 1, 0, 0, 0, 39, 57, 67, 72, 79, 84, 86, 96, 108, 115, 121, 128, 136, 150, 156, 165, 178, 186, 193, - 226, 228, 241, 245, 249, 260, 266, 272, 276, 279, 285, 294, 300, 309, 312, - 323, 328, 331, 334, 341, 346, + 222, 224, 237, 241, 245, 256, 262, 268, 272, 275, 281, 290, 296, 305, 308, + 319, 324, 327, 330, 337, 342, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -3151,8 +3149,7 @@ type IExpressionContext interface { AllExpression() []IExpressionContext Expression(i int) IExpressionContext QMARK() antlr.TerminalNode - AllCOL() []antlr.TerminalNode - COL(i int) antlr.TerminalNode + COL() antlr.TerminalNode LogicCharacter() ILogicCharacterContext OBRACK() antlr.TerminalNode CBRACK() antlr.TerminalNode @@ -3267,12 +3264,8 @@ func (s *ExpressionContext) QMARK() antlr.TerminalNode { return s.GetToken(bicepParserQMARK, 0) } -func (s *ExpressionContext) AllCOL() []antlr.TerminalNode { - return s.GetTokens(bicepParserCOL) -} - -func (s *ExpressionContext) COL(i int) antlr.TerminalNode { - return s.GetToken(bicepParserCOL, i) +func (s *ExpressionContext) COL() antlr.TerminalNode { + return s.GetToken(bicepParserCOL, 0) } func (s *ExpressionContext) LogicCharacter() ILogicCharacterContext { @@ -3375,7 +3368,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(228) + p.SetState(224) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3390,7 +3383,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(226) + p.SetState(222) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3402,8 +3395,8 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) p.SetState(198) - if !(p.Precpred(p.GetParserRuleContext(), 7)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 6)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) goto errorExit } { @@ -3428,7 +3421,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } { p.SetState(202) - p.expression(8) + p.expression(7) } case 2: @@ -3454,8 +3447,8 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) p.SetState(208) - if !(p.Precpred(p.GetParserRuleContext(), 8)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 8)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 7)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) goto errorExit } { @@ -3484,8 +3477,8 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) p.SetState(213) - if !(p.Precpred(p.GetParserRuleContext(), 6)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 5)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) goto errorExit } { @@ -3509,8 +3502,8 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) p.SetState(216) - if !(p.Precpred(p.GetParserRuleContext(), 5)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 4)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) goto errorExit } { @@ -3531,45 +3524,12 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) p.SetState(219) - if !(p.Precpred(p.GetParserRuleContext(), 4)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) - goto errorExit - } - { - p.SetState(220) - p.Match(bicepParserCOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(221) - - var _x = p.Identifier() - - localctx.(*ExpressionContext).name = _x - } - - case 7: - localctx = NewExpressionContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(222) - if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(223) - p.Match(bicepParserCOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(224) + p.SetState(220) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3577,7 +3537,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(225) + p.SetState(221) var _x = p.Identifier() @@ -3589,7 +3549,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } - p.SetState(230) + p.SetState(226) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3713,7 +3673,7 @@ func (p *bicepParser) LogicCharacter() (localctx ILogicCharacterContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(231) + p.SetState(227) _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1082331758592) != 0) { @@ -3927,7 +3887,7 @@ func (s *PrimaryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interf func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { localctx = NewPrimaryExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 28, bicepParserRULE_primaryExpression) - p.SetState(241) + p.SetState(237) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3937,28 +3897,28 @@ func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(233) + p.SetState(229) p.LiteralValue() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(234) + p.SetState(230) p.FunctionCall() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(235) + p.SetState(231) p.InterpString() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(236) + p.SetState(232) p.Match(bicepParserMULTILINE_STRING) if p.HasError() { // Recognition error - abort rule @@ -3969,28 +3929,28 @@ func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(237) + p.SetState(233) p.Array() } case 6: p.EnterOuterAlt(localctx, 6) { - p.SetState(238) + p.SetState(234) p.Object() } case 7: p.EnterOuterAlt(localctx, 7) { - p.SetState(239) + p.SetState(235) p.ForExpression() } case 8: p.EnterOuterAlt(localctx, 8) { - p.SetState(240) + p.SetState(236) p.ParenthesizedExpression() } @@ -4118,14 +4078,14 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi p.EnterOuterAlt(localctx, 1) { - p.SetState(243) + p.SetState(239) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(245) + p.SetState(241) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4134,7 +4094,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(244) + p.SetState(240) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4144,10 +4104,10 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(247) + p.SetState(243) p.expression(0) } - p.SetState(249) + p.SetState(245) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4156,7 +4116,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(248) + p.SetState(244) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4166,7 +4126,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(251) + p.SetState(247) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -4283,7 +4243,7 @@ func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { p.EnterRule(localctx, 32, bicepParserRULE_typeExpression) p.EnterOuterAlt(localctx, 1) { - p.SetState(253) + p.SetState(249) var _x = p.Identifier() @@ -4406,7 +4366,7 @@ func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { localctx = NewLiteralValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, bicepParserRULE_literalValue) - p.SetState(260) + p.SetState(256) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4416,7 +4376,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(255) + p.SetState(251) p.Match(bicepParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -4427,7 +4387,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(256) + p.SetState(252) p.Match(bicepParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -4438,7 +4398,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(257) + p.SetState(253) p.Match(bicepParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -4449,7 +4409,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(258) + p.SetState(254) p.Match(bicepParserNULL) if p.HasError() { // Recognition error - abort rule @@ -4460,7 +4420,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(259) + p.SetState(255) p.Identifier() } @@ -4614,14 +4574,14 @@ func (p *bicepParser) Object() (localctx IObjectContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(262) + p.SetState(258) p.Match(bicepParserOBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(279) + p.SetState(275) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4629,7 +4589,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) if _la == bicepParserNL { - p.SetState(264) + p.SetState(260) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4638,7 +4598,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(263) + p.SetState(259) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4646,14 +4606,14 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(266) + p.SetState(262) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(276) + p.SetState(272) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4662,10 +4622,10 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1100528730112) != 0 { { - p.SetState(268) + p.SetState(264) p.ObjectProperty() } - p.SetState(270) + p.SetState(266) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4674,7 +4634,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(269) + p.SetState(265) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4682,7 +4642,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(272) + p.SetState(268) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4690,7 +4650,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) } - p.SetState(278) + p.SetState(274) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4700,7 +4660,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } { - p.SetState(281) + p.SetState(277) p.Match(bicepParserCBRACE) if p.HasError() { // Recognition error - abort rule @@ -4855,7 +4815,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { localctx = NewObjectPropertyContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 38, bicepParserRULE_objectProperty) p.EnterOuterAlt(localctx, 1) - p.SetState(285) + p.SetState(281) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4864,7 +4824,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: { - p.SetState(283) + p.SetState(279) var _x = p.Identifier() @@ -4873,7 +4833,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: { - p.SetState(284) + p.SetState(280) p.InterpString() } @@ -4882,7 +4842,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { goto errorExit } { - p.SetState(287) + p.SetState(283) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -4890,7 +4850,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } } { - p.SetState(288) + p.SetState(284) p.expression(0) } @@ -5040,14 +5000,14 @@ func (p *bicepParser) Array() (localctx IArrayContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(290) + p.SetState(286) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(294) + p.SetState(290) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5056,7 +5016,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for _la == bicepParserNL { { - p.SetState(291) + p.SetState(287) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5064,14 +5024,14 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } } - p.SetState(296) + p.SetState(292) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(300) + p.SetState(296) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5080,11 +5040,11 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&3299551989842) != 0 { { - p.SetState(297) + p.SetState(293) p.ArrayItem() } - p.SetState(302) + p.SetState(298) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5092,7 +5052,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(303) + p.SetState(299) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -5215,17 +5175,17 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(305) + p.SetState(301) p.expression(0) } - p.SetState(312) + p.SetState(308) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { case bicepParserNL: - p.SetState(307) + p.SetState(303) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5234,7 +5194,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(306) + p.SetState(302) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5242,7 +5202,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - p.SetState(309) + p.SetState(305) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5252,7 +5212,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { case bicepParserCOMMA: { - p.SetState(311) + p.SetState(307) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -5373,7 +5333,7 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { p.EnterRule(localctx, 44, bicepParserRULE_decorator) p.EnterOuterAlt(localctx, 1) { - p.SetState(314) + p.SetState(310) p.Match(bicepParserAT) if p.HasError() { // Recognition error - abort rule @@ -5381,11 +5341,11 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { } } { - p.SetState(315) + p.SetState(311) p.DecoratorExpression() } { - p.SetState(316) + p.SetState(312) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5511,7 +5471,7 @@ func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 46, bicepParserRULE_decoratorExpression) - p.SetState(323) + p.SetState(319) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5521,18 +5481,18 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(318) + p.SetState(314) p.FunctionCall() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(319) + p.SetState(315) p.expression(0) } { - p.SetState(320) + p.SetState(316) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -5540,7 +5500,7 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex } } { - p.SetState(321) + p.SetState(317) p.FunctionCall() } @@ -5685,22 +5645,22 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(325) + p.SetState(321) p.Identifier() } { - p.SetState(326) + p.SetState(322) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(331) + p.SetState(327) p.GetErrorHandler().Sync(p) if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 35, p.GetParserRuleContext()) == 1 { - p.SetState(328) + p.SetState(324) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5709,7 +5669,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(327) + p.SetState(323) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5719,14 +5679,14 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(330) + p.SetState(326) p.ArgumentList() } } else if p.HasError() { // JIM goto errorExit } - p.SetState(334) + p.SetState(330) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5735,7 +5695,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(333) + p.SetState(329) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5745,7 +5705,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(336) + p.SetState(332) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -5899,10 +5859,10 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(338) + p.SetState(334) p.expression(0) } - p.SetState(346) + p.SetState(342) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5911,14 +5871,14 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { for _la == bicepParserCOMMA { { - p.SetState(339) + p.SetState(335) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(341) + p.SetState(337) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5927,7 +5887,7 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { if _la == bicepParserNL { { - p.SetState(340) + p.SetState(336) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5937,11 +5897,11 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { } { - p.SetState(343) + p.SetState(339) p.expression(0) } - p.SetState(348) + p.SetState(344) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6087,7 +6047,7 @@ func (p *bicepParser) Identifier() (localctx IIdentifierContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(349) + p.SetState(345) _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1100453232640) != 0) { @@ -6128,24 +6088,21 @@ func (p *bicepParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex i func (p *bicepParser) Expression_Sempred(localctx antlr.RuleContext, predIndex int) bool { switch predIndex { case 0: - return p.Precpred(p.GetParserRuleContext(), 7) + return p.Precpred(p.GetParserRuleContext(), 6) case 1: return p.Precpred(p.GetParserRuleContext(), 2) case 2: - return p.Precpred(p.GetParserRuleContext(), 8) + return p.Precpred(p.GetParserRuleContext(), 7) case 3: - return p.Precpred(p.GetParserRuleContext(), 6) - - case 4: return p.Precpred(p.GetParserRuleContext(), 5) - case 5: + case 4: return p.Precpred(p.GetParserRuleContext(), 4) - case 6: + case 5: return p.Precpred(p.GetParserRuleContext(), 3) default: From 5d320543fc7dc59338feee562bd8aa617048e2de Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 8 May 2024 12:44:09 +0100 Subject: [PATCH 099/130] added safety verifications to interpstring visitor and made it more readable --- pkg/parser/bicep/parser.go | 96 ++++++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 35 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index be3f277d82d..da48cbdd28c 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -472,46 +472,72 @@ func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interf return nil } -func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interface{} { - if ctx.GetChildCount() > 1 { - interpString := []interface{}{} - interpString = append(interpString, ctx.STRING_LEFT_PIECE().GetText()) - if ctx.AllSTRING_MIDDLE_PIECE() != nil && (len(ctx.AllSTRING_MIDDLE_PIECE()) > 0) { - for idx, val := range ctx.AllSTRING_MIDDLE_PIECE() { - interpString = append(interpString, ctx.Expression(idx).Accept(s), val.GetText()) - } - } - // Last expression with string right piece - if len(ctx.AllExpression()) > 0 { - interpString = append(interpString, - ctx.Expression(len(ctx.AllSTRING_MIDDLE_PIECE())).Accept(s), - ctx.STRING_RIGHT_PIECE().GetText()) +func acceptExpressionAtIndex(idx int, ctx *parser.InterpStringContext, s *BicepVisitor) interface{} { + var expression interface{} + expression = "" + if ctx.Expression(idx) != nil { + expression = ctx.Expression(idx).Accept(s) + } + + return expression +} + +func parseComplexInterp(ctx *parser.InterpStringContext, s *BicepVisitor) string { + interpString := []interface{}{} + + if ctx.STRING_LEFT_PIECE() == nil || ctx.STRING_RIGHT_PIECE() == nil { + return "" + } + + leftPiece := ctx.STRING_LEFT_PIECE().GetText() + rightPiece := ctx.STRING_RIGHT_PIECE().GetText() + middlePieces := ctx.AllSTRING_MIDDLE_PIECE() + + interpString = append(interpString, leftPiece) + + if middlePieces != nil && (len(middlePieces) > 0) { + for idx, val := range middlePieces { + expression := acceptExpressionAtIndex(idx, ctx, s) + interpString = append(interpString, expression, val.GetText()) } - str := "" - for _, v := range interpString { - switch v := v.(type) { - case string: - str += v - case map[string][]interface{}: - for identifier, argumentList := range v { - resStr := "[" + identifier + "(" - for idx, arg := range argumentList { - stringArg, ok := arg.(string) - if !ok { - return "" - } - resStr += stringArg - if idx < len(argumentList)-1 { - resStr += ", " - } - } + } + + lastExpression := acceptExpressionAtIndex(len(middlePieces), ctx, s) + interpString = append(interpString, + lastExpression, + rightPiece) - resStr += ")]" - str += resStr + str := "" + for _, v := range interpString { + switch v := v.(type) { + case string: + str += v + case map[string][]interface{}: + for identifier, argumentList := range v { + resStr := "[" + identifier + "(" + for idx, arg := range argumentList { + stringArg, ok := arg.(string) + if !ok { + return "" + } + resStr += stringArg + if idx < len(argumentList)-1 { + resStr += ", " + } } + + resStr += ")]" + str += resStr } } - return str + } + return str +} + +func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interface{} { + if ctx.GetChildCount() > 1 { + complexInterpString := parseComplexInterp(ctx, s) + return complexInterpString } unformattedString := ctx.STRING_COMPLETE().GetText() From d326f3869f1c25de01f5dca6c90620caf2b33080 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 8 May 2024 12:49:13 +0100 Subject: [PATCH 100/130] improved interpString readability --- pkg/parser/bicep/parser.go | 55 +++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index da48cbdd28c..9e14ebe7005 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -482,6 +482,35 @@ func acceptExpressionAtIndex(idx int, ctx *parser.InterpStringContext, s *BicepV return expression } +func buildComplexInterp(interpStringValues []interface{}) string { + str := "" + for _, v := range interpStringValues { + switch v := v.(type) { + case string: + str += v + case map[string][]interface{}: + for identifier, argumentList := range v { + resStr := "[" + identifier + "(" + for idx, arg := range argumentList { + stringArg, ok := arg.(string) + if !ok { + return "" + } + resStr += stringArg + if idx < len(argumentList)-1 { + resStr += ", " + } + } + + resStr += ")]" + str += resStr + } + } + } + + return str +} + func parseComplexInterp(ctx *parser.InterpStringContext, s *BicepVisitor) string { interpString := []interface{}{} @@ -507,31 +536,9 @@ func parseComplexInterp(ctx *parser.InterpStringContext, s *BicepVisitor) string lastExpression, rightPiece) - str := "" - for _, v := range interpString { - switch v := v.(type) { - case string: - str += v - case map[string][]interface{}: - for identifier, argumentList := range v { - resStr := "[" + identifier + "(" - for idx, arg := range argumentList { - stringArg, ok := arg.(string) - if !ok { - return "" - } - resStr += stringArg - if idx < len(argumentList)-1 { - resStr += ", " - } - } + resultString := buildComplexInterp(interpString) - resStr += ")]" - str += resStr - } - } - } - return str + return resultString } func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interface{} { From 0d35d7eea0f3d16d5f3f2bf9acb9a4e385a22803 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 8 May 2024 14:32:03 +0100 Subject: [PATCH 101/130] created function to remove reused code --- pkg/parser/bicep/parser.go | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 9e14ebe7005..3a495bb43b3 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -375,20 +375,27 @@ func parseFunctionCall(functionData map[string][]interface{}) string { return stringifiedFunctionCall } +// function to check if an identifier is a parameter/variable and add the required keyword if so +func convertToParamVar(str string, s *BicepVisitor) string { + for variable := range s.varList { + if variable == str { + return "variables('" + str + CloseParenthesis + } + } + for parameter := range s.paramList { + if parameter == str { + return "parameters('" + str + CloseParenthesis + } + } + + return str +} + func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{} { if ctx.GetChildCount() > 1 { if ctx.Identifier() != nil { identifier := ctx.Identifier().Accept(s).(string) - for variable := range s.varList { - if variable == identifier { - identifier = "variables('" + identifier + CloseParenthesis - } - } - for parameter := range s.paramList { - if parameter == identifier { - identifier = "parameters('" + identifier + CloseParenthesis - } - } + identifier = convertToParamVar(identifier, s) exp := ctx.Expression(0).Accept(s) if ctx.DOT() != nil { switch exp := exp.(type) { @@ -456,16 +463,7 @@ func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interf } if ctx.Identifier() != nil { identifier := ctx.Identifier().Accept(s).(string) - for variable := range s.varList { - if variable == identifier { - identifier = "variables('" + identifier + CloseParenthesis - } - } - for parameter := range s.paramList { - if parameter == identifier { - identifier = "parameters('" + identifier + CloseParenthesis - } - } + identifier = convertToParamVar(identifier, s) return identifier } From c37df950e88a448b8d5b366ef202ab9703a2caa7 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 8 May 2024 14:35:14 +0100 Subject: [PATCH 102/130] update go version for govulncheck --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a36d0af9514..c735387a3cc 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/Checkmarx/kics -go 1.22.2 +go 1.22.3 replace ( github.com/containerd/containerd => github.com/containerd/containerd v1.6.26 From edb1d8e6ef0582f234c3bb33727423d65c0fe5e0 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Wed, 8 May 2024 17:34:14 +0100 Subject: [PATCH 103/130] added metadata, imports and target scope to bicep grammar --- pkg/parser/bicep/antlr/bicep.g4 | 24 +- pkg/parser/bicep/antlr/parser/bicep.interp | 15 +- pkg/parser/bicep/antlr/parser/bicep.tokens | 88 +- .../bicep/antlr/parser/bicepLexer.interp | 17 +- .../bicep/antlr/parser/bicepLexer.tokens | 88 +- .../bicep/antlr/parser/bicep_base_visitor.go | 12 + pkg/parser/bicep/antlr/parser/bicep_lexer.go | 408 ++-- pkg/parser/bicep/antlr/parser/bicep_parser.go | 2067 +++++++++++------ .../bicep/antlr/parser/bicep_visitor.go | 9 + 9 files changed, 1811 insertions(+), 917 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index afcb1e6c38b..25d6151c196 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -3,7 +3,7 @@ grammar bicep; // program -> statement* EOF program: statement* EOF; -statement: parameterDecl | variableDecl | resourceDecl | outputDecl | NL; +statement: parameterDecl | variableDecl | resourceDecl | outputDecl | targetScopeDecl | importDecl | NL; // parameterDecl -> decorator* "parameter" IDENTIFIER(name) typeExpression parameterDefaultValue? NL // | decorator* "parameter" IDENTIFIER(name) "resource" interpString(type) parameterDefaultValue? NL @@ -31,6 +31,17 @@ resourceDecl: outputDecl: decorator* OUTPUT name = identifier (type1 = identifier | RESOURCE type2 = interpString) ASSIGN expression NL; +// targetScopeDecl -> "targetScope" "=" expression NL +targetScopeDecl: TARGET_SCOPE ASSIGN expression NL; + +// importDecl -> decorator* "import" interpString(specification) importWithClause? importAsClause? NL +importDecl: + decorator* IMPORT specification = interpString (WITH object | AS alias = identifier)* NL; + +// metadataDecl -> "metadata" IDENTIFIER(name) "=" expression NL +metadataDecl: + METADATA name = identifier ASSIGN expression NL; + // ifCondition -> "if" parenthesizedExpression object ifCondition : IF parenthesizedExpression object @@ -171,7 +182,18 @@ RESOURCE: 'resource'; OUTPUT: 'output'; +TARGET_SCOPE: 'targetScope'; + +IMPORT: 'import'; + +WITH: 'with'; + +AS: 'as'; + +METADATA: 'metadata'; + EXISTING: 'existing'; + // stringLeftPiece -> "'" STRINGCHAR* "${" STRING_LEFT_PIECE: '\'' STRINGCHAR* '${'; diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index f3a75154b85..9de80033c7e 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -21,6 +21,11 @@ null 'object' 'resource' 'output' +'targetScope' +'import' +'with' +'as' +'metadata' 'existing' null null @@ -70,6 +75,11 @@ NULL OBJECT RESOURCE OUTPUT +TARGET_SCOPE +IMPORT +WITH +AS +METADATA EXISTING STRING_LEFT_PIECE STRING_MIDDLE_PIECE @@ -104,6 +114,9 @@ parameterDefaultValue variableDecl resourceDecl outputDecl +targetScopeDecl +importDecl +metadataDecl ifCondition forExpression forVariableBlock @@ -127,4 +140,4 @@ identifier atn: -[4, 1, 46, 348, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 1, 0, 5, 0, 56, 8, 0, 10, 0, 12, 0, 59, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 68, 8, 1, 1, 2, 5, 2, 71, 8, 2, 10, 2, 12, 2, 74, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 80, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 85, 8, 2, 3, 2, 87, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 95, 8, 4, 10, 4, 12, 4, 98, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 107, 8, 5, 10, 5, 12, 5, 110, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 122, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 127, 8, 6, 10, 6, 12, 6, 130, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 137, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 5, 8, 149, 8, 8, 10, 8, 12, 8, 152, 9, 8, 1, 8, 1, 8, 1, 8, 3, 8, 157, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 164, 8, 8, 10, 8, 12, 8, 167, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 179, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 185, 8, 11, 10, 11, 12, 11, 188, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 194, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 223, 8, 12, 10, 12, 12, 12, 226, 9, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 238, 8, 14, 1, 15, 1, 15, 3, 15, 242, 8, 15, 1, 15, 1, 15, 3, 15, 246, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 257, 8, 17, 1, 18, 1, 18, 4, 18, 261, 8, 18, 11, 18, 12, 18, 262, 1, 18, 1, 18, 4, 18, 267, 8, 18, 11, 18, 12, 18, 268, 5, 18, 271, 8, 18, 10, 18, 12, 18, 274, 9, 18, 3, 18, 276, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 3, 19, 282, 8, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 5, 20, 289, 8, 20, 10, 20, 12, 20, 292, 9, 20, 1, 20, 5, 20, 295, 8, 20, 10, 20, 12, 20, 298, 9, 20, 1, 20, 1, 20, 1, 21, 1, 21, 4, 21, 304, 8, 21, 11, 21, 12, 21, 305, 1, 21, 3, 21, 309, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 320, 8, 23, 1, 24, 1, 24, 1, 24, 3, 24, 325, 8, 24, 1, 24, 3, 24, 328, 8, 24, 1, 24, 3, 24, 331, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 338, 8, 25, 1, 25, 5, 25, 341, 8, 25, 10, 25, 12, 25, 344, 9, 25, 1, 26, 1, 26, 1, 26, 0, 1, 24, 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 2, 1, 0, 34, 39, 3, 0, 14, 20, 27, 29, 40, 40, 377, 0, 57, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, 0, 10, 108, 1, 0, 0, 0, 12, 128, 1, 0, 0, 0, 14, 142, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 170, 1, 0, 0, 0, 20, 178, 1, 0, 0, 0, 22, 193, 1, 0, 0, 0, 24, 195, 1, 0, 0, 0, 26, 227, 1, 0, 0, 0, 28, 237, 1, 0, 0, 0, 30, 239, 1, 0, 0, 0, 32, 249, 1, 0, 0, 0, 34, 256, 1, 0, 0, 0, 36, 258, 1, 0, 0, 0, 38, 281, 1, 0, 0, 0, 40, 286, 1, 0, 0, 0, 42, 301, 1, 0, 0, 0, 44, 310, 1, 0, 0, 0, 46, 319, 1, 0, 0, 0, 48, 321, 1, 0, 0, 0, 50, 334, 1, 0, 0, 0, 52, 345, 1, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 60, 61, 5, 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, 2, 0, 63, 68, 3, 8, 4, 0, 64, 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, 68, 5, 42, 0, 0, 67, 62, 1, 0, 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 89, 5, 42, 0, 0, 89, 5, 1, 0, 0, 0, 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 42, 0, 0, 104, 9, 1, 0, 0, 0, 105, 107, 3, 44, 22, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, 113, 115, 3, 22, 11, 0, 114, 116, 5, 22, 0, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 121, 5, 11, 0, 0, 118, 122, 3, 14, 7, 0, 119, 122, 3, 36, 18, 0, 120, 122, 3, 16, 8, 0, 121, 118, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 5, 42, 0, 0, 124, 11, 1, 0, 0, 0, 125, 127, 3, 44, 22, 0, 126, 125, 1, 0, 0, 0, 127, 130, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 131, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 132, 5, 21, 0, 0, 132, 136, 3, 52, 26, 0, 133, 137, 3, 52, 26, 0, 134, 135, 5, 20, 0, 0, 135, 137, 3, 22, 11, 0, 136, 133, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 11, 0, 0, 139, 140, 3, 24, 12, 0, 140, 141, 5, 42, 0, 0, 141, 13, 1, 0, 0, 0, 142, 143, 5, 30, 0, 0, 143, 144, 3, 30, 15, 0, 144, 145, 3, 36, 18, 0, 145, 15, 1, 0, 0, 0, 146, 150, 5, 4, 0, 0, 147, 149, 5, 42, 0, 0, 148, 147, 1, 0, 0, 0, 149, 152, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, 156, 5, 31, 0, 0, 154, 157, 3, 52, 26, 0, 155, 157, 3, 18, 9, 0, 156, 154, 1, 0, 0, 0, 156, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 159, 5, 32, 0, 0, 159, 160, 3, 24, 12, 0, 160, 161, 5, 10, 0, 0, 161, 165, 3, 20, 10, 0, 162, 164, 5, 42, 0, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 5, 0, 0, 169, 17, 1, 0, 0, 0, 170, 171, 5, 6, 0, 0, 171, 172, 3, 52, 26, 0, 172, 173, 5, 3, 0, 0, 173, 174, 3, 52, 26, 0, 174, 175, 5, 7, 0, 0, 175, 19, 1, 0, 0, 0, 176, 179, 3, 24, 12, 0, 177, 179, 3, 14, 7, 0, 178, 176, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 21, 1, 0, 0, 0, 180, 186, 5, 23, 0, 0, 181, 182, 3, 24, 12, 0, 182, 183, 5, 24, 0, 0, 183, 185, 1, 0, 0, 0, 184, 181, 1, 0, 0, 0, 185, 188, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 186, 187, 1, 0, 0, 0, 187, 189, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 189, 190, 3, 24, 12, 0, 190, 191, 5, 25, 0, 0, 191, 194, 1, 0, 0, 0, 192, 194, 5, 26, 0, 0, 193, 180, 1, 0, 0, 0, 193, 192, 1, 0, 0, 0, 194, 23, 1, 0, 0, 0, 195, 196, 6, 12, -1, 0, 196, 197, 3, 28, 14, 0, 197, 224, 1, 0, 0, 0, 198, 199, 10, 6, 0, 0, 199, 200, 5, 33, 0, 0, 200, 201, 3, 24, 12, 0, 201, 202, 5, 10, 0, 0, 202, 203, 3, 24, 12, 7, 203, 223, 1, 0, 0, 0, 204, 205, 10, 2, 0, 0, 205, 206, 3, 26, 13, 0, 206, 207, 3, 24, 12, 3, 207, 223, 1, 0, 0, 0, 208, 209, 10, 7, 0, 0, 209, 210, 5, 4, 0, 0, 210, 211, 3, 24, 12, 0, 211, 212, 5, 5, 0, 0, 212, 223, 1, 0, 0, 0, 213, 214, 10, 5, 0, 0, 214, 215, 5, 8, 0, 0, 215, 223, 3, 52, 26, 0, 216, 217, 10, 4, 0, 0, 217, 218, 5, 8, 0, 0, 218, 223, 3, 48, 24, 0, 219, 220, 10, 3, 0, 0, 220, 221, 5, 10, 0, 0, 221, 223, 3, 52, 26, 0, 222, 198, 1, 0, 0, 0, 222, 204, 1, 0, 0, 0, 222, 208, 1, 0, 0, 0, 222, 213, 1, 0, 0, 0, 222, 216, 1, 0, 0, 0, 222, 219, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 25, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 228, 7, 0, 0, 0, 228, 27, 1, 0, 0, 0, 229, 238, 3, 34, 17, 0, 230, 238, 3, 48, 24, 0, 231, 238, 3, 22, 11, 0, 232, 238, 5, 1, 0, 0, 233, 238, 3, 40, 20, 0, 234, 238, 3, 36, 18, 0, 235, 238, 3, 16, 8, 0, 236, 238, 3, 30, 15, 0, 237, 229, 1, 0, 0, 0, 237, 230, 1, 0, 0, 0, 237, 231, 1, 0, 0, 0, 237, 232, 1, 0, 0, 0, 237, 233, 1, 0, 0, 0, 237, 234, 1, 0, 0, 0, 237, 235, 1, 0, 0, 0, 237, 236, 1, 0, 0, 0, 238, 29, 1, 0, 0, 0, 239, 241, 5, 6, 0, 0, 240, 242, 5, 42, 0, 0, 241, 240, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 245, 3, 24, 12, 0, 244, 246, 5, 42, 0, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 5, 7, 0, 0, 248, 31, 1, 0, 0, 0, 249, 250, 3, 52, 26, 0, 250, 33, 1, 0, 0, 0, 251, 257, 5, 41, 0, 0, 252, 257, 5, 16, 0, 0, 253, 257, 5, 17, 0, 0, 254, 257, 5, 18, 0, 0, 255, 257, 3, 52, 26, 0, 256, 251, 1, 0, 0, 0, 256, 252, 1, 0, 0, 0, 256, 253, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257, 35, 1, 0, 0, 0, 258, 275, 5, 12, 0, 0, 259, 261, 5, 42, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 272, 1, 0, 0, 0, 264, 266, 3, 38, 19, 0, 265, 267, 5, 42, 0, 0, 266, 265, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 264, 1, 0, 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 275, 260, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 278, 5, 13, 0, 0, 278, 37, 1, 0, 0, 0, 279, 282, 3, 52, 26, 0, 280, 282, 3, 22, 11, 0, 281, 279, 1, 0, 0, 0, 281, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, 5, 10, 0, 0, 284, 285, 3, 24, 12, 0, 285, 39, 1, 0, 0, 0, 286, 290, 5, 4, 0, 0, 287, 289, 5, 42, 0, 0, 288, 287, 1, 0, 0, 0, 289, 292, 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 296, 1, 0, 0, 0, 292, 290, 1, 0, 0, 0, 293, 295, 3, 42, 21, 0, 294, 293, 1, 0, 0, 0, 295, 298, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 299, 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 299, 300, 5, 5, 0, 0, 300, 41, 1, 0, 0, 0, 301, 308, 3, 24, 12, 0, 302, 304, 5, 42, 0, 0, 303, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 309, 1, 0, 0, 0, 307, 309, 5, 3, 0, 0, 308, 303, 1, 0, 0, 0, 308, 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 43, 1, 0, 0, 0, 310, 311, 5, 2, 0, 0, 311, 312, 3, 46, 23, 0, 312, 313, 5, 42, 0, 0, 313, 45, 1, 0, 0, 0, 314, 320, 3, 48, 24, 0, 315, 316, 3, 24, 12, 0, 316, 317, 5, 8, 0, 0, 317, 318, 3, 48, 24, 0, 318, 320, 1, 0, 0, 0, 319, 314, 1, 0, 0, 0, 319, 315, 1, 0, 0, 0, 320, 47, 1, 0, 0, 0, 321, 322, 3, 52, 26, 0, 322, 327, 5, 6, 0, 0, 323, 325, 5, 42, 0, 0, 324, 323, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 328, 3, 50, 25, 0, 327, 324, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 330, 1, 0, 0, 0, 329, 331, 5, 42, 0, 0, 330, 329, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 333, 5, 7, 0, 0, 333, 49, 1, 0, 0, 0, 334, 342, 3, 24, 12, 0, 335, 337, 5, 3, 0, 0, 336, 338, 5, 42, 0, 0, 337, 336, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 341, 3, 24, 12, 0, 340, 335, 1, 0, 0, 0, 341, 344, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 51, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 345, 346, 7, 1, 0, 0, 346, 53, 1, 0, 0, 0, 39, 57, 67, 72, 79, 84, 86, 96, 108, 115, 121, 128, 136, 150, 156, 165, 178, 186, 193, 222, 224, 237, 241, 245, 256, 262, 268, 272, 275, 281, 290, 296, 305, 308, 319, 324, 327, 330, 337, 342] \ No newline at end of file +[4, 1, 51, 386, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 1, 0, 5, 0, 62, 8, 0, 10, 0, 12, 0, 65, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 76, 8, 1, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 88, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 93, 8, 2, 3, 2, 95, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 103, 8, 4, 10, 4, 12, 4, 106, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 115, 8, 5, 10, 5, 12, 5, 118, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 124, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 130, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 135, 8, 6, 10, 6, 12, 6, 138, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 145, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 157, 8, 8, 10, 8, 12, 8, 160, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 168, 8, 8, 10, 8, 12, 8, 171, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 5, 11, 187, 8, 11, 10, 11, 12, 11, 190, 9, 11, 1, 11, 1, 11, 1, 11, 3, 11, 195, 8, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 202, 8, 11, 10, 11, 12, 11, 205, 9, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 217, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 223, 8, 14, 10, 14, 12, 14, 226, 9, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 232, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 261, 8, 15, 10, 15, 12, 15, 264, 9, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 276, 8, 17, 1, 18, 1, 18, 3, 18, 280, 8, 18, 1, 18, 1, 18, 3, 18, 284, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 295, 8, 20, 1, 21, 1, 21, 4, 21, 299, 8, 21, 11, 21, 12, 21, 300, 1, 21, 1, 21, 4, 21, 305, 8, 21, 11, 21, 12, 21, 306, 5, 21, 309, 8, 21, 10, 21, 12, 21, 312, 9, 21, 3, 21, 314, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 3, 22, 320, 8, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 327, 8, 23, 10, 23, 12, 23, 330, 9, 23, 1, 23, 5, 23, 333, 8, 23, 10, 23, 12, 23, 336, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 4, 24, 342, 8, 24, 11, 24, 12, 24, 343, 1, 24, 3, 24, 347, 8, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 358, 8, 26, 1, 27, 1, 27, 1, 27, 3, 27, 363, 8, 27, 1, 27, 3, 27, 366, 8, 27, 1, 27, 3, 27, 369, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 3, 28, 376, 8, 28, 1, 28, 5, 28, 379, 8, 28, 10, 28, 12, 28, 382, 9, 28, 1, 29, 1, 29, 1, 29, 0, 1, 30, 30, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 0, 2, 1, 0, 39, 44, 3, 0, 14, 20, 32, 34, 45, 45, 417, 0, 63, 1, 0, 0, 0, 2, 75, 1, 0, 0, 0, 4, 80, 1, 0, 0, 0, 6, 98, 1, 0, 0, 0, 8, 104, 1, 0, 0, 0, 10, 116, 1, 0, 0, 0, 12, 136, 1, 0, 0, 0, 14, 150, 1, 0, 0, 0, 16, 158, 1, 0, 0, 0, 18, 174, 1, 0, 0, 0, 20, 180, 1, 0, 0, 0, 22, 184, 1, 0, 0, 0, 24, 208, 1, 0, 0, 0, 26, 216, 1, 0, 0, 0, 28, 231, 1, 0, 0, 0, 30, 233, 1, 0, 0, 0, 32, 265, 1, 0, 0, 0, 34, 275, 1, 0, 0, 0, 36, 277, 1, 0, 0, 0, 38, 287, 1, 0, 0, 0, 40, 294, 1, 0, 0, 0, 42, 296, 1, 0, 0, 0, 44, 319, 1, 0, 0, 0, 46, 324, 1, 0, 0, 0, 48, 339, 1, 0, 0, 0, 50, 348, 1, 0, 0, 0, 52, 357, 1, 0, 0, 0, 54, 359, 1, 0, 0, 0, 56, 372, 1, 0, 0, 0, 58, 383, 1, 0, 0, 0, 60, 62, 3, 2, 1, 0, 61, 60, 1, 0, 0, 0, 62, 65, 1, 0, 0, 0, 63, 61, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 66, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, 66, 67, 5, 0, 0, 1, 67, 1, 1, 0, 0, 0, 68, 76, 3, 4, 2, 0, 69, 76, 3, 8, 4, 0, 70, 76, 3, 10, 5, 0, 71, 76, 3, 12, 6, 0, 72, 76, 3, 14, 7, 0, 73, 76, 3, 16, 8, 0, 74, 76, 5, 47, 0, 0, 75, 68, 1, 0, 0, 0, 75, 69, 1, 0, 0, 0, 75, 70, 1, 0, 0, 0, 75, 71, 1, 0, 0, 0, 75, 72, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 74, 1, 0, 0, 0, 76, 3, 1, 0, 0, 0, 77, 79, 3, 50, 25, 0, 78, 77, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 14, 0, 0, 84, 94, 3, 58, 29, 0, 85, 87, 3, 38, 19, 0, 86, 88, 3, 6, 3, 0, 87, 86, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 95, 1, 0, 0, 0, 89, 90, 5, 20, 0, 0, 90, 92, 3, 28, 14, 0, 91, 93, 3, 6, 3, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 95, 1, 0, 0, 0, 94, 85, 1, 0, 0, 0, 94, 89, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 47, 0, 0, 97, 5, 1, 0, 0, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 30, 15, 0, 100, 7, 1, 0, 0, 0, 101, 103, 3, 50, 25, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 15, 0, 0, 108, 109, 3, 58, 29, 0, 109, 110, 5, 11, 0, 0, 110, 111, 3, 30, 15, 0, 111, 112, 5, 47, 0, 0, 112, 9, 1, 0, 0, 0, 113, 115, 3, 50, 25, 0, 114, 113, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 20, 0, 0, 120, 121, 3, 58, 29, 0, 121, 123, 3, 28, 14, 0, 122, 124, 5, 27, 0, 0, 123, 122, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 129, 5, 11, 0, 0, 126, 130, 3, 20, 10, 0, 127, 130, 3, 42, 21, 0, 128, 130, 3, 22, 11, 0, 129, 126, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 129, 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 5, 47, 0, 0, 132, 11, 1, 0, 0, 0, 133, 135, 3, 50, 25, 0, 134, 133, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 139, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 140, 5, 21, 0, 0, 140, 144, 3, 58, 29, 0, 141, 145, 3, 58, 29, 0, 142, 143, 5, 20, 0, 0, 143, 145, 3, 28, 14, 0, 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 147, 5, 11, 0, 0, 147, 148, 3, 30, 15, 0, 148, 149, 5, 47, 0, 0, 149, 13, 1, 0, 0, 0, 150, 151, 5, 22, 0, 0, 151, 152, 5, 11, 0, 0, 152, 153, 3, 30, 15, 0, 153, 154, 5, 47, 0, 0, 154, 15, 1, 0, 0, 0, 155, 157, 3, 50, 25, 0, 156, 155, 1, 0, 0, 0, 157, 160, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 161, 162, 5, 23, 0, 0, 162, 169, 3, 28, 14, 0, 163, 164, 5, 24, 0, 0, 164, 168, 3, 42, 21, 0, 165, 166, 5, 25, 0, 0, 166, 168, 3, 58, 29, 0, 167, 163, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 171, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 172, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 172, 173, 5, 47, 0, 0, 173, 17, 1, 0, 0, 0, 174, 175, 5, 26, 0, 0, 175, 176, 3, 58, 29, 0, 176, 177, 5, 11, 0, 0, 177, 178, 3, 30, 15, 0, 178, 179, 5, 47, 0, 0, 179, 19, 1, 0, 0, 0, 180, 181, 5, 35, 0, 0, 181, 182, 3, 36, 18, 0, 182, 183, 3, 42, 21, 0, 183, 21, 1, 0, 0, 0, 184, 188, 5, 4, 0, 0, 185, 187, 5, 47, 0, 0, 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 191, 194, 5, 36, 0, 0, 192, 195, 3, 58, 29, 0, 193, 195, 3, 24, 12, 0, 194, 192, 1, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 197, 5, 37, 0, 0, 197, 198, 3, 30, 15, 0, 198, 199, 5, 10, 0, 0, 199, 203, 3, 26, 13, 0, 200, 202, 5, 47, 0, 0, 201, 200, 1, 0, 0, 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 206, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 207, 5, 5, 0, 0, 207, 23, 1, 0, 0, 0, 208, 209, 5, 6, 0, 0, 209, 210, 3, 58, 29, 0, 210, 211, 5, 3, 0, 0, 211, 212, 3, 58, 29, 0, 212, 213, 5, 7, 0, 0, 213, 25, 1, 0, 0, 0, 214, 217, 3, 30, 15, 0, 215, 217, 3, 20, 10, 0, 216, 214, 1, 0, 0, 0, 216, 215, 1, 0, 0, 0, 217, 27, 1, 0, 0, 0, 218, 224, 5, 28, 0, 0, 219, 220, 3, 30, 15, 0, 220, 221, 5, 29, 0, 0, 221, 223, 1, 0, 0, 0, 222, 219, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 227, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 228, 3, 30, 15, 0, 228, 229, 5, 30, 0, 0, 229, 232, 1, 0, 0, 0, 230, 232, 5, 31, 0, 0, 231, 218, 1, 0, 0, 0, 231, 230, 1, 0, 0, 0, 232, 29, 1, 0, 0, 0, 233, 234, 6, 15, -1, 0, 234, 235, 3, 34, 17, 0, 235, 262, 1, 0, 0, 0, 236, 237, 10, 6, 0, 0, 237, 238, 5, 38, 0, 0, 238, 239, 3, 30, 15, 0, 239, 240, 5, 10, 0, 0, 240, 241, 3, 30, 15, 7, 241, 261, 1, 0, 0, 0, 242, 243, 10, 2, 0, 0, 243, 244, 3, 32, 16, 0, 244, 245, 3, 30, 15, 3, 245, 261, 1, 0, 0, 0, 246, 247, 10, 7, 0, 0, 247, 248, 5, 4, 0, 0, 248, 249, 3, 30, 15, 0, 249, 250, 5, 5, 0, 0, 250, 261, 1, 0, 0, 0, 251, 252, 10, 5, 0, 0, 252, 253, 5, 8, 0, 0, 253, 261, 3, 58, 29, 0, 254, 255, 10, 4, 0, 0, 255, 256, 5, 8, 0, 0, 256, 261, 3, 54, 27, 0, 257, 258, 10, 3, 0, 0, 258, 259, 5, 10, 0, 0, 259, 261, 3, 58, 29, 0, 260, 236, 1, 0, 0, 0, 260, 242, 1, 0, 0, 0, 260, 246, 1, 0, 0, 0, 260, 251, 1, 0, 0, 0, 260, 254, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 31, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 7, 0, 0, 0, 266, 33, 1, 0, 0, 0, 267, 276, 3, 40, 20, 0, 268, 276, 3, 54, 27, 0, 269, 276, 3, 28, 14, 0, 270, 276, 5, 1, 0, 0, 271, 276, 3, 46, 23, 0, 272, 276, 3, 42, 21, 0, 273, 276, 3, 22, 11, 0, 274, 276, 3, 36, 18, 0, 275, 267, 1, 0, 0, 0, 275, 268, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, 270, 1, 0, 0, 0, 275, 271, 1, 0, 0, 0, 275, 272, 1, 0, 0, 0, 275, 273, 1, 0, 0, 0, 275, 274, 1, 0, 0, 0, 276, 35, 1, 0, 0, 0, 277, 279, 5, 6, 0, 0, 278, 280, 5, 47, 0, 0, 279, 278, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 283, 3, 30, 15, 0, 282, 284, 5, 47, 0, 0, 283, 282, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 286, 5, 7, 0, 0, 286, 37, 1, 0, 0, 0, 287, 288, 3, 58, 29, 0, 288, 39, 1, 0, 0, 0, 289, 295, 5, 46, 0, 0, 290, 295, 5, 16, 0, 0, 291, 295, 5, 17, 0, 0, 292, 295, 5, 18, 0, 0, 293, 295, 3, 58, 29, 0, 294, 289, 1, 0, 0, 0, 294, 290, 1, 0, 0, 0, 294, 291, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 293, 1, 0, 0, 0, 295, 41, 1, 0, 0, 0, 296, 313, 5, 12, 0, 0, 297, 299, 5, 47, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 310, 1, 0, 0, 0, 302, 304, 3, 44, 22, 0, 303, 305, 5, 47, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 302, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 298, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 316, 5, 13, 0, 0, 316, 43, 1, 0, 0, 0, 317, 320, 3, 58, 29, 0, 318, 320, 3, 28, 14, 0, 319, 317, 1, 0, 0, 0, 319, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 10, 0, 0, 322, 323, 3, 30, 15, 0, 323, 45, 1, 0, 0, 0, 324, 328, 5, 4, 0, 0, 325, 327, 5, 47, 0, 0, 326, 325, 1, 0, 0, 0, 327, 330, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 334, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 331, 333, 3, 48, 24, 0, 332, 331, 1, 0, 0, 0, 333, 336, 1, 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337, 338, 5, 5, 0, 0, 338, 47, 1, 0, 0, 0, 339, 346, 3, 30, 15, 0, 340, 342, 5, 47, 0, 0, 341, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 347, 1, 0, 0, 0, 345, 347, 5, 3, 0, 0, 346, 341, 1, 0, 0, 0, 346, 345, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 49, 1, 0, 0, 0, 348, 349, 5, 2, 0, 0, 349, 350, 3, 52, 26, 0, 350, 351, 5, 47, 0, 0, 351, 51, 1, 0, 0, 0, 352, 358, 3, 54, 27, 0, 353, 354, 3, 30, 15, 0, 354, 355, 5, 8, 0, 0, 355, 356, 3, 54, 27, 0, 356, 358, 1, 0, 0, 0, 357, 352, 1, 0, 0, 0, 357, 353, 1, 0, 0, 0, 358, 53, 1, 0, 0, 0, 359, 360, 3, 58, 29, 0, 360, 365, 5, 6, 0, 0, 361, 363, 5, 47, 0, 0, 362, 361, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 366, 3, 56, 28, 0, 365, 362, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 369, 5, 47, 0, 0, 368, 367, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 371, 5, 7, 0, 0, 371, 55, 1, 0, 0, 0, 372, 380, 3, 30, 15, 0, 373, 375, 5, 3, 0, 0, 374, 376, 5, 47, 0, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 379, 3, 30, 15, 0, 378, 373, 1, 0, 0, 0, 379, 382, 1, 0, 0, 0, 380, 378, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 57, 1, 0, 0, 0, 382, 380, 1, 0, 0, 0, 383, 384, 7, 1, 0, 0, 384, 59, 1, 0, 0, 0, 42, 63, 75, 80, 87, 92, 94, 104, 116, 123, 129, 136, 144, 158, 167, 169, 188, 194, 203, 216, 224, 231, 260, 262, 275, 279, 283, 294, 300, 306, 310, 313, 319, 328, 334, 343, 346, 357, 362, 365, 368, 375, 380] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep.tokens b/pkg/parser/bicep/antlr/parser/bicep.tokens index cef1c62deb6..91c8fff887c 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.tokens +++ b/pkg/parser/bicep/antlr/parser/bicep.tokens @@ -19,31 +19,36 @@ NULL=18 OBJECT=19 RESOURCE=20 OUTPUT=21 -EXISTING=22 -STRING_LEFT_PIECE=23 -STRING_MIDDLE_PIECE=24 -STRING_RIGHT_PIECE=25 -STRING_COMPLETE=26 -STRING=27 -INT=28 -BOOL=29 -IF=30 -FOR=31 -IN=32 -QMARK=33 -GT=34 -GTE=35 -LT=36 -LTE=37 -EQ=38 -NEQ=39 -IDENTIFIER=40 -NUMBER=41 -NL=42 -SINGLE_LINE_COMMENT=43 -MULTI_LINE_COMMENT=44 -SPACES=45 -UNKNOWN=46 +TARGET_SCOPE=22 +IMPORT=23 +WITH=24 +AS=25 +METADATA=26 +EXISTING=27 +STRING_LEFT_PIECE=28 +STRING_MIDDLE_PIECE=29 +STRING_RIGHT_PIECE=30 +STRING_COMPLETE=31 +STRING=32 +INT=33 +BOOL=34 +IF=35 +FOR=36 +IN=37 +QMARK=38 +GT=39 +GTE=40 +LT=41 +LTE=42 +EQ=43 +NEQ=44 +IDENTIFIER=45 +NUMBER=46 +NL=47 +SINGLE_LINE_COMMENT=48 +MULTI_LINE_COMMENT=49 +SPACES=50 +UNKNOWN=51 '@'=2 ','=3 '['=4 @@ -63,17 +68,22 @@ UNKNOWN=46 'object'=19 'resource'=20 'output'=21 -'existing'=22 -'string'=27 -'int'=28 -'bool'=29 -'if'=30 -'for'=31 -'in'=32 -'?'=33 -'>'=34 -'>='=35 -'<'=36 -'<='=37 -'=='=38 -'!='=39 +'targetScope'=22 +'import'=23 +'with'=24 +'as'=25 +'metadata'=26 +'existing'=27 +'string'=32 +'int'=33 +'bool'=34 +'if'=35 +'for'=36 +'in'=37 +'?'=38 +'>'=39 +'>='=40 +'<'=41 +'<='=42 +'=='=43 +'!='=44 diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.interp b/pkg/parser/bicep/antlr/parser/bicepLexer.interp index 03bf5e028a6..9173826e9f5 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.interp +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.interp @@ -21,6 +21,11 @@ null 'object' 'resource' 'output' +'targetScope' +'import' +'with' +'as' +'metadata' 'existing' null null @@ -70,6 +75,11 @@ NULL OBJECT RESOURCE OUTPUT +TARGET_SCOPE +IMPORT +WITH +AS +METADATA EXISTING STRING_LEFT_PIECE STRING_MIDDLE_PIECE @@ -118,6 +128,11 @@ NULL OBJECT RESOURCE OUTPUT +TARGET_SCOPE +IMPORT +WITH +AS +METADATA EXISTING STRING_LEFT_PIECE STRING_MIDDLE_PIECE @@ -155,4 +170,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 46, 359, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 105, 8, 0, 10, 0, 12, 0, 108, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 133, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 201, 8, 22, 10, 22, 12, 22, 204, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 211, 8, 23, 10, 23, 12, 23, 214, 9, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 221, 8, 24, 10, 24, 12, 24, 224, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 230, 8, 25, 10, 25, 12, 25, 233, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 5, 39, 283, 8, 39, 10, 39, 12, 39, 286, 9, 39, 1, 40, 4, 40, 289, 8, 40, 11, 40, 12, 40, 290, 1, 40, 1, 40, 4, 40, 295, 8, 40, 11, 40, 12, 40, 296, 3, 40, 299, 8, 40, 1, 41, 4, 41, 302, 8, 41, 11, 41, 12, 41, 303, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 310, 8, 42, 10, 42, 12, 42, 313, 9, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 321, 8, 43, 10, 43, 12, 43, 324, 9, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 4, 44, 332, 8, 44, 11, 44, 12, 44, 333, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 342, 8, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 4, 47, 350, 8, 47, 11, 47, 12, 47, 351, 1, 47, 1, 47, 3, 47, 356, 8, 47, 1, 48, 1, 48, 2, 106, 322, 0, 49, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 0, 95, 0, 97, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 372, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 1, 99, 1, 0, 0, 0, 3, 113, 1, 0, 0, 0, 5, 115, 1, 0, 0, 0, 7, 117, 1, 0, 0, 0, 9, 119, 1, 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 123, 1, 0, 0, 0, 15, 125, 1, 0, 0, 0, 17, 127, 1, 0, 0, 0, 19, 132, 1, 0, 0, 0, 21, 134, 1, 0, 0, 0, 23, 136, 1, 0, 0, 0, 25, 138, 1, 0, 0, 0, 27, 140, 1, 0, 0, 0, 29, 146, 1, 0, 0, 0, 31, 150, 1, 0, 0, 0, 33, 155, 1, 0, 0, 0, 35, 161, 1, 0, 0, 0, 37, 166, 1, 0, 0, 0, 39, 173, 1, 0, 0, 0, 41, 182, 1, 0, 0, 0, 43, 189, 1, 0, 0, 0, 45, 198, 1, 0, 0, 0, 47, 208, 1, 0, 0, 0, 49, 218, 1, 0, 0, 0, 51, 227, 1, 0, 0, 0, 53, 236, 1, 0, 0, 0, 55, 243, 1, 0, 0, 0, 57, 247, 1, 0, 0, 0, 59, 252, 1, 0, 0, 0, 61, 255, 1, 0, 0, 0, 63, 259, 1, 0, 0, 0, 65, 262, 1, 0, 0, 0, 67, 264, 1, 0, 0, 0, 69, 266, 1, 0, 0, 0, 71, 269, 1, 0, 0, 0, 73, 271, 1, 0, 0, 0, 75, 274, 1, 0, 0, 0, 77, 277, 1, 0, 0, 0, 79, 280, 1, 0, 0, 0, 81, 288, 1, 0, 0, 0, 83, 301, 1, 0, 0, 0, 85, 305, 1, 0, 0, 0, 87, 316, 1, 0, 0, 0, 89, 331, 1, 0, 0, 0, 91, 337, 1, 0, 0, 0, 93, 341, 1, 0, 0, 0, 95, 343, 1, 0, 0, 0, 97, 357, 1, 0, 0, 0, 99, 100, 5, 39, 0, 0, 100, 101, 5, 39, 0, 0, 101, 102, 5, 39, 0, 0, 102, 106, 1, 0, 0, 0, 103, 105, 9, 0, 0, 0, 104, 103, 1, 0, 0, 0, 105, 108, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 109, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, 5, 39, 0, 0, 111, 112, 5, 39, 0, 0, 112, 2, 1, 0, 0, 0, 113, 114, 5, 64, 0, 0, 114, 4, 1, 0, 0, 0, 115, 116, 5, 44, 0, 0, 116, 6, 1, 0, 0, 0, 117, 118, 5, 91, 0, 0, 118, 8, 1, 0, 0, 0, 119, 120, 5, 93, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, 40, 0, 0, 122, 12, 1, 0, 0, 0, 123, 124, 5, 41, 0, 0, 124, 14, 1, 0, 0, 0, 125, 126, 5, 46, 0, 0, 126, 16, 1, 0, 0, 0, 127, 128, 5, 124, 0, 0, 128, 18, 1, 0, 0, 0, 129, 133, 5, 58, 0, 0, 130, 131, 5, 58, 0, 0, 131, 133, 5, 58, 0, 0, 132, 129, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 133, 20, 1, 0, 0, 0, 134, 135, 5, 61, 0, 0, 135, 22, 1, 0, 0, 0, 136, 137, 5, 123, 0, 0, 137, 24, 1, 0, 0, 0, 138, 139, 5, 125, 0, 0, 139, 26, 1, 0, 0, 0, 140, 141, 5, 112, 0, 0, 141, 142, 5, 97, 0, 0, 142, 143, 5, 114, 0, 0, 143, 144, 5, 97, 0, 0, 144, 145, 5, 109, 0, 0, 145, 28, 1, 0, 0, 0, 146, 147, 5, 118, 0, 0, 147, 148, 5, 97, 0, 0, 148, 149, 5, 114, 0, 0, 149, 30, 1, 0, 0, 0, 150, 151, 5, 116, 0, 0, 151, 152, 5, 114, 0, 0, 152, 153, 5, 117, 0, 0, 153, 154, 5, 101, 0, 0, 154, 32, 1, 0, 0, 0, 155, 156, 5, 102, 0, 0, 156, 157, 5, 97, 0, 0, 157, 158, 5, 108, 0, 0, 158, 159, 5, 115, 0, 0, 159, 160, 5, 101, 0, 0, 160, 34, 1, 0, 0, 0, 161, 162, 5, 110, 0, 0, 162, 163, 5, 117, 0, 0, 163, 164, 5, 108, 0, 0, 164, 165, 5, 108, 0, 0, 165, 36, 1, 0, 0, 0, 166, 167, 5, 111, 0, 0, 167, 168, 5, 98, 0, 0, 168, 169, 5, 106, 0, 0, 169, 170, 5, 101, 0, 0, 170, 171, 5, 99, 0, 0, 171, 172, 5, 116, 0, 0, 172, 38, 1, 0, 0, 0, 173, 174, 5, 114, 0, 0, 174, 175, 5, 101, 0, 0, 175, 176, 5, 115, 0, 0, 176, 177, 5, 111, 0, 0, 177, 178, 5, 117, 0, 0, 178, 179, 5, 114, 0, 0, 179, 180, 5, 99, 0, 0, 180, 181, 5, 101, 0, 0, 181, 40, 1, 0, 0, 0, 182, 183, 5, 111, 0, 0, 183, 184, 5, 117, 0, 0, 184, 185, 5, 116, 0, 0, 185, 186, 5, 112, 0, 0, 186, 187, 5, 117, 0, 0, 187, 188, 5, 116, 0, 0, 188, 42, 1, 0, 0, 0, 189, 190, 5, 101, 0, 0, 190, 191, 5, 120, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, 5, 115, 0, 0, 193, 194, 5, 116, 0, 0, 194, 195, 5, 105, 0, 0, 195, 196, 5, 110, 0, 0, 196, 197, 5, 103, 0, 0, 197, 44, 1, 0, 0, 0, 198, 202, 5, 39, 0, 0, 199, 201, 3, 93, 46, 0, 200, 199, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 205, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 205, 206, 5, 36, 0, 0, 206, 207, 5, 123, 0, 0, 207, 46, 1, 0, 0, 0, 208, 212, 5, 125, 0, 0, 209, 211, 3, 93, 46, 0, 210, 209, 1, 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 215, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 215, 216, 5, 36, 0, 0, 216, 217, 5, 123, 0, 0, 217, 48, 1, 0, 0, 0, 218, 222, 5, 125, 0, 0, 219, 221, 3, 93, 46, 0, 220, 219, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 225, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 225, 226, 5, 39, 0, 0, 226, 50, 1, 0, 0, 0, 227, 231, 5, 39, 0, 0, 228, 230, 3, 93, 46, 0, 229, 228, 1, 0, 0, 0, 230, 233, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 234, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 234, 235, 5, 39, 0, 0, 235, 52, 1, 0, 0, 0, 236, 237, 5, 115, 0, 0, 237, 238, 5, 116, 0, 0, 238, 239, 5, 114, 0, 0, 239, 240, 5, 105, 0, 0, 240, 241, 5, 110, 0, 0, 241, 242, 5, 103, 0, 0, 242, 54, 1, 0, 0, 0, 243, 244, 5, 105, 0, 0, 244, 245, 5, 110, 0, 0, 245, 246, 5, 116, 0, 0, 246, 56, 1, 0, 0, 0, 247, 248, 5, 98, 0, 0, 248, 249, 5, 111, 0, 0, 249, 250, 5, 111, 0, 0, 250, 251, 5, 108, 0, 0, 251, 58, 1, 0, 0, 0, 252, 253, 5, 105, 0, 0, 253, 254, 5, 102, 0, 0, 254, 60, 1, 0, 0, 0, 255, 256, 5, 102, 0, 0, 256, 257, 5, 111, 0, 0, 257, 258, 5, 114, 0, 0, 258, 62, 1, 0, 0, 0, 259, 260, 5, 105, 0, 0, 260, 261, 5, 110, 0, 0, 261, 64, 1, 0, 0, 0, 262, 263, 5, 63, 0, 0, 263, 66, 1, 0, 0, 0, 264, 265, 5, 62, 0, 0, 265, 68, 1, 0, 0, 0, 266, 267, 5, 62, 0, 0, 267, 268, 5, 61, 0, 0, 268, 70, 1, 0, 0, 0, 269, 270, 5, 60, 0, 0, 270, 72, 1, 0, 0, 0, 271, 272, 5, 60, 0, 0, 272, 273, 5, 61, 0, 0, 273, 74, 1, 0, 0, 0, 274, 275, 5, 61, 0, 0, 275, 276, 5, 61, 0, 0, 276, 76, 1, 0, 0, 0, 277, 278, 5, 33, 0, 0, 278, 279, 5, 61, 0, 0, 279, 78, 1, 0, 0, 0, 280, 284, 7, 0, 0, 0, 281, 283, 7, 1, 0, 0, 282, 281, 1, 0, 0, 0, 283, 286, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 80, 1, 0, 0, 0, 286, 284, 1, 0, 0, 0, 287, 289, 7, 2, 0, 0, 288, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 298, 1, 0, 0, 0, 292, 294, 5, 46, 0, 0, 293, 295, 7, 2, 0, 0, 294, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 299, 1, 0, 0, 0, 298, 292, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 82, 1, 0, 0, 0, 300, 302, 7, 3, 0, 0, 301, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 84, 1, 0, 0, 0, 305, 306, 5, 47, 0, 0, 306, 307, 5, 47, 0, 0, 307, 311, 1, 0, 0, 0, 308, 310, 8, 3, 0, 0, 309, 308, 1, 0, 0, 0, 310, 313, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 314, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 314, 315, 6, 42, 0, 0, 315, 86, 1, 0, 0, 0, 316, 317, 5, 47, 0, 0, 317, 318, 5, 42, 0, 0, 318, 322, 1, 0, 0, 0, 319, 321, 9, 0, 0, 0, 320, 319, 1, 0, 0, 0, 321, 324, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 325, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 325, 326, 5, 42, 0, 0, 326, 327, 5, 47, 0, 0, 327, 328, 1, 0, 0, 0, 328, 329, 6, 43, 0, 0, 329, 88, 1, 0, 0, 0, 330, 332, 7, 4, 0, 0, 331, 330, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 336, 6, 44, 0, 0, 336, 90, 1, 0, 0, 0, 337, 338, 9, 0, 0, 0, 338, 92, 1, 0, 0, 0, 339, 342, 8, 5, 0, 0, 340, 342, 3, 95, 47, 0, 341, 339, 1, 0, 0, 0, 341, 340, 1, 0, 0, 0, 342, 94, 1, 0, 0, 0, 343, 355, 5, 92, 0, 0, 344, 356, 7, 6, 0, 0, 345, 346, 5, 117, 0, 0, 346, 347, 5, 123, 0, 0, 347, 349, 1, 0, 0, 0, 348, 350, 3, 97, 48, 0, 349, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, 353, 354, 5, 125, 0, 0, 354, 356, 1, 0, 0, 0, 355, 344, 1, 0, 0, 0, 355, 345, 1, 0, 0, 0, 356, 96, 1, 0, 0, 0, 357, 358, 7, 7, 0, 0, 358, 98, 1, 0, 0, 0, 18, 0, 106, 132, 202, 212, 222, 231, 284, 290, 296, 298, 303, 311, 322, 333, 341, 351, 355, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 51, 405, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 115, 8, 0, 10, 0, 12, 0, 118, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 143, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 5, 27, 247, 8, 27, 10, 27, 12, 27, 250, 9, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 5, 28, 257, 8, 28, 10, 28, 12, 28, 260, 9, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 5, 29, 267, 8, 29, 10, 29, 12, 29, 270, 9, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 276, 8, 30, 10, 30, 12, 30, 279, 9, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 5, 44, 329, 8, 44, 10, 44, 12, 44, 332, 9, 44, 1, 45, 4, 45, 335, 8, 45, 11, 45, 12, 45, 336, 1, 45, 1, 45, 4, 45, 341, 8, 45, 11, 45, 12, 45, 342, 3, 45, 345, 8, 45, 1, 46, 4, 46, 348, 8, 46, 11, 46, 12, 46, 349, 1, 47, 1, 47, 1, 47, 1, 47, 5, 47, 356, 8, 47, 10, 47, 12, 47, 359, 9, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 367, 8, 48, 10, 48, 12, 48, 370, 9, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 4, 49, 378, 8, 49, 11, 49, 12, 49, 379, 1, 49, 1, 49, 1, 50, 1, 50, 1, 51, 1, 51, 3, 51, 388, 8, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 4, 52, 396, 8, 52, 11, 52, 12, 52, 397, 1, 52, 1, 52, 3, 52, 402, 8, 52, 1, 53, 1, 53, 2, 116, 368, 0, 54, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 0, 105, 0, 107, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 418, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 1, 109, 1, 0, 0, 0, 3, 123, 1, 0, 0, 0, 5, 125, 1, 0, 0, 0, 7, 127, 1, 0, 0, 0, 9, 129, 1, 0, 0, 0, 11, 131, 1, 0, 0, 0, 13, 133, 1, 0, 0, 0, 15, 135, 1, 0, 0, 0, 17, 137, 1, 0, 0, 0, 19, 142, 1, 0, 0, 0, 21, 144, 1, 0, 0, 0, 23, 146, 1, 0, 0, 0, 25, 148, 1, 0, 0, 0, 27, 150, 1, 0, 0, 0, 29, 156, 1, 0, 0, 0, 31, 160, 1, 0, 0, 0, 33, 165, 1, 0, 0, 0, 35, 171, 1, 0, 0, 0, 37, 176, 1, 0, 0, 0, 39, 183, 1, 0, 0, 0, 41, 192, 1, 0, 0, 0, 43, 199, 1, 0, 0, 0, 45, 211, 1, 0, 0, 0, 47, 218, 1, 0, 0, 0, 49, 223, 1, 0, 0, 0, 51, 226, 1, 0, 0, 0, 53, 235, 1, 0, 0, 0, 55, 244, 1, 0, 0, 0, 57, 254, 1, 0, 0, 0, 59, 264, 1, 0, 0, 0, 61, 273, 1, 0, 0, 0, 63, 282, 1, 0, 0, 0, 65, 289, 1, 0, 0, 0, 67, 293, 1, 0, 0, 0, 69, 298, 1, 0, 0, 0, 71, 301, 1, 0, 0, 0, 73, 305, 1, 0, 0, 0, 75, 308, 1, 0, 0, 0, 77, 310, 1, 0, 0, 0, 79, 312, 1, 0, 0, 0, 81, 315, 1, 0, 0, 0, 83, 317, 1, 0, 0, 0, 85, 320, 1, 0, 0, 0, 87, 323, 1, 0, 0, 0, 89, 326, 1, 0, 0, 0, 91, 334, 1, 0, 0, 0, 93, 347, 1, 0, 0, 0, 95, 351, 1, 0, 0, 0, 97, 362, 1, 0, 0, 0, 99, 377, 1, 0, 0, 0, 101, 383, 1, 0, 0, 0, 103, 387, 1, 0, 0, 0, 105, 389, 1, 0, 0, 0, 107, 403, 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, 5, 39, 0, 0, 111, 112, 5, 39, 0, 0, 112, 116, 1, 0, 0, 0, 113, 115, 9, 0, 0, 0, 114, 113, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 39, 0, 0, 120, 121, 5, 39, 0, 0, 121, 122, 5, 39, 0, 0, 122, 2, 1, 0, 0, 0, 123, 124, 5, 64, 0, 0, 124, 4, 1, 0, 0, 0, 125, 126, 5, 44, 0, 0, 126, 6, 1, 0, 0, 0, 127, 128, 5, 91, 0, 0, 128, 8, 1, 0, 0, 0, 129, 130, 5, 93, 0, 0, 130, 10, 1, 0, 0, 0, 131, 132, 5, 40, 0, 0, 132, 12, 1, 0, 0, 0, 133, 134, 5, 41, 0, 0, 134, 14, 1, 0, 0, 0, 135, 136, 5, 46, 0, 0, 136, 16, 1, 0, 0, 0, 137, 138, 5, 124, 0, 0, 138, 18, 1, 0, 0, 0, 139, 143, 5, 58, 0, 0, 140, 141, 5, 58, 0, 0, 141, 143, 5, 58, 0, 0, 142, 139, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 143, 20, 1, 0, 0, 0, 144, 145, 5, 61, 0, 0, 145, 22, 1, 0, 0, 0, 146, 147, 5, 123, 0, 0, 147, 24, 1, 0, 0, 0, 148, 149, 5, 125, 0, 0, 149, 26, 1, 0, 0, 0, 150, 151, 5, 112, 0, 0, 151, 152, 5, 97, 0, 0, 152, 153, 5, 114, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 109, 0, 0, 155, 28, 1, 0, 0, 0, 156, 157, 5, 118, 0, 0, 157, 158, 5, 97, 0, 0, 158, 159, 5, 114, 0, 0, 159, 30, 1, 0, 0, 0, 160, 161, 5, 116, 0, 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 117, 0, 0, 163, 164, 5, 101, 0, 0, 164, 32, 1, 0, 0, 0, 165, 166, 5, 102, 0, 0, 166, 167, 5, 97, 0, 0, 167, 168, 5, 108, 0, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 101, 0, 0, 170, 34, 1, 0, 0, 0, 171, 172, 5, 110, 0, 0, 172, 173, 5, 117, 0, 0, 173, 174, 5, 108, 0, 0, 174, 175, 5, 108, 0, 0, 175, 36, 1, 0, 0, 0, 176, 177, 5, 111, 0, 0, 177, 178, 5, 98, 0, 0, 178, 179, 5, 106, 0, 0, 179, 180, 5, 101, 0, 0, 180, 181, 5, 99, 0, 0, 181, 182, 5, 116, 0, 0, 182, 38, 1, 0, 0, 0, 183, 184, 5, 114, 0, 0, 184, 185, 5, 101, 0, 0, 185, 186, 5, 115, 0, 0, 186, 187, 5, 111, 0, 0, 187, 188, 5, 117, 0, 0, 188, 189, 5, 114, 0, 0, 189, 190, 5, 99, 0, 0, 190, 191, 5, 101, 0, 0, 191, 40, 1, 0, 0, 0, 192, 193, 5, 111, 0, 0, 193, 194, 5, 117, 0, 0, 194, 195, 5, 116, 0, 0, 195, 196, 5, 112, 0, 0, 196, 197, 5, 117, 0, 0, 197, 198, 5, 116, 0, 0, 198, 42, 1, 0, 0, 0, 199, 200, 5, 116, 0, 0, 200, 201, 5, 97, 0, 0, 201, 202, 5, 114, 0, 0, 202, 203, 5, 103, 0, 0, 203, 204, 5, 101, 0, 0, 204, 205, 5, 116, 0, 0, 205, 206, 5, 83, 0, 0, 206, 207, 5, 99, 0, 0, 207, 208, 5, 111, 0, 0, 208, 209, 5, 112, 0, 0, 209, 210, 5, 101, 0, 0, 210, 44, 1, 0, 0, 0, 211, 212, 5, 105, 0, 0, 212, 213, 5, 109, 0, 0, 213, 214, 5, 112, 0, 0, 214, 215, 5, 111, 0, 0, 215, 216, 5, 114, 0, 0, 216, 217, 5, 116, 0, 0, 217, 46, 1, 0, 0, 0, 218, 219, 5, 119, 0, 0, 219, 220, 5, 105, 0, 0, 220, 221, 5, 116, 0, 0, 221, 222, 5, 104, 0, 0, 222, 48, 1, 0, 0, 0, 223, 224, 5, 97, 0, 0, 224, 225, 5, 115, 0, 0, 225, 50, 1, 0, 0, 0, 226, 227, 5, 109, 0, 0, 227, 228, 5, 101, 0, 0, 228, 229, 5, 116, 0, 0, 229, 230, 5, 97, 0, 0, 230, 231, 5, 100, 0, 0, 231, 232, 5, 97, 0, 0, 232, 233, 5, 116, 0, 0, 233, 234, 5, 97, 0, 0, 234, 52, 1, 0, 0, 0, 235, 236, 5, 101, 0, 0, 236, 237, 5, 120, 0, 0, 237, 238, 5, 105, 0, 0, 238, 239, 5, 115, 0, 0, 239, 240, 5, 116, 0, 0, 240, 241, 5, 105, 0, 0, 241, 242, 5, 110, 0, 0, 242, 243, 5, 103, 0, 0, 243, 54, 1, 0, 0, 0, 244, 248, 5, 39, 0, 0, 245, 247, 3, 103, 51, 0, 246, 245, 1, 0, 0, 0, 247, 250, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 251, 252, 5, 36, 0, 0, 252, 253, 5, 123, 0, 0, 253, 56, 1, 0, 0, 0, 254, 258, 5, 125, 0, 0, 255, 257, 3, 103, 51, 0, 256, 255, 1, 0, 0, 0, 257, 260, 1, 0, 0, 0, 258, 256, 1, 0, 0, 0, 258, 259, 1, 0, 0, 0, 259, 261, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 261, 262, 5, 36, 0, 0, 262, 263, 5, 123, 0, 0, 263, 58, 1, 0, 0, 0, 264, 268, 5, 125, 0, 0, 265, 267, 3, 103, 51, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 271, 272, 5, 39, 0, 0, 272, 60, 1, 0, 0, 0, 273, 277, 5, 39, 0, 0, 274, 276, 3, 103, 51, 0, 275, 274, 1, 0, 0, 0, 276, 279, 1, 0, 0, 0, 277, 275, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 280, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 280, 281, 5, 39, 0, 0, 281, 62, 1, 0, 0, 0, 282, 283, 5, 115, 0, 0, 283, 284, 5, 116, 0, 0, 284, 285, 5, 114, 0, 0, 285, 286, 5, 105, 0, 0, 286, 287, 5, 110, 0, 0, 287, 288, 5, 103, 0, 0, 288, 64, 1, 0, 0, 0, 289, 290, 5, 105, 0, 0, 290, 291, 5, 110, 0, 0, 291, 292, 5, 116, 0, 0, 292, 66, 1, 0, 0, 0, 293, 294, 5, 98, 0, 0, 294, 295, 5, 111, 0, 0, 295, 296, 5, 111, 0, 0, 296, 297, 5, 108, 0, 0, 297, 68, 1, 0, 0, 0, 298, 299, 5, 105, 0, 0, 299, 300, 5, 102, 0, 0, 300, 70, 1, 0, 0, 0, 301, 302, 5, 102, 0, 0, 302, 303, 5, 111, 0, 0, 303, 304, 5, 114, 0, 0, 304, 72, 1, 0, 0, 0, 305, 306, 5, 105, 0, 0, 306, 307, 5, 110, 0, 0, 307, 74, 1, 0, 0, 0, 308, 309, 5, 63, 0, 0, 309, 76, 1, 0, 0, 0, 310, 311, 5, 62, 0, 0, 311, 78, 1, 0, 0, 0, 312, 313, 5, 62, 0, 0, 313, 314, 5, 61, 0, 0, 314, 80, 1, 0, 0, 0, 315, 316, 5, 60, 0, 0, 316, 82, 1, 0, 0, 0, 317, 318, 5, 60, 0, 0, 318, 319, 5, 61, 0, 0, 319, 84, 1, 0, 0, 0, 320, 321, 5, 61, 0, 0, 321, 322, 5, 61, 0, 0, 322, 86, 1, 0, 0, 0, 323, 324, 5, 33, 0, 0, 324, 325, 5, 61, 0, 0, 325, 88, 1, 0, 0, 0, 326, 330, 7, 0, 0, 0, 327, 329, 7, 1, 0, 0, 328, 327, 1, 0, 0, 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 90, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 335, 7, 2, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 344, 1, 0, 0, 0, 338, 340, 5, 46, 0, 0, 339, 341, 7, 2, 0, 0, 340, 339, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 345, 1, 0, 0, 0, 344, 338, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 92, 1, 0, 0, 0, 346, 348, 7, 3, 0, 0, 347, 346, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 94, 1, 0, 0, 0, 351, 352, 5, 47, 0, 0, 352, 353, 5, 47, 0, 0, 353, 357, 1, 0, 0, 0, 354, 356, 8, 3, 0, 0, 355, 354, 1, 0, 0, 0, 356, 359, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 360, 1, 0, 0, 0, 359, 357, 1, 0, 0, 0, 360, 361, 6, 47, 0, 0, 361, 96, 1, 0, 0, 0, 362, 363, 5, 47, 0, 0, 363, 364, 5, 42, 0, 0, 364, 368, 1, 0, 0, 0, 365, 367, 9, 0, 0, 0, 366, 365, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 368, 366, 1, 0, 0, 0, 369, 371, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 371, 372, 5, 42, 0, 0, 372, 373, 5, 47, 0, 0, 373, 374, 1, 0, 0, 0, 374, 375, 6, 48, 0, 0, 375, 98, 1, 0, 0, 0, 376, 378, 7, 4, 0, 0, 377, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 382, 6, 49, 0, 0, 382, 100, 1, 0, 0, 0, 383, 384, 9, 0, 0, 0, 384, 102, 1, 0, 0, 0, 385, 388, 8, 5, 0, 0, 386, 388, 3, 105, 52, 0, 387, 385, 1, 0, 0, 0, 387, 386, 1, 0, 0, 0, 388, 104, 1, 0, 0, 0, 389, 401, 5, 92, 0, 0, 390, 402, 7, 6, 0, 0, 391, 392, 5, 117, 0, 0, 392, 393, 5, 123, 0, 0, 393, 395, 1, 0, 0, 0, 394, 396, 3, 107, 53, 0, 395, 394, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 398, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 400, 5, 125, 0, 0, 400, 402, 1, 0, 0, 0, 401, 390, 1, 0, 0, 0, 401, 391, 1, 0, 0, 0, 402, 106, 1, 0, 0, 0, 403, 404, 7, 7, 0, 0, 404, 108, 1, 0, 0, 0, 18, 0, 116, 142, 248, 258, 268, 277, 330, 336, 342, 344, 349, 357, 368, 379, 387, 397, 401, 1, 6, 0, 0] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens index cef1c62deb6..91c8fff887c 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens @@ -19,31 +19,36 @@ NULL=18 OBJECT=19 RESOURCE=20 OUTPUT=21 -EXISTING=22 -STRING_LEFT_PIECE=23 -STRING_MIDDLE_PIECE=24 -STRING_RIGHT_PIECE=25 -STRING_COMPLETE=26 -STRING=27 -INT=28 -BOOL=29 -IF=30 -FOR=31 -IN=32 -QMARK=33 -GT=34 -GTE=35 -LT=36 -LTE=37 -EQ=38 -NEQ=39 -IDENTIFIER=40 -NUMBER=41 -NL=42 -SINGLE_LINE_COMMENT=43 -MULTI_LINE_COMMENT=44 -SPACES=45 -UNKNOWN=46 +TARGET_SCOPE=22 +IMPORT=23 +WITH=24 +AS=25 +METADATA=26 +EXISTING=27 +STRING_LEFT_PIECE=28 +STRING_MIDDLE_PIECE=29 +STRING_RIGHT_PIECE=30 +STRING_COMPLETE=31 +STRING=32 +INT=33 +BOOL=34 +IF=35 +FOR=36 +IN=37 +QMARK=38 +GT=39 +GTE=40 +LT=41 +LTE=42 +EQ=43 +NEQ=44 +IDENTIFIER=45 +NUMBER=46 +NL=47 +SINGLE_LINE_COMMENT=48 +MULTI_LINE_COMMENT=49 +SPACES=50 +UNKNOWN=51 '@'=2 ','=3 '['=4 @@ -63,17 +68,22 @@ UNKNOWN=46 'object'=19 'resource'=20 'output'=21 -'existing'=22 -'string'=27 -'int'=28 -'bool'=29 -'if'=30 -'for'=31 -'in'=32 -'?'=33 -'>'=34 -'>='=35 -'<'=36 -'<='=37 -'=='=38 -'!='=39 +'targetScope'=22 +'import'=23 +'with'=24 +'as'=25 +'metadata'=26 +'existing'=27 +'string'=32 +'int'=33 +'bool'=34 +'if'=35 +'for'=36 +'in'=37 +'?'=38 +'>'=39 +'>='=40 +'<'=41 +'<='=42 +'=='=43 +'!='=44 diff --git a/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go index 5dfa47bddcd..18799996c85 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go +++ b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go @@ -36,6 +36,18 @@ func (v *BasebicepVisitor) VisitOutputDecl(ctx *OutputDeclContext) interface{} { return v.VisitChildren(ctx) } +func (v *BasebicepVisitor) VisitTargetScopeDecl(ctx *TargetScopeDeclContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitImportDecl(ctx *ImportDeclContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitMetadataDecl(ctx *MetadataDeclContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BasebicepVisitor) VisitIfCondition(ctx *IfConditionContext) interface{} { return v.VisitChildren(ctx) } diff --git a/pkg/parser/bicep/antlr/parser/bicep_lexer.go b/pkg/parser/bicep/antlr/parser/bicep_lexer.go index 33379172caf..fae69ac42ed 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_lexer.go +++ b/pkg/parser/bicep/antlr/parser/bicep_lexer.go @@ -45,31 +45,34 @@ func biceplexerLexerInit() { staticData.LiteralNames = []string{ "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", - "'object'", "'resource'", "'output'", "'existing'", "", "", "", "", - "'string'", "'int'", "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", - "'>='", "'<'", "'<='", "'=='", "'!='", + "'object'", "'resource'", "'output'", "'targetScope'", "'import'", "'with'", + "'as'", "'metadata'", "'existing'", "", "", "", "", "'string'", "'int'", + "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", + "'=='", "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "EXISTING", - "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", - "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", - "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", - "MULTI_LINE_COMMENT", "SPACES", "UNKNOWN", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", + "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "STRING_LEFT_PIECE", + "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", + "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", + "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", + "SPACES", "UNKNOWN", } staticData.RuleNames = []string{ "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "EXISTING", - "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", - "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", - "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", - "MULTI_LINE_COMMENT", "SPACES", "UNKNOWN", "STRINGCHAR", "ESCAPE", "HEX", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", + "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "STRING_LEFT_PIECE", + "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", + "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", + "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", + "SPACES", "UNKNOWN", "STRINGCHAR", "ESCAPE", "HEX", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 46, 359, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 51, 405, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, @@ -78,157 +81,177 @@ func biceplexerLexerInit() { 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, - 2, 47, 7, 47, 2, 48, 7, 48, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 105, 8, - 0, 10, 0, 12, 0, 108, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, - 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, - 8, 1, 9, 1, 9, 1, 9, 3, 9, 133, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, - 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, - 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, - 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, - 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, - 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 5, 22, 201, - 8, 22, 10, 22, 12, 22, 204, 9, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, - 23, 211, 8, 23, 10, 23, 12, 23, 214, 9, 23, 1, 23, 1, 23, 1, 23, 1, 24, - 1, 24, 5, 24, 221, 8, 24, 10, 24, 12, 24, 224, 9, 24, 1, 24, 1, 24, 1, - 25, 1, 25, 5, 25, 230, 8, 25, 10, 25, 12, 25, 233, 9, 25, 1, 25, 1, 25, - 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, - 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, - 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, - 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, - 1, 38, 1, 38, 1, 39, 1, 39, 5, 39, 283, 8, 39, 10, 39, 12, 39, 286, 9, - 39, 1, 40, 4, 40, 289, 8, 40, 11, 40, 12, 40, 290, 1, 40, 1, 40, 4, 40, - 295, 8, 40, 11, 40, 12, 40, 296, 3, 40, 299, 8, 40, 1, 41, 4, 41, 302, - 8, 41, 11, 41, 12, 41, 303, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 310, 8, - 42, 10, 42, 12, 42, 313, 9, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, - 5, 43, 321, 8, 43, 10, 43, 12, 43, 324, 9, 43, 1, 43, 1, 43, 1, 43, 1, - 43, 1, 43, 1, 44, 4, 44, 332, 8, 44, 11, 44, 12, 44, 333, 1, 44, 1, 44, - 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 342, 8, 46, 1, 47, 1, 47, 1, 47, 1, - 47, 1, 47, 1, 47, 4, 47, 350, 8, 47, 11, 47, 12, 47, 351, 1, 47, 1, 47, - 3, 47, 356, 8, 47, 1, 48, 1, 48, 2, 106, 322, 0, 49, 1, 1, 3, 2, 5, 3, - 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, - 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, - 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, - 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, - 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 0, 95, 0, 97, 0, 1, - 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, - 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, - 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, - 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 372, 0, 1, 1, 0, 0, - 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, - 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, - 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, - 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, - 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, - 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, - 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, - 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, - 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, - 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, - 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, - 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 1, 99, 1, 0, 0, 0, - 3, 113, 1, 0, 0, 0, 5, 115, 1, 0, 0, 0, 7, 117, 1, 0, 0, 0, 9, 119, 1, - 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 123, 1, 0, 0, 0, 15, 125, 1, 0, 0, 0, - 17, 127, 1, 0, 0, 0, 19, 132, 1, 0, 0, 0, 21, 134, 1, 0, 0, 0, 23, 136, - 1, 0, 0, 0, 25, 138, 1, 0, 0, 0, 27, 140, 1, 0, 0, 0, 29, 146, 1, 0, 0, - 0, 31, 150, 1, 0, 0, 0, 33, 155, 1, 0, 0, 0, 35, 161, 1, 0, 0, 0, 37, 166, - 1, 0, 0, 0, 39, 173, 1, 0, 0, 0, 41, 182, 1, 0, 0, 0, 43, 189, 1, 0, 0, - 0, 45, 198, 1, 0, 0, 0, 47, 208, 1, 0, 0, 0, 49, 218, 1, 0, 0, 0, 51, 227, - 1, 0, 0, 0, 53, 236, 1, 0, 0, 0, 55, 243, 1, 0, 0, 0, 57, 247, 1, 0, 0, - 0, 59, 252, 1, 0, 0, 0, 61, 255, 1, 0, 0, 0, 63, 259, 1, 0, 0, 0, 65, 262, - 1, 0, 0, 0, 67, 264, 1, 0, 0, 0, 69, 266, 1, 0, 0, 0, 71, 269, 1, 0, 0, - 0, 73, 271, 1, 0, 0, 0, 75, 274, 1, 0, 0, 0, 77, 277, 1, 0, 0, 0, 79, 280, - 1, 0, 0, 0, 81, 288, 1, 0, 0, 0, 83, 301, 1, 0, 0, 0, 85, 305, 1, 0, 0, - 0, 87, 316, 1, 0, 0, 0, 89, 331, 1, 0, 0, 0, 91, 337, 1, 0, 0, 0, 93, 341, - 1, 0, 0, 0, 95, 343, 1, 0, 0, 0, 97, 357, 1, 0, 0, 0, 99, 100, 5, 39, 0, - 0, 100, 101, 5, 39, 0, 0, 101, 102, 5, 39, 0, 0, 102, 106, 1, 0, 0, 0, - 103, 105, 9, 0, 0, 0, 104, 103, 1, 0, 0, 0, 105, 108, 1, 0, 0, 0, 106, - 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 109, 1, 0, 0, 0, 108, 106, - 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, 5, 39, 0, 0, 111, 112, 5, - 39, 0, 0, 112, 2, 1, 0, 0, 0, 113, 114, 5, 64, 0, 0, 114, 4, 1, 0, 0, 0, - 115, 116, 5, 44, 0, 0, 116, 6, 1, 0, 0, 0, 117, 118, 5, 91, 0, 0, 118, - 8, 1, 0, 0, 0, 119, 120, 5, 93, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, - 40, 0, 0, 122, 12, 1, 0, 0, 0, 123, 124, 5, 41, 0, 0, 124, 14, 1, 0, 0, - 0, 125, 126, 5, 46, 0, 0, 126, 16, 1, 0, 0, 0, 127, 128, 5, 124, 0, 0, - 128, 18, 1, 0, 0, 0, 129, 133, 5, 58, 0, 0, 130, 131, 5, 58, 0, 0, 131, - 133, 5, 58, 0, 0, 132, 129, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 133, 20, - 1, 0, 0, 0, 134, 135, 5, 61, 0, 0, 135, 22, 1, 0, 0, 0, 136, 137, 5, 123, - 0, 0, 137, 24, 1, 0, 0, 0, 138, 139, 5, 125, 0, 0, 139, 26, 1, 0, 0, 0, - 140, 141, 5, 112, 0, 0, 141, 142, 5, 97, 0, 0, 142, 143, 5, 114, 0, 0, - 143, 144, 5, 97, 0, 0, 144, 145, 5, 109, 0, 0, 145, 28, 1, 0, 0, 0, 146, - 147, 5, 118, 0, 0, 147, 148, 5, 97, 0, 0, 148, 149, 5, 114, 0, 0, 149, - 30, 1, 0, 0, 0, 150, 151, 5, 116, 0, 0, 151, 152, 5, 114, 0, 0, 152, 153, - 5, 117, 0, 0, 153, 154, 5, 101, 0, 0, 154, 32, 1, 0, 0, 0, 155, 156, 5, - 102, 0, 0, 156, 157, 5, 97, 0, 0, 157, 158, 5, 108, 0, 0, 158, 159, 5, - 115, 0, 0, 159, 160, 5, 101, 0, 0, 160, 34, 1, 0, 0, 0, 161, 162, 5, 110, - 0, 0, 162, 163, 5, 117, 0, 0, 163, 164, 5, 108, 0, 0, 164, 165, 5, 108, - 0, 0, 165, 36, 1, 0, 0, 0, 166, 167, 5, 111, 0, 0, 167, 168, 5, 98, 0, - 0, 168, 169, 5, 106, 0, 0, 169, 170, 5, 101, 0, 0, 170, 171, 5, 99, 0, - 0, 171, 172, 5, 116, 0, 0, 172, 38, 1, 0, 0, 0, 173, 174, 5, 114, 0, 0, - 174, 175, 5, 101, 0, 0, 175, 176, 5, 115, 0, 0, 176, 177, 5, 111, 0, 0, - 177, 178, 5, 117, 0, 0, 178, 179, 5, 114, 0, 0, 179, 180, 5, 99, 0, 0, - 180, 181, 5, 101, 0, 0, 181, 40, 1, 0, 0, 0, 182, 183, 5, 111, 0, 0, 183, - 184, 5, 117, 0, 0, 184, 185, 5, 116, 0, 0, 185, 186, 5, 112, 0, 0, 186, - 187, 5, 117, 0, 0, 187, 188, 5, 116, 0, 0, 188, 42, 1, 0, 0, 0, 189, 190, - 5, 101, 0, 0, 190, 191, 5, 120, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, - 5, 115, 0, 0, 193, 194, 5, 116, 0, 0, 194, 195, 5, 105, 0, 0, 195, 196, - 5, 110, 0, 0, 196, 197, 5, 103, 0, 0, 197, 44, 1, 0, 0, 0, 198, 202, 5, - 39, 0, 0, 199, 201, 3, 93, 46, 0, 200, 199, 1, 0, 0, 0, 201, 204, 1, 0, - 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 205, 1, 0, 0, 0, - 204, 202, 1, 0, 0, 0, 205, 206, 5, 36, 0, 0, 206, 207, 5, 123, 0, 0, 207, - 46, 1, 0, 0, 0, 208, 212, 5, 125, 0, 0, 209, 211, 3, 93, 46, 0, 210, 209, - 1, 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, - 0, 0, 213, 215, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 215, 216, 5, 36, 0, 0, - 216, 217, 5, 123, 0, 0, 217, 48, 1, 0, 0, 0, 218, 222, 5, 125, 0, 0, 219, - 221, 3, 93, 46, 0, 220, 219, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, - 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 225, 1, 0, 0, 0, 224, 222, 1, 0, - 0, 0, 225, 226, 5, 39, 0, 0, 226, 50, 1, 0, 0, 0, 227, 231, 5, 39, 0, 0, - 228, 230, 3, 93, 46, 0, 229, 228, 1, 0, 0, 0, 230, 233, 1, 0, 0, 0, 231, - 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 234, 1, 0, 0, 0, 233, 231, - 1, 0, 0, 0, 234, 235, 5, 39, 0, 0, 235, 52, 1, 0, 0, 0, 236, 237, 5, 115, - 0, 0, 237, 238, 5, 116, 0, 0, 238, 239, 5, 114, 0, 0, 239, 240, 5, 105, - 0, 0, 240, 241, 5, 110, 0, 0, 241, 242, 5, 103, 0, 0, 242, 54, 1, 0, 0, - 0, 243, 244, 5, 105, 0, 0, 244, 245, 5, 110, 0, 0, 245, 246, 5, 116, 0, - 0, 246, 56, 1, 0, 0, 0, 247, 248, 5, 98, 0, 0, 248, 249, 5, 111, 0, 0, - 249, 250, 5, 111, 0, 0, 250, 251, 5, 108, 0, 0, 251, 58, 1, 0, 0, 0, 252, - 253, 5, 105, 0, 0, 253, 254, 5, 102, 0, 0, 254, 60, 1, 0, 0, 0, 255, 256, - 5, 102, 0, 0, 256, 257, 5, 111, 0, 0, 257, 258, 5, 114, 0, 0, 258, 62, - 1, 0, 0, 0, 259, 260, 5, 105, 0, 0, 260, 261, 5, 110, 0, 0, 261, 64, 1, - 0, 0, 0, 262, 263, 5, 63, 0, 0, 263, 66, 1, 0, 0, 0, 264, 265, 5, 62, 0, - 0, 265, 68, 1, 0, 0, 0, 266, 267, 5, 62, 0, 0, 267, 268, 5, 61, 0, 0, 268, - 70, 1, 0, 0, 0, 269, 270, 5, 60, 0, 0, 270, 72, 1, 0, 0, 0, 271, 272, 5, - 60, 0, 0, 272, 273, 5, 61, 0, 0, 273, 74, 1, 0, 0, 0, 274, 275, 5, 61, - 0, 0, 275, 276, 5, 61, 0, 0, 276, 76, 1, 0, 0, 0, 277, 278, 5, 33, 0, 0, - 278, 279, 5, 61, 0, 0, 279, 78, 1, 0, 0, 0, 280, 284, 7, 0, 0, 0, 281, - 283, 7, 1, 0, 0, 282, 281, 1, 0, 0, 0, 283, 286, 1, 0, 0, 0, 284, 282, - 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 80, 1, 0, 0, 0, 286, 284, 1, 0, - 0, 0, 287, 289, 7, 2, 0, 0, 288, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, - 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 298, 1, 0, 0, 0, 292, - 294, 5, 46, 0, 0, 293, 295, 7, 2, 0, 0, 294, 293, 1, 0, 0, 0, 295, 296, - 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 299, 1, 0, - 0, 0, 298, 292, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 82, 1, 0, 0, 0, - 300, 302, 7, 3, 0, 0, 301, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, - 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 84, 1, 0, 0, 0, 305, 306, 5, - 47, 0, 0, 306, 307, 5, 47, 0, 0, 307, 311, 1, 0, 0, 0, 308, 310, 8, 3, - 0, 0, 309, 308, 1, 0, 0, 0, 310, 313, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, - 311, 312, 1, 0, 0, 0, 312, 314, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 314, - 315, 6, 42, 0, 0, 315, 86, 1, 0, 0, 0, 316, 317, 5, 47, 0, 0, 317, 318, - 5, 42, 0, 0, 318, 322, 1, 0, 0, 0, 319, 321, 9, 0, 0, 0, 320, 319, 1, 0, - 0, 0, 321, 324, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, - 323, 325, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 325, 326, 5, 42, 0, 0, 326, - 327, 5, 47, 0, 0, 327, 328, 1, 0, 0, 0, 328, 329, 6, 43, 0, 0, 329, 88, - 1, 0, 0, 0, 330, 332, 7, 4, 0, 0, 331, 330, 1, 0, 0, 0, 332, 333, 1, 0, - 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, - 335, 336, 6, 44, 0, 0, 336, 90, 1, 0, 0, 0, 337, 338, 9, 0, 0, 0, 338, - 92, 1, 0, 0, 0, 339, 342, 8, 5, 0, 0, 340, 342, 3, 95, 47, 0, 341, 339, - 1, 0, 0, 0, 341, 340, 1, 0, 0, 0, 342, 94, 1, 0, 0, 0, 343, 355, 5, 92, - 0, 0, 344, 356, 7, 6, 0, 0, 345, 346, 5, 117, 0, 0, 346, 347, 5, 123, 0, - 0, 347, 349, 1, 0, 0, 0, 348, 350, 3, 97, 48, 0, 349, 348, 1, 0, 0, 0, - 350, 351, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, - 353, 1, 0, 0, 0, 353, 354, 5, 125, 0, 0, 354, 356, 1, 0, 0, 0, 355, 344, - 1, 0, 0, 0, 355, 345, 1, 0, 0, 0, 356, 96, 1, 0, 0, 0, 357, 358, 7, 7, - 0, 0, 358, 98, 1, 0, 0, 0, 18, 0, 106, 132, 202, 212, 222, 231, 284, 290, - 296, 298, 303, 311, 322, 333, 341, 351, 355, 1, 6, 0, 0, + 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, + 52, 7, 52, 2, 53, 7, 53, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 115, 8, 0, + 10, 0, 12, 0, 118, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, + 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, + 1, 9, 1, 9, 1, 9, 3, 9, 143, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, + 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, + 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, + 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, + 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, + 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, + 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, + 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, + 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, + 1, 27, 1, 27, 5, 27, 247, 8, 27, 10, 27, 12, 27, 250, 9, 27, 1, 27, 1, + 27, 1, 27, 1, 28, 1, 28, 5, 28, 257, 8, 28, 10, 28, 12, 28, 260, 9, 28, + 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 5, 29, 267, 8, 29, 10, 29, 12, 29, 270, + 9, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 276, 8, 30, 10, 30, 12, 30, 279, + 9, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, + 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, + 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, + 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 42, + 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 5, 44, 329, 8, 44, 10, + 44, 12, 44, 332, 9, 44, 1, 45, 4, 45, 335, 8, 45, 11, 45, 12, 45, 336, + 1, 45, 1, 45, 4, 45, 341, 8, 45, 11, 45, 12, 45, 342, 3, 45, 345, 8, 45, + 1, 46, 4, 46, 348, 8, 46, 11, 46, 12, 46, 349, 1, 47, 1, 47, 1, 47, 1, + 47, 5, 47, 356, 8, 47, 10, 47, 12, 47, 359, 9, 47, 1, 47, 1, 47, 1, 48, + 1, 48, 1, 48, 1, 48, 5, 48, 367, 8, 48, 10, 48, 12, 48, 370, 9, 48, 1, + 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 4, 49, 378, 8, 49, 11, 49, 12, 49, + 379, 1, 49, 1, 49, 1, 50, 1, 50, 1, 51, 1, 51, 3, 51, 388, 8, 51, 1, 52, + 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 4, 52, 396, 8, 52, 11, 52, 12, 52, 397, + 1, 52, 1, 52, 3, 52, 402, 8, 52, 1, 53, 1, 53, 2, 116, 368, 0, 54, 1, 1, + 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, + 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, + 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, + 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, + 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, + 48, 97, 49, 99, 50, 101, 51, 103, 0, 105, 0, 107, 0, 1, 0, 8, 3, 0, 65, + 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, + 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, + 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, + 116, 3, 0, 48, 57, 65, 70, 97, 102, 418, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, + 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, + 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, + 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, + 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, + 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, + 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, + 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, + 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, + 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, + 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, + 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, + 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, + 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 1, 109, 1, + 0, 0, 0, 3, 123, 1, 0, 0, 0, 5, 125, 1, 0, 0, 0, 7, 127, 1, 0, 0, 0, 9, + 129, 1, 0, 0, 0, 11, 131, 1, 0, 0, 0, 13, 133, 1, 0, 0, 0, 15, 135, 1, + 0, 0, 0, 17, 137, 1, 0, 0, 0, 19, 142, 1, 0, 0, 0, 21, 144, 1, 0, 0, 0, + 23, 146, 1, 0, 0, 0, 25, 148, 1, 0, 0, 0, 27, 150, 1, 0, 0, 0, 29, 156, + 1, 0, 0, 0, 31, 160, 1, 0, 0, 0, 33, 165, 1, 0, 0, 0, 35, 171, 1, 0, 0, + 0, 37, 176, 1, 0, 0, 0, 39, 183, 1, 0, 0, 0, 41, 192, 1, 0, 0, 0, 43, 199, + 1, 0, 0, 0, 45, 211, 1, 0, 0, 0, 47, 218, 1, 0, 0, 0, 49, 223, 1, 0, 0, + 0, 51, 226, 1, 0, 0, 0, 53, 235, 1, 0, 0, 0, 55, 244, 1, 0, 0, 0, 57, 254, + 1, 0, 0, 0, 59, 264, 1, 0, 0, 0, 61, 273, 1, 0, 0, 0, 63, 282, 1, 0, 0, + 0, 65, 289, 1, 0, 0, 0, 67, 293, 1, 0, 0, 0, 69, 298, 1, 0, 0, 0, 71, 301, + 1, 0, 0, 0, 73, 305, 1, 0, 0, 0, 75, 308, 1, 0, 0, 0, 77, 310, 1, 0, 0, + 0, 79, 312, 1, 0, 0, 0, 81, 315, 1, 0, 0, 0, 83, 317, 1, 0, 0, 0, 85, 320, + 1, 0, 0, 0, 87, 323, 1, 0, 0, 0, 89, 326, 1, 0, 0, 0, 91, 334, 1, 0, 0, + 0, 93, 347, 1, 0, 0, 0, 95, 351, 1, 0, 0, 0, 97, 362, 1, 0, 0, 0, 99, 377, + 1, 0, 0, 0, 101, 383, 1, 0, 0, 0, 103, 387, 1, 0, 0, 0, 105, 389, 1, 0, + 0, 0, 107, 403, 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, 5, 39, 0, + 0, 111, 112, 5, 39, 0, 0, 112, 116, 1, 0, 0, 0, 113, 115, 9, 0, 0, 0, 114, + 113, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 116, 114, + 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 39, + 0, 0, 120, 121, 5, 39, 0, 0, 121, 122, 5, 39, 0, 0, 122, 2, 1, 0, 0, 0, + 123, 124, 5, 64, 0, 0, 124, 4, 1, 0, 0, 0, 125, 126, 5, 44, 0, 0, 126, + 6, 1, 0, 0, 0, 127, 128, 5, 91, 0, 0, 128, 8, 1, 0, 0, 0, 129, 130, 5, + 93, 0, 0, 130, 10, 1, 0, 0, 0, 131, 132, 5, 40, 0, 0, 132, 12, 1, 0, 0, + 0, 133, 134, 5, 41, 0, 0, 134, 14, 1, 0, 0, 0, 135, 136, 5, 46, 0, 0, 136, + 16, 1, 0, 0, 0, 137, 138, 5, 124, 0, 0, 138, 18, 1, 0, 0, 0, 139, 143, + 5, 58, 0, 0, 140, 141, 5, 58, 0, 0, 141, 143, 5, 58, 0, 0, 142, 139, 1, + 0, 0, 0, 142, 140, 1, 0, 0, 0, 143, 20, 1, 0, 0, 0, 144, 145, 5, 61, 0, + 0, 145, 22, 1, 0, 0, 0, 146, 147, 5, 123, 0, 0, 147, 24, 1, 0, 0, 0, 148, + 149, 5, 125, 0, 0, 149, 26, 1, 0, 0, 0, 150, 151, 5, 112, 0, 0, 151, 152, + 5, 97, 0, 0, 152, 153, 5, 114, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, + 109, 0, 0, 155, 28, 1, 0, 0, 0, 156, 157, 5, 118, 0, 0, 157, 158, 5, 97, + 0, 0, 158, 159, 5, 114, 0, 0, 159, 30, 1, 0, 0, 0, 160, 161, 5, 116, 0, + 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 117, 0, 0, 163, 164, 5, 101, 0, + 0, 164, 32, 1, 0, 0, 0, 165, 166, 5, 102, 0, 0, 166, 167, 5, 97, 0, 0, + 167, 168, 5, 108, 0, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 101, 0, 0, + 170, 34, 1, 0, 0, 0, 171, 172, 5, 110, 0, 0, 172, 173, 5, 117, 0, 0, 173, + 174, 5, 108, 0, 0, 174, 175, 5, 108, 0, 0, 175, 36, 1, 0, 0, 0, 176, 177, + 5, 111, 0, 0, 177, 178, 5, 98, 0, 0, 178, 179, 5, 106, 0, 0, 179, 180, + 5, 101, 0, 0, 180, 181, 5, 99, 0, 0, 181, 182, 5, 116, 0, 0, 182, 38, 1, + 0, 0, 0, 183, 184, 5, 114, 0, 0, 184, 185, 5, 101, 0, 0, 185, 186, 5, 115, + 0, 0, 186, 187, 5, 111, 0, 0, 187, 188, 5, 117, 0, 0, 188, 189, 5, 114, + 0, 0, 189, 190, 5, 99, 0, 0, 190, 191, 5, 101, 0, 0, 191, 40, 1, 0, 0, + 0, 192, 193, 5, 111, 0, 0, 193, 194, 5, 117, 0, 0, 194, 195, 5, 116, 0, + 0, 195, 196, 5, 112, 0, 0, 196, 197, 5, 117, 0, 0, 197, 198, 5, 116, 0, + 0, 198, 42, 1, 0, 0, 0, 199, 200, 5, 116, 0, 0, 200, 201, 5, 97, 0, 0, + 201, 202, 5, 114, 0, 0, 202, 203, 5, 103, 0, 0, 203, 204, 5, 101, 0, 0, + 204, 205, 5, 116, 0, 0, 205, 206, 5, 83, 0, 0, 206, 207, 5, 99, 0, 0, 207, + 208, 5, 111, 0, 0, 208, 209, 5, 112, 0, 0, 209, 210, 5, 101, 0, 0, 210, + 44, 1, 0, 0, 0, 211, 212, 5, 105, 0, 0, 212, 213, 5, 109, 0, 0, 213, 214, + 5, 112, 0, 0, 214, 215, 5, 111, 0, 0, 215, 216, 5, 114, 0, 0, 216, 217, + 5, 116, 0, 0, 217, 46, 1, 0, 0, 0, 218, 219, 5, 119, 0, 0, 219, 220, 5, + 105, 0, 0, 220, 221, 5, 116, 0, 0, 221, 222, 5, 104, 0, 0, 222, 48, 1, + 0, 0, 0, 223, 224, 5, 97, 0, 0, 224, 225, 5, 115, 0, 0, 225, 50, 1, 0, + 0, 0, 226, 227, 5, 109, 0, 0, 227, 228, 5, 101, 0, 0, 228, 229, 5, 116, + 0, 0, 229, 230, 5, 97, 0, 0, 230, 231, 5, 100, 0, 0, 231, 232, 5, 97, 0, + 0, 232, 233, 5, 116, 0, 0, 233, 234, 5, 97, 0, 0, 234, 52, 1, 0, 0, 0, + 235, 236, 5, 101, 0, 0, 236, 237, 5, 120, 0, 0, 237, 238, 5, 105, 0, 0, + 238, 239, 5, 115, 0, 0, 239, 240, 5, 116, 0, 0, 240, 241, 5, 105, 0, 0, + 241, 242, 5, 110, 0, 0, 242, 243, 5, 103, 0, 0, 243, 54, 1, 0, 0, 0, 244, + 248, 5, 39, 0, 0, 245, 247, 3, 103, 51, 0, 246, 245, 1, 0, 0, 0, 247, 250, + 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 1, 0, + 0, 0, 250, 248, 1, 0, 0, 0, 251, 252, 5, 36, 0, 0, 252, 253, 5, 123, 0, + 0, 253, 56, 1, 0, 0, 0, 254, 258, 5, 125, 0, 0, 255, 257, 3, 103, 51, 0, + 256, 255, 1, 0, 0, 0, 257, 260, 1, 0, 0, 0, 258, 256, 1, 0, 0, 0, 258, + 259, 1, 0, 0, 0, 259, 261, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 261, 262, + 5, 36, 0, 0, 262, 263, 5, 123, 0, 0, 263, 58, 1, 0, 0, 0, 264, 268, 5, + 125, 0, 0, 265, 267, 3, 103, 51, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, + 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, + 0, 270, 268, 1, 0, 0, 0, 271, 272, 5, 39, 0, 0, 272, 60, 1, 0, 0, 0, 273, + 277, 5, 39, 0, 0, 274, 276, 3, 103, 51, 0, 275, 274, 1, 0, 0, 0, 276, 279, + 1, 0, 0, 0, 277, 275, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 280, 1, 0, + 0, 0, 279, 277, 1, 0, 0, 0, 280, 281, 5, 39, 0, 0, 281, 62, 1, 0, 0, 0, + 282, 283, 5, 115, 0, 0, 283, 284, 5, 116, 0, 0, 284, 285, 5, 114, 0, 0, + 285, 286, 5, 105, 0, 0, 286, 287, 5, 110, 0, 0, 287, 288, 5, 103, 0, 0, + 288, 64, 1, 0, 0, 0, 289, 290, 5, 105, 0, 0, 290, 291, 5, 110, 0, 0, 291, + 292, 5, 116, 0, 0, 292, 66, 1, 0, 0, 0, 293, 294, 5, 98, 0, 0, 294, 295, + 5, 111, 0, 0, 295, 296, 5, 111, 0, 0, 296, 297, 5, 108, 0, 0, 297, 68, + 1, 0, 0, 0, 298, 299, 5, 105, 0, 0, 299, 300, 5, 102, 0, 0, 300, 70, 1, + 0, 0, 0, 301, 302, 5, 102, 0, 0, 302, 303, 5, 111, 0, 0, 303, 304, 5, 114, + 0, 0, 304, 72, 1, 0, 0, 0, 305, 306, 5, 105, 0, 0, 306, 307, 5, 110, 0, + 0, 307, 74, 1, 0, 0, 0, 308, 309, 5, 63, 0, 0, 309, 76, 1, 0, 0, 0, 310, + 311, 5, 62, 0, 0, 311, 78, 1, 0, 0, 0, 312, 313, 5, 62, 0, 0, 313, 314, + 5, 61, 0, 0, 314, 80, 1, 0, 0, 0, 315, 316, 5, 60, 0, 0, 316, 82, 1, 0, + 0, 0, 317, 318, 5, 60, 0, 0, 318, 319, 5, 61, 0, 0, 319, 84, 1, 0, 0, 0, + 320, 321, 5, 61, 0, 0, 321, 322, 5, 61, 0, 0, 322, 86, 1, 0, 0, 0, 323, + 324, 5, 33, 0, 0, 324, 325, 5, 61, 0, 0, 325, 88, 1, 0, 0, 0, 326, 330, + 7, 0, 0, 0, 327, 329, 7, 1, 0, 0, 328, 327, 1, 0, 0, 0, 329, 332, 1, 0, + 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 90, 1, 0, 0, 0, + 332, 330, 1, 0, 0, 0, 333, 335, 7, 2, 0, 0, 334, 333, 1, 0, 0, 0, 335, + 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 344, + 1, 0, 0, 0, 338, 340, 5, 46, 0, 0, 339, 341, 7, 2, 0, 0, 340, 339, 1, 0, + 0, 0, 341, 342, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, + 343, 345, 1, 0, 0, 0, 344, 338, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, + 92, 1, 0, 0, 0, 346, 348, 7, 3, 0, 0, 347, 346, 1, 0, 0, 0, 348, 349, 1, + 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 94, 1, 0, 0, + 0, 351, 352, 5, 47, 0, 0, 352, 353, 5, 47, 0, 0, 353, 357, 1, 0, 0, 0, + 354, 356, 8, 3, 0, 0, 355, 354, 1, 0, 0, 0, 356, 359, 1, 0, 0, 0, 357, + 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 360, 1, 0, 0, 0, 359, 357, + 1, 0, 0, 0, 360, 361, 6, 47, 0, 0, 361, 96, 1, 0, 0, 0, 362, 363, 5, 47, + 0, 0, 363, 364, 5, 42, 0, 0, 364, 368, 1, 0, 0, 0, 365, 367, 9, 0, 0, 0, + 366, 365, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 368, + 366, 1, 0, 0, 0, 369, 371, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 371, 372, + 5, 42, 0, 0, 372, 373, 5, 47, 0, 0, 373, 374, 1, 0, 0, 0, 374, 375, 6, + 48, 0, 0, 375, 98, 1, 0, 0, 0, 376, 378, 7, 4, 0, 0, 377, 376, 1, 0, 0, + 0, 378, 379, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, + 381, 1, 0, 0, 0, 381, 382, 6, 49, 0, 0, 382, 100, 1, 0, 0, 0, 383, 384, + 9, 0, 0, 0, 384, 102, 1, 0, 0, 0, 385, 388, 8, 5, 0, 0, 386, 388, 3, 105, + 52, 0, 387, 385, 1, 0, 0, 0, 387, 386, 1, 0, 0, 0, 388, 104, 1, 0, 0, 0, + 389, 401, 5, 92, 0, 0, 390, 402, 7, 6, 0, 0, 391, 392, 5, 117, 0, 0, 392, + 393, 5, 123, 0, 0, 393, 395, 1, 0, 0, 0, 394, 396, 3, 107, 53, 0, 395, + 394, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 398, + 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 400, 5, 125, 0, 0, 400, 402, 1, + 0, 0, 0, 401, 390, 1, 0, 0, 0, 401, 391, 1, 0, 0, 0, 402, 106, 1, 0, 0, + 0, 403, 404, 7, 7, 0, 0, 404, 108, 1, 0, 0, 0, 18, 0, 116, 142, 248, 258, + 268, 277, 330, 336, 342, 344, 349, 357, 368, 379, 387, 397, 401, 1, 6, + 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -290,29 +313,34 @@ const ( bicepLexerOBJECT = 19 bicepLexerRESOURCE = 20 bicepLexerOUTPUT = 21 - bicepLexerEXISTING = 22 - bicepLexerSTRING_LEFT_PIECE = 23 - bicepLexerSTRING_MIDDLE_PIECE = 24 - bicepLexerSTRING_RIGHT_PIECE = 25 - bicepLexerSTRING_COMPLETE = 26 - bicepLexerSTRING = 27 - bicepLexerINT = 28 - bicepLexerBOOL = 29 - bicepLexerIF = 30 - bicepLexerFOR = 31 - bicepLexerIN = 32 - bicepLexerQMARK = 33 - bicepLexerGT = 34 - bicepLexerGTE = 35 - bicepLexerLT = 36 - bicepLexerLTE = 37 - bicepLexerEQ = 38 - bicepLexerNEQ = 39 - bicepLexerIDENTIFIER = 40 - bicepLexerNUMBER = 41 - bicepLexerNL = 42 - bicepLexerSINGLE_LINE_COMMENT = 43 - bicepLexerMULTI_LINE_COMMENT = 44 - bicepLexerSPACES = 45 - bicepLexerUNKNOWN = 46 + bicepLexerTARGET_SCOPE = 22 + bicepLexerIMPORT = 23 + bicepLexerWITH = 24 + bicepLexerAS = 25 + bicepLexerMETADATA = 26 + bicepLexerEXISTING = 27 + bicepLexerSTRING_LEFT_PIECE = 28 + bicepLexerSTRING_MIDDLE_PIECE = 29 + bicepLexerSTRING_RIGHT_PIECE = 30 + bicepLexerSTRING_COMPLETE = 31 + bicepLexerSTRING = 32 + bicepLexerINT = 33 + bicepLexerBOOL = 34 + bicepLexerIF = 35 + bicepLexerFOR = 36 + bicepLexerIN = 37 + bicepLexerQMARK = 38 + bicepLexerGT = 39 + bicepLexerGTE = 40 + bicepLexerLT = 41 + bicepLexerLTE = 42 + bicepLexerEQ = 43 + bicepLexerNEQ = 44 + bicepLexerIDENTIFIER = 45 + bicepLexerNUMBER = 46 + bicepLexerNL = 47 + bicepLexerSINGLE_LINE_COMMENT = 48 + bicepLexerMULTI_LINE_COMMENT = 49 + bicepLexerSPACES = 50 + bicepLexerUNKNOWN = 51 ) diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 5366cd8c259..71f338a27ea 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -35,185 +35,205 @@ func bicepParserInit() { staticData.LiteralNames = []string{ "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", - "'object'", "'resource'", "'output'", "'existing'", "", "", "", "", - "'string'", "'int'", "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", - "'>='", "'<'", "'<='", "'=='", "'!='", + "'object'", "'resource'", "'output'", "'targetScope'", "'import'", "'with'", + "'as'", "'metadata'", "'existing'", "", "", "", "", "'string'", "'int'", + "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", + "'=='", "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "EXISTING", - "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", - "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", - "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", - "MULTI_LINE_COMMENT", "SPACES", "UNKNOWN", + "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", + "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "STRING_LEFT_PIECE", + "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", + "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", + "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", + "SPACES", "UNKNOWN", } staticData.RuleNames = []string{ "program", "statement", "parameterDecl", "parameterDefaultValue", "variableDecl", - "resourceDecl", "outputDecl", "ifCondition", "forExpression", "forVariableBlock", - "forBody", "interpString", "expression", "logicCharacter", "primaryExpression", - "parenthesizedExpression", "typeExpression", "literalValue", "object", - "objectProperty", "array", "arrayItem", "decorator", "decoratorExpression", - "functionCall", "argumentList", "identifier", + "resourceDecl", "outputDecl", "targetScopeDecl", "importDecl", "metadataDecl", + "ifCondition", "forExpression", "forVariableBlock", "forBody", "interpString", + "expression", "logicCharacter", "primaryExpression", "parenthesizedExpression", + "typeExpression", "literalValue", "object", "objectProperty", "array", + "arrayItem", "decorator", "decoratorExpression", "functionCall", "argumentList", + "identifier", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 46, 348, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 51, 386, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, - 7, 26, 1, 0, 5, 0, 56, 8, 0, 10, 0, 12, 0, 59, 9, 0, 1, 0, 1, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 68, 8, 1, 1, 2, 5, 2, 71, 8, 2, 10, 2, 12, - 2, 74, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 80, 8, 2, 1, 2, 1, 2, 1, 2, - 3, 2, 85, 8, 2, 3, 2, 87, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, - 4, 95, 8, 4, 10, 4, 12, 4, 98, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, - 1, 5, 5, 5, 107, 8, 5, 10, 5, 12, 5, 110, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, - 3, 5, 116, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 122, 8, 5, 1, 5, 1, 5, 1, - 6, 5, 6, 127, 8, 6, 10, 6, 12, 6, 130, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, - 6, 3, 6, 137, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, - 8, 1, 8, 5, 8, 149, 8, 8, 10, 8, 12, 8, 152, 9, 8, 1, 8, 1, 8, 1, 8, 3, - 8, 157, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 164, 8, 8, 10, 8, 12, - 8, 167, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, - 10, 3, 10, 179, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 185, 8, 11, 10, - 11, 12, 11, 188, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 194, 8, 11, - 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, - 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, - 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 223, 8, 12, 10, 12, 12, - 12, 226, 9, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, - 1, 14, 1, 14, 3, 14, 238, 8, 14, 1, 15, 1, 15, 3, 15, 242, 8, 15, 1, 15, - 1, 15, 3, 15, 246, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, - 17, 1, 17, 1, 17, 3, 17, 257, 8, 17, 1, 18, 1, 18, 4, 18, 261, 8, 18, 11, - 18, 12, 18, 262, 1, 18, 1, 18, 4, 18, 267, 8, 18, 11, 18, 12, 18, 268, - 5, 18, 271, 8, 18, 10, 18, 12, 18, 274, 9, 18, 3, 18, 276, 8, 18, 1, 18, - 1, 18, 1, 19, 1, 19, 3, 19, 282, 8, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, - 20, 5, 20, 289, 8, 20, 10, 20, 12, 20, 292, 9, 20, 1, 20, 5, 20, 295, 8, - 20, 10, 20, 12, 20, 298, 9, 20, 1, 20, 1, 20, 1, 21, 1, 21, 4, 21, 304, - 8, 21, 11, 21, 12, 21, 305, 1, 21, 3, 21, 309, 8, 21, 1, 22, 1, 22, 1, - 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 320, 8, 23, 1, 24, - 1, 24, 1, 24, 3, 24, 325, 8, 24, 1, 24, 3, 24, 328, 8, 24, 1, 24, 3, 24, - 331, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 338, 8, 25, 1, 25, - 5, 25, 341, 8, 25, 10, 25, 12, 25, 344, 9, 25, 1, 26, 1, 26, 1, 26, 0, - 1, 24, 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, - 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 2, 1, 0, 34, 39, 3, 0, 14, 20, - 27, 29, 40, 40, 377, 0, 57, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, - 0, 0, 6, 90, 1, 0, 0, 0, 8, 96, 1, 0, 0, 0, 10, 108, 1, 0, 0, 0, 12, 128, - 1, 0, 0, 0, 14, 142, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 170, 1, 0, 0, - 0, 20, 178, 1, 0, 0, 0, 22, 193, 1, 0, 0, 0, 24, 195, 1, 0, 0, 0, 26, 227, - 1, 0, 0, 0, 28, 237, 1, 0, 0, 0, 30, 239, 1, 0, 0, 0, 32, 249, 1, 0, 0, - 0, 34, 256, 1, 0, 0, 0, 36, 258, 1, 0, 0, 0, 38, 281, 1, 0, 0, 0, 40, 286, - 1, 0, 0, 0, 42, 301, 1, 0, 0, 0, 44, 310, 1, 0, 0, 0, 46, 319, 1, 0, 0, - 0, 48, 321, 1, 0, 0, 0, 50, 334, 1, 0, 0, 0, 52, 345, 1, 0, 0, 0, 54, 56, - 3, 2, 1, 0, 55, 54, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, - 57, 58, 1, 0, 0, 0, 58, 60, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 60, 61, 5, - 0, 0, 1, 61, 1, 1, 0, 0, 0, 62, 68, 3, 4, 2, 0, 63, 68, 3, 8, 4, 0, 64, - 68, 3, 10, 5, 0, 65, 68, 3, 12, 6, 0, 66, 68, 5, 42, 0, 0, 67, 62, 1, 0, - 0, 0, 67, 63, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, - 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 71, 3, 44, 22, 0, 70, 69, 1, 0, 0, 0, - 71, 74, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, - 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 76, 5, 14, 0, 0, 76, 86, 3, 52, 26, 0, - 77, 79, 3, 32, 16, 0, 78, 80, 3, 6, 3, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, - 0, 0, 0, 80, 87, 1, 0, 0, 0, 81, 82, 5, 20, 0, 0, 82, 84, 3, 22, 11, 0, - 83, 85, 3, 6, 3, 0, 84, 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, - 0, 0, 0, 86, 77, 1, 0, 0, 0, 86, 81, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, - 89, 5, 42, 0, 0, 89, 5, 1, 0, 0, 0, 90, 91, 5, 11, 0, 0, 91, 92, 3, 24, - 12, 0, 92, 7, 1, 0, 0, 0, 93, 95, 3, 44, 22, 0, 94, 93, 1, 0, 0, 0, 95, - 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 99, 1, 0, 0, - 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 15, 0, 0, 100, 101, 3, 52, 26, 0, 101, - 102, 5, 11, 0, 0, 102, 103, 3, 24, 12, 0, 103, 104, 5, 42, 0, 0, 104, 9, - 1, 0, 0, 0, 105, 107, 3, 44, 22, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, - 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, - 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 20, 0, 0, 112, 113, 3, 52, 26, 0, - 113, 115, 3, 22, 11, 0, 114, 116, 5, 22, 0, 0, 115, 114, 1, 0, 0, 0, 115, - 116, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 121, 5, 11, 0, 0, 118, 122, - 3, 14, 7, 0, 119, 122, 3, 36, 18, 0, 120, 122, 3, 16, 8, 0, 121, 118, 1, - 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, - 0, 123, 124, 5, 42, 0, 0, 124, 11, 1, 0, 0, 0, 125, 127, 3, 44, 22, 0, - 126, 125, 1, 0, 0, 0, 127, 130, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, - 129, 1, 0, 0, 0, 129, 131, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 132, - 5, 21, 0, 0, 132, 136, 3, 52, 26, 0, 133, 137, 3, 52, 26, 0, 134, 135, - 5, 20, 0, 0, 135, 137, 3, 22, 11, 0, 136, 133, 1, 0, 0, 0, 136, 134, 1, - 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 11, 0, 0, 139, 140, 3, 24, - 12, 0, 140, 141, 5, 42, 0, 0, 141, 13, 1, 0, 0, 0, 142, 143, 5, 30, 0, - 0, 143, 144, 3, 30, 15, 0, 144, 145, 3, 36, 18, 0, 145, 15, 1, 0, 0, 0, - 146, 150, 5, 4, 0, 0, 147, 149, 5, 42, 0, 0, 148, 147, 1, 0, 0, 0, 149, - 152, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 153, - 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, 156, 5, 31, 0, 0, 154, 157, 3, 52, - 26, 0, 155, 157, 3, 18, 9, 0, 156, 154, 1, 0, 0, 0, 156, 155, 1, 0, 0, - 0, 157, 158, 1, 0, 0, 0, 158, 159, 5, 32, 0, 0, 159, 160, 3, 24, 12, 0, - 160, 161, 5, 10, 0, 0, 161, 165, 3, 20, 10, 0, 162, 164, 5, 42, 0, 0, 163, - 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, - 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 5, - 0, 0, 169, 17, 1, 0, 0, 0, 170, 171, 5, 6, 0, 0, 171, 172, 3, 52, 26, 0, - 172, 173, 5, 3, 0, 0, 173, 174, 3, 52, 26, 0, 174, 175, 5, 7, 0, 0, 175, - 19, 1, 0, 0, 0, 176, 179, 3, 24, 12, 0, 177, 179, 3, 14, 7, 0, 178, 176, - 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 21, 1, 0, 0, 0, 180, 186, 5, 23, - 0, 0, 181, 182, 3, 24, 12, 0, 182, 183, 5, 24, 0, 0, 183, 185, 1, 0, 0, - 0, 184, 181, 1, 0, 0, 0, 185, 188, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 186, - 187, 1, 0, 0, 0, 187, 189, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 189, 190, - 3, 24, 12, 0, 190, 191, 5, 25, 0, 0, 191, 194, 1, 0, 0, 0, 192, 194, 5, - 26, 0, 0, 193, 180, 1, 0, 0, 0, 193, 192, 1, 0, 0, 0, 194, 23, 1, 0, 0, - 0, 195, 196, 6, 12, -1, 0, 196, 197, 3, 28, 14, 0, 197, 224, 1, 0, 0, 0, - 198, 199, 10, 6, 0, 0, 199, 200, 5, 33, 0, 0, 200, 201, 3, 24, 12, 0, 201, - 202, 5, 10, 0, 0, 202, 203, 3, 24, 12, 7, 203, 223, 1, 0, 0, 0, 204, 205, - 10, 2, 0, 0, 205, 206, 3, 26, 13, 0, 206, 207, 3, 24, 12, 3, 207, 223, - 1, 0, 0, 0, 208, 209, 10, 7, 0, 0, 209, 210, 5, 4, 0, 0, 210, 211, 3, 24, - 12, 0, 211, 212, 5, 5, 0, 0, 212, 223, 1, 0, 0, 0, 213, 214, 10, 5, 0, - 0, 214, 215, 5, 8, 0, 0, 215, 223, 3, 52, 26, 0, 216, 217, 10, 4, 0, 0, - 217, 218, 5, 8, 0, 0, 218, 223, 3, 48, 24, 0, 219, 220, 10, 3, 0, 0, 220, - 221, 5, 10, 0, 0, 221, 223, 3, 52, 26, 0, 222, 198, 1, 0, 0, 0, 222, 204, - 1, 0, 0, 0, 222, 208, 1, 0, 0, 0, 222, 213, 1, 0, 0, 0, 222, 216, 1, 0, - 0, 0, 222, 219, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, - 224, 225, 1, 0, 0, 0, 225, 25, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 228, - 7, 0, 0, 0, 228, 27, 1, 0, 0, 0, 229, 238, 3, 34, 17, 0, 230, 238, 3, 48, - 24, 0, 231, 238, 3, 22, 11, 0, 232, 238, 5, 1, 0, 0, 233, 238, 3, 40, 20, - 0, 234, 238, 3, 36, 18, 0, 235, 238, 3, 16, 8, 0, 236, 238, 3, 30, 15, - 0, 237, 229, 1, 0, 0, 0, 237, 230, 1, 0, 0, 0, 237, 231, 1, 0, 0, 0, 237, - 232, 1, 0, 0, 0, 237, 233, 1, 0, 0, 0, 237, 234, 1, 0, 0, 0, 237, 235, - 1, 0, 0, 0, 237, 236, 1, 0, 0, 0, 238, 29, 1, 0, 0, 0, 239, 241, 5, 6, - 0, 0, 240, 242, 5, 42, 0, 0, 241, 240, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, - 242, 243, 1, 0, 0, 0, 243, 245, 3, 24, 12, 0, 244, 246, 5, 42, 0, 0, 245, - 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, - 5, 7, 0, 0, 248, 31, 1, 0, 0, 0, 249, 250, 3, 52, 26, 0, 250, 33, 1, 0, - 0, 0, 251, 257, 5, 41, 0, 0, 252, 257, 5, 16, 0, 0, 253, 257, 5, 17, 0, - 0, 254, 257, 5, 18, 0, 0, 255, 257, 3, 52, 26, 0, 256, 251, 1, 0, 0, 0, - 256, 252, 1, 0, 0, 0, 256, 253, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, - 255, 1, 0, 0, 0, 257, 35, 1, 0, 0, 0, 258, 275, 5, 12, 0, 0, 259, 261, - 5, 42, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, - 0, 0, 262, 263, 1, 0, 0, 0, 263, 272, 1, 0, 0, 0, 264, 266, 3, 38, 19, - 0, 265, 267, 5, 42, 0, 0, 266, 265, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, - 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 264, - 1, 0, 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, 273, 1, 0, - 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 275, 260, 1, 0, 0, 0, - 275, 276, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 278, 5, 13, 0, 0, 278, - 37, 1, 0, 0, 0, 279, 282, 3, 52, 26, 0, 280, 282, 3, 22, 11, 0, 281, 279, - 1, 0, 0, 0, 281, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, 5, 10, - 0, 0, 284, 285, 3, 24, 12, 0, 285, 39, 1, 0, 0, 0, 286, 290, 5, 4, 0, 0, - 287, 289, 5, 42, 0, 0, 288, 287, 1, 0, 0, 0, 289, 292, 1, 0, 0, 0, 290, - 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 296, 1, 0, 0, 0, 292, 290, - 1, 0, 0, 0, 293, 295, 3, 42, 21, 0, 294, 293, 1, 0, 0, 0, 295, 298, 1, - 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 299, 1, 0, 0, - 0, 298, 296, 1, 0, 0, 0, 299, 300, 5, 5, 0, 0, 300, 41, 1, 0, 0, 0, 301, - 308, 3, 24, 12, 0, 302, 304, 5, 42, 0, 0, 303, 302, 1, 0, 0, 0, 304, 305, - 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 309, 1, 0, - 0, 0, 307, 309, 5, 3, 0, 0, 308, 303, 1, 0, 0, 0, 308, 307, 1, 0, 0, 0, - 308, 309, 1, 0, 0, 0, 309, 43, 1, 0, 0, 0, 310, 311, 5, 2, 0, 0, 311, 312, - 3, 46, 23, 0, 312, 313, 5, 42, 0, 0, 313, 45, 1, 0, 0, 0, 314, 320, 3, - 48, 24, 0, 315, 316, 3, 24, 12, 0, 316, 317, 5, 8, 0, 0, 317, 318, 3, 48, - 24, 0, 318, 320, 1, 0, 0, 0, 319, 314, 1, 0, 0, 0, 319, 315, 1, 0, 0, 0, - 320, 47, 1, 0, 0, 0, 321, 322, 3, 52, 26, 0, 322, 327, 5, 6, 0, 0, 323, - 325, 5, 42, 0, 0, 324, 323, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 326, - 1, 0, 0, 0, 326, 328, 3, 50, 25, 0, 327, 324, 1, 0, 0, 0, 327, 328, 1, - 0, 0, 0, 328, 330, 1, 0, 0, 0, 329, 331, 5, 42, 0, 0, 330, 329, 1, 0, 0, - 0, 330, 331, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 333, 5, 7, 0, 0, 333, - 49, 1, 0, 0, 0, 334, 342, 3, 24, 12, 0, 335, 337, 5, 3, 0, 0, 336, 338, - 5, 42, 0, 0, 337, 336, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 339, 1, 0, - 0, 0, 339, 341, 3, 24, 12, 0, 340, 335, 1, 0, 0, 0, 341, 344, 1, 0, 0, - 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 51, 1, 0, 0, 0, 344, - 342, 1, 0, 0, 0, 345, 346, 7, 1, 0, 0, 346, 53, 1, 0, 0, 0, 39, 57, 67, - 72, 79, 84, 86, 96, 108, 115, 121, 128, 136, 150, 156, 165, 178, 186, 193, - 222, 224, 237, 241, 245, 256, 262, 268, 272, 275, 281, 290, 296, 305, 308, - 319, 324, 327, 330, 337, 342, + 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 1, 0, 5, 0, 62, 8, 0, + 10, 0, 12, 0, 65, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 1, 76, 8, 1, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 3, 2, 88, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 93, 8, 2, + 3, 2, 95, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 103, 8, 4, 10, + 4, 12, 4, 106, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 115, + 8, 5, 10, 5, 12, 5, 118, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 124, 8, 5, + 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 130, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 135, 8, + 6, 10, 6, 12, 6, 138, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 145, 8, + 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 157, + 8, 8, 10, 8, 12, 8, 160, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, + 168, 8, 8, 10, 8, 12, 8, 171, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, + 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 5, 11, 187, 8, 11, + 10, 11, 12, 11, 190, 9, 11, 1, 11, 1, 11, 1, 11, 3, 11, 195, 8, 11, 1, + 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 202, 8, 11, 10, 11, 12, 11, 205, + 9, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, + 13, 3, 13, 217, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 223, 8, 14, 10, + 14, 12, 14, 226, 9, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 232, 8, 14, + 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, + 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, + 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 261, 8, 15, 10, 15, 12, + 15, 264, 9, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, + 1, 17, 1, 17, 3, 17, 276, 8, 17, 1, 18, 1, 18, 3, 18, 280, 8, 18, 1, 18, + 1, 18, 3, 18, 284, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 3, 20, 295, 8, 20, 1, 21, 1, 21, 4, 21, 299, 8, 21, 11, + 21, 12, 21, 300, 1, 21, 1, 21, 4, 21, 305, 8, 21, 11, 21, 12, 21, 306, + 5, 21, 309, 8, 21, 10, 21, 12, 21, 312, 9, 21, 3, 21, 314, 8, 21, 1, 21, + 1, 21, 1, 22, 1, 22, 3, 22, 320, 8, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, + 23, 5, 23, 327, 8, 23, 10, 23, 12, 23, 330, 9, 23, 1, 23, 5, 23, 333, 8, + 23, 10, 23, 12, 23, 336, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 4, 24, 342, + 8, 24, 11, 24, 12, 24, 343, 1, 24, 3, 24, 347, 8, 24, 1, 25, 1, 25, 1, + 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 358, 8, 26, 1, 27, + 1, 27, 1, 27, 3, 27, 363, 8, 27, 1, 27, 3, 27, 366, 8, 27, 1, 27, 3, 27, + 369, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 3, 28, 376, 8, 28, 1, 28, + 5, 28, 379, 8, 28, 10, 28, 12, 28, 382, 9, 28, 1, 29, 1, 29, 1, 29, 0, + 1, 30, 30, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, + 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 0, 2, 1, 0, 39, 44, + 3, 0, 14, 20, 32, 34, 45, 45, 417, 0, 63, 1, 0, 0, 0, 2, 75, 1, 0, 0, 0, + 4, 80, 1, 0, 0, 0, 6, 98, 1, 0, 0, 0, 8, 104, 1, 0, 0, 0, 10, 116, 1, 0, + 0, 0, 12, 136, 1, 0, 0, 0, 14, 150, 1, 0, 0, 0, 16, 158, 1, 0, 0, 0, 18, + 174, 1, 0, 0, 0, 20, 180, 1, 0, 0, 0, 22, 184, 1, 0, 0, 0, 24, 208, 1, + 0, 0, 0, 26, 216, 1, 0, 0, 0, 28, 231, 1, 0, 0, 0, 30, 233, 1, 0, 0, 0, + 32, 265, 1, 0, 0, 0, 34, 275, 1, 0, 0, 0, 36, 277, 1, 0, 0, 0, 38, 287, + 1, 0, 0, 0, 40, 294, 1, 0, 0, 0, 42, 296, 1, 0, 0, 0, 44, 319, 1, 0, 0, + 0, 46, 324, 1, 0, 0, 0, 48, 339, 1, 0, 0, 0, 50, 348, 1, 0, 0, 0, 52, 357, + 1, 0, 0, 0, 54, 359, 1, 0, 0, 0, 56, 372, 1, 0, 0, 0, 58, 383, 1, 0, 0, + 0, 60, 62, 3, 2, 1, 0, 61, 60, 1, 0, 0, 0, 62, 65, 1, 0, 0, 0, 63, 61, + 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 66, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, + 66, 67, 5, 0, 0, 1, 67, 1, 1, 0, 0, 0, 68, 76, 3, 4, 2, 0, 69, 76, 3, 8, + 4, 0, 70, 76, 3, 10, 5, 0, 71, 76, 3, 12, 6, 0, 72, 76, 3, 14, 7, 0, 73, + 76, 3, 16, 8, 0, 74, 76, 5, 47, 0, 0, 75, 68, 1, 0, 0, 0, 75, 69, 1, 0, + 0, 0, 75, 70, 1, 0, 0, 0, 75, 71, 1, 0, 0, 0, 75, 72, 1, 0, 0, 0, 75, 73, + 1, 0, 0, 0, 75, 74, 1, 0, 0, 0, 76, 3, 1, 0, 0, 0, 77, 79, 3, 50, 25, 0, + 78, 77, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, + 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 14, 0, 0, 84, + 94, 3, 58, 29, 0, 85, 87, 3, 38, 19, 0, 86, 88, 3, 6, 3, 0, 87, 86, 1, + 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 95, 1, 0, 0, 0, 89, 90, 5, 20, 0, 0, 90, + 92, 3, 28, 14, 0, 91, 93, 3, 6, 3, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, + 0, 0, 93, 95, 1, 0, 0, 0, 94, 85, 1, 0, 0, 0, 94, 89, 1, 0, 0, 0, 95, 96, + 1, 0, 0, 0, 96, 97, 5, 47, 0, 0, 97, 5, 1, 0, 0, 0, 98, 99, 5, 11, 0, 0, + 99, 100, 3, 30, 15, 0, 100, 7, 1, 0, 0, 0, 101, 103, 3, 50, 25, 0, 102, + 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, + 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 15, + 0, 0, 108, 109, 3, 58, 29, 0, 109, 110, 5, 11, 0, 0, 110, 111, 3, 30, 15, + 0, 111, 112, 5, 47, 0, 0, 112, 9, 1, 0, 0, 0, 113, 115, 3, 50, 25, 0, 114, + 113, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 116, 117, + 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 20, + 0, 0, 120, 121, 3, 58, 29, 0, 121, 123, 3, 28, 14, 0, 122, 124, 5, 27, + 0, 0, 123, 122, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, + 125, 129, 5, 11, 0, 0, 126, 130, 3, 20, 10, 0, 127, 130, 3, 42, 21, 0, + 128, 130, 3, 22, 11, 0, 129, 126, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 129, + 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 5, 47, 0, 0, 132, 11, + 1, 0, 0, 0, 133, 135, 3, 50, 25, 0, 134, 133, 1, 0, 0, 0, 135, 138, 1, + 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 139, 1, 0, 0, + 0, 138, 136, 1, 0, 0, 0, 139, 140, 5, 21, 0, 0, 140, 144, 3, 58, 29, 0, + 141, 145, 3, 58, 29, 0, 142, 143, 5, 20, 0, 0, 143, 145, 3, 28, 14, 0, + 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, + 147, 5, 11, 0, 0, 147, 148, 3, 30, 15, 0, 148, 149, 5, 47, 0, 0, 149, 13, + 1, 0, 0, 0, 150, 151, 5, 22, 0, 0, 151, 152, 5, 11, 0, 0, 152, 153, 3, + 30, 15, 0, 153, 154, 5, 47, 0, 0, 154, 15, 1, 0, 0, 0, 155, 157, 3, 50, + 25, 0, 156, 155, 1, 0, 0, 0, 157, 160, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, + 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 161, + 162, 5, 23, 0, 0, 162, 169, 3, 28, 14, 0, 163, 164, 5, 24, 0, 0, 164, 168, + 3, 42, 21, 0, 165, 166, 5, 25, 0, 0, 166, 168, 3, 58, 29, 0, 167, 163, + 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 171, 1, 0, 0, 0, 169, 167, 1, 0, + 0, 0, 169, 170, 1, 0, 0, 0, 170, 172, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, + 172, 173, 5, 47, 0, 0, 173, 17, 1, 0, 0, 0, 174, 175, 5, 26, 0, 0, 175, + 176, 3, 58, 29, 0, 176, 177, 5, 11, 0, 0, 177, 178, 3, 30, 15, 0, 178, + 179, 5, 47, 0, 0, 179, 19, 1, 0, 0, 0, 180, 181, 5, 35, 0, 0, 181, 182, + 3, 36, 18, 0, 182, 183, 3, 42, 21, 0, 183, 21, 1, 0, 0, 0, 184, 188, 5, + 4, 0, 0, 185, 187, 5, 47, 0, 0, 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, + 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, + 188, 1, 0, 0, 0, 191, 194, 5, 36, 0, 0, 192, 195, 3, 58, 29, 0, 193, 195, + 3, 24, 12, 0, 194, 192, 1, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 196, 1, + 0, 0, 0, 196, 197, 5, 37, 0, 0, 197, 198, 3, 30, 15, 0, 198, 199, 5, 10, + 0, 0, 199, 203, 3, 26, 13, 0, 200, 202, 5, 47, 0, 0, 201, 200, 1, 0, 0, + 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, + 206, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 207, 5, 5, 0, 0, 207, 23, 1, + 0, 0, 0, 208, 209, 5, 6, 0, 0, 209, 210, 3, 58, 29, 0, 210, 211, 5, 3, + 0, 0, 211, 212, 3, 58, 29, 0, 212, 213, 5, 7, 0, 0, 213, 25, 1, 0, 0, 0, + 214, 217, 3, 30, 15, 0, 215, 217, 3, 20, 10, 0, 216, 214, 1, 0, 0, 0, 216, + 215, 1, 0, 0, 0, 217, 27, 1, 0, 0, 0, 218, 224, 5, 28, 0, 0, 219, 220, + 3, 30, 15, 0, 220, 221, 5, 29, 0, 0, 221, 223, 1, 0, 0, 0, 222, 219, 1, + 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, + 0, 225, 227, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 228, 3, 30, 15, 0, + 228, 229, 5, 30, 0, 0, 229, 232, 1, 0, 0, 0, 230, 232, 5, 31, 0, 0, 231, + 218, 1, 0, 0, 0, 231, 230, 1, 0, 0, 0, 232, 29, 1, 0, 0, 0, 233, 234, 6, + 15, -1, 0, 234, 235, 3, 34, 17, 0, 235, 262, 1, 0, 0, 0, 236, 237, 10, + 6, 0, 0, 237, 238, 5, 38, 0, 0, 238, 239, 3, 30, 15, 0, 239, 240, 5, 10, + 0, 0, 240, 241, 3, 30, 15, 7, 241, 261, 1, 0, 0, 0, 242, 243, 10, 2, 0, + 0, 243, 244, 3, 32, 16, 0, 244, 245, 3, 30, 15, 3, 245, 261, 1, 0, 0, 0, + 246, 247, 10, 7, 0, 0, 247, 248, 5, 4, 0, 0, 248, 249, 3, 30, 15, 0, 249, + 250, 5, 5, 0, 0, 250, 261, 1, 0, 0, 0, 251, 252, 10, 5, 0, 0, 252, 253, + 5, 8, 0, 0, 253, 261, 3, 58, 29, 0, 254, 255, 10, 4, 0, 0, 255, 256, 5, + 8, 0, 0, 256, 261, 3, 54, 27, 0, 257, 258, 10, 3, 0, 0, 258, 259, 5, 10, + 0, 0, 259, 261, 3, 58, 29, 0, 260, 236, 1, 0, 0, 0, 260, 242, 1, 0, 0, + 0, 260, 246, 1, 0, 0, 0, 260, 251, 1, 0, 0, 0, 260, 254, 1, 0, 0, 0, 260, + 257, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, + 1, 0, 0, 0, 263, 31, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 7, 0, + 0, 0, 266, 33, 1, 0, 0, 0, 267, 276, 3, 40, 20, 0, 268, 276, 3, 54, 27, + 0, 269, 276, 3, 28, 14, 0, 270, 276, 5, 1, 0, 0, 271, 276, 3, 46, 23, 0, + 272, 276, 3, 42, 21, 0, 273, 276, 3, 22, 11, 0, 274, 276, 3, 36, 18, 0, + 275, 267, 1, 0, 0, 0, 275, 268, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, + 270, 1, 0, 0, 0, 275, 271, 1, 0, 0, 0, 275, 272, 1, 0, 0, 0, 275, 273, + 1, 0, 0, 0, 275, 274, 1, 0, 0, 0, 276, 35, 1, 0, 0, 0, 277, 279, 5, 6, + 0, 0, 278, 280, 5, 47, 0, 0, 279, 278, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, + 280, 281, 1, 0, 0, 0, 281, 283, 3, 30, 15, 0, 282, 284, 5, 47, 0, 0, 283, + 282, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 286, + 5, 7, 0, 0, 286, 37, 1, 0, 0, 0, 287, 288, 3, 58, 29, 0, 288, 39, 1, 0, + 0, 0, 289, 295, 5, 46, 0, 0, 290, 295, 5, 16, 0, 0, 291, 295, 5, 17, 0, + 0, 292, 295, 5, 18, 0, 0, 293, 295, 3, 58, 29, 0, 294, 289, 1, 0, 0, 0, + 294, 290, 1, 0, 0, 0, 294, 291, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, + 293, 1, 0, 0, 0, 295, 41, 1, 0, 0, 0, 296, 313, 5, 12, 0, 0, 297, 299, + 5, 47, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, + 0, 0, 300, 301, 1, 0, 0, 0, 301, 310, 1, 0, 0, 0, 302, 304, 3, 44, 22, + 0, 303, 305, 5, 47, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, + 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 302, + 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, + 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 298, 1, 0, 0, 0, + 313, 314, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 316, 5, 13, 0, 0, 316, + 43, 1, 0, 0, 0, 317, 320, 3, 58, 29, 0, 318, 320, 3, 28, 14, 0, 319, 317, + 1, 0, 0, 0, 319, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 10, + 0, 0, 322, 323, 3, 30, 15, 0, 323, 45, 1, 0, 0, 0, 324, 328, 5, 4, 0, 0, + 325, 327, 5, 47, 0, 0, 326, 325, 1, 0, 0, 0, 327, 330, 1, 0, 0, 0, 328, + 326, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 334, 1, 0, 0, 0, 330, 328, + 1, 0, 0, 0, 331, 333, 3, 48, 24, 0, 332, 331, 1, 0, 0, 0, 333, 336, 1, + 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 1, 0, 0, + 0, 336, 334, 1, 0, 0, 0, 337, 338, 5, 5, 0, 0, 338, 47, 1, 0, 0, 0, 339, + 346, 3, 30, 15, 0, 340, 342, 5, 47, 0, 0, 341, 340, 1, 0, 0, 0, 342, 343, + 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 347, 1, 0, + 0, 0, 345, 347, 5, 3, 0, 0, 346, 341, 1, 0, 0, 0, 346, 345, 1, 0, 0, 0, + 346, 347, 1, 0, 0, 0, 347, 49, 1, 0, 0, 0, 348, 349, 5, 2, 0, 0, 349, 350, + 3, 52, 26, 0, 350, 351, 5, 47, 0, 0, 351, 51, 1, 0, 0, 0, 352, 358, 3, + 54, 27, 0, 353, 354, 3, 30, 15, 0, 354, 355, 5, 8, 0, 0, 355, 356, 3, 54, + 27, 0, 356, 358, 1, 0, 0, 0, 357, 352, 1, 0, 0, 0, 357, 353, 1, 0, 0, 0, + 358, 53, 1, 0, 0, 0, 359, 360, 3, 58, 29, 0, 360, 365, 5, 6, 0, 0, 361, + 363, 5, 47, 0, 0, 362, 361, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, + 1, 0, 0, 0, 364, 366, 3, 56, 28, 0, 365, 362, 1, 0, 0, 0, 365, 366, 1, + 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 369, 5, 47, 0, 0, 368, 367, 1, 0, 0, + 0, 368, 369, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 371, 5, 7, 0, 0, 371, + 55, 1, 0, 0, 0, 372, 380, 3, 30, 15, 0, 373, 375, 5, 3, 0, 0, 374, 376, + 5, 47, 0, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, + 0, 0, 377, 379, 3, 30, 15, 0, 378, 373, 1, 0, 0, 0, 379, 382, 1, 0, 0, + 0, 380, 378, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 57, 1, 0, 0, 0, 382, + 380, 1, 0, 0, 0, 383, 384, 7, 1, 0, 0, 384, 59, 1, 0, 0, 0, 42, 63, 75, + 80, 87, 92, 94, 104, 116, 123, 129, 136, 144, 158, 167, 169, 188, 194, + 203, 216, 224, 231, 260, 262, 275, 279, 283, 294, 300, 306, 310, 313, 319, + 328, 334, 343, 346, 357, 362, 365, 368, 375, 380, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -273,31 +293,36 @@ const ( bicepParserOBJECT = 19 bicepParserRESOURCE = 20 bicepParserOUTPUT = 21 - bicepParserEXISTING = 22 - bicepParserSTRING_LEFT_PIECE = 23 - bicepParserSTRING_MIDDLE_PIECE = 24 - bicepParserSTRING_RIGHT_PIECE = 25 - bicepParserSTRING_COMPLETE = 26 - bicepParserSTRING = 27 - bicepParserINT = 28 - bicepParserBOOL = 29 - bicepParserIF = 30 - bicepParserFOR = 31 - bicepParserIN = 32 - bicepParserQMARK = 33 - bicepParserGT = 34 - bicepParserGTE = 35 - bicepParserLT = 36 - bicepParserLTE = 37 - bicepParserEQ = 38 - bicepParserNEQ = 39 - bicepParserIDENTIFIER = 40 - bicepParserNUMBER = 41 - bicepParserNL = 42 - bicepParserSINGLE_LINE_COMMENT = 43 - bicepParserMULTI_LINE_COMMENT = 44 - bicepParserSPACES = 45 - bicepParserUNKNOWN = 46 + bicepParserTARGET_SCOPE = 22 + bicepParserIMPORT = 23 + bicepParserWITH = 24 + bicepParserAS = 25 + bicepParserMETADATA = 26 + bicepParserEXISTING = 27 + bicepParserSTRING_LEFT_PIECE = 28 + bicepParserSTRING_MIDDLE_PIECE = 29 + bicepParserSTRING_RIGHT_PIECE = 30 + bicepParserSTRING_COMPLETE = 31 + bicepParserSTRING = 32 + bicepParserINT = 33 + bicepParserBOOL = 34 + bicepParserIF = 35 + bicepParserFOR = 36 + bicepParserIN = 37 + bicepParserQMARK = 38 + bicepParserGT = 39 + bicepParserGTE = 40 + bicepParserLT = 41 + bicepParserLTE = 42 + bicepParserEQ = 43 + bicepParserNEQ = 44 + bicepParserIDENTIFIER = 45 + bicepParserNUMBER = 46 + bicepParserNL = 47 + bicepParserSINGLE_LINE_COMMENT = 48 + bicepParserMULTI_LINE_COMMENT = 49 + bicepParserSPACES = 50 + bicepParserUNKNOWN = 51 ) // bicepParser rules. @@ -309,26 +334,29 @@ const ( bicepParserRULE_variableDecl = 4 bicepParserRULE_resourceDecl = 5 bicepParserRULE_outputDecl = 6 - bicepParserRULE_ifCondition = 7 - bicepParserRULE_forExpression = 8 - bicepParserRULE_forVariableBlock = 9 - bicepParserRULE_forBody = 10 - bicepParserRULE_interpString = 11 - bicepParserRULE_expression = 12 - bicepParserRULE_logicCharacter = 13 - bicepParserRULE_primaryExpression = 14 - bicepParserRULE_parenthesizedExpression = 15 - bicepParserRULE_typeExpression = 16 - bicepParserRULE_literalValue = 17 - bicepParserRULE_object = 18 - bicepParserRULE_objectProperty = 19 - bicepParserRULE_array = 20 - bicepParserRULE_arrayItem = 21 - bicepParserRULE_decorator = 22 - bicepParserRULE_decoratorExpression = 23 - bicepParserRULE_functionCall = 24 - bicepParserRULE_argumentList = 25 - bicepParserRULE_identifier = 26 + bicepParserRULE_targetScopeDecl = 7 + bicepParserRULE_importDecl = 8 + bicepParserRULE_metadataDecl = 9 + bicepParserRULE_ifCondition = 10 + bicepParserRULE_forExpression = 11 + bicepParserRULE_forVariableBlock = 12 + bicepParserRULE_forBody = 13 + bicepParserRULE_interpString = 14 + bicepParserRULE_expression = 15 + bicepParserRULE_logicCharacter = 16 + bicepParserRULE_primaryExpression = 17 + bicepParserRULE_parenthesizedExpression = 18 + bicepParserRULE_typeExpression = 19 + bicepParserRULE_literalValue = 20 + bicepParserRULE_object = 21 + bicepParserRULE_objectProperty = 22 + bicepParserRULE_array = 23 + bicepParserRULE_arrayItem = 24 + bicepParserRULE_decorator = 25 + bicepParserRULE_decoratorExpression = 26 + bicepParserRULE_functionCall = 27 + bicepParserRULE_argumentList = 28 + bicepParserRULE_identifier = 29 ) // IProgramContext is an interface to support dynamic dispatch. @@ -448,20 +476,20 @@ func (p *bicepParser) Program() (localctx IProgramContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(57) + p.SetState(63) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4398049705988) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&140737504133124) != 0 { { - p.SetState(54) + p.SetState(60) p.Statement() } - p.SetState(59) + p.SetState(65) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -469,7 +497,7 @@ func (p *bicepParser) Program() (localctx IProgramContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(60) + p.SetState(66) p.Match(bicepParserEOF) if p.HasError() { // Recognition error - abort rule @@ -502,6 +530,8 @@ type IStatementContext interface { VariableDecl() IVariableDeclContext ResourceDecl() IResourceDeclContext OutputDecl() IOutputDeclContext + TargetScopeDecl() ITargetScopeDeclContext + ImportDecl() IImportDeclContext NL() antlr.TerminalNode // IsStatementContext differentiates from other interfaces. @@ -604,6 +634,38 @@ func (s *StatementContext) OutputDecl() IOutputDeclContext { return t.(IOutputDeclContext) } +func (s *StatementContext) TargetScopeDecl() ITargetScopeDeclContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITargetScopeDeclContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITargetScopeDeclContext) +} + +func (s *StatementContext) ImportDecl() IImportDeclContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IImportDeclContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IImportDeclContext) +} + func (s *StatementContext) NL() antlr.TerminalNode { return s.GetToken(bicepParserNL, 0) } @@ -629,7 +691,7 @@ func (s *StatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 2, bicepParserRULE_statement) - p.SetState(67) + p.SetState(75) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -639,35 +701,49 @@ func (p *bicepParser) Statement() (localctx IStatementContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(62) + p.SetState(68) p.ParameterDecl() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(63) + p.SetState(69) p.VariableDecl() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(64) + p.SetState(70) p.ResourceDecl() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(65) + p.SetState(71) p.OutputDecl() } case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(66) + p.SetState(72) + p.TargetScopeDecl() + } + + case 6: + p.EnterOuterAlt(localctx, 6) + { + p.SetState(73) + p.ImportDecl() + } + + case 7: + p.EnterOuterAlt(localctx, 7) + { + p.SetState(74) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -909,7 +985,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(72) + p.SetState(80) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -918,11 +994,11 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { for _la == bicepParserAT { { - p.SetState(69) + p.SetState(77) p.Decorator() } - p.SetState(74) + p.SetState(82) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -930,7 +1006,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(75) + p.SetState(83) p.Match(bicepParserPARAM) if p.HasError() { // Recognition error - abort rule @@ -938,13 +1014,13 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { } } { - p.SetState(76) + p.SetState(84) var _x = p.Identifier() localctx.(*ParameterDeclContext).name = _x } - p.SetState(86) + p.SetState(94) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -953,10 +1029,10 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext()) { case 1: { - p.SetState(77) + p.SetState(85) p.TypeExpression() } - p.SetState(79) + p.SetState(87) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -965,7 +1041,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { if _la == bicepParserASSIGN { { - p.SetState(78) + p.SetState(86) p.ParameterDefaultValue() } @@ -973,7 +1049,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { case 2: { - p.SetState(81) + p.SetState(89) p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule @@ -981,13 +1057,13 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { } } { - p.SetState(82) + p.SetState(90) var _x = p.InterpString() localctx.(*ParameterDeclContext).type_ = _x } - p.SetState(84) + p.SetState(92) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -996,7 +1072,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { if _la == bicepParserASSIGN { { - p.SetState(83) + p.SetState(91) p.ParameterDefaultValue() } @@ -1006,7 +1082,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { goto errorExit } { - p.SetState(88) + p.SetState(96) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1117,7 +1193,7 @@ func (p *bicepParser) ParameterDefaultValue() (localctx IParameterDefaultValueCo p.EnterRule(localctx, 6, bicepParserRULE_parameterDefaultValue) p.EnterOuterAlt(localctx, 1) { - p.SetState(90) + p.SetState(98) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -1125,7 +1201,7 @@ func (p *bicepParser) ParameterDefaultValue() (localctx IParameterDefaultValueCo } } { - p.SetState(91) + p.SetState(99) p.expression(0) } @@ -1314,7 +1390,7 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(96) + p.SetState(104) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1323,11 +1399,11 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { for _la == bicepParserAT { { - p.SetState(93) + p.SetState(101) p.Decorator() } - p.SetState(98) + p.SetState(106) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1335,7 +1411,7 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(99) + p.SetState(107) p.Match(bicepParserVAR) if p.HasError() { // Recognition error - abort rule @@ -1343,14 +1419,14 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { } } { - p.SetState(100) + p.SetState(108) var _x = p.Identifier() localctx.(*VariableDeclContext).name = _x } { - p.SetState(101) + p.SetState(109) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -1358,11 +1434,11 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { } } { - p.SetState(102) + p.SetState(110) p.expression(0) } { - p.SetState(103) + p.SetState(111) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1622,7 +1698,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(108) + p.SetState(116) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1631,11 +1707,11 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { for _la == bicepParserAT { { - p.SetState(105) + p.SetState(113) p.Decorator() } - p.SetState(110) + p.SetState(118) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1643,7 +1719,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(111) + p.SetState(119) p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule @@ -1651,20 +1727,20 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { } } { - p.SetState(112) + p.SetState(120) var _x = p.Identifier() localctx.(*ResourceDeclContext).name = _x } { - p.SetState(113) + p.SetState(121) var _x = p.InterpString() localctx.(*ResourceDeclContext).type_ = _x } - p.SetState(115) + p.SetState(123) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1673,7 +1749,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { if _la == bicepParserEXISTING { { - p.SetState(114) + p.SetState(122) p.Match(bicepParserEXISTING) if p.HasError() { // Recognition error - abort rule @@ -1683,14 +1759,14 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { } { - p.SetState(117) + p.SetState(125) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(121) + p.SetState(129) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1699,19 +1775,19 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { switch p.GetTokenStream().LA(1) { case bicepParserIF: { - p.SetState(118) + p.SetState(126) p.IfCondition() } case bicepParserOBRACE: { - p.SetState(119) + p.SetState(127) p.Object() } case bicepParserOBRACK: { - p.SetState(120) + p.SetState(128) p.ForExpression() } @@ -1720,7 +1796,877 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { goto errorExit } { - p.SetState(123) + p.SetState(131) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IOutputDeclContext is an interface to support dynamic dispatch. +type IOutputDeclContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetName returns the name rule contexts. + GetName() IIdentifierContext + + // GetType1 returns the type1 rule contexts. + GetType1() IIdentifierContext + + // GetType2 returns the type2 rule contexts. + GetType2() IInterpStringContext + + // SetName sets the name rule contexts. + SetName(IIdentifierContext) + + // SetType1 sets the type1 rule contexts. + SetType1(IIdentifierContext) + + // SetType2 sets the type2 rule contexts. + SetType2(IInterpStringContext) + + // Getter signatures + OUTPUT() antlr.TerminalNode + ASSIGN() antlr.TerminalNode + Expression() IExpressionContext + NL() antlr.TerminalNode + AllIdentifier() []IIdentifierContext + Identifier(i int) IIdentifierContext + RESOURCE() antlr.TerminalNode + AllDecorator() []IDecoratorContext + Decorator(i int) IDecoratorContext + InterpString() IInterpStringContext + + // IsOutputDeclContext differentiates from other interfaces. + IsOutputDeclContext() +} + +type OutputDeclContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + name IIdentifierContext + type1 IIdentifierContext + type2 IInterpStringContext +} + +func NewEmptyOutputDeclContext() *OutputDeclContext { + var p = new(OutputDeclContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_outputDecl + return p +} + +func InitEmptyOutputDeclContext(p *OutputDeclContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_outputDecl +} + +func (*OutputDeclContext) IsOutputDeclContext() {} + +func NewOutputDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OutputDeclContext { + var p = new(OutputDeclContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_outputDecl + + return p +} + +func (s *OutputDeclContext) GetParser() antlr.Parser { return s.parser } + +func (s *OutputDeclContext) GetName() IIdentifierContext { return s.name } + +func (s *OutputDeclContext) GetType1() IIdentifierContext { return s.type1 } + +func (s *OutputDeclContext) GetType2() IInterpStringContext { return s.type2 } + +func (s *OutputDeclContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *OutputDeclContext) SetType1(v IIdentifierContext) { s.type1 = v } + +func (s *OutputDeclContext) SetType2(v IInterpStringContext) { s.type2 = v } + +func (s *OutputDeclContext) OUTPUT() antlr.TerminalNode { + return s.GetToken(bicepParserOUTPUT, 0) +} + +func (s *OutputDeclContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) +} + +func (s *OutputDeclContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *OutputDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *OutputDeclContext) AllIdentifier() []IIdentifierContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IIdentifierContext); ok { + len++ + } + } + + tst := make([]IIdentifierContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IIdentifierContext); ok { + tst[i] = t.(IIdentifierContext) + i++ + } + } + + return tst +} + +func (s *OutputDeclContext) Identifier(i int) IIdentifierContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *OutputDeclContext) RESOURCE() antlr.TerminalNode { + return s.GetToken(bicepParserRESOURCE, 0) +} + +func (s *OutputDeclContext) AllDecorator() []IDecoratorContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDecoratorContext); ok { + len++ + } + } + + tst := make([]IDecoratorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) + i++ + } + } + + return tst +} + +func (s *OutputDeclContext) Decorator(i int) IDecoratorContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecoratorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDecoratorContext) +} + +func (s *OutputDeclContext) InterpString() IInterpStringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInterpStringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInterpStringContext) +} + +func (s *OutputDeclContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *OutputDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *OutputDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitOutputDecl(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { + localctx = NewOutputDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 12, bicepParserRULE_outputDecl) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(136) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserAT { + { + p.SetState(133) + p.Decorator() + } + + p.SetState(138) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(139) + p.Match(bicepParserOUTPUT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(140) + + var _x = p.Identifier() + + localctx.(*OutputDeclContext).name = _x + } + p.SetState(144) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) { + case 1: + { + p.SetState(141) + + var _x = p.Identifier() + + localctx.(*OutputDeclContext).type1 = _x + } + + case 2: + { + p.SetState(142) + p.Match(bicepParserRESOURCE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(143) + + var _x = p.InterpString() + + localctx.(*OutputDeclContext).type2 = _x + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + { + p.SetState(146) + p.Match(bicepParserASSIGN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(147) + p.expression(0) + } + { + p.SetState(148) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ITargetScopeDeclContext is an interface to support dynamic dispatch. +type ITargetScopeDeclContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + TARGET_SCOPE() antlr.TerminalNode + ASSIGN() antlr.TerminalNode + Expression() IExpressionContext + NL() antlr.TerminalNode + + // IsTargetScopeDeclContext differentiates from other interfaces. + IsTargetScopeDeclContext() +} + +type TargetScopeDeclContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTargetScopeDeclContext() *TargetScopeDeclContext { + var p = new(TargetScopeDeclContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_targetScopeDecl + return p +} + +func InitEmptyTargetScopeDeclContext(p *TargetScopeDeclContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_targetScopeDecl +} + +func (*TargetScopeDeclContext) IsTargetScopeDeclContext() {} + +func NewTargetScopeDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TargetScopeDeclContext { + var p = new(TargetScopeDeclContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_targetScopeDecl + + return p +} + +func (s *TargetScopeDeclContext) GetParser() antlr.Parser { return s.parser } + +func (s *TargetScopeDeclContext) TARGET_SCOPE() antlr.TerminalNode { + return s.GetToken(bicepParserTARGET_SCOPE, 0) +} + +func (s *TargetScopeDeclContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) +} + +func (s *TargetScopeDeclContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *TargetScopeDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *TargetScopeDeclContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TargetScopeDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TargetScopeDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitTargetScopeDecl(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) TargetScopeDecl() (localctx ITargetScopeDeclContext) { + localctx = NewTargetScopeDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 14, bicepParserRULE_targetScopeDecl) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(150) + p.Match(bicepParserTARGET_SCOPE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(151) + p.Match(bicepParserASSIGN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(152) + p.expression(0) + } + { + p.SetState(153) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IImportDeclContext is an interface to support dynamic dispatch. +type IImportDeclContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetSpecification returns the specification rule contexts. + GetSpecification() IInterpStringContext + + // GetAlias returns the alias rule contexts. + GetAlias() IIdentifierContext + + // SetSpecification sets the specification rule contexts. + SetSpecification(IInterpStringContext) + + // SetAlias sets the alias rule contexts. + SetAlias(IIdentifierContext) + + // Getter signatures + IMPORT() antlr.TerminalNode + NL() antlr.TerminalNode + InterpString() IInterpStringContext + AllDecorator() []IDecoratorContext + Decorator(i int) IDecoratorContext + AllWITH() []antlr.TerminalNode + WITH(i int) antlr.TerminalNode + AllObject() []IObjectContext + Object(i int) IObjectContext + AllAS() []antlr.TerminalNode + AS(i int) antlr.TerminalNode + AllIdentifier() []IIdentifierContext + Identifier(i int) IIdentifierContext + + // IsImportDeclContext differentiates from other interfaces. + IsImportDeclContext() +} + +type ImportDeclContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + specification IInterpStringContext + alias IIdentifierContext +} + +func NewEmptyImportDeclContext() *ImportDeclContext { + var p = new(ImportDeclContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_importDecl + return p +} + +func InitEmptyImportDeclContext(p *ImportDeclContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_importDecl +} + +func (*ImportDeclContext) IsImportDeclContext() {} + +func NewImportDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportDeclContext { + var p = new(ImportDeclContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_importDecl + + return p +} + +func (s *ImportDeclContext) GetParser() antlr.Parser { return s.parser } + +func (s *ImportDeclContext) GetSpecification() IInterpStringContext { return s.specification } + +func (s *ImportDeclContext) GetAlias() IIdentifierContext { return s.alias } + +func (s *ImportDeclContext) SetSpecification(v IInterpStringContext) { s.specification = v } + +func (s *ImportDeclContext) SetAlias(v IIdentifierContext) { s.alias = v } + +func (s *ImportDeclContext) IMPORT() antlr.TerminalNode { + return s.GetToken(bicepParserIMPORT, 0) +} + +func (s *ImportDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *ImportDeclContext) InterpString() IInterpStringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInterpStringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInterpStringContext) +} + +func (s *ImportDeclContext) AllDecorator() []IDecoratorContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDecoratorContext); ok { + len++ + } + } + + tst := make([]IDecoratorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) + i++ + } + } + + return tst +} + +func (s *ImportDeclContext) Decorator(i int) IDecoratorContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecoratorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDecoratorContext) +} + +func (s *ImportDeclContext) AllWITH() []antlr.TerminalNode { + return s.GetTokens(bicepParserWITH) +} + +func (s *ImportDeclContext) WITH(i int) antlr.TerminalNode { + return s.GetToken(bicepParserWITH, i) +} + +func (s *ImportDeclContext) AllObject() []IObjectContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IObjectContext); ok { + len++ + } + } + + tst := make([]IObjectContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IObjectContext); ok { + tst[i] = t.(IObjectContext) + i++ + } + } + + return tst +} + +func (s *ImportDeclContext) Object(i int) IObjectContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjectContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IObjectContext) +} + +func (s *ImportDeclContext) AllAS() []antlr.TerminalNode { + return s.GetTokens(bicepParserAS) +} + +func (s *ImportDeclContext) AS(i int) antlr.TerminalNode { + return s.GetToken(bicepParserAS, i) +} + +func (s *ImportDeclContext) AllIdentifier() []IIdentifierContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IIdentifierContext); ok { + len++ + } + } + + tst := make([]IIdentifierContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IIdentifierContext); ok { + tst[i] = t.(IIdentifierContext) + i++ + } + } + + return tst +} + +func (s *ImportDeclContext) Identifier(i int) IIdentifierContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *ImportDeclContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ImportDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ImportDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitImportDecl(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { + localctx = NewImportDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 16, bicepParserRULE_importDecl) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(158) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserAT { + { + p.SetState(155) + p.Decorator() + } + + p.SetState(160) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(161) + p.Match(bicepParserIMPORT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(162) + + var _x = p.InterpString() + + localctx.(*ImportDeclContext).specification = _x + } + p.SetState(169) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserWITH || _la == bicepParserAS { + p.SetState(167) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case bicepParserWITH: + { + p.SetState(163) + p.Match(bicepParserWITH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(164) + p.Object() + } + + case bicepParserAS: + { + p.SetState(165) + p.Match(bicepParserAS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(166) + + var _x = p.Identifier() + + localctx.(*ImportDeclContext).alias = _x + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + + p.SetState(171) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(172) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1741,8 +2687,8 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IOutputDeclContext is an interface to support dynamic dispatch. -type IOutputDeclContext interface { +// IMetadataDeclContext is an interface to support dynamic dispatch. +type IMetadataDeclContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -1751,93 +2697,66 @@ type IOutputDeclContext interface { // GetName returns the name rule contexts. GetName() IIdentifierContext - // GetType1 returns the type1 rule contexts. - GetType1() IIdentifierContext - - // GetType2 returns the type2 rule contexts. - GetType2() IInterpStringContext - // SetName sets the name rule contexts. SetName(IIdentifierContext) - // SetType1 sets the type1 rule contexts. - SetType1(IIdentifierContext) - - // SetType2 sets the type2 rule contexts. - SetType2(IInterpStringContext) - // Getter signatures - OUTPUT() antlr.TerminalNode + METADATA() antlr.TerminalNode ASSIGN() antlr.TerminalNode Expression() IExpressionContext NL() antlr.TerminalNode - AllIdentifier() []IIdentifierContext - Identifier(i int) IIdentifierContext - RESOURCE() antlr.TerminalNode - AllDecorator() []IDecoratorContext - Decorator(i int) IDecoratorContext - InterpString() IInterpStringContext + Identifier() IIdentifierContext - // IsOutputDeclContext differentiates from other interfaces. - IsOutputDeclContext() + // IsMetadataDeclContext differentiates from other interfaces. + IsMetadataDeclContext() } -type OutputDeclContext struct { +type MetadataDeclContext struct { antlr.BaseParserRuleContext parser antlr.Parser name IIdentifierContext - type1 IIdentifierContext - type2 IInterpStringContext } -func NewEmptyOutputDeclContext() *OutputDeclContext { - var p = new(OutputDeclContext) +func NewEmptyMetadataDeclContext() *MetadataDeclContext { + var p = new(MetadataDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_outputDecl + p.RuleIndex = bicepParserRULE_metadataDecl return p } -func InitEmptyOutputDeclContext(p *OutputDeclContext) { +func InitEmptyMetadataDeclContext(p *MetadataDeclContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_outputDecl + p.RuleIndex = bicepParserRULE_metadataDecl } -func (*OutputDeclContext) IsOutputDeclContext() {} +func (*MetadataDeclContext) IsMetadataDeclContext() {} -func NewOutputDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OutputDeclContext { - var p = new(OutputDeclContext) +func NewMetadataDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MetadataDeclContext { + var p = new(MetadataDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = bicepParserRULE_outputDecl + p.RuleIndex = bicepParserRULE_metadataDecl return p } -func (s *OutputDeclContext) GetParser() antlr.Parser { return s.parser } - -func (s *OutputDeclContext) GetName() IIdentifierContext { return s.name } - -func (s *OutputDeclContext) GetType1() IIdentifierContext { return s.type1 } - -func (s *OutputDeclContext) GetType2() IInterpStringContext { return s.type2 } - -func (s *OutputDeclContext) SetName(v IIdentifierContext) { s.name = v } +func (s *MetadataDeclContext) GetParser() antlr.Parser { return s.parser } -func (s *OutputDeclContext) SetType1(v IIdentifierContext) { s.type1 = v } +func (s *MetadataDeclContext) GetName() IIdentifierContext { return s.name } -func (s *OutputDeclContext) SetType2(v IInterpStringContext) { s.type2 = v } +func (s *MetadataDeclContext) SetName(v IIdentifierContext) { s.name = v } -func (s *OutputDeclContext) OUTPUT() antlr.TerminalNode { - return s.GetToken(bicepParserOUTPUT, 0) +func (s *MetadataDeclContext) METADATA() antlr.TerminalNode { + return s.GetToken(bicepParserMETADATA, 0) } -func (s *OutputDeclContext) ASSIGN() antlr.TerminalNode { +func (s *MetadataDeclContext) ASSIGN() antlr.TerminalNode { return s.GetToken(bicepParserASSIGN, 0) } -func (s *OutputDeclContext) Expression() IExpressionContext { +func (s *MetadataDeclContext) Expression() IExpressionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IExpressionContext); ok { @@ -1853,100 +2772,14 @@ func (s *OutputDeclContext) Expression() IExpressionContext { return t.(IExpressionContext) } -func (s *OutputDeclContext) NL() antlr.TerminalNode { +func (s *MetadataDeclContext) NL() antlr.TerminalNode { return s.GetToken(bicepParserNL, 0) } -func (s *OutputDeclContext) AllIdentifier() []IIdentifierContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IIdentifierContext); ok { - len++ - } - } - - tst := make([]IIdentifierContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IIdentifierContext); ok { - tst[i] = t.(IIdentifierContext) - i++ - } - } - - return tst -} - -func (s *OutputDeclContext) Identifier(i int) IIdentifierContext { +func (s *MetadataDeclContext) Identifier() IIdentifierContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IIdentifierContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IIdentifierContext) -} - -func (s *OutputDeclContext) RESOURCE() antlr.TerminalNode { - return s.GetToken(bicepParserRESOURCE, 0) -} - -func (s *OutputDeclContext) AllDecorator() []IDecoratorContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IDecoratorContext); ok { - len++ - } - } - - tst := make([]IDecoratorContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IDecoratorContext); ok { - tst[i] = t.(IDecoratorContext) - i++ - } - } - - return tst -} - -func (s *OutputDeclContext) Decorator(i int) IDecoratorContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDecoratorContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IDecoratorContext) -} - -func (s *OutputDeclContext) InterpString() IInterpStringContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IInterpStringContext); ok { t = ctx.(antlr.RuleContext) break } @@ -1956,106 +2789,48 @@ func (s *OutputDeclContext) InterpString() IInterpStringContext { return nil } - return t.(IInterpStringContext) + return t.(IIdentifierContext) } -func (s *OutputDeclContext) GetRuleContext() antlr.RuleContext { +func (s *MetadataDeclContext) GetRuleContext() antlr.RuleContext { return s } -func (s *OutputDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *MetadataDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *OutputDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *MetadataDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: - return t.VisitOutputDecl(s) + return t.VisitMetadataDecl(s) default: return t.VisitChildren(s) } } -func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { - localctx = NewOutputDeclContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 12, bicepParserRULE_outputDecl) - var _la int - +func (p *bicepParser) MetadataDecl() (localctx IMetadataDeclContext) { + localctx = NewMetadataDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, bicepParserRULE_metadataDecl) p.EnterOuterAlt(localctx, 1) - p.SetState(128) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == bicepParserAT { - { - p.SetState(125) - p.Decorator() - } - - p.SetState(130) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } { - p.SetState(131) - p.Match(bicepParserOUTPUT) + p.SetState(174) + p.Match(bicepParserMETADATA) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(132) + p.SetState(175) var _x = p.Identifier() - localctx.(*OutputDeclContext).name = _x - } - p.SetState(136) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) { - case 1: - { - p.SetState(133) - - var _x = p.Identifier() - - localctx.(*OutputDeclContext).type1 = _x - } - - case 2: - { - p.SetState(134) - p.Match(bicepParserRESOURCE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(135) - - var _x = p.InterpString() - - localctx.(*OutputDeclContext).type2 = _x - } - - case antlr.ATNInvalidAltNumber: - goto errorExit + localctx.(*MetadataDeclContext).name = _x } { - p.SetState(138) + p.SetState(176) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -2063,11 +2838,11 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { } } { - p.SetState(139) + p.SetState(177) p.expression(0) } { - p.SetState(140) + p.SetState(178) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2192,10 +2967,10 @@ func (s *IfConditionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) IfCondition() (localctx IIfConditionContext) { localctx = NewIfConditionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 14, bicepParserRULE_ifCondition) + p.EnterRule(localctx, 20, bicepParserRULE_ifCondition) p.EnterOuterAlt(localctx, 1) { - p.SetState(142) + p.SetState(180) p.Match(bicepParserIF) if p.HasError() { // Recognition error - abort rule @@ -2203,11 +2978,11 @@ func (p *bicepParser) IfCondition() (localctx IIfConditionContext) { } } { - p.SetState(143) + p.SetState(181) p.ParenthesizedExpression() } { - p.SetState(144) + p.SetState(182) p.Object() } @@ -2403,19 +3178,19 @@ func (s *ForExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { localctx = NewForExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 16, bicepParserRULE_forExpression) + p.EnterRule(localctx, 22, bicepParserRULE_forExpression) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(146) + p.SetState(184) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(150) + p.SetState(188) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2424,7 +3199,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { for _la == bicepParserNL { { - p.SetState(147) + p.SetState(185) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2432,7 +3207,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } - p.SetState(152) + p.SetState(190) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2440,14 +3215,14 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(153) + p.SetState(191) p.Match(bicepParserFOR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(156) + p.SetState(194) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2456,7 +3231,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: { - p.SetState(154) + p.SetState(192) var _x = p.Identifier() @@ -2465,7 +3240,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { case bicepParserOPAR: { - p.SetState(155) + p.SetState(193) p.ForVariableBlock() } @@ -2474,7 +3249,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { goto errorExit } { - p.SetState(158) + p.SetState(196) p.Match(bicepParserIN) if p.HasError() { // Recognition error - abort rule @@ -2482,11 +3257,11 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } { - p.SetState(159) + p.SetState(197) p.expression(0) } { - p.SetState(160) + p.SetState(198) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -2494,10 +3269,10 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } { - p.SetState(161) + p.SetState(199) p.ForBody() } - p.SetState(165) + p.SetState(203) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2506,7 +3281,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { for _la == bicepParserNL { { - p.SetState(162) + p.SetState(200) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2514,7 +3289,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } - p.SetState(167) + p.SetState(205) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2522,7 +3297,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(168) + p.SetState(206) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -2688,10 +3463,10 @@ func (s *ForVariableBlockContext) Accept(visitor antlr.ParseTreeVisitor) interfa func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { localctx = NewForVariableBlockContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 18, bicepParserRULE_forVariableBlock) + p.EnterRule(localctx, 24, bicepParserRULE_forVariableBlock) p.EnterOuterAlt(localctx, 1) { - p.SetState(170) + p.SetState(208) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule @@ -2699,14 +3474,14 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { } } { - p.SetState(171) + p.SetState(209) var _x = p.Identifier() localctx.(*ForVariableBlockContext).item = _x } { - p.SetState(172) + p.SetState(210) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -2714,14 +3489,14 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { } } { - p.SetState(173) + p.SetState(211) var _x = p.Identifier() localctx.(*ForVariableBlockContext).index = _x } { - p.SetState(174) + p.SetState(212) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -2852,8 +3627,8 @@ func (s *ForBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) ForBody() (localctx IForBodyContext) { localctx = NewForBodyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 20, bicepParserRULE_forBody) - p.SetState(178) + p.EnterRule(localctx, 26, bicepParserRULE_forBody) + p.SetState(216) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2863,7 +3638,7 @@ func (p *bicepParser) ForBody() (localctx IForBodyContext) { case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER, bicepParserNUMBER: p.EnterOuterAlt(localctx, 1) { - p.SetState(176) + p.SetState(214) var _x = p.expression(0) @@ -2873,7 +3648,7 @@ func (p *bicepParser) ForBody() (localctx IForBodyContext) { case bicepParserIF: p.EnterOuterAlt(localctx, 2) { - p.SetState(177) + p.SetState(215) p.IfCondition() } @@ -3028,10 +3803,10 @@ func (s *InterpStringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) InterpString() (localctx IInterpStringContext) { localctx = NewInterpStringContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 22, bicepParserRULE_interpString) + p.EnterRule(localctx, 28, bicepParserRULE_interpString) var _alt int - p.SetState(193) + p.SetState(231) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3041,30 +3816,30 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_LEFT_PIECE: p.EnterOuterAlt(localctx, 1) { - p.SetState(180) + p.SetState(218) p.Match(bicepParserSTRING_LEFT_PIECE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(186) + p.SetState(224) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(181) + p.SetState(219) p.expression(0) } { - p.SetState(182) + p.SetState(220) p.Match(bicepParserSTRING_MIDDLE_PIECE) if p.HasError() { // Recognition error - abort rule @@ -3073,22 +3848,22 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { } } - p.SetState(188) + p.SetState(226) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } { - p.SetState(189) + p.SetState(227) p.expression(0) } { - p.SetState(190) + p.SetState(228) p.Match(bicepParserSTRING_RIGHT_PIECE) if p.HasError() { // Recognition error - abort rule @@ -3099,7 +3874,7 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_COMPLETE: p.EnterOuterAlt(localctx, 2) { - p.SetState(192) + p.SetState(230) p.Match(bicepParserSTRING_COMPLETE) if p.HasError() { // Recognition error - abort rule @@ -3357,23 +4132,23 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { localctx = NewExpressionContext(p, p.GetParserRuleContext(), _parentState) var _prevctx IExpressionContext = localctx var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. - _startState := 24 - p.EnterRecursionRule(localctx, 24, bicepParserRULE_expression, _p) + _startState := 30 + p.EnterRecursionRule(localctx, 30, bicepParserRULE_expression, _p) var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(196) + p.SetState(234) p.PrimaryExpression() } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(224) + p.SetState(262) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -3383,24 +4158,24 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(222) + p.SetState(260) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 21, p.GetParserRuleContext()) { case 1: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(198) + p.SetState(236) if !(p.Precpred(p.GetParserRuleContext(), 6)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) goto errorExit } { - p.SetState(199) + p.SetState(237) p.Match(bicepParserQMARK) if p.HasError() { // Recognition error - abort rule @@ -3408,11 +4183,11 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(200) + p.SetState(238) p.expression(0) } { - p.SetState(201) + p.SetState(239) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3420,39 +4195,39 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(202) + p.SetState(240) p.expression(7) } case 2: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(204) + p.SetState(242) if !(p.Precpred(p.GetParserRuleContext(), 2)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) goto errorExit } { - p.SetState(205) + p.SetState(243) p.LogicCharacter() } { - p.SetState(206) + p.SetState(244) p.expression(3) } case 3: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(208) + p.SetState(246) if !(p.Precpred(p.GetParserRuleContext(), 7)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) goto errorExit } { - p.SetState(209) + p.SetState(247) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule @@ -3460,11 +4235,11 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(210) + p.SetState(248) p.expression(0) } { - p.SetState(211) + p.SetState(249) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -3475,14 +4250,14 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 4: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(213) + p.SetState(251) if !(p.Precpred(p.GetParserRuleContext(), 5)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) goto errorExit } { - p.SetState(214) + p.SetState(252) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -3490,7 +4265,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(215) + p.SetState(253) var _x = p.Identifier() @@ -3500,14 +4275,14 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 5: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(216) + p.SetState(254) if !(p.Precpred(p.GetParserRuleContext(), 4)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) goto errorExit } { - p.SetState(217) + p.SetState(255) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -3515,21 +4290,21 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(218) + p.SetState(256) p.FunctionCall() } case 6: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(219) + p.SetState(257) if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(220) + p.SetState(258) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3537,7 +4312,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(221) + p.SetState(259) var _x = p.Identifier() @@ -3549,12 +4324,12 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } - p.SetState(226) + p.SetState(264) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -3668,15 +4443,15 @@ func (s *LogicCharacterContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) LogicCharacter() (localctx ILogicCharacterContext) { localctx = NewLogicCharacterContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 26, bicepParserRULE_logicCharacter) + p.EnterRule(localctx, 32, bicepParserRULE_logicCharacter) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(227) + p.SetState(265) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1082331758592) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&34634616274944) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -3886,39 +4661,39 @@ func (s *PrimaryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interf func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { localctx = NewPrimaryExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 28, bicepParserRULE_primaryExpression) - p.SetState(237) + p.EnterRule(localctx, 34, bicepParserRULE_primaryExpression) + p.SetState(275) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 20, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(229) + p.SetState(267) p.LiteralValue() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(230) + p.SetState(268) p.FunctionCall() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(231) + p.SetState(269) p.InterpString() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(232) + p.SetState(270) p.Match(bicepParserMULTILINE_STRING) if p.HasError() { // Recognition error - abort rule @@ -3929,28 +4704,28 @@ func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(233) + p.SetState(271) p.Array() } case 6: p.EnterOuterAlt(localctx, 6) { - p.SetState(234) + p.SetState(272) p.Object() } case 7: p.EnterOuterAlt(localctx, 7) { - p.SetState(235) + p.SetState(273) p.ForExpression() } case 8: p.EnterOuterAlt(localctx, 8) { - p.SetState(236) + p.SetState(274) p.ParenthesizedExpression() } @@ -4073,19 +4848,19 @@ func (s *ParenthesizedExpressionContext) Accept(visitor antlr.ParseTreeVisitor) func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressionContext) { localctx = NewParenthesizedExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 30, bicepParserRULE_parenthesizedExpression) + p.EnterRule(localctx, 36, bicepParserRULE_parenthesizedExpression) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(239) + p.SetState(277) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(241) + p.SetState(279) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4094,7 +4869,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(240) + p.SetState(278) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4104,10 +4879,10 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(243) + p.SetState(281) p.expression(0) } - p.SetState(245) + p.SetState(283) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4116,7 +4891,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(244) + p.SetState(282) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4126,7 +4901,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(247) + p.SetState(285) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -4240,10 +5015,10 @@ func (s *TypeExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { localctx = NewTypeExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 32, bicepParserRULE_typeExpression) + p.EnterRule(localctx, 38, bicepParserRULE_typeExpression) p.EnterOuterAlt(localctx, 1) { - p.SetState(249) + p.SetState(287) var _x = p.Identifier() @@ -4365,18 +5140,18 @@ func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { localctx = NewLiteralValueContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 34, bicepParserRULE_literalValue) - p.SetState(256) + p.EnterRule(localctx, 40, bicepParserRULE_literalValue) + p.SetState(294) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 26, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(251) + p.SetState(289) p.Match(bicepParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -4387,7 +5162,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(252) + p.SetState(290) p.Match(bicepParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -4398,7 +5173,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(253) + p.SetState(291) p.Match(bicepParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -4409,7 +5184,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(254) + p.SetState(292) p.Match(bicepParserNULL) if p.HasError() { // Recognition error - abort rule @@ -4420,7 +5195,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(255) + p.SetState(293) p.Identifier() } @@ -4569,19 +5344,19 @@ func (s *ObjectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Object() (localctx IObjectContext) { localctx = NewObjectContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 36, bicepParserRULE_object) + p.EnterRule(localctx, 42, bicepParserRULE_object) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(258) + p.SetState(296) p.Match(bicepParserOBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(275) + p.SetState(313) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4589,7 +5364,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) if _la == bicepParserNL { - p.SetState(260) + p.SetState(298) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4598,7 +5373,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(259) + p.SetState(297) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4606,26 +5381,26 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(262) + p.SetState(300) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(272) + p.SetState(310) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1100528730112) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&35216854859776) != 0 { { - p.SetState(264) + p.SetState(302) p.ObjectProperty() } - p.SetState(266) + p.SetState(304) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4634,7 +5409,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(265) + p.SetState(303) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4642,7 +5417,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(268) + p.SetState(306) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4650,7 +5425,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) } - p.SetState(274) + p.SetState(312) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4660,7 +5435,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } { - p.SetState(277) + p.SetState(315) p.Match(bicepParserCBRACE) if p.HasError() { // Recognition error - abort rule @@ -4813,9 +5588,9 @@ func (s *ObjectPropertyContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { localctx = NewObjectPropertyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 38, bicepParserRULE_objectProperty) + p.EnterRule(localctx, 44, bicepParserRULE_objectProperty) p.EnterOuterAlt(localctx, 1) - p.SetState(281) + p.SetState(319) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4824,7 +5599,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: { - p.SetState(279) + p.SetState(317) var _x = p.Identifier() @@ -4833,7 +5608,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: { - p.SetState(280) + p.SetState(318) p.InterpString() } @@ -4842,7 +5617,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { goto errorExit } { - p.SetState(283) + p.SetState(321) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -4850,7 +5625,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } } { - p.SetState(284) + p.SetState(322) p.expression(0) } @@ -4995,19 +5770,19 @@ func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Array() (localctx IArrayContext) { localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 40, bicepParserRULE_array) + p.EnterRule(localctx, 46, bicepParserRULE_array) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(286) + p.SetState(324) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(290) + p.SetState(328) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5016,7 +5791,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for _la == bicepParserNL { { - p.SetState(287) + p.SetState(325) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5024,27 +5799,27 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } } - p.SetState(292) + p.SetState(330) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(296) + p.SetState(334) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&3299551989842) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&105585599041618) != 0 { { - p.SetState(293) + p.SetState(331) p.ArrayItem() } - p.SetState(298) + p.SetState(336) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5052,7 +5827,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(299) + p.SetState(337) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -5170,22 +5945,22 @@ func (s *ArrayItemContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { localctx = NewArrayItemContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 42, bicepParserRULE_arrayItem) + p.EnterRule(localctx, 48, bicepParserRULE_arrayItem) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(301) + p.SetState(339) p.expression(0) } - p.SetState(308) + p.SetState(346) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { case bicepParserNL: - p.SetState(303) + p.SetState(341) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5194,7 +5969,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(302) + p.SetState(340) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5202,7 +5977,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - p.SetState(305) + p.SetState(343) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5212,7 +5987,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { case bicepParserCOMMA: { - p.SetState(307) + p.SetState(345) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -5330,10 +6105,10 @@ func (s *DecoratorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Decorator() (localctx IDecoratorContext) { localctx = NewDecoratorContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 44, bicepParserRULE_decorator) + p.EnterRule(localctx, 50, bicepParserRULE_decorator) p.EnterOuterAlt(localctx, 1) { - p.SetState(310) + p.SetState(348) p.Match(bicepParserAT) if p.HasError() { // Recognition error - abort rule @@ -5341,11 +6116,11 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { } } { - p.SetState(311) + p.SetState(349) p.DecoratorExpression() } { - p.SetState(312) + p.SetState(350) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5470,29 +6245,29 @@ func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 46, bicepParserRULE_decoratorExpression) - p.SetState(319) + p.EnterRule(localctx, 52, bicepParserRULE_decoratorExpression) + p.SetState(357) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 33, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 36, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(314) + p.SetState(352) p.FunctionCall() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(315) + p.SetState(353) p.expression(0) } { - p.SetState(316) + p.SetState(354) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -5500,7 +6275,7 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex } } { - p.SetState(317) + p.SetState(355) p.FunctionCall() } @@ -5640,27 +6415,27 @@ func (s *FunctionCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { localctx = NewFunctionCallContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 48, bicepParserRULE_functionCall) + p.EnterRule(localctx, 54, bicepParserRULE_functionCall) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(321) + p.SetState(359) p.Identifier() } { - p.SetState(322) + p.SetState(360) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(327) + p.SetState(365) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 35, p.GetParserRuleContext()) == 1 { - p.SetState(324) + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 38, p.GetParserRuleContext()) == 1 { + p.SetState(362) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5669,7 +6444,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(323) + p.SetState(361) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5679,14 +6454,14 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(326) + p.SetState(364) p.ArgumentList() } } else if p.HasError() { // JIM goto errorExit } - p.SetState(330) + p.SetState(368) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5695,7 +6470,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(329) + p.SetState(367) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5705,7 +6480,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(332) + p.SetState(370) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -5854,15 +6629,15 @@ func (s *ArgumentListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { localctx = NewArgumentListContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 50, bicepParserRULE_argumentList) + p.EnterRule(localctx, 56, bicepParserRULE_argumentList) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(334) + p.SetState(372) p.expression(0) } - p.SetState(342) + p.SetState(380) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5871,14 +6646,14 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { for _la == bicepParserCOMMA { { - p.SetState(335) + p.SetState(373) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(337) + p.SetState(375) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5887,7 +6662,7 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { if _la == bicepParserNL { { - p.SetState(336) + p.SetState(374) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5897,11 +6672,11 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { } { - p.SetState(339) + p.SetState(377) p.expression(0) } - p.SetState(344) + p.SetState(382) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6042,15 +6817,15 @@ func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Identifier() (localctx IIdentifierContext) { localctx = NewIdentifierContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 52, bicepParserRULE_identifier) + p.EnterRule(localctx, 58, bicepParserRULE_identifier) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(345) + p.SetState(383) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1100453232640) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&35214438940672) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -6073,7 +6848,7 @@ errorExit: func (p *bicepParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { switch ruleIndex { - case 12: + case 15: var t *ExpressionContext = nil if localctx != nil { t = localctx.(*ExpressionContext) diff --git a/pkg/parser/bicep/antlr/parser/bicep_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_visitor.go index bd888927731..65641864612 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_visitor.go +++ b/pkg/parser/bicep/antlr/parser/bicep_visitor.go @@ -29,6 +29,15 @@ type bicepVisitor interface { // Visit a parse tree produced by bicepParser#outputDecl. VisitOutputDecl(ctx *OutputDeclContext) interface{} + // Visit a parse tree produced by bicepParser#targetScopeDecl. + VisitTargetScopeDecl(ctx *TargetScopeDeclContext) interface{} + + // Visit a parse tree produced by bicepParser#importDecl. + VisitImportDecl(ctx *ImportDeclContext) interface{} + + // Visit a parse tree produced by bicepParser#metadataDecl. + VisitMetadataDecl(ctx *MetadataDeclContext) interface{} + // Visit a parse tree produced by bicepParser#ifCondition. VisitIfCondition(ctx *IfConditionContext) interface{} From 85fe3dd0ed16672049adb5cb91c22066df4e5d4a Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 9 May 2024 11:23:13 +0100 Subject: [PATCH 104/130] support for more identifiers for panic handling --- pkg/parser/bicep/antlr/bicep.g4 | 37 +- pkg/parser/bicep/antlr/parser/bicep.interp | 4 +- pkg/parser/bicep/antlr/parser/bicep.tokens | 112 ++--- .../bicep/antlr/parser/bicepLexer.interp | 5 +- .../bicep/antlr/parser/bicepLexer.tokens | 112 ++--- pkg/parser/bicep/antlr/parser/bicep_lexer.go | 400 +++++++++--------- pkg/parser/bicep/antlr/parser/bicep_parser.go | 233 ++++++---- pkg/parser/bicep/parser.go | 6 + 8 files changed, 498 insertions(+), 411 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index 25d6151c196..dfbaeac0d26 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -126,18 +126,29 @@ functionCall: identifier OPAR (NL? argumentList)? NL? CPAR; // argumentList -> expression ("," expression)* argumentList: expression (COMMA NL? expression)*; -identifier: - IDENTIFIER - | PARAM - | RESOURCE - | VAR - | TRUE - | FALSE - | NULL - | STRING - | INT - | BOOL - | OBJECT; +identifier + : IDENTIFIER + | IMPORT + | WITH + | AS + | METADATA + | PARAM + | RESOURCE + | OUTPUT + | EXISTING + | VAR + | IF + | FOR + | IN + | TRUE + | FALSE + | NULL + | TARGET_SCOPE + | STRING + | INT + | BOOL + | ARRAY + | OBJECT; // multilineString -> "'''" + MULTILINESTRINGCHAR+ + "'''" MULTILINE_STRING: '\'\'\'' .*? '\'\'\''; @@ -176,6 +187,8 @@ FALSE: 'false'; NULL: 'null'; +ARRAY: 'array'; + OBJECT: 'object'; RESOURCE: 'resource'; diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index 9de80033c7e..933ca91b3c7 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -18,6 +18,7 @@ null 'true' 'false' 'null' +'array' 'object' 'resource' 'output' @@ -72,6 +73,7 @@ VAR TRUE FALSE NULL +ARRAY OBJECT RESOURCE OUTPUT @@ -140,4 +142,4 @@ identifier atn: -[4, 1, 51, 386, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 1, 0, 5, 0, 62, 8, 0, 10, 0, 12, 0, 65, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 76, 8, 1, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 88, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 93, 8, 2, 3, 2, 95, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 103, 8, 4, 10, 4, 12, 4, 106, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 115, 8, 5, 10, 5, 12, 5, 118, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 124, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 130, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 135, 8, 6, 10, 6, 12, 6, 138, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 145, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 157, 8, 8, 10, 8, 12, 8, 160, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 168, 8, 8, 10, 8, 12, 8, 171, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 5, 11, 187, 8, 11, 10, 11, 12, 11, 190, 9, 11, 1, 11, 1, 11, 1, 11, 3, 11, 195, 8, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 202, 8, 11, 10, 11, 12, 11, 205, 9, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 217, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 223, 8, 14, 10, 14, 12, 14, 226, 9, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 232, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 261, 8, 15, 10, 15, 12, 15, 264, 9, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 276, 8, 17, 1, 18, 1, 18, 3, 18, 280, 8, 18, 1, 18, 1, 18, 3, 18, 284, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 295, 8, 20, 1, 21, 1, 21, 4, 21, 299, 8, 21, 11, 21, 12, 21, 300, 1, 21, 1, 21, 4, 21, 305, 8, 21, 11, 21, 12, 21, 306, 5, 21, 309, 8, 21, 10, 21, 12, 21, 312, 9, 21, 3, 21, 314, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 3, 22, 320, 8, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 327, 8, 23, 10, 23, 12, 23, 330, 9, 23, 1, 23, 5, 23, 333, 8, 23, 10, 23, 12, 23, 336, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 4, 24, 342, 8, 24, 11, 24, 12, 24, 343, 1, 24, 3, 24, 347, 8, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 358, 8, 26, 1, 27, 1, 27, 1, 27, 3, 27, 363, 8, 27, 1, 27, 3, 27, 366, 8, 27, 1, 27, 3, 27, 369, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 3, 28, 376, 8, 28, 1, 28, 5, 28, 379, 8, 28, 10, 28, 12, 28, 382, 9, 28, 1, 29, 1, 29, 1, 29, 0, 1, 30, 30, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 0, 2, 1, 0, 39, 44, 3, 0, 14, 20, 32, 34, 45, 45, 417, 0, 63, 1, 0, 0, 0, 2, 75, 1, 0, 0, 0, 4, 80, 1, 0, 0, 0, 6, 98, 1, 0, 0, 0, 8, 104, 1, 0, 0, 0, 10, 116, 1, 0, 0, 0, 12, 136, 1, 0, 0, 0, 14, 150, 1, 0, 0, 0, 16, 158, 1, 0, 0, 0, 18, 174, 1, 0, 0, 0, 20, 180, 1, 0, 0, 0, 22, 184, 1, 0, 0, 0, 24, 208, 1, 0, 0, 0, 26, 216, 1, 0, 0, 0, 28, 231, 1, 0, 0, 0, 30, 233, 1, 0, 0, 0, 32, 265, 1, 0, 0, 0, 34, 275, 1, 0, 0, 0, 36, 277, 1, 0, 0, 0, 38, 287, 1, 0, 0, 0, 40, 294, 1, 0, 0, 0, 42, 296, 1, 0, 0, 0, 44, 319, 1, 0, 0, 0, 46, 324, 1, 0, 0, 0, 48, 339, 1, 0, 0, 0, 50, 348, 1, 0, 0, 0, 52, 357, 1, 0, 0, 0, 54, 359, 1, 0, 0, 0, 56, 372, 1, 0, 0, 0, 58, 383, 1, 0, 0, 0, 60, 62, 3, 2, 1, 0, 61, 60, 1, 0, 0, 0, 62, 65, 1, 0, 0, 0, 63, 61, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 66, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, 66, 67, 5, 0, 0, 1, 67, 1, 1, 0, 0, 0, 68, 76, 3, 4, 2, 0, 69, 76, 3, 8, 4, 0, 70, 76, 3, 10, 5, 0, 71, 76, 3, 12, 6, 0, 72, 76, 3, 14, 7, 0, 73, 76, 3, 16, 8, 0, 74, 76, 5, 47, 0, 0, 75, 68, 1, 0, 0, 0, 75, 69, 1, 0, 0, 0, 75, 70, 1, 0, 0, 0, 75, 71, 1, 0, 0, 0, 75, 72, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 74, 1, 0, 0, 0, 76, 3, 1, 0, 0, 0, 77, 79, 3, 50, 25, 0, 78, 77, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 14, 0, 0, 84, 94, 3, 58, 29, 0, 85, 87, 3, 38, 19, 0, 86, 88, 3, 6, 3, 0, 87, 86, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 95, 1, 0, 0, 0, 89, 90, 5, 20, 0, 0, 90, 92, 3, 28, 14, 0, 91, 93, 3, 6, 3, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 95, 1, 0, 0, 0, 94, 85, 1, 0, 0, 0, 94, 89, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 47, 0, 0, 97, 5, 1, 0, 0, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 30, 15, 0, 100, 7, 1, 0, 0, 0, 101, 103, 3, 50, 25, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 15, 0, 0, 108, 109, 3, 58, 29, 0, 109, 110, 5, 11, 0, 0, 110, 111, 3, 30, 15, 0, 111, 112, 5, 47, 0, 0, 112, 9, 1, 0, 0, 0, 113, 115, 3, 50, 25, 0, 114, 113, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 20, 0, 0, 120, 121, 3, 58, 29, 0, 121, 123, 3, 28, 14, 0, 122, 124, 5, 27, 0, 0, 123, 122, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 129, 5, 11, 0, 0, 126, 130, 3, 20, 10, 0, 127, 130, 3, 42, 21, 0, 128, 130, 3, 22, 11, 0, 129, 126, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 129, 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 5, 47, 0, 0, 132, 11, 1, 0, 0, 0, 133, 135, 3, 50, 25, 0, 134, 133, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 139, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 140, 5, 21, 0, 0, 140, 144, 3, 58, 29, 0, 141, 145, 3, 58, 29, 0, 142, 143, 5, 20, 0, 0, 143, 145, 3, 28, 14, 0, 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 147, 5, 11, 0, 0, 147, 148, 3, 30, 15, 0, 148, 149, 5, 47, 0, 0, 149, 13, 1, 0, 0, 0, 150, 151, 5, 22, 0, 0, 151, 152, 5, 11, 0, 0, 152, 153, 3, 30, 15, 0, 153, 154, 5, 47, 0, 0, 154, 15, 1, 0, 0, 0, 155, 157, 3, 50, 25, 0, 156, 155, 1, 0, 0, 0, 157, 160, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 161, 162, 5, 23, 0, 0, 162, 169, 3, 28, 14, 0, 163, 164, 5, 24, 0, 0, 164, 168, 3, 42, 21, 0, 165, 166, 5, 25, 0, 0, 166, 168, 3, 58, 29, 0, 167, 163, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 171, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 172, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 172, 173, 5, 47, 0, 0, 173, 17, 1, 0, 0, 0, 174, 175, 5, 26, 0, 0, 175, 176, 3, 58, 29, 0, 176, 177, 5, 11, 0, 0, 177, 178, 3, 30, 15, 0, 178, 179, 5, 47, 0, 0, 179, 19, 1, 0, 0, 0, 180, 181, 5, 35, 0, 0, 181, 182, 3, 36, 18, 0, 182, 183, 3, 42, 21, 0, 183, 21, 1, 0, 0, 0, 184, 188, 5, 4, 0, 0, 185, 187, 5, 47, 0, 0, 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 191, 194, 5, 36, 0, 0, 192, 195, 3, 58, 29, 0, 193, 195, 3, 24, 12, 0, 194, 192, 1, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 197, 5, 37, 0, 0, 197, 198, 3, 30, 15, 0, 198, 199, 5, 10, 0, 0, 199, 203, 3, 26, 13, 0, 200, 202, 5, 47, 0, 0, 201, 200, 1, 0, 0, 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 206, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 207, 5, 5, 0, 0, 207, 23, 1, 0, 0, 0, 208, 209, 5, 6, 0, 0, 209, 210, 3, 58, 29, 0, 210, 211, 5, 3, 0, 0, 211, 212, 3, 58, 29, 0, 212, 213, 5, 7, 0, 0, 213, 25, 1, 0, 0, 0, 214, 217, 3, 30, 15, 0, 215, 217, 3, 20, 10, 0, 216, 214, 1, 0, 0, 0, 216, 215, 1, 0, 0, 0, 217, 27, 1, 0, 0, 0, 218, 224, 5, 28, 0, 0, 219, 220, 3, 30, 15, 0, 220, 221, 5, 29, 0, 0, 221, 223, 1, 0, 0, 0, 222, 219, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 227, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 228, 3, 30, 15, 0, 228, 229, 5, 30, 0, 0, 229, 232, 1, 0, 0, 0, 230, 232, 5, 31, 0, 0, 231, 218, 1, 0, 0, 0, 231, 230, 1, 0, 0, 0, 232, 29, 1, 0, 0, 0, 233, 234, 6, 15, -1, 0, 234, 235, 3, 34, 17, 0, 235, 262, 1, 0, 0, 0, 236, 237, 10, 6, 0, 0, 237, 238, 5, 38, 0, 0, 238, 239, 3, 30, 15, 0, 239, 240, 5, 10, 0, 0, 240, 241, 3, 30, 15, 7, 241, 261, 1, 0, 0, 0, 242, 243, 10, 2, 0, 0, 243, 244, 3, 32, 16, 0, 244, 245, 3, 30, 15, 3, 245, 261, 1, 0, 0, 0, 246, 247, 10, 7, 0, 0, 247, 248, 5, 4, 0, 0, 248, 249, 3, 30, 15, 0, 249, 250, 5, 5, 0, 0, 250, 261, 1, 0, 0, 0, 251, 252, 10, 5, 0, 0, 252, 253, 5, 8, 0, 0, 253, 261, 3, 58, 29, 0, 254, 255, 10, 4, 0, 0, 255, 256, 5, 8, 0, 0, 256, 261, 3, 54, 27, 0, 257, 258, 10, 3, 0, 0, 258, 259, 5, 10, 0, 0, 259, 261, 3, 58, 29, 0, 260, 236, 1, 0, 0, 0, 260, 242, 1, 0, 0, 0, 260, 246, 1, 0, 0, 0, 260, 251, 1, 0, 0, 0, 260, 254, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 31, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 7, 0, 0, 0, 266, 33, 1, 0, 0, 0, 267, 276, 3, 40, 20, 0, 268, 276, 3, 54, 27, 0, 269, 276, 3, 28, 14, 0, 270, 276, 5, 1, 0, 0, 271, 276, 3, 46, 23, 0, 272, 276, 3, 42, 21, 0, 273, 276, 3, 22, 11, 0, 274, 276, 3, 36, 18, 0, 275, 267, 1, 0, 0, 0, 275, 268, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, 270, 1, 0, 0, 0, 275, 271, 1, 0, 0, 0, 275, 272, 1, 0, 0, 0, 275, 273, 1, 0, 0, 0, 275, 274, 1, 0, 0, 0, 276, 35, 1, 0, 0, 0, 277, 279, 5, 6, 0, 0, 278, 280, 5, 47, 0, 0, 279, 278, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 283, 3, 30, 15, 0, 282, 284, 5, 47, 0, 0, 283, 282, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 286, 5, 7, 0, 0, 286, 37, 1, 0, 0, 0, 287, 288, 3, 58, 29, 0, 288, 39, 1, 0, 0, 0, 289, 295, 5, 46, 0, 0, 290, 295, 5, 16, 0, 0, 291, 295, 5, 17, 0, 0, 292, 295, 5, 18, 0, 0, 293, 295, 3, 58, 29, 0, 294, 289, 1, 0, 0, 0, 294, 290, 1, 0, 0, 0, 294, 291, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 293, 1, 0, 0, 0, 295, 41, 1, 0, 0, 0, 296, 313, 5, 12, 0, 0, 297, 299, 5, 47, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 310, 1, 0, 0, 0, 302, 304, 3, 44, 22, 0, 303, 305, 5, 47, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 302, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 298, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 316, 5, 13, 0, 0, 316, 43, 1, 0, 0, 0, 317, 320, 3, 58, 29, 0, 318, 320, 3, 28, 14, 0, 319, 317, 1, 0, 0, 0, 319, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 10, 0, 0, 322, 323, 3, 30, 15, 0, 323, 45, 1, 0, 0, 0, 324, 328, 5, 4, 0, 0, 325, 327, 5, 47, 0, 0, 326, 325, 1, 0, 0, 0, 327, 330, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 334, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 331, 333, 3, 48, 24, 0, 332, 331, 1, 0, 0, 0, 333, 336, 1, 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337, 338, 5, 5, 0, 0, 338, 47, 1, 0, 0, 0, 339, 346, 3, 30, 15, 0, 340, 342, 5, 47, 0, 0, 341, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 347, 1, 0, 0, 0, 345, 347, 5, 3, 0, 0, 346, 341, 1, 0, 0, 0, 346, 345, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 49, 1, 0, 0, 0, 348, 349, 5, 2, 0, 0, 349, 350, 3, 52, 26, 0, 350, 351, 5, 47, 0, 0, 351, 51, 1, 0, 0, 0, 352, 358, 3, 54, 27, 0, 353, 354, 3, 30, 15, 0, 354, 355, 5, 8, 0, 0, 355, 356, 3, 54, 27, 0, 356, 358, 1, 0, 0, 0, 357, 352, 1, 0, 0, 0, 357, 353, 1, 0, 0, 0, 358, 53, 1, 0, 0, 0, 359, 360, 3, 58, 29, 0, 360, 365, 5, 6, 0, 0, 361, 363, 5, 47, 0, 0, 362, 361, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 366, 3, 56, 28, 0, 365, 362, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 369, 5, 47, 0, 0, 368, 367, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 371, 5, 7, 0, 0, 371, 55, 1, 0, 0, 0, 372, 380, 3, 30, 15, 0, 373, 375, 5, 3, 0, 0, 374, 376, 5, 47, 0, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 379, 3, 30, 15, 0, 378, 373, 1, 0, 0, 0, 379, 382, 1, 0, 0, 0, 380, 378, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 57, 1, 0, 0, 0, 382, 380, 1, 0, 0, 0, 383, 384, 7, 1, 0, 0, 384, 59, 1, 0, 0, 0, 42, 63, 75, 80, 87, 92, 94, 104, 116, 123, 129, 136, 144, 158, 167, 169, 188, 194, 203, 216, 224, 231, 260, 262, 275, 279, 283, 294, 300, 306, 310, 313, 319, 328, 334, 343, 346, 357, 362, 365, 368, 375, 380] \ No newline at end of file +[4, 1, 52, 386, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 1, 0, 5, 0, 62, 8, 0, 10, 0, 12, 0, 65, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 76, 8, 1, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 88, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 93, 8, 2, 3, 2, 95, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 103, 8, 4, 10, 4, 12, 4, 106, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 115, 8, 5, 10, 5, 12, 5, 118, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 124, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 130, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 135, 8, 6, 10, 6, 12, 6, 138, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 145, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 157, 8, 8, 10, 8, 12, 8, 160, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 168, 8, 8, 10, 8, 12, 8, 171, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 5, 11, 187, 8, 11, 10, 11, 12, 11, 190, 9, 11, 1, 11, 1, 11, 1, 11, 3, 11, 195, 8, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 202, 8, 11, 10, 11, 12, 11, 205, 9, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 217, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 223, 8, 14, 10, 14, 12, 14, 226, 9, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 232, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 261, 8, 15, 10, 15, 12, 15, 264, 9, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 276, 8, 17, 1, 18, 1, 18, 3, 18, 280, 8, 18, 1, 18, 1, 18, 3, 18, 284, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 295, 8, 20, 1, 21, 1, 21, 4, 21, 299, 8, 21, 11, 21, 12, 21, 300, 1, 21, 1, 21, 4, 21, 305, 8, 21, 11, 21, 12, 21, 306, 5, 21, 309, 8, 21, 10, 21, 12, 21, 312, 9, 21, 3, 21, 314, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 3, 22, 320, 8, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 327, 8, 23, 10, 23, 12, 23, 330, 9, 23, 1, 23, 5, 23, 333, 8, 23, 10, 23, 12, 23, 336, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 4, 24, 342, 8, 24, 11, 24, 12, 24, 343, 1, 24, 3, 24, 347, 8, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 358, 8, 26, 1, 27, 1, 27, 1, 27, 3, 27, 363, 8, 27, 1, 27, 3, 27, 366, 8, 27, 1, 27, 3, 27, 369, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 3, 28, 376, 8, 28, 1, 28, 5, 28, 379, 8, 28, 10, 28, 12, 28, 382, 9, 28, 1, 29, 1, 29, 1, 29, 0, 1, 30, 30, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 0, 2, 1, 0, 40, 45, 3, 0, 14, 28, 33, 38, 46, 46, 417, 0, 63, 1, 0, 0, 0, 2, 75, 1, 0, 0, 0, 4, 80, 1, 0, 0, 0, 6, 98, 1, 0, 0, 0, 8, 104, 1, 0, 0, 0, 10, 116, 1, 0, 0, 0, 12, 136, 1, 0, 0, 0, 14, 150, 1, 0, 0, 0, 16, 158, 1, 0, 0, 0, 18, 174, 1, 0, 0, 0, 20, 180, 1, 0, 0, 0, 22, 184, 1, 0, 0, 0, 24, 208, 1, 0, 0, 0, 26, 216, 1, 0, 0, 0, 28, 231, 1, 0, 0, 0, 30, 233, 1, 0, 0, 0, 32, 265, 1, 0, 0, 0, 34, 275, 1, 0, 0, 0, 36, 277, 1, 0, 0, 0, 38, 287, 1, 0, 0, 0, 40, 294, 1, 0, 0, 0, 42, 296, 1, 0, 0, 0, 44, 319, 1, 0, 0, 0, 46, 324, 1, 0, 0, 0, 48, 339, 1, 0, 0, 0, 50, 348, 1, 0, 0, 0, 52, 357, 1, 0, 0, 0, 54, 359, 1, 0, 0, 0, 56, 372, 1, 0, 0, 0, 58, 383, 1, 0, 0, 0, 60, 62, 3, 2, 1, 0, 61, 60, 1, 0, 0, 0, 62, 65, 1, 0, 0, 0, 63, 61, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 66, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, 66, 67, 5, 0, 0, 1, 67, 1, 1, 0, 0, 0, 68, 76, 3, 4, 2, 0, 69, 76, 3, 8, 4, 0, 70, 76, 3, 10, 5, 0, 71, 76, 3, 12, 6, 0, 72, 76, 3, 14, 7, 0, 73, 76, 3, 16, 8, 0, 74, 76, 5, 48, 0, 0, 75, 68, 1, 0, 0, 0, 75, 69, 1, 0, 0, 0, 75, 70, 1, 0, 0, 0, 75, 71, 1, 0, 0, 0, 75, 72, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 74, 1, 0, 0, 0, 76, 3, 1, 0, 0, 0, 77, 79, 3, 50, 25, 0, 78, 77, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 14, 0, 0, 84, 94, 3, 58, 29, 0, 85, 87, 3, 38, 19, 0, 86, 88, 3, 6, 3, 0, 87, 86, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 95, 1, 0, 0, 0, 89, 90, 5, 21, 0, 0, 90, 92, 3, 28, 14, 0, 91, 93, 3, 6, 3, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 95, 1, 0, 0, 0, 94, 85, 1, 0, 0, 0, 94, 89, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 48, 0, 0, 97, 5, 1, 0, 0, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 30, 15, 0, 100, 7, 1, 0, 0, 0, 101, 103, 3, 50, 25, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 15, 0, 0, 108, 109, 3, 58, 29, 0, 109, 110, 5, 11, 0, 0, 110, 111, 3, 30, 15, 0, 111, 112, 5, 48, 0, 0, 112, 9, 1, 0, 0, 0, 113, 115, 3, 50, 25, 0, 114, 113, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 21, 0, 0, 120, 121, 3, 58, 29, 0, 121, 123, 3, 28, 14, 0, 122, 124, 5, 28, 0, 0, 123, 122, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 129, 5, 11, 0, 0, 126, 130, 3, 20, 10, 0, 127, 130, 3, 42, 21, 0, 128, 130, 3, 22, 11, 0, 129, 126, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 129, 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 5, 48, 0, 0, 132, 11, 1, 0, 0, 0, 133, 135, 3, 50, 25, 0, 134, 133, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 139, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 140, 5, 22, 0, 0, 140, 144, 3, 58, 29, 0, 141, 145, 3, 58, 29, 0, 142, 143, 5, 21, 0, 0, 143, 145, 3, 28, 14, 0, 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 147, 5, 11, 0, 0, 147, 148, 3, 30, 15, 0, 148, 149, 5, 48, 0, 0, 149, 13, 1, 0, 0, 0, 150, 151, 5, 23, 0, 0, 151, 152, 5, 11, 0, 0, 152, 153, 3, 30, 15, 0, 153, 154, 5, 48, 0, 0, 154, 15, 1, 0, 0, 0, 155, 157, 3, 50, 25, 0, 156, 155, 1, 0, 0, 0, 157, 160, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 161, 162, 5, 24, 0, 0, 162, 169, 3, 28, 14, 0, 163, 164, 5, 25, 0, 0, 164, 168, 3, 42, 21, 0, 165, 166, 5, 26, 0, 0, 166, 168, 3, 58, 29, 0, 167, 163, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 171, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 172, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 172, 173, 5, 48, 0, 0, 173, 17, 1, 0, 0, 0, 174, 175, 5, 27, 0, 0, 175, 176, 3, 58, 29, 0, 176, 177, 5, 11, 0, 0, 177, 178, 3, 30, 15, 0, 178, 179, 5, 48, 0, 0, 179, 19, 1, 0, 0, 0, 180, 181, 5, 36, 0, 0, 181, 182, 3, 36, 18, 0, 182, 183, 3, 42, 21, 0, 183, 21, 1, 0, 0, 0, 184, 188, 5, 4, 0, 0, 185, 187, 5, 48, 0, 0, 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 191, 194, 5, 37, 0, 0, 192, 195, 3, 58, 29, 0, 193, 195, 3, 24, 12, 0, 194, 192, 1, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 197, 5, 38, 0, 0, 197, 198, 3, 30, 15, 0, 198, 199, 5, 10, 0, 0, 199, 203, 3, 26, 13, 0, 200, 202, 5, 48, 0, 0, 201, 200, 1, 0, 0, 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 206, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 207, 5, 5, 0, 0, 207, 23, 1, 0, 0, 0, 208, 209, 5, 6, 0, 0, 209, 210, 3, 58, 29, 0, 210, 211, 5, 3, 0, 0, 211, 212, 3, 58, 29, 0, 212, 213, 5, 7, 0, 0, 213, 25, 1, 0, 0, 0, 214, 217, 3, 30, 15, 0, 215, 217, 3, 20, 10, 0, 216, 214, 1, 0, 0, 0, 216, 215, 1, 0, 0, 0, 217, 27, 1, 0, 0, 0, 218, 224, 5, 29, 0, 0, 219, 220, 3, 30, 15, 0, 220, 221, 5, 30, 0, 0, 221, 223, 1, 0, 0, 0, 222, 219, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 227, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 228, 3, 30, 15, 0, 228, 229, 5, 31, 0, 0, 229, 232, 1, 0, 0, 0, 230, 232, 5, 32, 0, 0, 231, 218, 1, 0, 0, 0, 231, 230, 1, 0, 0, 0, 232, 29, 1, 0, 0, 0, 233, 234, 6, 15, -1, 0, 234, 235, 3, 34, 17, 0, 235, 262, 1, 0, 0, 0, 236, 237, 10, 6, 0, 0, 237, 238, 5, 39, 0, 0, 238, 239, 3, 30, 15, 0, 239, 240, 5, 10, 0, 0, 240, 241, 3, 30, 15, 7, 241, 261, 1, 0, 0, 0, 242, 243, 10, 2, 0, 0, 243, 244, 3, 32, 16, 0, 244, 245, 3, 30, 15, 3, 245, 261, 1, 0, 0, 0, 246, 247, 10, 7, 0, 0, 247, 248, 5, 4, 0, 0, 248, 249, 3, 30, 15, 0, 249, 250, 5, 5, 0, 0, 250, 261, 1, 0, 0, 0, 251, 252, 10, 5, 0, 0, 252, 253, 5, 8, 0, 0, 253, 261, 3, 58, 29, 0, 254, 255, 10, 4, 0, 0, 255, 256, 5, 8, 0, 0, 256, 261, 3, 54, 27, 0, 257, 258, 10, 3, 0, 0, 258, 259, 5, 10, 0, 0, 259, 261, 3, 58, 29, 0, 260, 236, 1, 0, 0, 0, 260, 242, 1, 0, 0, 0, 260, 246, 1, 0, 0, 0, 260, 251, 1, 0, 0, 0, 260, 254, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 31, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 7, 0, 0, 0, 266, 33, 1, 0, 0, 0, 267, 276, 3, 40, 20, 0, 268, 276, 3, 54, 27, 0, 269, 276, 3, 28, 14, 0, 270, 276, 5, 1, 0, 0, 271, 276, 3, 46, 23, 0, 272, 276, 3, 42, 21, 0, 273, 276, 3, 22, 11, 0, 274, 276, 3, 36, 18, 0, 275, 267, 1, 0, 0, 0, 275, 268, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, 270, 1, 0, 0, 0, 275, 271, 1, 0, 0, 0, 275, 272, 1, 0, 0, 0, 275, 273, 1, 0, 0, 0, 275, 274, 1, 0, 0, 0, 276, 35, 1, 0, 0, 0, 277, 279, 5, 6, 0, 0, 278, 280, 5, 48, 0, 0, 279, 278, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 283, 3, 30, 15, 0, 282, 284, 5, 48, 0, 0, 283, 282, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 286, 5, 7, 0, 0, 286, 37, 1, 0, 0, 0, 287, 288, 3, 58, 29, 0, 288, 39, 1, 0, 0, 0, 289, 295, 5, 47, 0, 0, 290, 295, 5, 16, 0, 0, 291, 295, 5, 17, 0, 0, 292, 295, 5, 18, 0, 0, 293, 295, 3, 58, 29, 0, 294, 289, 1, 0, 0, 0, 294, 290, 1, 0, 0, 0, 294, 291, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 293, 1, 0, 0, 0, 295, 41, 1, 0, 0, 0, 296, 313, 5, 12, 0, 0, 297, 299, 5, 48, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 310, 1, 0, 0, 0, 302, 304, 3, 44, 22, 0, 303, 305, 5, 48, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 302, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 298, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 316, 5, 13, 0, 0, 316, 43, 1, 0, 0, 0, 317, 320, 3, 58, 29, 0, 318, 320, 3, 28, 14, 0, 319, 317, 1, 0, 0, 0, 319, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 10, 0, 0, 322, 323, 3, 30, 15, 0, 323, 45, 1, 0, 0, 0, 324, 328, 5, 4, 0, 0, 325, 327, 5, 48, 0, 0, 326, 325, 1, 0, 0, 0, 327, 330, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 334, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 331, 333, 3, 48, 24, 0, 332, 331, 1, 0, 0, 0, 333, 336, 1, 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337, 338, 5, 5, 0, 0, 338, 47, 1, 0, 0, 0, 339, 346, 3, 30, 15, 0, 340, 342, 5, 48, 0, 0, 341, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 347, 1, 0, 0, 0, 345, 347, 5, 3, 0, 0, 346, 341, 1, 0, 0, 0, 346, 345, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 49, 1, 0, 0, 0, 348, 349, 5, 2, 0, 0, 349, 350, 3, 52, 26, 0, 350, 351, 5, 48, 0, 0, 351, 51, 1, 0, 0, 0, 352, 358, 3, 54, 27, 0, 353, 354, 3, 30, 15, 0, 354, 355, 5, 8, 0, 0, 355, 356, 3, 54, 27, 0, 356, 358, 1, 0, 0, 0, 357, 352, 1, 0, 0, 0, 357, 353, 1, 0, 0, 0, 358, 53, 1, 0, 0, 0, 359, 360, 3, 58, 29, 0, 360, 365, 5, 6, 0, 0, 361, 363, 5, 48, 0, 0, 362, 361, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 366, 3, 56, 28, 0, 365, 362, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 369, 5, 48, 0, 0, 368, 367, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 371, 5, 7, 0, 0, 371, 55, 1, 0, 0, 0, 372, 380, 3, 30, 15, 0, 373, 375, 5, 3, 0, 0, 374, 376, 5, 48, 0, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 379, 3, 30, 15, 0, 378, 373, 1, 0, 0, 0, 379, 382, 1, 0, 0, 0, 380, 378, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 57, 1, 0, 0, 0, 382, 380, 1, 0, 0, 0, 383, 384, 7, 1, 0, 0, 384, 59, 1, 0, 0, 0, 42, 63, 75, 80, 87, 92, 94, 104, 116, 123, 129, 136, 144, 158, 167, 169, 188, 194, 203, 216, 224, 231, 260, 262, 275, 279, 283, 294, 300, 306, 310, 313, 319, 328, 334, 343, 346, 357, 362, 365, 368, 375, 380] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep.tokens b/pkg/parser/bicep/antlr/parser/bicep.tokens index 91c8fff887c..ec33a639e52 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.tokens +++ b/pkg/parser/bicep/antlr/parser/bicep.tokens @@ -16,39 +16,40 @@ VAR=15 TRUE=16 FALSE=17 NULL=18 -OBJECT=19 -RESOURCE=20 -OUTPUT=21 -TARGET_SCOPE=22 -IMPORT=23 -WITH=24 -AS=25 -METADATA=26 -EXISTING=27 -STRING_LEFT_PIECE=28 -STRING_MIDDLE_PIECE=29 -STRING_RIGHT_PIECE=30 -STRING_COMPLETE=31 -STRING=32 -INT=33 -BOOL=34 -IF=35 -FOR=36 -IN=37 -QMARK=38 -GT=39 -GTE=40 -LT=41 -LTE=42 -EQ=43 -NEQ=44 -IDENTIFIER=45 -NUMBER=46 -NL=47 -SINGLE_LINE_COMMENT=48 -MULTI_LINE_COMMENT=49 -SPACES=50 -UNKNOWN=51 +ARRAY=19 +OBJECT=20 +RESOURCE=21 +OUTPUT=22 +TARGET_SCOPE=23 +IMPORT=24 +WITH=25 +AS=26 +METADATA=27 +EXISTING=28 +STRING_LEFT_PIECE=29 +STRING_MIDDLE_PIECE=30 +STRING_RIGHT_PIECE=31 +STRING_COMPLETE=32 +STRING=33 +INT=34 +BOOL=35 +IF=36 +FOR=37 +IN=38 +QMARK=39 +GT=40 +GTE=41 +LT=42 +LTE=43 +EQ=44 +NEQ=45 +IDENTIFIER=46 +NUMBER=47 +NL=48 +SINGLE_LINE_COMMENT=49 +MULTI_LINE_COMMENT=50 +SPACES=51 +UNKNOWN=52 '@'=2 ','=3 '['=4 @@ -65,25 +66,26 @@ UNKNOWN=51 'true'=16 'false'=17 'null'=18 -'object'=19 -'resource'=20 -'output'=21 -'targetScope'=22 -'import'=23 -'with'=24 -'as'=25 -'metadata'=26 -'existing'=27 -'string'=32 -'int'=33 -'bool'=34 -'if'=35 -'for'=36 -'in'=37 -'?'=38 -'>'=39 -'>='=40 -'<'=41 -'<='=42 -'=='=43 -'!='=44 +'array'=19 +'object'=20 +'resource'=21 +'output'=22 +'targetScope'=23 +'import'=24 +'with'=25 +'as'=26 +'metadata'=27 +'existing'=28 +'string'=33 +'int'=34 +'bool'=35 +'if'=36 +'for'=37 +'in'=38 +'?'=39 +'>'=40 +'>='=41 +'<'=42 +'<='=43 +'=='=44 +'!='=45 diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.interp b/pkg/parser/bicep/antlr/parser/bicepLexer.interp index 9173826e9f5..b05aacb688d 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.interp +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.interp @@ -18,6 +18,7 @@ null 'true' 'false' 'null' +'array' 'object' 'resource' 'output' @@ -72,6 +73,7 @@ VAR TRUE FALSE NULL +ARRAY OBJECT RESOURCE OUTPUT @@ -125,6 +127,7 @@ VAR TRUE FALSE NULL +ARRAY OBJECT RESOURCE OUTPUT @@ -170,4 +173,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 51, 405, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 115, 8, 0, 10, 0, 12, 0, 118, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 143, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 5, 27, 247, 8, 27, 10, 27, 12, 27, 250, 9, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 5, 28, 257, 8, 28, 10, 28, 12, 28, 260, 9, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 5, 29, 267, 8, 29, 10, 29, 12, 29, 270, 9, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 276, 8, 30, 10, 30, 12, 30, 279, 9, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 5, 44, 329, 8, 44, 10, 44, 12, 44, 332, 9, 44, 1, 45, 4, 45, 335, 8, 45, 11, 45, 12, 45, 336, 1, 45, 1, 45, 4, 45, 341, 8, 45, 11, 45, 12, 45, 342, 3, 45, 345, 8, 45, 1, 46, 4, 46, 348, 8, 46, 11, 46, 12, 46, 349, 1, 47, 1, 47, 1, 47, 1, 47, 5, 47, 356, 8, 47, 10, 47, 12, 47, 359, 9, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 367, 8, 48, 10, 48, 12, 48, 370, 9, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 4, 49, 378, 8, 49, 11, 49, 12, 49, 379, 1, 49, 1, 49, 1, 50, 1, 50, 1, 51, 1, 51, 3, 51, 388, 8, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 4, 52, 396, 8, 52, 11, 52, 12, 52, 397, 1, 52, 1, 52, 3, 52, 402, 8, 52, 1, 53, 1, 53, 2, 116, 368, 0, 54, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 0, 105, 0, 107, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 418, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 1, 109, 1, 0, 0, 0, 3, 123, 1, 0, 0, 0, 5, 125, 1, 0, 0, 0, 7, 127, 1, 0, 0, 0, 9, 129, 1, 0, 0, 0, 11, 131, 1, 0, 0, 0, 13, 133, 1, 0, 0, 0, 15, 135, 1, 0, 0, 0, 17, 137, 1, 0, 0, 0, 19, 142, 1, 0, 0, 0, 21, 144, 1, 0, 0, 0, 23, 146, 1, 0, 0, 0, 25, 148, 1, 0, 0, 0, 27, 150, 1, 0, 0, 0, 29, 156, 1, 0, 0, 0, 31, 160, 1, 0, 0, 0, 33, 165, 1, 0, 0, 0, 35, 171, 1, 0, 0, 0, 37, 176, 1, 0, 0, 0, 39, 183, 1, 0, 0, 0, 41, 192, 1, 0, 0, 0, 43, 199, 1, 0, 0, 0, 45, 211, 1, 0, 0, 0, 47, 218, 1, 0, 0, 0, 49, 223, 1, 0, 0, 0, 51, 226, 1, 0, 0, 0, 53, 235, 1, 0, 0, 0, 55, 244, 1, 0, 0, 0, 57, 254, 1, 0, 0, 0, 59, 264, 1, 0, 0, 0, 61, 273, 1, 0, 0, 0, 63, 282, 1, 0, 0, 0, 65, 289, 1, 0, 0, 0, 67, 293, 1, 0, 0, 0, 69, 298, 1, 0, 0, 0, 71, 301, 1, 0, 0, 0, 73, 305, 1, 0, 0, 0, 75, 308, 1, 0, 0, 0, 77, 310, 1, 0, 0, 0, 79, 312, 1, 0, 0, 0, 81, 315, 1, 0, 0, 0, 83, 317, 1, 0, 0, 0, 85, 320, 1, 0, 0, 0, 87, 323, 1, 0, 0, 0, 89, 326, 1, 0, 0, 0, 91, 334, 1, 0, 0, 0, 93, 347, 1, 0, 0, 0, 95, 351, 1, 0, 0, 0, 97, 362, 1, 0, 0, 0, 99, 377, 1, 0, 0, 0, 101, 383, 1, 0, 0, 0, 103, 387, 1, 0, 0, 0, 105, 389, 1, 0, 0, 0, 107, 403, 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, 5, 39, 0, 0, 111, 112, 5, 39, 0, 0, 112, 116, 1, 0, 0, 0, 113, 115, 9, 0, 0, 0, 114, 113, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 39, 0, 0, 120, 121, 5, 39, 0, 0, 121, 122, 5, 39, 0, 0, 122, 2, 1, 0, 0, 0, 123, 124, 5, 64, 0, 0, 124, 4, 1, 0, 0, 0, 125, 126, 5, 44, 0, 0, 126, 6, 1, 0, 0, 0, 127, 128, 5, 91, 0, 0, 128, 8, 1, 0, 0, 0, 129, 130, 5, 93, 0, 0, 130, 10, 1, 0, 0, 0, 131, 132, 5, 40, 0, 0, 132, 12, 1, 0, 0, 0, 133, 134, 5, 41, 0, 0, 134, 14, 1, 0, 0, 0, 135, 136, 5, 46, 0, 0, 136, 16, 1, 0, 0, 0, 137, 138, 5, 124, 0, 0, 138, 18, 1, 0, 0, 0, 139, 143, 5, 58, 0, 0, 140, 141, 5, 58, 0, 0, 141, 143, 5, 58, 0, 0, 142, 139, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 143, 20, 1, 0, 0, 0, 144, 145, 5, 61, 0, 0, 145, 22, 1, 0, 0, 0, 146, 147, 5, 123, 0, 0, 147, 24, 1, 0, 0, 0, 148, 149, 5, 125, 0, 0, 149, 26, 1, 0, 0, 0, 150, 151, 5, 112, 0, 0, 151, 152, 5, 97, 0, 0, 152, 153, 5, 114, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 109, 0, 0, 155, 28, 1, 0, 0, 0, 156, 157, 5, 118, 0, 0, 157, 158, 5, 97, 0, 0, 158, 159, 5, 114, 0, 0, 159, 30, 1, 0, 0, 0, 160, 161, 5, 116, 0, 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 117, 0, 0, 163, 164, 5, 101, 0, 0, 164, 32, 1, 0, 0, 0, 165, 166, 5, 102, 0, 0, 166, 167, 5, 97, 0, 0, 167, 168, 5, 108, 0, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 101, 0, 0, 170, 34, 1, 0, 0, 0, 171, 172, 5, 110, 0, 0, 172, 173, 5, 117, 0, 0, 173, 174, 5, 108, 0, 0, 174, 175, 5, 108, 0, 0, 175, 36, 1, 0, 0, 0, 176, 177, 5, 111, 0, 0, 177, 178, 5, 98, 0, 0, 178, 179, 5, 106, 0, 0, 179, 180, 5, 101, 0, 0, 180, 181, 5, 99, 0, 0, 181, 182, 5, 116, 0, 0, 182, 38, 1, 0, 0, 0, 183, 184, 5, 114, 0, 0, 184, 185, 5, 101, 0, 0, 185, 186, 5, 115, 0, 0, 186, 187, 5, 111, 0, 0, 187, 188, 5, 117, 0, 0, 188, 189, 5, 114, 0, 0, 189, 190, 5, 99, 0, 0, 190, 191, 5, 101, 0, 0, 191, 40, 1, 0, 0, 0, 192, 193, 5, 111, 0, 0, 193, 194, 5, 117, 0, 0, 194, 195, 5, 116, 0, 0, 195, 196, 5, 112, 0, 0, 196, 197, 5, 117, 0, 0, 197, 198, 5, 116, 0, 0, 198, 42, 1, 0, 0, 0, 199, 200, 5, 116, 0, 0, 200, 201, 5, 97, 0, 0, 201, 202, 5, 114, 0, 0, 202, 203, 5, 103, 0, 0, 203, 204, 5, 101, 0, 0, 204, 205, 5, 116, 0, 0, 205, 206, 5, 83, 0, 0, 206, 207, 5, 99, 0, 0, 207, 208, 5, 111, 0, 0, 208, 209, 5, 112, 0, 0, 209, 210, 5, 101, 0, 0, 210, 44, 1, 0, 0, 0, 211, 212, 5, 105, 0, 0, 212, 213, 5, 109, 0, 0, 213, 214, 5, 112, 0, 0, 214, 215, 5, 111, 0, 0, 215, 216, 5, 114, 0, 0, 216, 217, 5, 116, 0, 0, 217, 46, 1, 0, 0, 0, 218, 219, 5, 119, 0, 0, 219, 220, 5, 105, 0, 0, 220, 221, 5, 116, 0, 0, 221, 222, 5, 104, 0, 0, 222, 48, 1, 0, 0, 0, 223, 224, 5, 97, 0, 0, 224, 225, 5, 115, 0, 0, 225, 50, 1, 0, 0, 0, 226, 227, 5, 109, 0, 0, 227, 228, 5, 101, 0, 0, 228, 229, 5, 116, 0, 0, 229, 230, 5, 97, 0, 0, 230, 231, 5, 100, 0, 0, 231, 232, 5, 97, 0, 0, 232, 233, 5, 116, 0, 0, 233, 234, 5, 97, 0, 0, 234, 52, 1, 0, 0, 0, 235, 236, 5, 101, 0, 0, 236, 237, 5, 120, 0, 0, 237, 238, 5, 105, 0, 0, 238, 239, 5, 115, 0, 0, 239, 240, 5, 116, 0, 0, 240, 241, 5, 105, 0, 0, 241, 242, 5, 110, 0, 0, 242, 243, 5, 103, 0, 0, 243, 54, 1, 0, 0, 0, 244, 248, 5, 39, 0, 0, 245, 247, 3, 103, 51, 0, 246, 245, 1, 0, 0, 0, 247, 250, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 251, 252, 5, 36, 0, 0, 252, 253, 5, 123, 0, 0, 253, 56, 1, 0, 0, 0, 254, 258, 5, 125, 0, 0, 255, 257, 3, 103, 51, 0, 256, 255, 1, 0, 0, 0, 257, 260, 1, 0, 0, 0, 258, 256, 1, 0, 0, 0, 258, 259, 1, 0, 0, 0, 259, 261, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 261, 262, 5, 36, 0, 0, 262, 263, 5, 123, 0, 0, 263, 58, 1, 0, 0, 0, 264, 268, 5, 125, 0, 0, 265, 267, 3, 103, 51, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 271, 272, 5, 39, 0, 0, 272, 60, 1, 0, 0, 0, 273, 277, 5, 39, 0, 0, 274, 276, 3, 103, 51, 0, 275, 274, 1, 0, 0, 0, 276, 279, 1, 0, 0, 0, 277, 275, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 280, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 280, 281, 5, 39, 0, 0, 281, 62, 1, 0, 0, 0, 282, 283, 5, 115, 0, 0, 283, 284, 5, 116, 0, 0, 284, 285, 5, 114, 0, 0, 285, 286, 5, 105, 0, 0, 286, 287, 5, 110, 0, 0, 287, 288, 5, 103, 0, 0, 288, 64, 1, 0, 0, 0, 289, 290, 5, 105, 0, 0, 290, 291, 5, 110, 0, 0, 291, 292, 5, 116, 0, 0, 292, 66, 1, 0, 0, 0, 293, 294, 5, 98, 0, 0, 294, 295, 5, 111, 0, 0, 295, 296, 5, 111, 0, 0, 296, 297, 5, 108, 0, 0, 297, 68, 1, 0, 0, 0, 298, 299, 5, 105, 0, 0, 299, 300, 5, 102, 0, 0, 300, 70, 1, 0, 0, 0, 301, 302, 5, 102, 0, 0, 302, 303, 5, 111, 0, 0, 303, 304, 5, 114, 0, 0, 304, 72, 1, 0, 0, 0, 305, 306, 5, 105, 0, 0, 306, 307, 5, 110, 0, 0, 307, 74, 1, 0, 0, 0, 308, 309, 5, 63, 0, 0, 309, 76, 1, 0, 0, 0, 310, 311, 5, 62, 0, 0, 311, 78, 1, 0, 0, 0, 312, 313, 5, 62, 0, 0, 313, 314, 5, 61, 0, 0, 314, 80, 1, 0, 0, 0, 315, 316, 5, 60, 0, 0, 316, 82, 1, 0, 0, 0, 317, 318, 5, 60, 0, 0, 318, 319, 5, 61, 0, 0, 319, 84, 1, 0, 0, 0, 320, 321, 5, 61, 0, 0, 321, 322, 5, 61, 0, 0, 322, 86, 1, 0, 0, 0, 323, 324, 5, 33, 0, 0, 324, 325, 5, 61, 0, 0, 325, 88, 1, 0, 0, 0, 326, 330, 7, 0, 0, 0, 327, 329, 7, 1, 0, 0, 328, 327, 1, 0, 0, 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 90, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 335, 7, 2, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 344, 1, 0, 0, 0, 338, 340, 5, 46, 0, 0, 339, 341, 7, 2, 0, 0, 340, 339, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 345, 1, 0, 0, 0, 344, 338, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 92, 1, 0, 0, 0, 346, 348, 7, 3, 0, 0, 347, 346, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 94, 1, 0, 0, 0, 351, 352, 5, 47, 0, 0, 352, 353, 5, 47, 0, 0, 353, 357, 1, 0, 0, 0, 354, 356, 8, 3, 0, 0, 355, 354, 1, 0, 0, 0, 356, 359, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 360, 1, 0, 0, 0, 359, 357, 1, 0, 0, 0, 360, 361, 6, 47, 0, 0, 361, 96, 1, 0, 0, 0, 362, 363, 5, 47, 0, 0, 363, 364, 5, 42, 0, 0, 364, 368, 1, 0, 0, 0, 365, 367, 9, 0, 0, 0, 366, 365, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 368, 366, 1, 0, 0, 0, 369, 371, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 371, 372, 5, 42, 0, 0, 372, 373, 5, 47, 0, 0, 373, 374, 1, 0, 0, 0, 374, 375, 6, 48, 0, 0, 375, 98, 1, 0, 0, 0, 376, 378, 7, 4, 0, 0, 377, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 382, 6, 49, 0, 0, 382, 100, 1, 0, 0, 0, 383, 384, 9, 0, 0, 0, 384, 102, 1, 0, 0, 0, 385, 388, 8, 5, 0, 0, 386, 388, 3, 105, 52, 0, 387, 385, 1, 0, 0, 0, 387, 386, 1, 0, 0, 0, 388, 104, 1, 0, 0, 0, 389, 401, 5, 92, 0, 0, 390, 402, 7, 6, 0, 0, 391, 392, 5, 117, 0, 0, 392, 393, 5, 123, 0, 0, 393, 395, 1, 0, 0, 0, 394, 396, 3, 107, 53, 0, 395, 394, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 398, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 400, 5, 125, 0, 0, 400, 402, 1, 0, 0, 0, 401, 390, 1, 0, 0, 0, 401, 391, 1, 0, 0, 0, 402, 106, 1, 0, 0, 0, 403, 404, 7, 7, 0, 0, 404, 108, 1, 0, 0, 0, 18, 0, 116, 142, 248, 258, 268, 277, 330, 336, 342, 344, 349, 357, 368, 379, 387, 397, 401, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 52, 413, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 117, 8, 0, 10, 0, 12, 0, 120, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 145, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 5, 28, 255, 8, 28, 10, 28, 12, 28, 258, 9, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 5, 29, 265, 8, 29, 10, 29, 12, 29, 268, 9, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 275, 8, 30, 10, 30, 12, 30, 278, 9, 30, 1, 30, 1, 30, 1, 31, 1, 31, 5, 31, 284, 8, 31, 10, 31, 12, 31, 287, 9, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 5, 45, 337, 8, 45, 10, 45, 12, 45, 340, 9, 45, 1, 46, 4, 46, 343, 8, 46, 11, 46, 12, 46, 344, 1, 46, 1, 46, 4, 46, 349, 8, 46, 11, 46, 12, 46, 350, 3, 46, 353, 8, 46, 1, 47, 4, 47, 356, 8, 47, 11, 47, 12, 47, 357, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 364, 8, 48, 10, 48, 12, 48, 367, 9, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 5, 49, 375, 8, 49, 10, 49, 12, 49, 378, 9, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 4, 50, 386, 8, 50, 11, 50, 12, 50, 387, 1, 50, 1, 50, 1, 51, 1, 51, 1, 52, 1, 52, 3, 52, 396, 8, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 4, 53, 404, 8, 53, 11, 53, 12, 53, 405, 1, 53, 1, 53, 3, 53, 410, 8, 53, 1, 54, 1, 54, 2, 118, 376, 0, 55, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 0, 107, 0, 109, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 426, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 1, 111, 1, 0, 0, 0, 3, 125, 1, 0, 0, 0, 5, 127, 1, 0, 0, 0, 7, 129, 1, 0, 0, 0, 9, 131, 1, 0, 0, 0, 11, 133, 1, 0, 0, 0, 13, 135, 1, 0, 0, 0, 15, 137, 1, 0, 0, 0, 17, 139, 1, 0, 0, 0, 19, 144, 1, 0, 0, 0, 21, 146, 1, 0, 0, 0, 23, 148, 1, 0, 0, 0, 25, 150, 1, 0, 0, 0, 27, 152, 1, 0, 0, 0, 29, 158, 1, 0, 0, 0, 31, 162, 1, 0, 0, 0, 33, 167, 1, 0, 0, 0, 35, 173, 1, 0, 0, 0, 37, 178, 1, 0, 0, 0, 39, 184, 1, 0, 0, 0, 41, 191, 1, 0, 0, 0, 43, 200, 1, 0, 0, 0, 45, 207, 1, 0, 0, 0, 47, 219, 1, 0, 0, 0, 49, 226, 1, 0, 0, 0, 51, 231, 1, 0, 0, 0, 53, 234, 1, 0, 0, 0, 55, 243, 1, 0, 0, 0, 57, 252, 1, 0, 0, 0, 59, 262, 1, 0, 0, 0, 61, 272, 1, 0, 0, 0, 63, 281, 1, 0, 0, 0, 65, 290, 1, 0, 0, 0, 67, 297, 1, 0, 0, 0, 69, 301, 1, 0, 0, 0, 71, 306, 1, 0, 0, 0, 73, 309, 1, 0, 0, 0, 75, 313, 1, 0, 0, 0, 77, 316, 1, 0, 0, 0, 79, 318, 1, 0, 0, 0, 81, 320, 1, 0, 0, 0, 83, 323, 1, 0, 0, 0, 85, 325, 1, 0, 0, 0, 87, 328, 1, 0, 0, 0, 89, 331, 1, 0, 0, 0, 91, 334, 1, 0, 0, 0, 93, 342, 1, 0, 0, 0, 95, 355, 1, 0, 0, 0, 97, 359, 1, 0, 0, 0, 99, 370, 1, 0, 0, 0, 101, 385, 1, 0, 0, 0, 103, 391, 1, 0, 0, 0, 105, 395, 1, 0, 0, 0, 107, 397, 1, 0, 0, 0, 109, 411, 1, 0, 0, 0, 111, 112, 5, 39, 0, 0, 112, 113, 5, 39, 0, 0, 113, 114, 5, 39, 0, 0, 114, 118, 1, 0, 0, 0, 115, 117, 9, 0, 0, 0, 116, 115, 1, 0, 0, 0, 117, 120, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 121, 1, 0, 0, 0, 120, 118, 1, 0, 0, 0, 121, 122, 5, 39, 0, 0, 122, 123, 5, 39, 0, 0, 123, 124, 5, 39, 0, 0, 124, 2, 1, 0, 0, 0, 125, 126, 5, 64, 0, 0, 126, 4, 1, 0, 0, 0, 127, 128, 5, 44, 0, 0, 128, 6, 1, 0, 0, 0, 129, 130, 5, 91, 0, 0, 130, 8, 1, 0, 0, 0, 131, 132, 5, 93, 0, 0, 132, 10, 1, 0, 0, 0, 133, 134, 5, 40, 0, 0, 134, 12, 1, 0, 0, 0, 135, 136, 5, 41, 0, 0, 136, 14, 1, 0, 0, 0, 137, 138, 5, 46, 0, 0, 138, 16, 1, 0, 0, 0, 139, 140, 5, 124, 0, 0, 140, 18, 1, 0, 0, 0, 141, 145, 5, 58, 0, 0, 142, 143, 5, 58, 0, 0, 143, 145, 5, 58, 0, 0, 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 20, 1, 0, 0, 0, 146, 147, 5, 61, 0, 0, 147, 22, 1, 0, 0, 0, 148, 149, 5, 123, 0, 0, 149, 24, 1, 0, 0, 0, 150, 151, 5, 125, 0, 0, 151, 26, 1, 0, 0, 0, 152, 153, 5, 112, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 114, 0, 0, 155, 156, 5, 97, 0, 0, 156, 157, 5, 109, 0, 0, 157, 28, 1, 0, 0, 0, 158, 159, 5, 118, 0, 0, 159, 160, 5, 97, 0, 0, 160, 161, 5, 114, 0, 0, 161, 30, 1, 0, 0, 0, 162, 163, 5, 116, 0, 0, 163, 164, 5, 114, 0, 0, 164, 165, 5, 117, 0, 0, 165, 166, 5, 101, 0, 0, 166, 32, 1, 0, 0, 0, 167, 168, 5, 102, 0, 0, 168, 169, 5, 97, 0, 0, 169, 170, 5, 108, 0, 0, 170, 171, 5, 115, 0, 0, 171, 172, 5, 101, 0, 0, 172, 34, 1, 0, 0, 0, 173, 174, 5, 110, 0, 0, 174, 175, 5, 117, 0, 0, 175, 176, 5, 108, 0, 0, 176, 177, 5, 108, 0, 0, 177, 36, 1, 0, 0, 0, 178, 179, 5, 97, 0, 0, 179, 180, 5, 114, 0, 0, 180, 181, 5, 114, 0, 0, 181, 182, 5, 97, 0, 0, 182, 183, 5, 121, 0, 0, 183, 38, 1, 0, 0, 0, 184, 185, 5, 111, 0, 0, 185, 186, 5, 98, 0, 0, 186, 187, 5, 106, 0, 0, 187, 188, 5, 101, 0, 0, 188, 189, 5, 99, 0, 0, 189, 190, 5, 116, 0, 0, 190, 40, 1, 0, 0, 0, 191, 192, 5, 114, 0, 0, 192, 193, 5, 101, 0, 0, 193, 194, 5, 115, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 117, 0, 0, 196, 197, 5, 114, 0, 0, 197, 198, 5, 99, 0, 0, 198, 199, 5, 101, 0, 0, 199, 42, 1, 0, 0, 0, 200, 201, 5, 111, 0, 0, 201, 202, 5, 117, 0, 0, 202, 203, 5, 116, 0, 0, 203, 204, 5, 112, 0, 0, 204, 205, 5, 117, 0, 0, 205, 206, 5, 116, 0, 0, 206, 44, 1, 0, 0, 0, 207, 208, 5, 116, 0, 0, 208, 209, 5, 97, 0, 0, 209, 210, 5, 114, 0, 0, 210, 211, 5, 103, 0, 0, 211, 212, 5, 101, 0, 0, 212, 213, 5, 116, 0, 0, 213, 214, 5, 83, 0, 0, 214, 215, 5, 99, 0, 0, 215, 216, 5, 111, 0, 0, 216, 217, 5, 112, 0, 0, 217, 218, 5, 101, 0, 0, 218, 46, 1, 0, 0, 0, 219, 220, 5, 105, 0, 0, 220, 221, 5, 109, 0, 0, 221, 222, 5, 112, 0, 0, 222, 223, 5, 111, 0, 0, 223, 224, 5, 114, 0, 0, 224, 225, 5, 116, 0, 0, 225, 48, 1, 0, 0, 0, 226, 227, 5, 119, 0, 0, 227, 228, 5, 105, 0, 0, 228, 229, 5, 116, 0, 0, 229, 230, 5, 104, 0, 0, 230, 50, 1, 0, 0, 0, 231, 232, 5, 97, 0, 0, 232, 233, 5, 115, 0, 0, 233, 52, 1, 0, 0, 0, 234, 235, 5, 109, 0, 0, 235, 236, 5, 101, 0, 0, 236, 237, 5, 116, 0, 0, 237, 238, 5, 97, 0, 0, 238, 239, 5, 100, 0, 0, 239, 240, 5, 97, 0, 0, 240, 241, 5, 116, 0, 0, 241, 242, 5, 97, 0, 0, 242, 54, 1, 0, 0, 0, 243, 244, 5, 101, 0, 0, 244, 245, 5, 120, 0, 0, 245, 246, 5, 105, 0, 0, 246, 247, 5, 115, 0, 0, 247, 248, 5, 116, 0, 0, 248, 249, 5, 105, 0, 0, 249, 250, 5, 110, 0, 0, 250, 251, 5, 103, 0, 0, 251, 56, 1, 0, 0, 0, 252, 256, 5, 39, 0, 0, 253, 255, 3, 105, 52, 0, 254, 253, 1, 0, 0, 0, 255, 258, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 259, 1, 0, 0, 0, 258, 256, 1, 0, 0, 0, 259, 260, 5, 36, 0, 0, 260, 261, 5, 123, 0, 0, 261, 58, 1, 0, 0, 0, 262, 266, 5, 125, 0, 0, 263, 265, 3, 105, 52, 0, 264, 263, 1, 0, 0, 0, 265, 268, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 269, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 270, 5, 36, 0, 0, 270, 271, 5, 123, 0, 0, 271, 60, 1, 0, 0, 0, 272, 276, 5, 125, 0, 0, 273, 275, 3, 105, 52, 0, 274, 273, 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 279, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 279, 280, 5, 39, 0, 0, 280, 62, 1, 0, 0, 0, 281, 285, 5, 39, 0, 0, 282, 284, 3, 105, 52, 0, 283, 282, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 288, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 288, 289, 5, 39, 0, 0, 289, 64, 1, 0, 0, 0, 290, 291, 5, 115, 0, 0, 291, 292, 5, 116, 0, 0, 292, 293, 5, 114, 0, 0, 293, 294, 5, 105, 0, 0, 294, 295, 5, 110, 0, 0, 295, 296, 5, 103, 0, 0, 296, 66, 1, 0, 0, 0, 297, 298, 5, 105, 0, 0, 298, 299, 5, 110, 0, 0, 299, 300, 5, 116, 0, 0, 300, 68, 1, 0, 0, 0, 301, 302, 5, 98, 0, 0, 302, 303, 5, 111, 0, 0, 303, 304, 5, 111, 0, 0, 304, 305, 5, 108, 0, 0, 305, 70, 1, 0, 0, 0, 306, 307, 5, 105, 0, 0, 307, 308, 5, 102, 0, 0, 308, 72, 1, 0, 0, 0, 309, 310, 5, 102, 0, 0, 310, 311, 5, 111, 0, 0, 311, 312, 5, 114, 0, 0, 312, 74, 1, 0, 0, 0, 313, 314, 5, 105, 0, 0, 314, 315, 5, 110, 0, 0, 315, 76, 1, 0, 0, 0, 316, 317, 5, 63, 0, 0, 317, 78, 1, 0, 0, 0, 318, 319, 5, 62, 0, 0, 319, 80, 1, 0, 0, 0, 320, 321, 5, 62, 0, 0, 321, 322, 5, 61, 0, 0, 322, 82, 1, 0, 0, 0, 323, 324, 5, 60, 0, 0, 324, 84, 1, 0, 0, 0, 325, 326, 5, 60, 0, 0, 326, 327, 5, 61, 0, 0, 327, 86, 1, 0, 0, 0, 328, 329, 5, 61, 0, 0, 329, 330, 5, 61, 0, 0, 330, 88, 1, 0, 0, 0, 331, 332, 5, 33, 0, 0, 332, 333, 5, 61, 0, 0, 333, 90, 1, 0, 0, 0, 334, 338, 7, 0, 0, 0, 335, 337, 7, 1, 0, 0, 336, 335, 1, 0, 0, 0, 337, 340, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 92, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 341, 343, 7, 2, 0, 0, 342, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 352, 1, 0, 0, 0, 346, 348, 5, 46, 0, 0, 347, 349, 7, 2, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 353, 1, 0, 0, 0, 352, 346, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, 353, 94, 1, 0, 0, 0, 354, 356, 7, 3, 0, 0, 355, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 96, 1, 0, 0, 0, 359, 360, 5, 47, 0, 0, 360, 361, 5, 47, 0, 0, 361, 365, 1, 0, 0, 0, 362, 364, 8, 3, 0, 0, 363, 362, 1, 0, 0, 0, 364, 367, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 368, 369, 6, 48, 0, 0, 369, 98, 1, 0, 0, 0, 370, 371, 5, 47, 0, 0, 371, 372, 5, 42, 0, 0, 372, 376, 1, 0, 0, 0, 373, 375, 9, 0, 0, 0, 374, 373, 1, 0, 0, 0, 375, 378, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 376, 374, 1, 0, 0, 0, 377, 379, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 379, 380, 5, 42, 0, 0, 380, 381, 5, 47, 0, 0, 381, 382, 1, 0, 0, 0, 382, 383, 6, 49, 0, 0, 383, 100, 1, 0, 0, 0, 384, 386, 7, 4, 0, 0, 385, 384, 1, 0, 0, 0, 386, 387, 1, 0, 0, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 389, 1, 0, 0, 0, 389, 390, 6, 50, 0, 0, 390, 102, 1, 0, 0, 0, 391, 392, 9, 0, 0, 0, 392, 104, 1, 0, 0, 0, 393, 396, 8, 5, 0, 0, 394, 396, 3, 107, 53, 0, 395, 393, 1, 0, 0, 0, 395, 394, 1, 0, 0, 0, 396, 106, 1, 0, 0, 0, 397, 409, 5, 92, 0, 0, 398, 410, 7, 6, 0, 0, 399, 400, 5, 117, 0, 0, 400, 401, 5, 123, 0, 0, 401, 403, 1, 0, 0, 0, 402, 404, 3, 109, 54, 0, 403, 402, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, 403, 1, 0, 0, 0, 405, 406, 1, 0, 0, 0, 406, 407, 1, 0, 0, 0, 407, 408, 5, 125, 0, 0, 408, 410, 1, 0, 0, 0, 409, 398, 1, 0, 0, 0, 409, 399, 1, 0, 0, 0, 410, 108, 1, 0, 0, 0, 411, 412, 7, 7, 0, 0, 412, 110, 1, 0, 0, 0, 18, 0, 118, 144, 256, 266, 276, 285, 338, 344, 350, 352, 357, 365, 376, 387, 395, 405, 409, 1, 6, 0, 0] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens index 91c8fff887c..ec33a639e52 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens @@ -16,39 +16,40 @@ VAR=15 TRUE=16 FALSE=17 NULL=18 -OBJECT=19 -RESOURCE=20 -OUTPUT=21 -TARGET_SCOPE=22 -IMPORT=23 -WITH=24 -AS=25 -METADATA=26 -EXISTING=27 -STRING_LEFT_PIECE=28 -STRING_MIDDLE_PIECE=29 -STRING_RIGHT_PIECE=30 -STRING_COMPLETE=31 -STRING=32 -INT=33 -BOOL=34 -IF=35 -FOR=36 -IN=37 -QMARK=38 -GT=39 -GTE=40 -LT=41 -LTE=42 -EQ=43 -NEQ=44 -IDENTIFIER=45 -NUMBER=46 -NL=47 -SINGLE_LINE_COMMENT=48 -MULTI_LINE_COMMENT=49 -SPACES=50 -UNKNOWN=51 +ARRAY=19 +OBJECT=20 +RESOURCE=21 +OUTPUT=22 +TARGET_SCOPE=23 +IMPORT=24 +WITH=25 +AS=26 +METADATA=27 +EXISTING=28 +STRING_LEFT_PIECE=29 +STRING_MIDDLE_PIECE=30 +STRING_RIGHT_PIECE=31 +STRING_COMPLETE=32 +STRING=33 +INT=34 +BOOL=35 +IF=36 +FOR=37 +IN=38 +QMARK=39 +GT=40 +GTE=41 +LT=42 +LTE=43 +EQ=44 +NEQ=45 +IDENTIFIER=46 +NUMBER=47 +NL=48 +SINGLE_LINE_COMMENT=49 +MULTI_LINE_COMMENT=50 +SPACES=51 +UNKNOWN=52 '@'=2 ','=3 '['=4 @@ -65,25 +66,26 @@ UNKNOWN=51 'true'=16 'false'=17 'null'=18 -'object'=19 -'resource'=20 -'output'=21 -'targetScope'=22 -'import'=23 -'with'=24 -'as'=25 -'metadata'=26 -'existing'=27 -'string'=32 -'int'=33 -'bool'=34 -'if'=35 -'for'=36 -'in'=37 -'?'=38 -'>'=39 -'>='=40 -'<'=41 -'<='=42 -'=='=43 -'!='=44 +'array'=19 +'object'=20 +'resource'=21 +'output'=22 +'targetScope'=23 +'import'=24 +'with'=25 +'as'=26 +'metadata'=27 +'existing'=28 +'string'=33 +'int'=34 +'bool'=35 +'if'=36 +'for'=37 +'in'=38 +'?'=39 +'>'=40 +'>='=41 +'<'=42 +'<='=43 +'=='=44 +'!='=45 diff --git a/pkg/parser/bicep/antlr/parser/bicep_lexer.go b/pkg/parser/bicep/antlr/parser/bicep_lexer.go index fae69ac42ed..7e099ddab6b 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_lexer.go +++ b/pkg/parser/bicep/antlr/parser/bicep_lexer.go @@ -45,15 +45,15 @@ func biceplexerLexerInit() { staticData.LiteralNames = []string{ "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", - "'object'", "'resource'", "'output'", "'targetScope'", "'import'", "'with'", - "'as'", "'metadata'", "'existing'", "", "", "", "", "'string'", "'int'", - "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", - "'=='", "'!='", + "'array'", "'object'", "'resource'", "'output'", "'targetScope'", "'import'", + "'with'", "'as'", "'metadata'", "'existing'", "", "", "", "", "'string'", + "'int'", "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", + "'<='", "'=='", "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", + "TRUE", "FALSE", "NULL", "ARRAY", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", @@ -63,7 +63,7 @@ func biceplexerLexerInit() { staticData.RuleNames = []string{ "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", + "TRUE", "FALSE", "NULL", "ARRAY", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", @@ -72,7 +72,7 @@ func biceplexerLexerInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 51, 405, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 52, 413, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, @@ -82,47 +82,48 @@ func biceplexerLexerInit() { 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, - 52, 7, 52, 2, 53, 7, 53, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 115, 8, 0, - 10, 0, 12, 0, 118, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, - 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, - 1, 9, 1, 9, 1, 9, 3, 9, 143, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, - 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, - 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, - 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, - 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, - 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, - 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, - 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, - 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, - 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, - 1, 27, 1, 27, 5, 27, 247, 8, 27, 10, 27, 12, 27, 250, 9, 27, 1, 27, 1, - 27, 1, 27, 1, 28, 1, 28, 5, 28, 257, 8, 28, 10, 28, 12, 28, 260, 9, 28, - 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 5, 29, 267, 8, 29, 10, 29, 12, 29, 270, - 9, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 276, 8, 30, 10, 30, 12, 30, 279, - 9, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, - 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, - 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, - 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 42, - 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 5, 44, 329, 8, 44, 10, - 44, 12, 44, 332, 9, 44, 1, 45, 4, 45, 335, 8, 45, 11, 45, 12, 45, 336, - 1, 45, 1, 45, 4, 45, 341, 8, 45, 11, 45, 12, 45, 342, 3, 45, 345, 8, 45, - 1, 46, 4, 46, 348, 8, 46, 11, 46, 12, 46, 349, 1, 47, 1, 47, 1, 47, 1, - 47, 5, 47, 356, 8, 47, 10, 47, 12, 47, 359, 9, 47, 1, 47, 1, 47, 1, 48, - 1, 48, 1, 48, 1, 48, 5, 48, 367, 8, 48, 10, 48, 12, 48, 370, 9, 48, 1, - 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 4, 49, 378, 8, 49, 11, 49, 12, 49, - 379, 1, 49, 1, 49, 1, 50, 1, 50, 1, 51, 1, 51, 3, 51, 388, 8, 51, 1, 52, - 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 4, 52, 396, 8, 52, 11, 52, 12, 52, 397, - 1, 52, 1, 52, 3, 52, 402, 8, 52, 1, 53, 1, 53, 2, 116, 368, 0, 54, 1, 1, - 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, - 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, - 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, - 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, - 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, - 48, 97, 49, 99, 50, 101, 51, 103, 0, 105, 0, 107, 0, 1, 0, 8, 3, 0, 65, - 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, - 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, - 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, - 116, 3, 0, 48, 57, 65, 70, 97, 102, 418, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, + 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, + 0, 117, 8, 0, 10, 0, 12, 0, 120, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, + 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, + 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 145, 8, 9, 1, 10, 1, 10, 1, 11, + 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, + 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, + 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, + 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, + 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, + 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, + 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, + 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, + 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, + 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, + 5, 28, 255, 8, 28, 10, 28, 12, 28, 258, 9, 28, 1, 28, 1, 28, 1, 28, 1, + 29, 1, 29, 5, 29, 265, 8, 29, 10, 29, 12, 29, 268, 9, 29, 1, 29, 1, 29, + 1, 29, 1, 30, 1, 30, 5, 30, 275, 8, 30, 10, 30, 12, 30, 278, 9, 30, 1, + 30, 1, 30, 1, 31, 1, 31, 5, 31, 284, 8, 31, 10, 31, 12, 31, 287, 9, 31, + 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, + 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, + 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, + 39, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, + 1, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 5, 45, 337, 8, 45, 10, 45, 12, + 45, 340, 9, 45, 1, 46, 4, 46, 343, 8, 46, 11, 46, 12, 46, 344, 1, 46, 1, + 46, 4, 46, 349, 8, 46, 11, 46, 12, 46, 350, 3, 46, 353, 8, 46, 1, 47, 4, + 47, 356, 8, 47, 11, 47, 12, 47, 357, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, + 364, 8, 48, 10, 48, 12, 48, 367, 9, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, + 49, 1, 49, 5, 49, 375, 8, 49, 10, 49, 12, 49, 378, 9, 49, 1, 49, 1, 49, + 1, 49, 1, 49, 1, 49, 1, 50, 4, 50, 386, 8, 50, 11, 50, 12, 50, 387, 1, + 50, 1, 50, 1, 51, 1, 51, 1, 52, 1, 52, 3, 52, 396, 8, 52, 1, 53, 1, 53, + 1, 53, 1, 53, 1, 53, 1, 53, 4, 53, 404, 8, 53, 11, 53, 12, 53, 405, 1, + 53, 1, 53, 3, 53, 410, 8, 53, 1, 54, 1, 54, 2, 118, 376, 0, 55, 1, 1, 3, + 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, + 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, + 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, + 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, + 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, + 97, 49, 99, 50, 101, 51, 103, 52, 105, 0, 107, 0, 109, 0, 1, 0, 8, 3, 0, + 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, + 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, + 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, + 116, 3, 0, 48, 57, 65, 70, 97, 102, 426, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, @@ -135,123 +136,125 @@ func biceplexerLexerInit() { 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, - 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 1, 109, 1, - 0, 0, 0, 3, 123, 1, 0, 0, 0, 5, 125, 1, 0, 0, 0, 7, 127, 1, 0, 0, 0, 9, - 129, 1, 0, 0, 0, 11, 131, 1, 0, 0, 0, 13, 133, 1, 0, 0, 0, 15, 135, 1, - 0, 0, 0, 17, 137, 1, 0, 0, 0, 19, 142, 1, 0, 0, 0, 21, 144, 1, 0, 0, 0, - 23, 146, 1, 0, 0, 0, 25, 148, 1, 0, 0, 0, 27, 150, 1, 0, 0, 0, 29, 156, - 1, 0, 0, 0, 31, 160, 1, 0, 0, 0, 33, 165, 1, 0, 0, 0, 35, 171, 1, 0, 0, - 0, 37, 176, 1, 0, 0, 0, 39, 183, 1, 0, 0, 0, 41, 192, 1, 0, 0, 0, 43, 199, - 1, 0, 0, 0, 45, 211, 1, 0, 0, 0, 47, 218, 1, 0, 0, 0, 49, 223, 1, 0, 0, - 0, 51, 226, 1, 0, 0, 0, 53, 235, 1, 0, 0, 0, 55, 244, 1, 0, 0, 0, 57, 254, - 1, 0, 0, 0, 59, 264, 1, 0, 0, 0, 61, 273, 1, 0, 0, 0, 63, 282, 1, 0, 0, - 0, 65, 289, 1, 0, 0, 0, 67, 293, 1, 0, 0, 0, 69, 298, 1, 0, 0, 0, 71, 301, - 1, 0, 0, 0, 73, 305, 1, 0, 0, 0, 75, 308, 1, 0, 0, 0, 77, 310, 1, 0, 0, - 0, 79, 312, 1, 0, 0, 0, 81, 315, 1, 0, 0, 0, 83, 317, 1, 0, 0, 0, 85, 320, - 1, 0, 0, 0, 87, 323, 1, 0, 0, 0, 89, 326, 1, 0, 0, 0, 91, 334, 1, 0, 0, - 0, 93, 347, 1, 0, 0, 0, 95, 351, 1, 0, 0, 0, 97, 362, 1, 0, 0, 0, 99, 377, - 1, 0, 0, 0, 101, 383, 1, 0, 0, 0, 103, 387, 1, 0, 0, 0, 105, 389, 1, 0, - 0, 0, 107, 403, 1, 0, 0, 0, 109, 110, 5, 39, 0, 0, 110, 111, 5, 39, 0, - 0, 111, 112, 5, 39, 0, 0, 112, 116, 1, 0, 0, 0, 113, 115, 9, 0, 0, 0, 114, - 113, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 116, 114, - 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 39, - 0, 0, 120, 121, 5, 39, 0, 0, 121, 122, 5, 39, 0, 0, 122, 2, 1, 0, 0, 0, - 123, 124, 5, 64, 0, 0, 124, 4, 1, 0, 0, 0, 125, 126, 5, 44, 0, 0, 126, - 6, 1, 0, 0, 0, 127, 128, 5, 91, 0, 0, 128, 8, 1, 0, 0, 0, 129, 130, 5, - 93, 0, 0, 130, 10, 1, 0, 0, 0, 131, 132, 5, 40, 0, 0, 132, 12, 1, 0, 0, - 0, 133, 134, 5, 41, 0, 0, 134, 14, 1, 0, 0, 0, 135, 136, 5, 46, 0, 0, 136, - 16, 1, 0, 0, 0, 137, 138, 5, 124, 0, 0, 138, 18, 1, 0, 0, 0, 139, 143, - 5, 58, 0, 0, 140, 141, 5, 58, 0, 0, 141, 143, 5, 58, 0, 0, 142, 139, 1, - 0, 0, 0, 142, 140, 1, 0, 0, 0, 143, 20, 1, 0, 0, 0, 144, 145, 5, 61, 0, - 0, 145, 22, 1, 0, 0, 0, 146, 147, 5, 123, 0, 0, 147, 24, 1, 0, 0, 0, 148, - 149, 5, 125, 0, 0, 149, 26, 1, 0, 0, 0, 150, 151, 5, 112, 0, 0, 151, 152, - 5, 97, 0, 0, 152, 153, 5, 114, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, - 109, 0, 0, 155, 28, 1, 0, 0, 0, 156, 157, 5, 118, 0, 0, 157, 158, 5, 97, - 0, 0, 158, 159, 5, 114, 0, 0, 159, 30, 1, 0, 0, 0, 160, 161, 5, 116, 0, - 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 117, 0, 0, 163, 164, 5, 101, 0, - 0, 164, 32, 1, 0, 0, 0, 165, 166, 5, 102, 0, 0, 166, 167, 5, 97, 0, 0, - 167, 168, 5, 108, 0, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 101, 0, 0, - 170, 34, 1, 0, 0, 0, 171, 172, 5, 110, 0, 0, 172, 173, 5, 117, 0, 0, 173, - 174, 5, 108, 0, 0, 174, 175, 5, 108, 0, 0, 175, 36, 1, 0, 0, 0, 176, 177, - 5, 111, 0, 0, 177, 178, 5, 98, 0, 0, 178, 179, 5, 106, 0, 0, 179, 180, - 5, 101, 0, 0, 180, 181, 5, 99, 0, 0, 181, 182, 5, 116, 0, 0, 182, 38, 1, - 0, 0, 0, 183, 184, 5, 114, 0, 0, 184, 185, 5, 101, 0, 0, 185, 186, 5, 115, - 0, 0, 186, 187, 5, 111, 0, 0, 187, 188, 5, 117, 0, 0, 188, 189, 5, 114, - 0, 0, 189, 190, 5, 99, 0, 0, 190, 191, 5, 101, 0, 0, 191, 40, 1, 0, 0, - 0, 192, 193, 5, 111, 0, 0, 193, 194, 5, 117, 0, 0, 194, 195, 5, 116, 0, - 0, 195, 196, 5, 112, 0, 0, 196, 197, 5, 117, 0, 0, 197, 198, 5, 116, 0, - 0, 198, 42, 1, 0, 0, 0, 199, 200, 5, 116, 0, 0, 200, 201, 5, 97, 0, 0, - 201, 202, 5, 114, 0, 0, 202, 203, 5, 103, 0, 0, 203, 204, 5, 101, 0, 0, - 204, 205, 5, 116, 0, 0, 205, 206, 5, 83, 0, 0, 206, 207, 5, 99, 0, 0, 207, - 208, 5, 111, 0, 0, 208, 209, 5, 112, 0, 0, 209, 210, 5, 101, 0, 0, 210, - 44, 1, 0, 0, 0, 211, 212, 5, 105, 0, 0, 212, 213, 5, 109, 0, 0, 213, 214, - 5, 112, 0, 0, 214, 215, 5, 111, 0, 0, 215, 216, 5, 114, 0, 0, 216, 217, - 5, 116, 0, 0, 217, 46, 1, 0, 0, 0, 218, 219, 5, 119, 0, 0, 219, 220, 5, - 105, 0, 0, 220, 221, 5, 116, 0, 0, 221, 222, 5, 104, 0, 0, 222, 48, 1, - 0, 0, 0, 223, 224, 5, 97, 0, 0, 224, 225, 5, 115, 0, 0, 225, 50, 1, 0, - 0, 0, 226, 227, 5, 109, 0, 0, 227, 228, 5, 101, 0, 0, 228, 229, 5, 116, - 0, 0, 229, 230, 5, 97, 0, 0, 230, 231, 5, 100, 0, 0, 231, 232, 5, 97, 0, - 0, 232, 233, 5, 116, 0, 0, 233, 234, 5, 97, 0, 0, 234, 52, 1, 0, 0, 0, - 235, 236, 5, 101, 0, 0, 236, 237, 5, 120, 0, 0, 237, 238, 5, 105, 0, 0, - 238, 239, 5, 115, 0, 0, 239, 240, 5, 116, 0, 0, 240, 241, 5, 105, 0, 0, - 241, 242, 5, 110, 0, 0, 242, 243, 5, 103, 0, 0, 243, 54, 1, 0, 0, 0, 244, - 248, 5, 39, 0, 0, 245, 247, 3, 103, 51, 0, 246, 245, 1, 0, 0, 0, 247, 250, - 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 1, 0, - 0, 0, 250, 248, 1, 0, 0, 0, 251, 252, 5, 36, 0, 0, 252, 253, 5, 123, 0, - 0, 253, 56, 1, 0, 0, 0, 254, 258, 5, 125, 0, 0, 255, 257, 3, 103, 51, 0, - 256, 255, 1, 0, 0, 0, 257, 260, 1, 0, 0, 0, 258, 256, 1, 0, 0, 0, 258, - 259, 1, 0, 0, 0, 259, 261, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 261, 262, - 5, 36, 0, 0, 262, 263, 5, 123, 0, 0, 263, 58, 1, 0, 0, 0, 264, 268, 5, - 125, 0, 0, 265, 267, 3, 103, 51, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, - 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, - 0, 270, 268, 1, 0, 0, 0, 271, 272, 5, 39, 0, 0, 272, 60, 1, 0, 0, 0, 273, - 277, 5, 39, 0, 0, 274, 276, 3, 103, 51, 0, 275, 274, 1, 0, 0, 0, 276, 279, - 1, 0, 0, 0, 277, 275, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 280, 1, 0, - 0, 0, 279, 277, 1, 0, 0, 0, 280, 281, 5, 39, 0, 0, 281, 62, 1, 0, 0, 0, - 282, 283, 5, 115, 0, 0, 283, 284, 5, 116, 0, 0, 284, 285, 5, 114, 0, 0, - 285, 286, 5, 105, 0, 0, 286, 287, 5, 110, 0, 0, 287, 288, 5, 103, 0, 0, - 288, 64, 1, 0, 0, 0, 289, 290, 5, 105, 0, 0, 290, 291, 5, 110, 0, 0, 291, - 292, 5, 116, 0, 0, 292, 66, 1, 0, 0, 0, 293, 294, 5, 98, 0, 0, 294, 295, - 5, 111, 0, 0, 295, 296, 5, 111, 0, 0, 296, 297, 5, 108, 0, 0, 297, 68, - 1, 0, 0, 0, 298, 299, 5, 105, 0, 0, 299, 300, 5, 102, 0, 0, 300, 70, 1, - 0, 0, 0, 301, 302, 5, 102, 0, 0, 302, 303, 5, 111, 0, 0, 303, 304, 5, 114, - 0, 0, 304, 72, 1, 0, 0, 0, 305, 306, 5, 105, 0, 0, 306, 307, 5, 110, 0, - 0, 307, 74, 1, 0, 0, 0, 308, 309, 5, 63, 0, 0, 309, 76, 1, 0, 0, 0, 310, - 311, 5, 62, 0, 0, 311, 78, 1, 0, 0, 0, 312, 313, 5, 62, 0, 0, 313, 314, - 5, 61, 0, 0, 314, 80, 1, 0, 0, 0, 315, 316, 5, 60, 0, 0, 316, 82, 1, 0, - 0, 0, 317, 318, 5, 60, 0, 0, 318, 319, 5, 61, 0, 0, 319, 84, 1, 0, 0, 0, - 320, 321, 5, 61, 0, 0, 321, 322, 5, 61, 0, 0, 322, 86, 1, 0, 0, 0, 323, - 324, 5, 33, 0, 0, 324, 325, 5, 61, 0, 0, 325, 88, 1, 0, 0, 0, 326, 330, - 7, 0, 0, 0, 327, 329, 7, 1, 0, 0, 328, 327, 1, 0, 0, 0, 329, 332, 1, 0, - 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 90, 1, 0, 0, 0, - 332, 330, 1, 0, 0, 0, 333, 335, 7, 2, 0, 0, 334, 333, 1, 0, 0, 0, 335, - 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 344, - 1, 0, 0, 0, 338, 340, 5, 46, 0, 0, 339, 341, 7, 2, 0, 0, 340, 339, 1, 0, - 0, 0, 341, 342, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, - 343, 345, 1, 0, 0, 0, 344, 338, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, - 92, 1, 0, 0, 0, 346, 348, 7, 3, 0, 0, 347, 346, 1, 0, 0, 0, 348, 349, 1, - 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 94, 1, 0, 0, - 0, 351, 352, 5, 47, 0, 0, 352, 353, 5, 47, 0, 0, 353, 357, 1, 0, 0, 0, - 354, 356, 8, 3, 0, 0, 355, 354, 1, 0, 0, 0, 356, 359, 1, 0, 0, 0, 357, - 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 360, 1, 0, 0, 0, 359, 357, - 1, 0, 0, 0, 360, 361, 6, 47, 0, 0, 361, 96, 1, 0, 0, 0, 362, 363, 5, 47, - 0, 0, 363, 364, 5, 42, 0, 0, 364, 368, 1, 0, 0, 0, 365, 367, 9, 0, 0, 0, - 366, 365, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 368, - 366, 1, 0, 0, 0, 369, 371, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 371, 372, - 5, 42, 0, 0, 372, 373, 5, 47, 0, 0, 373, 374, 1, 0, 0, 0, 374, 375, 6, - 48, 0, 0, 375, 98, 1, 0, 0, 0, 376, 378, 7, 4, 0, 0, 377, 376, 1, 0, 0, - 0, 378, 379, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, - 381, 1, 0, 0, 0, 381, 382, 6, 49, 0, 0, 382, 100, 1, 0, 0, 0, 383, 384, - 9, 0, 0, 0, 384, 102, 1, 0, 0, 0, 385, 388, 8, 5, 0, 0, 386, 388, 3, 105, - 52, 0, 387, 385, 1, 0, 0, 0, 387, 386, 1, 0, 0, 0, 388, 104, 1, 0, 0, 0, - 389, 401, 5, 92, 0, 0, 390, 402, 7, 6, 0, 0, 391, 392, 5, 117, 0, 0, 392, - 393, 5, 123, 0, 0, 393, 395, 1, 0, 0, 0, 394, 396, 3, 107, 53, 0, 395, - 394, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 398, - 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 400, 5, 125, 0, 0, 400, 402, 1, - 0, 0, 0, 401, 390, 1, 0, 0, 0, 401, 391, 1, 0, 0, 0, 402, 106, 1, 0, 0, - 0, 403, 404, 7, 7, 0, 0, 404, 108, 1, 0, 0, 0, 18, 0, 116, 142, 248, 258, - 268, 277, 330, 336, 342, 344, 349, 357, 368, 379, 387, 397, 401, 1, 6, - 0, 0, + 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, + 0, 0, 0, 1, 111, 1, 0, 0, 0, 3, 125, 1, 0, 0, 0, 5, 127, 1, 0, 0, 0, 7, + 129, 1, 0, 0, 0, 9, 131, 1, 0, 0, 0, 11, 133, 1, 0, 0, 0, 13, 135, 1, 0, + 0, 0, 15, 137, 1, 0, 0, 0, 17, 139, 1, 0, 0, 0, 19, 144, 1, 0, 0, 0, 21, + 146, 1, 0, 0, 0, 23, 148, 1, 0, 0, 0, 25, 150, 1, 0, 0, 0, 27, 152, 1, + 0, 0, 0, 29, 158, 1, 0, 0, 0, 31, 162, 1, 0, 0, 0, 33, 167, 1, 0, 0, 0, + 35, 173, 1, 0, 0, 0, 37, 178, 1, 0, 0, 0, 39, 184, 1, 0, 0, 0, 41, 191, + 1, 0, 0, 0, 43, 200, 1, 0, 0, 0, 45, 207, 1, 0, 0, 0, 47, 219, 1, 0, 0, + 0, 49, 226, 1, 0, 0, 0, 51, 231, 1, 0, 0, 0, 53, 234, 1, 0, 0, 0, 55, 243, + 1, 0, 0, 0, 57, 252, 1, 0, 0, 0, 59, 262, 1, 0, 0, 0, 61, 272, 1, 0, 0, + 0, 63, 281, 1, 0, 0, 0, 65, 290, 1, 0, 0, 0, 67, 297, 1, 0, 0, 0, 69, 301, + 1, 0, 0, 0, 71, 306, 1, 0, 0, 0, 73, 309, 1, 0, 0, 0, 75, 313, 1, 0, 0, + 0, 77, 316, 1, 0, 0, 0, 79, 318, 1, 0, 0, 0, 81, 320, 1, 0, 0, 0, 83, 323, + 1, 0, 0, 0, 85, 325, 1, 0, 0, 0, 87, 328, 1, 0, 0, 0, 89, 331, 1, 0, 0, + 0, 91, 334, 1, 0, 0, 0, 93, 342, 1, 0, 0, 0, 95, 355, 1, 0, 0, 0, 97, 359, + 1, 0, 0, 0, 99, 370, 1, 0, 0, 0, 101, 385, 1, 0, 0, 0, 103, 391, 1, 0, + 0, 0, 105, 395, 1, 0, 0, 0, 107, 397, 1, 0, 0, 0, 109, 411, 1, 0, 0, 0, + 111, 112, 5, 39, 0, 0, 112, 113, 5, 39, 0, 0, 113, 114, 5, 39, 0, 0, 114, + 118, 1, 0, 0, 0, 115, 117, 9, 0, 0, 0, 116, 115, 1, 0, 0, 0, 117, 120, + 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 121, 1, 0, + 0, 0, 120, 118, 1, 0, 0, 0, 121, 122, 5, 39, 0, 0, 122, 123, 5, 39, 0, + 0, 123, 124, 5, 39, 0, 0, 124, 2, 1, 0, 0, 0, 125, 126, 5, 64, 0, 0, 126, + 4, 1, 0, 0, 0, 127, 128, 5, 44, 0, 0, 128, 6, 1, 0, 0, 0, 129, 130, 5, + 91, 0, 0, 130, 8, 1, 0, 0, 0, 131, 132, 5, 93, 0, 0, 132, 10, 1, 0, 0, + 0, 133, 134, 5, 40, 0, 0, 134, 12, 1, 0, 0, 0, 135, 136, 5, 41, 0, 0, 136, + 14, 1, 0, 0, 0, 137, 138, 5, 46, 0, 0, 138, 16, 1, 0, 0, 0, 139, 140, 5, + 124, 0, 0, 140, 18, 1, 0, 0, 0, 141, 145, 5, 58, 0, 0, 142, 143, 5, 58, + 0, 0, 143, 145, 5, 58, 0, 0, 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, + 145, 20, 1, 0, 0, 0, 146, 147, 5, 61, 0, 0, 147, 22, 1, 0, 0, 0, 148, 149, + 5, 123, 0, 0, 149, 24, 1, 0, 0, 0, 150, 151, 5, 125, 0, 0, 151, 26, 1, + 0, 0, 0, 152, 153, 5, 112, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 114, + 0, 0, 155, 156, 5, 97, 0, 0, 156, 157, 5, 109, 0, 0, 157, 28, 1, 0, 0, + 0, 158, 159, 5, 118, 0, 0, 159, 160, 5, 97, 0, 0, 160, 161, 5, 114, 0, + 0, 161, 30, 1, 0, 0, 0, 162, 163, 5, 116, 0, 0, 163, 164, 5, 114, 0, 0, + 164, 165, 5, 117, 0, 0, 165, 166, 5, 101, 0, 0, 166, 32, 1, 0, 0, 0, 167, + 168, 5, 102, 0, 0, 168, 169, 5, 97, 0, 0, 169, 170, 5, 108, 0, 0, 170, + 171, 5, 115, 0, 0, 171, 172, 5, 101, 0, 0, 172, 34, 1, 0, 0, 0, 173, 174, + 5, 110, 0, 0, 174, 175, 5, 117, 0, 0, 175, 176, 5, 108, 0, 0, 176, 177, + 5, 108, 0, 0, 177, 36, 1, 0, 0, 0, 178, 179, 5, 97, 0, 0, 179, 180, 5, + 114, 0, 0, 180, 181, 5, 114, 0, 0, 181, 182, 5, 97, 0, 0, 182, 183, 5, + 121, 0, 0, 183, 38, 1, 0, 0, 0, 184, 185, 5, 111, 0, 0, 185, 186, 5, 98, + 0, 0, 186, 187, 5, 106, 0, 0, 187, 188, 5, 101, 0, 0, 188, 189, 5, 99, + 0, 0, 189, 190, 5, 116, 0, 0, 190, 40, 1, 0, 0, 0, 191, 192, 5, 114, 0, + 0, 192, 193, 5, 101, 0, 0, 193, 194, 5, 115, 0, 0, 194, 195, 5, 111, 0, + 0, 195, 196, 5, 117, 0, 0, 196, 197, 5, 114, 0, 0, 197, 198, 5, 99, 0, + 0, 198, 199, 5, 101, 0, 0, 199, 42, 1, 0, 0, 0, 200, 201, 5, 111, 0, 0, + 201, 202, 5, 117, 0, 0, 202, 203, 5, 116, 0, 0, 203, 204, 5, 112, 0, 0, + 204, 205, 5, 117, 0, 0, 205, 206, 5, 116, 0, 0, 206, 44, 1, 0, 0, 0, 207, + 208, 5, 116, 0, 0, 208, 209, 5, 97, 0, 0, 209, 210, 5, 114, 0, 0, 210, + 211, 5, 103, 0, 0, 211, 212, 5, 101, 0, 0, 212, 213, 5, 116, 0, 0, 213, + 214, 5, 83, 0, 0, 214, 215, 5, 99, 0, 0, 215, 216, 5, 111, 0, 0, 216, 217, + 5, 112, 0, 0, 217, 218, 5, 101, 0, 0, 218, 46, 1, 0, 0, 0, 219, 220, 5, + 105, 0, 0, 220, 221, 5, 109, 0, 0, 221, 222, 5, 112, 0, 0, 222, 223, 5, + 111, 0, 0, 223, 224, 5, 114, 0, 0, 224, 225, 5, 116, 0, 0, 225, 48, 1, + 0, 0, 0, 226, 227, 5, 119, 0, 0, 227, 228, 5, 105, 0, 0, 228, 229, 5, 116, + 0, 0, 229, 230, 5, 104, 0, 0, 230, 50, 1, 0, 0, 0, 231, 232, 5, 97, 0, + 0, 232, 233, 5, 115, 0, 0, 233, 52, 1, 0, 0, 0, 234, 235, 5, 109, 0, 0, + 235, 236, 5, 101, 0, 0, 236, 237, 5, 116, 0, 0, 237, 238, 5, 97, 0, 0, + 238, 239, 5, 100, 0, 0, 239, 240, 5, 97, 0, 0, 240, 241, 5, 116, 0, 0, + 241, 242, 5, 97, 0, 0, 242, 54, 1, 0, 0, 0, 243, 244, 5, 101, 0, 0, 244, + 245, 5, 120, 0, 0, 245, 246, 5, 105, 0, 0, 246, 247, 5, 115, 0, 0, 247, + 248, 5, 116, 0, 0, 248, 249, 5, 105, 0, 0, 249, 250, 5, 110, 0, 0, 250, + 251, 5, 103, 0, 0, 251, 56, 1, 0, 0, 0, 252, 256, 5, 39, 0, 0, 253, 255, + 3, 105, 52, 0, 254, 253, 1, 0, 0, 0, 255, 258, 1, 0, 0, 0, 256, 254, 1, + 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 259, 1, 0, 0, 0, 258, 256, 1, 0, 0, + 0, 259, 260, 5, 36, 0, 0, 260, 261, 5, 123, 0, 0, 261, 58, 1, 0, 0, 0, + 262, 266, 5, 125, 0, 0, 263, 265, 3, 105, 52, 0, 264, 263, 1, 0, 0, 0, + 265, 268, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, + 269, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 270, 5, 36, 0, 0, 270, 271, + 5, 123, 0, 0, 271, 60, 1, 0, 0, 0, 272, 276, 5, 125, 0, 0, 273, 275, 3, + 105, 52, 0, 274, 273, 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, + 0, 0, 276, 277, 1, 0, 0, 0, 277, 279, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, + 279, 280, 5, 39, 0, 0, 280, 62, 1, 0, 0, 0, 281, 285, 5, 39, 0, 0, 282, + 284, 3, 105, 52, 0, 283, 282, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 283, + 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 288, 1, 0, 0, 0, 287, 285, 1, 0, + 0, 0, 288, 289, 5, 39, 0, 0, 289, 64, 1, 0, 0, 0, 290, 291, 5, 115, 0, + 0, 291, 292, 5, 116, 0, 0, 292, 293, 5, 114, 0, 0, 293, 294, 5, 105, 0, + 0, 294, 295, 5, 110, 0, 0, 295, 296, 5, 103, 0, 0, 296, 66, 1, 0, 0, 0, + 297, 298, 5, 105, 0, 0, 298, 299, 5, 110, 0, 0, 299, 300, 5, 116, 0, 0, + 300, 68, 1, 0, 0, 0, 301, 302, 5, 98, 0, 0, 302, 303, 5, 111, 0, 0, 303, + 304, 5, 111, 0, 0, 304, 305, 5, 108, 0, 0, 305, 70, 1, 0, 0, 0, 306, 307, + 5, 105, 0, 0, 307, 308, 5, 102, 0, 0, 308, 72, 1, 0, 0, 0, 309, 310, 5, + 102, 0, 0, 310, 311, 5, 111, 0, 0, 311, 312, 5, 114, 0, 0, 312, 74, 1, + 0, 0, 0, 313, 314, 5, 105, 0, 0, 314, 315, 5, 110, 0, 0, 315, 76, 1, 0, + 0, 0, 316, 317, 5, 63, 0, 0, 317, 78, 1, 0, 0, 0, 318, 319, 5, 62, 0, 0, + 319, 80, 1, 0, 0, 0, 320, 321, 5, 62, 0, 0, 321, 322, 5, 61, 0, 0, 322, + 82, 1, 0, 0, 0, 323, 324, 5, 60, 0, 0, 324, 84, 1, 0, 0, 0, 325, 326, 5, + 60, 0, 0, 326, 327, 5, 61, 0, 0, 327, 86, 1, 0, 0, 0, 328, 329, 5, 61, + 0, 0, 329, 330, 5, 61, 0, 0, 330, 88, 1, 0, 0, 0, 331, 332, 5, 33, 0, 0, + 332, 333, 5, 61, 0, 0, 333, 90, 1, 0, 0, 0, 334, 338, 7, 0, 0, 0, 335, + 337, 7, 1, 0, 0, 336, 335, 1, 0, 0, 0, 337, 340, 1, 0, 0, 0, 338, 336, + 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 92, 1, 0, 0, 0, 340, 338, 1, 0, + 0, 0, 341, 343, 7, 2, 0, 0, 342, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, + 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 352, 1, 0, 0, 0, 346, + 348, 5, 46, 0, 0, 347, 349, 7, 2, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, + 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 353, 1, 0, + 0, 0, 352, 346, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, 353, 94, 1, 0, 0, 0, + 354, 356, 7, 3, 0, 0, 355, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, + 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 96, 1, 0, 0, 0, 359, 360, 5, + 47, 0, 0, 360, 361, 5, 47, 0, 0, 361, 365, 1, 0, 0, 0, 362, 364, 8, 3, + 0, 0, 363, 362, 1, 0, 0, 0, 364, 367, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, + 365, 366, 1, 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 368, + 369, 6, 48, 0, 0, 369, 98, 1, 0, 0, 0, 370, 371, 5, 47, 0, 0, 371, 372, + 5, 42, 0, 0, 372, 376, 1, 0, 0, 0, 373, 375, 9, 0, 0, 0, 374, 373, 1, 0, + 0, 0, 375, 378, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 376, 374, 1, 0, 0, 0, + 377, 379, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 379, 380, 5, 42, 0, 0, 380, + 381, 5, 47, 0, 0, 381, 382, 1, 0, 0, 0, 382, 383, 6, 49, 0, 0, 383, 100, + 1, 0, 0, 0, 384, 386, 7, 4, 0, 0, 385, 384, 1, 0, 0, 0, 386, 387, 1, 0, + 0, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 389, 1, 0, 0, 0, + 389, 390, 6, 50, 0, 0, 390, 102, 1, 0, 0, 0, 391, 392, 9, 0, 0, 0, 392, + 104, 1, 0, 0, 0, 393, 396, 8, 5, 0, 0, 394, 396, 3, 107, 53, 0, 395, 393, + 1, 0, 0, 0, 395, 394, 1, 0, 0, 0, 396, 106, 1, 0, 0, 0, 397, 409, 5, 92, + 0, 0, 398, 410, 7, 6, 0, 0, 399, 400, 5, 117, 0, 0, 400, 401, 5, 123, 0, + 0, 401, 403, 1, 0, 0, 0, 402, 404, 3, 109, 54, 0, 403, 402, 1, 0, 0, 0, + 404, 405, 1, 0, 0, 0, 405, 403, 1, 0, 0, 0, 405, 406, 1, 0, 0, 0, 406, + 407, 1, 0, 0, 0, 407, 408, 5, 125, 0, 0, 408, 410, 1, 0, 0, 0, 409, 398, + 1, 0, 0, 0, 409, 399, 1, 0, 0, 0, 410, 108, 1, 0, 0, 0, 411, 412, 7, 7, + 0, 0, 412, 110, 1, 0, 0, 0, 18, 0, 118, 144, 256, 266, 276, 285, 338, 344, + 350, 352, 357, 365, 376, 387, 395, 405, 409, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -310,37 +313,38 @@ const ( bicepLexerTRUE = 16 bicepLexerFALSE = 17 bicepLexerNULL = 18 - bicepLexerOBJECT = 19 - bicepLexerRESOURCE = 20 - bicepLexerOUTPUT = 21 - bicepLexerTARGET_SCOPE = 22 - bicepLexerIMPORT = 23 - bicepLexerWITH = 24 - bicepLexerAS = 25 - bicepLexerMETADATA = 26 - bicepLexerEXISTING = 27 - bicepLexerSTRING_LEFT_PIECE = 28 - bicepLexerSTRING_MIDDLE_PIECE = 29 - bicepLexerSTRING_RIGHT_PIECE = 30 - bicepLexerSTRING_COMPLETE = 31 - bicepLexerSTRING = 32 - bicepLexerINT = 33 - bicepLexerBOOL = 34 - bicepLexerIF = 35 - bicepLexerFOR = 36 - bicepLexerIN = 37 - bicepLexerQMARK = 38 - bicepLexerGT = 39 - bicepLexerGTE = 40 - bicepLexerLT = 41 - bicepLexerLTE = 42 - bicepLexerEQ = 43 - bicepLexerNEQ = 44 - bicepLexerIDENTIFIER = 45 - bicepLexerNUMBER = 46 - bicepLexerNL = 47 - bicepLexerSINGLE_LINE_COMMENT = 48 - bicepLexerMULTI_LINE_COMMENT = 49 - bicepLexerSPACES = 50 - bicepLexerUNKNOWN = 51 + bicepLexerARRAY = 19 + bicepLexerOBJECT = 20 + bicepLexerRESOURCE = 21 + bicepLexerOUTPUT = 22 + bicepLexerTARGET_SCOPE = 23 + bicepLexerIMPORT = 24 + bicepLexerWITH = 25 + bicepLexerAS = 26 + bicepLexerMETADATA = 27 + bicepLexerEXISTING = 28 + bicepLexerSTRING_LEFT_PIECE = 29 + bicepLexerSTRING_MIDDLE_PIECE = 30 + bicepLexerSTRING_RIGHT_PIECE = 31 + bicepLexerSTRING_COMPLETE = 32 + bicepLexerSTRING = 33 + bicepLexerINT = 34 + bicepLexerBOOL = 35 + bicepLexerIF = 36 + bicepLexerFOR = 37 + bicepLexerIN = 38 + bicepLexerQMARK = 39 + bicepLexerGT = 40 + bicepLexerGTE = 41 + bicepLexerLT = 42 + bicepLexerLTE = 43 + bicepLexerEQ = 44 + bicepLexerNEQ = 45 + bicepLexerIDENTIFIER = 46 + bicepLexerNUMBER = 47 + bicepLexerNL = 48 + bicepLexerSINGLE_LINE_COMMENT = 49 + bicepLexerMULTI_LINE_COMMENT = 50 + bicepLexerSPACES = 51 + bicepLexerUNKNOWN = 52 ) diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 71f338a27ea..9ae27c55251 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -35,15 +35,15 @@ func bicepParserInit() { staticData.LiteralNames = []string{ "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", - "'object'", "'resource'", "'output'", "'targetScope'", "'import'", "'with'", - "'as'", "'metadata'", "'existing'", "", "", "", "", "'string'", "'int'", - "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", "'<='", - "'=='", "'!='", + "'array'", "'object'", "'resource'", "'output'", "'targetScope'", "'import'", + "'with'", "'as'", "'metadata'", "'existing'", "", "", "", "", "'string'", + "'int'", "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", + "'<='", "'=='", "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", - "TRUE", "FALSE", "NULL", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", + "TRUE", "FALSE", "NULL", "ARRAY", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", @@ -61,7 +61,7 @@ func bicepParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 51, 386, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 52, 386, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, @@ -102,8 +102,8 @@ func bicepParserInit() { 369, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 3, 28, 376, 8, 28, 1, 28, 5, 28, 379, 8, 28, 10, 28, 12, 28, 382, 9, 28, 1, 29, 1, 29, 1, 29, 0, 1, 30, 30, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, - 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 0, 2, 1, 0, 39, 44, - 3, 0, 14, 20, 32, 34, 45, 45, 417, 0, 63, 1, 0, 0, 0, 2, 75, 1, 0, 0, 0, + 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 0, 2, 1, 0, 40, 45, + 3, 0, 14, 28, 33, 38, 46, 46, 417, 0, 63, 1, 0, 0, 0, 2, 75, 1, 0, 0, 0, 4, 80, 1, 0, 0, 0, 6, 98, 1, 0, 0, 0, 8, 104, 1, 0, 0, 0, 10, 116, 1, 0, 0, 0, 12, 136, 1, 0, 0, 0, 14, 150, 1, 0, 0, 0, 16, 158, 1, 0, 0, 0, 18, 174, 1, 0, 0, 0, 20, 180, 1, 0, 0, 0, 22, 184, 1, 0, 0, 0, 24, 208, 1, @@ -116,65 +116,65 @@ func bicepParserInit() { 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 66, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, 66, 67, 5, 0, 0, 1, 67, 1, 1, 0, 0, 0, 68, 76, 3, 4, 2, 0, 69, 76, 3, 8, 4, 0, 70, 76, 3, 10, 5, 0, 71, 76, 3, 12, 6, 0, 72, 76, 3, 14, 7, 0, 73, - 76, 3, 16, 8, 0, 74, 76, 5, 47, 0, 0, 75, 68, 1, 0, 0, 0, 75, 69, 1, 0, + 76, 3, 16, 8, 0, 74, 76, 5, 48, 0, 0, 75, 68, 1, 0, 0, 0, 75, 69, 1, 0, 0, 0, 75, 70, 1, 0, 0, 0, 75, 71, 1, 0, 0, 0, 75, 72, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 74, 1, 0, 0, 0, 76, 3, 1, 0, 0, 0, 77, 79, 3, 50, 25, 0, 78, 77, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 14, 0, 0, 84, 94, 3, 58, 29, 0, 85, 87, 3, 38, 19, 0, 86, 88, 3, 6, 3, 0, 87, 86, 1, - 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 95, 1, 0, 0, 0, 89, 90, 5, 20, 0, 0, 90, + 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 95, 1, 0, 0, 0, 89, 90, 5, 21, 0, 0, 90, 92, 3, 28, 14, 0, 91, 93, 3, 6, 3, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 95, 1, 0, 0, 0, 94, 85, 1, 0, 0, 0, 94, 89, 1, 0, 0, 0, 95, 96, - 1, 0, 0, 0, 96, 97, 5, 47, 0, 0, 97, 5, 1, 0, 0, 0, 98, 99, 5, 11, 0, 0, + 1, 0, 0, 0, 96, 97, 5, 48, 0, 0, 97, 5, 1, 0, 0, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 30, 15, 0, 100, 7, 1, 0, 0, 0, 101, 103, 3, 50, 25, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 15, 0, 0, 108, 109, 3, 58, 29, 0, 109, 110, 5, 11, 0, 0, 110, 111, 3, 30, 15, - 0, 111, 112, 5, 47, 0, 0, 112, 9, 1, 0, 0, 0, 113, 115, 3, 50, 25, 0, 114, + 0, 111, 112, 5, 48, 0, 0, 112, 9, 1, 0, 0, 0, 113, 115, 3, 50, 25, 0, 114, 113, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 116, 117, - 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 20, - 0, 0, 120, 121, 3, 58, 29, 0, 121, 123, 3, 28, 14, 0, 122, 124, 5, 27, + 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 21, + 0, 0, 120, 121, 3, 58, 29, 0, 121, 123, 3, 28, 14, 0, 122, 124, 5, 28, 0, 0, 123, 122, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 129, 5, 11, 0, 0, 126, 130, 3, 20, 10, 0, 127, 130, 3, 42, 21, 0, 128, 130, 3, 22, 11, 0, 129, 126, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 129, - 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 5, 47, 0, 0, 132, 11, + 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 5, 48, 0, 0, 132, 11, 1, 0, 0, 0, 133, 135, 3, 50, 25, 0, 134, 133, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 139, 1, 0, 0, - 0, 138, 136, 1, 0, 0, 0, 139, 140, 5, 21, 0, 0, 140, 144, 3, 58, 29, 0, - 141, 145, 3, 58, 29, 0, 142, 143, 5, 20, 0, 0, 143, 145, 3, 28, 14, 0, + 0, 138, 136, 1, 0, 0, 0, 139, 140, 5, 22, 0, 0, 140, 144, 3, 58, 29, 0, + 141, 145, 3, 58, 29, 0, 142, 143, 5, 21, 0, 0, 143, 145, 3, 28, 14, 0, 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, - 147, 5, 11, 0, 0, 147, 148, 3, 30, 15, 0, 148, 149, 5, 47, 0, 0, 149, 13, - 1, 0, 0, 0, 150, 151, 5, 22, 0, 0, 151, 152, 5, 11, 0, 0, 152, 153, 3, - 30, 15, 0, 153, 154, 5, 47, 0, 0, 154, 15, 1, 0, 0, 0, 155, 157, 3, 50, + 147, 5, 11, 0, 0, 147, 148, 3, 30, 15, 0, 148, 149, 5, 48, 0, 0, 149, 13, + 1, 0, 0, 0, 150, 151, 5, 23, 0, 0, 151, 152, 5, 11, 0, 0, 152, 153, 3, + 30, 15, 0, 153, 154, 5, 48, 0, 0, 154, 15, 1, 0, 0, 0, 155, 157, 3, 50, 25, 0, 156, 155, 1, 0, 0, 0, 157, 160, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 161, - 162, 5, 23, 0, 0, 162, 169, 3, 28, 14, 0, 163, 164, 5, 24, 0, 0, 164, 168, - 3, 42, 21, 0, 165, 166, 5, 25, 0, 0, 166, 168, 3, 58, 29, 0, 167, 163, + 162, 5, 24, 0, 0, 162, 169, 3, 28, 14, 0, 163, 164, 5, 25, 0, 0, 164, 168, + 3, 42, 21, 0, 165, 166, 5, 26, 0, 0, 166, 168, 3, 58, 29, 0, 167, 163, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 171, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 172, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, - 172, 173, 5, 47, 0, 0, 173, 17, 1, 0, 0, 0, 174, 175, 5, 26, 0, 0, 175, + 172, 173, 5, 48, 0, 0, 173, 17, 1, 0, 0, 0, 174, 175, 5, 27, 0, 0, 175, 176, 3, 58, 29, 0, 176, 177, 5, 11, 0, 0, 177, 178, 3, 30, 15, 0, 178, - 179, 5, 47, 0, 0, 179, 19, 1, 0, 0, 0, 180, 181, 5, 35, 0, 0, 181, 182, + 179, 5, 48, 0, 0, 179, 19, 1, 0, 0, 0, 180, 181, 5, 36, 0, 0, 181, 182, 3, 36, 18, 0, 182, 183, 3, 42, 21, 0, 183, 21, 1, 0, 0, 0, 184, 188, 5, - 4, 0, 0, 185, 187, 5, 47, 0, 0, 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, + 4, 0, 0, 185, 187, 5, 48, 0, 0, 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, - 188, 1, 0, 0, 0, 191, 194, 5, 36, 0, 0, 192, 195, 3, 58, 29, 0, 193, 195, + 188, 1, 0, 0, 0, 191, 194, 5, 37, 0, 0, 192, 195, 3, 58, 29, 0, 193, 195, 3, 24, 12, 0, 194, 192, 1, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 196, 1, - 0, 0, 0, 196, 197, 5, 37, 0, 0, 197, 198, 3, 30, 15, 0, 198, 199, 5, 10, - 0, 0, 199, 203, 3, 26, 13, 0, 200, 202, 5, 47, 0, 0, 201, 200, 1, 0, 0, + 0, 0, 0, 196, 197, 5, 38, 0, 0, 197, 198, 3, 30, 15, 0, 198, 199, 5, 10, + 0, 0, 199, 203, 3, 26, 13, 0, 200, 202, 5, 48, 0, 0, 201, 200, 1, 0, 0, 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 206, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 207, 5, 5, 0, 0, 207, 23, 1, 0, 0, 0, 208, 209, 5, 6, 0, 0, 209, 210, 3, 58, 29, 0, 210, 211, 5, 3, 0, 0, 211, 212, 3, 58, 29, 0, 212, 213, 5, 7, 0, 0, 213, 25, 1, 0, 0, 0, 214, 217, 3, 30, 15, 0, 215, 217, 3, 20, 10, 0, 216, 214, 1, 0, 0, 0, 216, - 215, 1, 0, 0, 0, 217, 27, 1, 0, 0, 0, 218, 224, 5, 28, 0, 0, 219, 220, - 3, 30, 15, 0, 220, 221, 5, 29, 0, 0, 221, 223, 1, 0, 0, 0, 222, 219, 1, + 215, 1, 0, 0, 0, 217, 27, 1, 0, 0, 0, 218, 224, 5, 29, 0, 0, 219, 220, + 3, 30, 15, 0, 220, 221, 5, 30, 0, 0, 221, 223, 1, 0, 0, 0, 222, 219, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 227, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 228, 3, 30, 15, 0, - 228, 229, 5, 30, 0, 0, 229, 232, 1, 0, 0, 0, 230, 232, 5, 31, 0, 0, 231, + 228, 229, 5, 31, 0, 0, 229, 232, 1, 0, 0, 0, 230, 232, 5, 32, 0, 0, 231, 218, 1, 0, 0, 0, 231, 230, 1, 0, 0, 0, 232, 29, 1, 0, 0, 0, 233, 234, 6, 15, -1, 0, 234, 235, 3, 34, 17, 0, 235, 262, 1, 0, 0, 0, 236, 237, 10, - 6, 0, 0, 237, 238, 5, 38, 0, 0, 238, 239, 3, 30, 15, 0, 239, 240, 5, 10, + 6, 0, 0, 237, 238, 5, 39, 0, 0, 238, 239, 3, 30, 15, 0, 239, 240, 5, 10, 0, 0, 240, 241, 3, 30, 15, 7, 241, 261, 1, 0, 0, 0, 242, 243, 10, 2, 0, 0, 243, 244, 3, 32, 16, 0, 244, 245, 3, 30, 15, 3, 245, 261, 1, 0, 0, 0, 246, 247, 10, 7, 0, 0, 247, 248, 5, 4, 0, 0, 248, 249, 3, 30, 15, 0, 249, @@ -191,17 +191,17 @@ func bicepParserInit() { 275, 267, 1, 0, 0, 0, 275, 268, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, 270, 1, 0, 0, 0, 275, 271, 1, 0, 0, 0, 275, 272, 1, 0, 0, 0, 275, 273, 1, 0, 0, 0, 275, 274, 1, 0, 0, 0, 276, 35, 1, 0, 0, 0, 277, 279, 5, 6, - 0, 0, 278, 280, 5, 47, 0, 0, 279, 278, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, - 280, 281, 1, 0, 0, 0, 281, 283, 3, 30, 15, 0, 282, 284, 5, 47, 0, 0, 283, + 0, 0, 278, 280, 5, 48, 0, 0, 279, 278, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, + 280, 281, 1, 0, 0, 0, 281, 283, 3, 30, 15, 0, 282, 284, 5, 48, 0, 0, 283, 282, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 286, 5, 7, 0, 0, 286, 37, 1, 0, 0, 0, 287, 288, 3, 58, 29, 0, 288, 39, 1, 0, - 0, 0, 289, 295, 5, 46, 0, 0, 290, 295, 5, 16, 0, 0, 291, 295, 5, 17, 0, + 0, 0, 289, 295, 5, 47, 0, 0, 290, 295, 5, 16, 0, 0, 291, 295, 5, 17, 0, 0, 292, 295, 5, 18, 0, 0, 293, 295, 3, 58, 29, 0, 294, 289, 1, 0, 0, 0, 294, 290, 1, 0, 0, 0, 294, 291, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 293, 1, 0, 0, 0, 295, 41, 1, 0, 0, 0, 296, 313, 5, 12, 0, 0, 297, 299, - 5, 47, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, + 5, 48, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 310, 1, 0, 0, 0, 302, 304, 3, 44, 22, - 0, 303, 305, 5, 47, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, + 0, 303, 305, 5, 48, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 302, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 298, 1, 0, 0, 0, @@ -209,25 +209,25 @@ func bicepParserInit() { 43, 1, 0, 0, 0, 317, 320, 3, 58, 29, 0, 318, 320, 3, 28, 14, 0, 319, 317, 1, 0, 0, 0, 319, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 10, 0, 0, 322, 323, 3, 30, 15, 0, 323, 45, 1, 0, 0, 0, 324, 328, 5, 4, 0, 0, - 325, 327, 5, 47, 0, 0, 326, 325, 1, 0, 0, 0, 327, 330, 1, 0, 0, 0, 328, + 325, 327, 5, 48, 0, 0, 326, 325, 1, 0, 0, 0, 327, 330, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 334, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 331, 333, 3, 48, 24, 0, 332, 331, 1, 0, 0, 0, 333, 336, 1, 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337, 338, 5, 5, 0, 0, 338, 47, 1, 0, 0, 0, 339, - 346, 3, 30, 15, 0, 340, 342, 5, 47, 0, 0, 341, 340, 1, 0, 0, 0, 342, 343, + 346, 3, 30, 15, 0, 340, 342, 5, 48, 0, 0, 341, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 347, 1, 0, 0, 0, 345, 347, 5, 3, 0, 0, 346, 341, 1, 0, 0, 0, 346, 345, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 49, 1, 0, 0, 0, 348, 349, 5, 2, 0, 0, 349, 350, - 3, 52, 26, 0, 350, 351, 5, 47, 0, 0, 351, 51, 1, 0, 0, 0, 352, 358, 3, + 3, 52, 26, 0, 350, 351, 5, 48, 0, 0, 351, 51, 1, 0, 0, 0, 352, 358, 3, 54, 27, 0, 353, 354, 3, 30, 15, 0, 354, 355, 5, 8, 0, 0, 355, 356, 3, 54, 27, 0, 356, 358, 1, 0, 0, 0, 357, 352, 1, 0, 0, 0, 357, 353, 1, 0, 0, 0, 358, 53, 1, 0, 0, 0, 359, 360, 3, 58, 29, 0, 360, 365, 5, 6, 0, 0, 361, - 363, 5, 47, 0, 0, 362, 361, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, + 363, 5, 48, 0, 0, 362, 361, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 366, 3, 56, 28, 0, 365, 362, 1, 0, 0, 0, 365, 366, 1, - 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 369, 5, 47, 0, 0, 368, 367, 1, 0, 0, + 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 369, 5, 48, 0, 0, 368, 367, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 371, 5, 7, 0, 0, 371, 55, 1, 0, 0, 0, 372, 380, 3, 30, 15, 0, 373, 375, 5, 3, 0, 0, 374, 376, - 5, 47, 0, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, + 5, 48, 0, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 379, 3, 30, 15, 0, 378, 373, 1, 0, 0, 0, 379, 382, 1, 0, 0, 0, 380, 378, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 57, 1, 0, 0, 0, 382, 380, 1, 0, 0, 0, 383, 384, 7, 1, 0, 0, 384, 59, 1, 0, 0, 0, 42, 63, 75, @@ -290,39 +290,40 @@ const ( bicepParserTRUE = 16 bicepParserFALSE = 17 bicepParserNULL = 18 - bicepParserOBJECT = 19 - bicepParserRESOURCE = 20 - bicepParserOUTPUT = 21 - bicepParserTARGET_SCOPE = 22 - bicepParserIMPORT = 23 - bicepParserWITH = 24 - bicepParserAS = 25 - bicepParserMETADATA = 26 - bicepParserEXISTING = 27 - bicepParserSTRING_LEFT_PIECE = 28 - bicepParserSTRING_MIDDLE_PIECE = 29 - bicepParserSTRING_RIGHT_PIECE = 30 - bicepParserSTRING_COMPLETE = 31 - bicepParserSTRING = 32 - bicepParserINT = 33 - bicepParserBOOL = 34 - bicepParserIF = 35 - bicepParserFOR = 36 - bicepParserIN = 37 - bicepParserQMARK = 38 - bicepParserGT = 39 - bicepParserGTE = 40 - bicepParserLT = 41 - bicepParserLTE = 42 - bicepParserEQ = 43 - bicepParserNEQ = 44 - bicepParserIDENTIFIER = 45 - bicepParserNUMBER = 46 - bicepParserNL = 47 - bicepParserSINGLE_LINE_COMMENT = 48 - bicepParserMULTI_LINE_COMMENT = 49 - bicepParserSPACES = 50 - bicepParserUNKNOWN = 51 + bicepParserARRAY = 19 + bicepParserOBJECT = 20 + bicepParserRESOURCE = 21 + bicepParserOUTPUT = 22 + bicepParserTARGET_SCOPE = 23 + bicepParserIMPORT = 24 + bicepParserWITH = 25 + bicepParserAS = 26 + bicepParserMETADATA = 27 + bicepParserEXISTING = 28 + bicepParserSTRING_LEFT_PIECE = 29 + bicepParserSTRING_MIDDLE_PIECE = 30 + bicepParserSTRING_RIGHT_PIECE = 31 + bicepParserSTRING_COMPLETE = 32 + bicepParserSTRING = 33 + bicepParserINT = 34 + bicepParserBOOL = 35 + bicepParserIF = 36 + bicepParserFOR = 37 + bicepParserIN = 38 + bicepParserQMARK = 39 + bicepParserGT = 40 + bicepParserGTE = 41 + bicepParserLT = 42 + bicepParserLTE = 43 + bicepParserEQ = 44 + bicepParserNEQ = 45 + bicepParserIDENTIFIER = 46 + bicepParserNUMBER = 47 + bicepParserNL = 48 + bicepParserSINGLE_LINE_COMMENT = 49 + bicepParserMULTI_LINE_COMMENT = 50 + bicepParserSPACES = 51 + bicepParserUNKNOWN = 52 ) // bicepParser rules. @@ -483,7 +484,7 @@ func (p *bicepParser) Program() (localctx IProgramContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&140737504133124) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&281475008217092) != 0 { { p.SetState(60) p.Statement() @@ -3229,7 +3230,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } switch p.GetTokenStream().LA(1) { - case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: + case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: { p.SetState(192) @@ -3634,8 +3635,8 @@ func (p *bicepParser) ForBody() (localctx IForBodyContext) { goto errorExit } - switch p.GetTokenStream().LA(1) { - case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER, bicepParserNUMBER: + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { + case 1: p.EnterOuterAlt(localctx, 1) { p.SetState(214) @@ -3645,15 +3646,14 @@ func (p *bicepParser) ForBody() (localctx IForBodyContext) { localctx.(*ForBodyContext).body = _x } - case bicepParserIF: + case 2: p.EnterOuterAlt(localctx, 2) { p.SetState(215) p.IfCondition() } - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + case antlr.ATNInvalidAltNumber: goto errorExit } @@ -4451,7 +4451,7 @@ func (p *bicepParser) LogicCharacter() (localctx ILogicCharacterContext) { p.SetState(265) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&34634616274944) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&69269232549888) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -5395,7 +5395,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&35216854859776) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&70915278749696) != 0 { { p.SetState(302) p.ObjectProperty() @@ -5597,7 +5597,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } switch p.GetTokenStream().LA(1) { - case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER: + case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: { p.SetState(317) @@ -5813,7 +5813,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&105585599041618) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&211652767109202) != 0 { { p.SetState(331) p.ArrayItem() @@ -5995,7 +5995,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserCBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserOBJECT, bicepParserRESOURCE, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIDENTIFIER, bicepParserNUMBER: + case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserCBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER, bicepParserNUMBER: default: } @@ -6706,15 +6706,26 @@ type IIdentifierContext interface { // Getter signatures IDENTIFIER() antlr.TerminalNode + IMPORT() antlr.TerminalNode + WITH() antlr.TerminalNode + AS() antlr.TerminalNode + METADATA() antlr.TerminalNode PARAM() antlr.TerminalNode RESOURCE() antlr.TerminalNode + OUTPUT() antlr.TerminalNode + EXISTING() antlr.TerminalNode VAR() antlr.TerminalNode + IF() antlr.TerminalNode + FOR() antlr.TerminalNode + IN() antlr.TerminalNode TRUE() antlr.TerminalNode FALSE() antlr.TerminalNode NULL() antlr.TerminalNode + TARGET_SCOPE() antlr.TerminalNode STRING() antlr.TerminalNode INT() antlr.TerminalNode BOOL() antlr.TerminalNode + ARRAY() antlr.TerminalNode OBJECT() antlr.TerminalNode // IsIdentifierContext differentiates from other interfaces. @@ -6757,6 +6768,22 @@ func (s *IdentifierContext) IDENTIFIER() antlr.TerminalNode { return s.GetToken(bicepParserIDENTIFIER, 0) } +func (s *IdentifierContext) IMPORT() antlr.TerminalNode { + return s.GetToken(bicepParserIMPORT, 0) +} + +func (s *IdentifierContext) WITH() antlr.TerminalNode { + return s.GetToken(bicepParserWITH, 0) +} + +func (s *IdentifierContext) AS() antlr.TerminalNode { + return s.GetToken(bicepParserAS, 0) +} + +func (s *IdentifierContext) METADATA() antlr.TerminalNode { + return s.GetToken(bicepParserMETADATA, 0) +} + func (s *IdentifierContext) PARAM() antlr.TerminalNode { return s.GetToken(bicepParserPARAM, 0) } @@ -6765,10 +6792,30 @@ func (s *IdentifierContext) RESOURCE() antlr.TerminalNode { return s.GetToken(bicepParserRESOURCE, 0) } +func (s *IdentifierContext) OUTPUT() antlr.TerminalNode { + return s.GetToken(bicepParserOUTPUT, 0) +} + +func (s *IdentifierContext) EXISTING() antlr.TerminalNode { + return s.GetToken(bicepParserEXISTING, 0) +} + func (s *IdentifierContext) VAR() antlr.TerminalNode { return s.GetToken(bicepParserVAR, 0) } +func (s *IdentifierContext) IF() antlr.TerminalNode { + return s.GetToken(bicepParserIF, 0) +} + +func (s *IdentifierContext) FOR() antlr.TerminalNode { + return s.GetToken(bicepParserFOR, 0) +} + +func (s *IdentifierContext) IN() antlr.TerminalNode { + return s.GetToken(bicepParserIN, 0) +} + func (s *IdentifierContext) TRUE() antlr.TerminalNode { return s.GetToken(bicepParserTRUE, 0) } @@ -6781,6 +6828,10 @@ func (s *IdentifierContext) NULL() antlr.TerminalNode { return s.GetToken(bicepParserNULL, 0) } +func (s *IdentifierContext) TARGET_SCOPE() antlr.TerminalNode { + return s.GetToken(bicepParserTARGET_SCOPE, 0) +} + func (s *IdentifierContext) STRING() antlr.TerminalNode { return s.GetToken(bicepParserSTRING, 0) } @@ -6793,6 +6844,10 @@ func (s *IdentifierContext) BOOL() antlr.TerminalNode { return s.GetToken(bicepParserBOOL, 0) } +func (s *IdentifierContext) ARRAY() antlr.TerminalNode { + return s.GetToken(bicepParserARRAY, 0) +} + func (s *IdentifierContext) OBJECT() antlr.TerminalNode { return s.GetToken(bicepParserOBJECT, 0) } @@ -6825,7 +6880,7 @@ func (p *bicepParser) Identifier() (localctx IIdentifierContext) { p.SetState(383) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&35214438940672) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&70910446911488) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 3a495bb43b3..a0c0d809ebb 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -658,6 +658,12 @@ func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{ if (ctx.OBJECT()) != nil { return ctx.OBJECT().GetText() } + if (ctx.ARRAY()) != nil { + return ctx.ARRAY().GetText() + } + if (ctx.METADATA()) != nil { + return ctx.METADATA().GetText() + } return "" } From c65767ec0d55905c3ea652c521876791e0cb8e5a Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 9 May 2024 11:35:18 +0100 Subject: [PATCH 105/130] added modules and type to bicep grammar --- pkg/parser/bicep/antlr/bicep.g4 | 26 +- pkg/parser/bicep/antlr/parser/bicep.interp | 8 +- pkg/parser/bicep/antlr/parser/bicep.tokens | 78 +- .../bicep/antlr/parser/bicepLexer.interp | 8 +- .../bicep/antlr/parser/bicepLexer.tokens | 78 +- .../bicep/antlr/parser/bicep_base_visitor.go | 8 + pkg/parser/bicep/antlr/parser/bicep_lexer.go | 415 ++-- pkg/parser/bicep/antlr/parser/bicep_parser.go | 1723 ++++++++++++----- .../bicep/antlr/parser/bicep_visitor.go | 6 + 9 files changed, 1542 insertions(+), 808 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index dfbaeac0d26..d80f936193f 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -3,7 +3,7 @@ grammar bicep; // program -> statement* EOF program: statement* EOF; -statement: parameterDecl | variableDecl | resourceDecl | outputDecl | targetScopeDecl | importDecl | NL; +statement: parameterDecl | variableDecl | resourceDecl | outputDecl | targetScopeDecl | importDecl | metadataDecl | typeDecl | moduleDecl | NL; // parameterDecl -> decorator* "parameter" IDENTIFIER(name) typeExpression parameterDefaultValue? NL // | decorator* "parameter" IDENTIFIER(name) "resource" interpString(type) parameterDefaultValue? NL @@ -29,7 +29,12 @@ resourceDecl: | forExpression ) NL; -outputDecl: decorator* OUTPUT name = identifier (type1 = identifier | RESOURCE type2 = interpString) ASSIGN expression NL; + +// outputDecl -> +// decorator* "output" IDENTIFIER(name) IDENTIFIER(type) "=" expression NL +// decorator* "output" IDENTIFIER(name) "resource" interpString(type) "=" expression NL +outputDecl: + decorator* OUTPUT name = identifier (type1 = identifier | RESOURCE type2 = interpString) ASSIGN expression NL; // targetScopeDecl -> "targetScope" "=" expression NL targetScopeDecl: TARGET_SCOPE ASSIGN expression NL; @@ -42,6 +47,19 @@ importDecl: metadataDecl: METADATA name = identifier ASSIGN expression NL; +// typeDecl -> decorator* "type" IDENTIFIER(name) "=" typeExpression NL +typeDecl: + decorator* TYPE name = identifier ASSIGN typeExpression NL; + +// moduleDecl -> decorator* "module" IDENTIFIER(name) interpString(type) "=" (ifCondition | object | forExpression) NL +moduleDecl + : decorator* MODULE name = identifier type = interpString ASSIGN ( + ifCondition + | object + | forExpression + ) NL + ; + // ifCondition -> "if" parenthesizedExpression object ifCondition : IF parenthesizedExpression object @@ -207,6 +225,10 @@ METADATA: 'metadata'; EXISTING: 'existing'; +TYPE: 'type'; + +MODULE: 'module'; + // stringLeftPiece -> "'" STRINGCHAR* "${" STRING_LEFT_PIECE: '\'' STRINGCHAR* '${'; diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index 933ca91b3c7..de09f84fb6e 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -28,6 +28,8 @@ null 'as' 'metadata' 'existing' +'type' +'module' null null null @@ -83,6 +85,8 @@ WITH AS METADATA EXISTING +TYPE +MODULE STRING_LEFT_PIECE STRING_MIDDLE_PIECE STRING_RIGHT_PIECE @@ -119,6 +123,8 @@ outputDecl targetScopeDecl importDecl metadataDecl +typeDecl +moduleDecl ifCondition forExpression forVariableBlock @@ -142,4 +148,4 @@ identifier atn: -[4, 1, 52, 386, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 1, 0, 5, 0, 62, 8, 0, 10, 0, 12, 0, 65, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 76, 8, 1, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 88, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 93, 8, 2, 3, 2, 95, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 103, 8, 4, 10, 4, 12, 4, 106, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 115, 8, 5, 10, 5, 12, 5, 118, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 124, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 130, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 135, 8, 6, 10, 6, 12, 6, 138, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 145, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 157, 8, 8, 10, 8, 12, 8, 160, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 168, 8, 8, 10, 8, 12, 8, 171, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 5, 11, 187, 8, 11, 10, 11, 12, 11, 190, 9, 11, 1, 11, 1, 11, 1, 11, 3, 11, 195, 8, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 202, 8, 11, 10, 11, 12, 11, 205, 9, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 217, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 223, 8, 14, 10, 14, 12, 14, 226, 9, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 232, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 261, 8, 15, 10, 15, 12, 15, 264, 9, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 276, 8, 17, 1, 18, 1, 18, 3, 18, 280, 8, 18, 1, 18, 1, 18, 3, 18, 284, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 295, 8, 20, 1, 21, 1, 21, 4, 21, 299, 8, 21, 11, 21, 12, 21, 300, 1, 21, 1, 21, 4, 21, 305, 8, 21, 11, 21, 12, 21, 306, 5, 21, 309, 8, 21, 10, 21, 12, 21, 312, 9, 21, 3, 21, 314, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 3, 22, 320, 8, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 327, 8, 23, 10, 23, 12, 23, 330, 9, 23, 1, 23, 5, 23, 333, 8, 23, 10, 23, 12, 23, 336, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 4, 24, 342, 8, 24, 11, 24, 12, 24, 343, 1, 24, 3, 24, 347, 8, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 358, 8, 26, 1, 27, 1, 27, 1, 27, 3, 27, 363, 8, 27, 1, 27, 3, 27, 366, 8, 27, 1, 27, 3, 27, 369, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 3, 28, 376, 8, 28, 1, 28, 5, 28, 379, 8, 28, 10, 28, 12, 28, 382, 9, 28, 1, 29, 1, 29, 1, 29, 0, 1, 30, 30, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 0, 2, 1, 0, 40, 45, 3, 0, 14, 28, 33, 38, 46, 46, 417, 0, 63, 1, 0, 0, 0, 2, 75, 1, 0, 0, 0, 4, 80, 1, 0, 0, 0, 6, 98, 1, 0, 0, 0, 8, 104, 1, 0, 0, 0, 10, 116, 1, 0, 0, 0, 12, 136, 1, 0, 0, 0, 14, 150, 1, 0, 0, 0, 16, 158, 1, 0, 0, 0, 18, 174, 1, 0, 0, 0, 20, 180, 1, 0, 0, 0, 22, 184, 1, 0, 0, 0, 24, 208, 1, 0, 0, 0, 26, 216, 1, 0, 0, 0, 28, 231, 1, 0, 0, 0, 30, 233, 1, 0, 0, 0, 32, 265, 1, 0, 0, 0, 34, 275, 1, 0, 0, 0, 36, 277, 1, 0, 0, 0, 38, 287, 1, 0, 0, 0, 40, 294, 1, 0, 0, 0, 42, 296, 1, 0, 0, 0, 44, 319, 1, 0, 0, 0, 46, 324, 1, 0, 0, 0, 48, 339, 1, 0, 0, 0, 50, 348, 1, 0, 0, 0, 52, 357, 1, 0, 0, 0, 54, 359, 1, 0, 0, 0, 56, 372, 1, 0, 0, 0, 58, 383, 1, 0, 0, 0, 60, 62, 3, 2, 1, 0, 61, 60, 1, 0, 0, 0, 62, 65, 1, 0, 0, 0, 63, 61, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 66, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, 66, 67, 5, 0, 0, 1, 67, 1, 1, 0, 0, 0, 68, 76, 3, 4, 2, 0, 69, 76, 3, 8, 4, 0, 70, 76, 3, 10, 5, 0, 71, 76, 3, 12, 6, 0, 72, 76, 3, 14, 7, 0, 73, 76, 3, 16, 8, 0, 74, 76, 5, 48, 0, 0, 75, 68, 1, 0, 0, 0, 75, 69, 1, 0, 0, 0, 75, 70, 1, 0, 0, 0, 75, 71, 1, 0, 0, 0, 75, 72, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 74, 1, 0, 0, 0, 76, 3, 1, 0, 0, 0, 77, 79, 3, 50, 25, 0, 78, 77, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 14, 0, 0, 84, 94, 3, 58, 29, 0, 85, 87, 3, 38, 19, 0, 86, 88, 3, 6, 3, 0, 87, 86, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 95, 1, 0, 0, 0, 89, 90, 5, 21, 0, 0, 90, 92, 3, 28, 14, 0, 91, 93, 3, 6, 3, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 95, 1, 0, 0, 0, 94, 85, 1, 0, 0, 0, 94, 89, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 48, 0, 0, 97, 5, 1, 0, 0, 0, 98, 99, 5, 11, 0, 0, 99, 100, 3, 30, 15, 0, 100, 7, 1, 0, 0, 0, 101, 103, 3, 50, 25, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 15, 0, 0, 108, 109, 3, 58, 29, 0, 109, 110, 5, 11, 0, 0, 110, 111, 3, 30, 15, 0, 111, 112, 5, 48, 0, 0, 112, 9, 1, 0, 0, 0, 113, 115, 3, 50, 25, 0, 114, 113, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 21, 0, 0, 120, 121, 3, 58, 29, 0, 121, 123, 3, 28, 14, 0, 122, 124, 5, 28, 0, 0, 123, 122, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 129, 5, 11, 0, 0, 126, 130, 3, 20, 10, 0, 127, 130, 3, 42, 21, 0, 128, 130, 3, 22, 11, 0, 129, 126, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 129, 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 5, 48, 0, 0, 132, 11, 1, 0, 0, 0, 133, 135, 3, 50, 25, 0, 134, 133, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 139, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 140, 5, 22, 0, 0, 140, 144, 3, 58, 29, 0, 141, 145, 3, 58, 29, 0, 142, 143, 5, 21, 0, 0, 143, 145, 3, 28, 14, 0, 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 147, 5, 11, 0, 0, 147, 148, 3, 30, 15, 0, 148, 149, 5, 48, 0, 0, 149, 13, 1, 0, 0, 0, 150, 151, 5, 23, 0, 0, 151, 152, 5, 11, 0, 0, 152, 153, 3, 30, 15, 0, 153, 154, 5, 48, 0, 0, 154, 15, 1, 0, 0, 0, 155, 157, 3, 50, 25, 0, 156, 155, 1, 0, 0, 0, 157, 160, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 161, 162, 5, 24, 0, 0, 162, 169, 3, 28, 14, 0, 163, 164, 5, 25, 0, 0, 164, 168, 3, 42, 21, 0, 165, 166, 5, 26, 0, 0, 166, 168, 3, 58, 29, 0, 167, 163, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 171, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 172, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 172, 173, 5, 48, 0, 0, 173, 17, 1, 0, 0, 0, 174, 175, 5, 27, 0, 0, 175, 176, 3, 58, 29, 0, 176, 177, 5, 11, 0, 0, 177, 178, 3, 30, 15, 0, 178, 179, 5, 48, 0, 0, 179, 19, 1, 0, 0, 0, 180, 181, 5, 36, 0, 0, 181, 182, 3, 36, 18, 0, 182, 183, 3, 42, 21, 0, 183, 21, 1, 0, 0, 0, 184, 188, 5, 4, 0, 0, 185, 187, 5, 48, 0, 0, 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 191, 194, 5, 37, 0, 0, 192, 195, 3, 58, 29, 0, 193, 195, 3, 24, 12, 0, 194, 192, 1, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 197, 5, 38, 0, 0, 197, 198, 3, 30, 15, 0, 198, 199, 5, 10, 0, 0, 199, 203, 3, 26, 13, 0, 200, 202, 5, 48, 0, 0, 201, 200, 1, 0, 0, 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 206, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 207, 5, 5, 0, 0, 207, 23, 1, 0, 0, 0, 208, 209, 5, 6, 0, 0, 209, 210, 3, 58, 29, 0, 210, 211, 5, 3, 0, 0, 211, 212, 3, 58, 29, 0, 212, 213, 5, 7, 0, 0, 213, 25, 1, 0, 0, 0, 214, 217, 3, 30, 15, 0, 215, 217, 3, 20, 10, 0, 216, 214, 1, 0, 0, 0, 216, 215, 1, 0, 0, 0, 217, 27, 1, 0, 0, 0, 218, 224, 5, 29, 0, 0, 219, 220, 3, 30, 15, 0, 220, 221, 5, 30, 0, 0, 221, 223, 1, 0, 0, 0, 222, 219, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 227, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 228, 3, 30, 15, 0, 228, 229, 5, 31, 0, 0, 229, 232, 1, 0, 0, 0, 230, 232, 5, 32, 0, 0, 231, 218, 1, 0, 0, 0, 231, 230, 1, 0, 0, 0, 232, 29, 1, 0, 0, 0, 233, 234, 6, 15, -1, 0, 234, 235, 3, 34, 17, 0, 235, 262, 1, 0, 0, 0, 236, 237, 10, 6, 0, 0, 237, 238, 5, 39, 0, 0, 238, 239, 3, 30, 15, 0, 239, 240, 5, 10, 0, 0, 240, 241, 3, 30, 15, 7, 241, 261, 1, 0, 0, 0, 242, 243, 10, 2, 0, 0, 243, 244, 3, 32, 16, 0, 244, 245, 3, 30, 15, 3, 245, 261, 1, 0, 0, 0, 246, 247, 10, 7, 0, 0, 247, 248, 5, 4, 0, 0, 248, 249, 3, 30, 15, 0, 249, 250, 5, 5, 0, 0, 250, 261, 1, 0, 0, 0, 251, 252, 10, 5, 0, 0, 252, 253, 5, 8, 0, 0, 253, 261, 3, 58, 29, 0, 254, 255, 10, 4, 0, 0, 255, 256, 5, 8, 0, 0, 256, 261, 3, 54, 27, 0, 257, 258, 10, 3, 0, 0, 258, 259, 5, 10, 0, 0, 259, 261, 3, 58, 29, 0, 260, 236, 1, 0, 0, 0, 260, 242, 1, 0, 0, 0, 260, 246, 1, 0, 0, 0, 260, 251, 1, 0, 0, 0, 260, 254, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 31, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 7, 0, 0, 0, 266, 33, 1, 0, 0, 0, 267, 276, 3, 40, 20, 0, 268, 276, 3, 54, 27, 0, 269, 276, 3, 28, 14, 0, 270, 276, 5, 1, 0, 0, 271, 276, 3, 46, 23, 0, 272, 276, 3, 42, 21, 0, 273, 276, 3, 22, 11, 0, 274, 276, 3, 36, 18, 0, 275, 267, 1, 0, 0, 0, 275, 268, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, 270, 1, 0, 0, 0, 275, 271, 1, 0, 0, 0, 275, 272, 1, 0, 0, 0, 275, 273, 1, 0, 0, 0, 275, 274, 1, 0, 0, 0, 276, 35, 1, 0, 0, 0, 277, 279, 5, 6, 0, 0, 278, 280, 5, 48, 0, 0, 279, 278, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 283, 3, 30, 15, 0, 282, 284, 5, 48, 0, 0, 283, 282, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 286, 5, 7, 0, 0, 286, 37, 1, 0, 0, 0, 287, 288, 3, 58, 29, 0, 288, 39, 1, 0, 0, 0, 289, 295, 5, 47, 0, 0, 290, 295, 5, 16, 0, 0, 291, 295, 5, 17, 0, 0, 292, 295, 5, 18, 0, 0, 293, 295, 3, 58, 29, 0, 294, 289, 1, 0, 0, 0, 294, 290, 1, 0, 0, 0, 294, 291, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 293, 1, 0, 0, 0, 295, 41, 1, 0, 0, 0, 296, 313, 5, 12, 0, 0, 297, 299, 5, 48, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 310, 1, 0, 0, 0, 302, 304, 3, 44, 22, 0, 303, 305, 5, 48, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 302, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 298, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 316, 5, 13, 0, 0, 316, 43, 1, 0, 0, 0, 317, 320, 3, 58, 29, 0, 318, 320, 3, 28, 14, 0, 319, 317, 1, 0, 0, 0, 319, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 10, 0, 0, 322, 323, 3, 30, 15, 0, 323, 45, 1, 0, 0, 0, 324, 328, 5, 4, 0, 0, 325, 327, 5, 48, 0, 0, 326, 325, 1, 0, 0, 0, 327, 330, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 334, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 331, 333, 3, 48, 24, 0, 332, 331, 1, 0, 0, 0, 333, 336, 1, 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337, 338, 5, 5, 0, 0, 338, 47, 1, 0, 0, 0, 339, 346, 3, 30, 15, 0, 340, 342, 5, 48, 0, 0, 341, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 347, 1, 0, 0, 0, 345, 347, 5, 3, 0, 0, 346, 341, 1, 0, 0, 0, 346, 345, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 49, 1, 0, 0, 0, 348, 349, 5, 2, 0, 0, 349, 350, 3, 52, 26, 0, 350, 351, 5, 48, 0, 0, 351, 51, 1, 0, 0, 0, 352, 358, 3, 54, 27, 0, 353, 354, 3, 30, 15, 0, 354, 355, 5, 8, 0, 0, 355, 356, 3, 54, 27, 0, 356, 358, 1, 0, 0, 0, 357, 352, 1, 0, 0, 0, 357, 353, 1, 0, 0, 0, 358, 53, 1, 0, 0, 0, 359, 360, 3, 58, 29, 0, 360, 365, 5, 6, 0, 0, 361, 363, 5, 48, 0, 0, 362, 361, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 366, 3, 56, 28, 0, 365, 362, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 369, 5, 48, 0, 0, 368, 367, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 371, 5, 7, 0, 0, 371, 55, 1, 0, 0, 0, 372, 380, 3, 30, 15, 0, 373, 375, 5, 3, 0, 0, 374, 376, 5, 48, 0, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 379, 3, 30, 15, 0, 378, 373, 1, 0, 0, 0, 379, 382, 1, 0, 0, 0, 380, 378, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 57, 1, 0, 0, 0, 382, 380, 1, 0, 0, 0, 383, 384, 7, 1, 0, 0, 384, 59, 1, 0, 0, 0, 42, 63, 75, 80, 87, 92, 94, 104, 116, 123, 129, 136, 144, 158, 167, 169, 188, 194, 203, 216, 224, 231, 260, 262, 275, 279, 283, 294, 300, 306, 310, 313, 319, 328, 334, 343, 346, 357, 362, 365, 368, 375, 380] \ No newline at end of file +[4, 1, 54, 422, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 1, 0, 5, 0, 66, 8, 0, 10, 0, 12, 0, 69, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 83, 8, 1, 1, 2, 5, 2, 86, 8, 2, 10, 2, 12, 2, 89, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 95, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 100, 8, 2, 3, 2, 102, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 110, 8, 4, 10, 4, 12, 4, 113, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 122, 8, 5, 10, 5, 12, 5, 125, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 131, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 137, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 142, 8, 6, 10, 6, 12, 6, 145, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 152, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 164, 8, 8, 10, 8, 12, 8, 167, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 175, 8, 8, 10, 8, 12, 8, 178, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 5, 10, 189, 8, 10, 10, 10, 12, 10, 192, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 5, 11, 201, 8, 11, 10, 11, 12, 11, 204, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 213, 8, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 5, 13, 223, 8, 13, 10, 13, 12, 13, 226, 9, 13, 1, 13, 1, 13, 1, 13, 3, 13, 231, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 238, 8, 13, 10, 13, 12, 13, 241, 9, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 3, 15, 253, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 259, 8, 16, 10, 16, 12, 16, 262, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 268, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 297, 8, 17, 10, 17, 12, 17, 300, 9, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 312, 8, 19, 1, 20, 1, 20, 3, 20, 316, 8, 20, 1, 20, 1, 20, 3, 20, 320, 8, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 331, 8, 22, 1, 23, 1, 23, 4, 23, 335, 8, 23, 11, 23, 12, 23, 336, 1, 23, 1, 23, 4, 23, 341, 8, 23, 11, 23, 12, 23, 342, 5, 23, 345, 8, 23, 10, 23, 12, 23, 348, 9, 23, 3, 23, 350, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 3, 24, 356, 8, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 363, 8, 25, 10, 25, 12, 25, 366, 9, 25, 1, 25, 5, 25, 369, 8, 25, 10, 25, 12, 25, 372, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 4, 26, 378, 8, 26, 11, 26, 12, 26, 379, 1, 26, 3, 26, 383, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 394, 8, 28, 1, 29, 1, 29, 1, 29, 3, 29, 399, 8, 29, 1, 29, 3, 29, 402, 8, 29, 1, 29, 3, 29, 405, 8, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 3, 30, 412, 8, 30, 1, 30, 5, 30, 415, 8, 30, 10, 30, 12, 30, 418, 9, 30, 1, 31, 1, 31, 1, 31, 0, 1, 34, 32, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 0, 2, 1, 0, 42, 47, 3, 0, 14, 28, 35, 40, 48, 48, 458, 0, 67, 1, 0, 0, 0, 2, 82, 1, 0, 0, 0, 4, 87, 1, 0, 0, 0, 6, 105, 1, 0, 0, 0, 8, 111, 1, 0, 0, 0, 10, 123, 1, 0, 0, 0, 12, 143, 1, 0, 0, 0, 14, 157, 1, 0, 0, 0, 16, 165, 1, 0, 0, 0, 18, 181, 1, 0, 0, 0, 20, 190, 1, 0, 0, 0, 22, 202, 1, 0, 0, 0, 24, 216, 1, 0, 0, 0, 26, 220, 1, 0, 0, 0, 28, 244, 1, 0, 0, 0, 30, 252, 1, 0, 0, 0, 32, 267, 1, 0, 0, 0, 34, 269, 1, 0, 0, 0, 36, 301, 1, 0, 0, 0, 38, 311, 1, 0, 0, 0, 40, 313, 1, 0, 0, 0, 42, 323, 1, 0, 0, 0, 44, 330, 1, 0, 0, 0, 46, 332, 1, 0, 0, 0, 48, 355, 1, 0, 0, 0, 50, 360, 1, 0, 0, 0, 52, 375, 1, 0, 0, 0, 54, 384, 1, 0, 0, 0, 56, 393, 1, 0, 0, 0, 58, 395, 1, 0, 0, 0, 60, 408, 1, 0, 0, 0, 62, 419, 1, 0, 0, 0, 64, 66, 3, 2, 1, 0, 65, 64, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 0, 0, 1, 71, 1, 1, 0, 0, 0, 72, 83, 3, 4, 2, 0, 73, 83, 3, 8, 4, 0, 74, 83, 3, 10, 5, 0, 75, 83, 3, 12, 6, 0, 76, 83, 3, 14, 7, 0, 77, 83, 3, 16, 8, 0, 78, 83, 3, 18, 9, 0, 79, 83, 3, 20, 10, 0, 80, 83, 3, 22, 11, 0, 81, 83, 5, 50, 0, 0, 82, 72, 1, 0, 0, 0, 82, 73, 1, 0, 0, 0, 82, 74, 1, 0, 0, 0, 82, 75, 1, 0, 0, 0, 82, 76, 1, 0, 0, 0, 82, 77, 1, 0, 0, 0, 82, 78, 1, 0, 0, 0, 82, 79, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 81, 1, 0, 0, 0, 83, 3, 1, 0, 0, 0, 84, 86, 3, 54, 27, 0, 85, 84, 1, 0, 0, 0, 86, 89, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 90, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, 90, 91, 5, 14, 0, 0, 91, 101, 3, 62, 31, 0, 92, 94, 3, 42, 21, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 102, 1, 0, 0, 0, 96, 97, 5, 21, 0, 0, 97, 99, 3, 32, 16, 0, 98, 100, 3, 6, 3, 0, 99, 98, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 102, 1, 0, 0, 0, 101, 92, 1, 0, 0, 0, 101, 96, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 104, 5, 50, 0, 0, 104, 5, 1, 0, 0, 0, 105, 106, 5, 11, 0, 0, 106, 107, 3, 34, 17, 0, 107, 7, 1, 0, 0, 0, 108, 110, 3, 54, 27, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 15, 0, 0, 115, 116, 3, 62, 31, 0, 116, 117, 5, 11, 0, 0, 117, 118, 3, 34, 17, 0, 118, 119, 5, 50, 0, 0, 119, 9, 1, 0, 0, 0, 120, 122, 3, 54, 27, 0, 121, 120, 1, 0, 0, 0, 122, 125, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 126, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 126, 127, 5, 21, 0, 0, 127, 128, 3, 62, 31, 0, 128, 130, 3, 32, 16, 0, 129, 131, 5, 28, 0, 0, 130, 129, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 136, 5, 11, 0, 0, 133, 137, 3, 24, 12, 0, 134, 137, 3, 46, 23, 0, 135, 137, 3, 26, 13, 0, 136, 133, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 50, 0, 0, 139, 11, 1, 0, 0, 0, 140, 142, 3, 54, 27, 0, 141, 140, 1, 0, 0, 0, 142, 145, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 146, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 146, 147, 5, 22, 0, 0, 147, 151, 3, 62, 31, 0, 148, 152, 3, 62, 31, 0, 149, 150, 5, 21, 0, 0, 150, 152, 3, 32, 16, 0, 151, 148, 1, 0, 0, 0, 151, 149, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 11, 0, 0, 154, 155, 3, 34, 17, 0, 155, 156, 5, 50, 0, 0, 156, 13, 1, 0, 0, 0, 157, 158, 5, 23, 0, 0, 158, 159, 5, 11, 0, 0, 159, 160, 3, 34, 17, 0, 160, 161, 5, 50, 0, 0, 161, 15, 1, 0, 0, 0, 162, 164, 3, 54, 27, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 24, 0, 0, 169, 176, 3, 32, 16, 0, 170, 171, 5, 25, 0, 0, 171, 175, 3, 46, 23, 0, 172, 173, 5, 26, 0, 0, 173, 175, 3, 62, 31, 0, 174, 170, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 175, 178, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 179, 180, 5, 50, 0, 0, 180, 17, 1, 0, 0, 0, 181, 182, 5, 27, 0, 0, 182, 183, 3, 62, 31, 0, 183, 184, 5, 11, 0, 0, 184, 185, 3, 34, 17, 0, 185, 186, 5, 50, 0, 0, 186, 19, 1, 0, 0, 0, 187, 189, 3, 54, 27, 0, 188, 187, 1, 0, 0, 0, 189, 192, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 193, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 193, 194, 5, 29, 0, 0, 194, 195, 3, 62, 31, 0, 195, 196, 5, 11, 0, 0, 196, 197, 3, 42, 21, 0, 197, 198, 5, 50, 0, 0, 198, 21, 1, 0, 0, 0, 199, 201, 3, 54, 27, 0, 200, 199, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 205, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 205, 206, 5, 30, 0, 0, 206, 207, 3, 62, 31, 0, 207, 208, 3, 32, 16, 0, 208, 212, 5, 11, 0, 0, 209, 213, 3, 24, 12, 0, 210, 213, 3, 46, 23, 0, 211, 213, 3, 26, 13, 0, 212, 209, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 50, 0, 0, 215, 23, 1, 0, 0, 0, 216, 217, 5, 38, 0, 0, 217, 218, 3, 40, 20, 0, 218, 219, 3, 46, 23, 0, 219, 25, 1, 0, 0, 0, 220, 224, 5, 4, 0, 0, 221, 223, 5, 50, 0, 0, 222, 221, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 227, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 230, 5, 39, 0, 0, 228, 231, 3, 62, 31, 0, 229, 231, 3, 28, 14, 0, 230, 228, 1, 0, 0, 0, 230, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 5, 40, 0, 0, 233, 234, 3, 34, 17, 0, 234, 235, 5, 10, 0, 0, 235, 239, 3, 30, 15, 0, 236, 238, 5, 50, 0, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 5, 0, 0, 243, 27, 1, 0, 0, 0, 244, 245, 5, 6, 0, 0, 245, 246, 3, 62, 31, 0, 246, 247, 5, 3, 0, 0, 247, 248, 3, 62, 31, 0, 248, 249, 5, 7, 0, 0, 249, 29, 1, 0, 0, 0, 250, 253, 3, 34, 17, 0, 251, 253, 3, 24, 12, 0, 252, 250, 1, 0, 0, 0, 252, 251, 1, 0, 0, 0, 253, 31, 1, 0, 0, 0, 254, 260, 5, 31, 0, 0, 255, 256, 3, 34, 17, 0, 256, 257, 5, 32, 0, 0, 257, 259, 1, 0, 0, 0, 258, 255, 1, 0, 0, 0, 259, 262, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 263, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 263, 264, 3, 34, 17, 0, 264, 265, 5, 33, 0, 0, 265, 268, 1, 0, 0, 0, 266, 268, 5, 34, 0, 0, 267, 254, 1, 0, 0, 0, 267, 266, 1, 0, 0, 0, 268, 33, 1, 0, 0, 0, 269, 270, 6, 17, -1, 0, 270, 271, 3, 38, 19, 0, 271, 298, 1, 0, 0, 0, 272, 273, 10, 6, 0, 0, 273, 274, 5, 41, 0, 0, 274, 275, 3, 34, 17, 0, 275, 276, 5, 10, 0, 0, 276, 277, 3, 34, 17, 7, 277, 297, 1, 0, 0, 0, 278, 279, 10, 2, 0, 0, 279, 280, 3, 36, 18, 0, 280, 281, 3, 34, 17, 3, 281, 297, 1, 0, 0, 0, 282, 283, 10, 7, 0, 0, 283, 284, 5, 4, 0, 0, 284, 285, 3, 34, 17, 0, 285, 286, 5, 5, 0, 0, 286, 297, 1, 0, 0, 0, 287, 288, 10, 5, 0, 0, 288, 289, 5, 8, 0, 0, 289, 297, 3, 62, 31, 0, 290, 291, 10, 4, 0, 0, 291, 292, 5, 8, 0, 0, 292, 297, 3, 58, 29, 0, 293, 294, 10, 3, 0, 0, 294, 295, 5, 10, 0, 0, 295, 297, 3, 62, 31, 0, 296, 272, 1, 0, 0, 0, 296, 278, 1, 0, 0, 0, 296, 282, 1, 0, 0, 0, 296, 287, 1, 0, 0, 0, 296, 290, 1, 0, 0, 0, 296, 293, 1, 0, 0, 0, 297, 300, 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 35, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 301, 302, 7, 0, 0, 0, 302, 37, 1, 0, 0, 0, 303, 312, 3, 44, 22, 0, 304, 312, 3, 58, 29, 0, 305, 312, 3, 32, 16, 0, 306, 312, 5, 1, 0, 0, 307, 312, 3, 50, 25, 0, 308, 312, 3, 46, 23, 0, 309, 312, 3, 26, 13, 0, 310, 312, 3, 40, 20, 0, 311, 303, 1, 0, 0, 0, 311, 304, 1, 0, 0, 0, 311, 305, 1, 0, 0, 0, 311, 306, 1, 0, 0, 0, 311, 307, 1, 0, 0, 0, 311, 308, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, 311, 310, 1, 0, 0, 0, 312, 39, 1, 0, 0, 0, 313, 315, 5, 6, 0, 0, 314, 316, 5, 50, 0, 0, 315, 314, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 319, 3, 34, 17, 0, 318, 320, 5, 50, 0, 0, 319, 318, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 7, 0, 0, 322, 41, 1, 0, 0, 0, 323, 324, 3, 62, 31, 0, 324, 43, 1, 0, 0, 0, 325, 331, 5, 49, 0, 0, 326, 331, 5, 16, 0, 0, 327, 331, 5, 17, 0, 0, 328, 331, 5, 18, 0, 0, 329, 331, 3, 62, 31, 0, 330, 325, 1, 0, 0, 0, 330, 326, 1, 0, 0, 0, 330, 327, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 329, 1, 0, 0, 0, 331, 45, 1, 0, 0, 0, 332, 349, 5, 12, 0, 0, 333, 335, 5, 50, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 346, 1, 0, 0, 0, 338, 340, 3, 48, 24, 0, 339, 341, 5, 50, 0, 0, 340, 339, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 345, 1, 0, 0, 0, 344, 338, 1, 0, 0, 0, 345, 348, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 350, 1, 0, 0, 0, 348, 346, 1, 0, 0, 0, 349, 334, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 352, 5, 13, 0, 0, 352, 47, 1, 0, 0, 0, 353, 356, 3, 62, 31, 0, 354, 356, 3, 32, 16, 0, 355, 353, 1, 0, 0, 0, 355, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 358, 5, 10, 0, 0, 358, 359, 3, 34, 17, 0, 359, 49, 1, 0, 0, 0, 360, 364, 5, 4, 0, 0, 361, 363, 5, 50, 0, 0, 362, 361, 1, 0, 0, 0, 363, 366, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 370, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, 367, 369, 3, 52, 26, 0, 368, 367, 1, 0, 0, 0, 369, 372, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 373, 1, 0, 0, 0, 372, 370, 1, 0, 0, 0, 373, 374, 5, 5, 0, 0, 374, 51, 1, 0, 0, 0, 375, 382, 3, 34, 17, 0, 376, 378, 5, 50, 0, 0, 377, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 383, 1, 0, 0, 0, 381, 383, 5, 3, 0, 0, 382, 377, 1, 0, 0, 0, 382, 381, 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, 383, 53, 1, 0, 0, 0, 384, 385, 5, 2, 0, 0, 385, 386, 3, 56, 28, 0, 386, 387, 5, 50, 0, 0, 387, 55, 1, 0, 0, 0, 388, 394, 3, 58, 29, 0, 389, 390, 3, 34, 17, 0, 390, 391, 5, 8, 0, 0, 391, 392, 3, 58, 29, 0, 392, 394, 1, 0, 0, 0, 393, 388, 1, 0, 0, 0, 393, 389, 1, 0, 0, 0, 394, 57, 1, 0, 0, 0, 395, 396, 3, 62, 31, 0, 396, 401, 5, 6, 0, 0, 397, 399, 5, 50, 0, 0, 398, 397, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 400, 1, 0, 0, 0, 400, 402, 3, 60, 30, 0, 401, 398, 1, 0, 0, 0, 401, 402, 1, 0, 0, 0, 402, 404, 1, 0, 0, 0, 403, 405, 5, 50, 0, 0, 404, 403, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, 406, 1, 0, 0, 0, 406, 407, 5, 7, 0, 0, 407, 59, 1, 0, 0, 0, 408, 416, 3, 34, 17, 0, 409, 411, 5, 3, 0, 0, 410, 412, 5, 50, 0, 0, 411, 410, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 415, 3, 34, 17, 0, 414, 409, 1, 0, 0, 0, 415, 418, 1, 0, 0, 0, 416, 414, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 61, 1, 0, 0, 0, 418, 416, 1, 0, 0, 0, 419, 420, 7, 1, 0, 0, 420, 63, 1, 0, 0, 0, 45, 67, 82, 87, 94, 99, 101, 111, 123, 130, 136, 143, 151, 165, 174, 176, 190, 202, 212, 224, 230, 239, 252, 260, 267, 296, 298, 311, 315, 319, 330, 336, 342, 346, 349, 355, 364, 370, 379, 382, 393, 398, 401, 404, 411, 416] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep.tokens b/pkg/parser/bicep/antlr/parser/bicep.tokens index ec33a639e52..deb4cb3d93c 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.tokens +++ b/pkg/parser/bicep/antlr/parser/bicep.tokens @@ -26,30 +26,32 @@ WITH=25 AS=26 METADATA=27 EXISTING=28 -STRING_LEFT_PIECE=29 -STRING_MIDDLE_PIECE=30 -STRING_RIGHT_PIECE=31 -STRING_COMPLETE=32 -STRING=33 -INT=34 -BOOL=35 -IF=36 -FOR=37 -IN=38 -QMARK=39 -GT=40 -GTE=41 -LT=42 -LTE=43 -EQ=44 -NEQ=45 -IDENTIFIER=46 -NUMBER=47 -NL=48 -SINGLE_LINE_COMMENT=49 -MULTI_LINE_COMMENT=50 -SPACES=51 -UNKNOWN=52 +TYPE=29 +MODULE=30 +STRING_LEFT_PIECE=31 +STRING_MIDDLE_PIECE=32 +STRING_RIGHT_PIECE=33 +STRING_COMPLETE=34 +STRING=35 +INT=36 +BOOL=37 +IF=38 +FOR=39 +IN=40 +QMARK=41 +GT=42 +GTE=43 +LT=44 +LTE=45 +EQ=46 +NEQ=47 +IDENTIFIER=48 +NUMBER=49 +NL=50 +SINGLE_LINE_COMMENT=51 +MULTI_LINE_COMMENT=52 +SPACES=53 +UNKNOWN=54 '@'=2 ','=3 '['=4 @@ -76,16 +78,18 @@ UNKNOWN=52 'as'=26 'metadata'=27 'existing'=28 -'string'=33 -'int'=34 -'bool'=35 -'if'=36 -'for'=37 -'in'=38 -'?'=39 -'>'=40 -'>='=41 -'<'=42 -'<='=43 -'=='=44 -'!='=45 +'type'=29 +'module'=30 +'string'=35 +'int'=36 +'bool'=37 +'if'=38 +'for'=39 +'in'=40 +'?'=41 +'>'=42 +'>='=43 +'<'=44 +'<='=45 +'=='=46 +'!='=47 diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.interp b/pkg/parser/bicep/antlr/parser/bicepLexer.interp index b05aacb688d..666137d4574 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.interp +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.interp @@ -28,6 +28,8 @@ null 'as' 'metadata' 'existing' +'type' +'module' null null null @@ -83,6 +85,8 @@ WITH AS METADATA EXISTING +TYPE +MODULE STRING_LEFT_PIECE STRING_MIDDLE_PIECE STRING_RIGHT_PIECE @@ -137,6 +141,8 @@ WITH AS METADATA EXISTING +TYPE +MODULE STRING_LEFT_PIECE STRING_MIDDLE_PIECE STRING_RIGHT_PIECE @@ -173,4 +179,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 52, 413, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 117, 8, 0, 10, 0, 12, 0, 120, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 145, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 5, 28, 255, 8, 28, 10, 28, 12, 28, 258, 9, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 5, 29, 265, 8, 29, 10, 29, 12, 29, 268, 9, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 275, 8, 30, 10, 30, 12, 30, 278, 9, 30, 1, 30, 1, 30, 1, 31, 1, 31, 5, 31, 284, 8, 31, 10, 31, 12, 31, 287, 9, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 5, 45, 337, 8, 45, 10, 45, 12, 45, 340, 9, 45, 1, 46, 4, 46, 343, 8, 46, 11, 46, 12, 46, 344, 1, 46, 1, 46, 4, 46, 349, 8, 46, 11, 46, 12, 46, 350, 3, 46, 353, 8, 46, 1, 47, 4, 47, 356, 8, 47, 11, 47, 12, 47, 357, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 364, 8, 48, 10, 48, 12, 48, 367, 9, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 5, 49, 375, 8, 49, 10, 49, 12, 49, 378, 9, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 4, 50, 386, 8, 50, 11, 50, 12, 50, 387, 1, 50, 1, 50, 1, 51, 1, 51, 1, 52, 1, 52, 3, 52, 396, 8, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 4, 53, 404, 8, 53, 11, 53, 12, 53, 405, 1, 53, 1, 53, 3, 53, 410, 8, 53, 1, 54, 1, 54, 2, 118, 376, 0, 55, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 0, 107, 0, 109, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 426, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 1, 111, 1, 0, 0, 0, 3, 125, 1, 0, 0, 0, 5, 127, 1, 0, 0, 0, 7, 129, 1, 0, 0, 0, 9, 131, 1, 0, 0, 0, 11, 133, 1, 0, 0, 0, 13, 135, 1, 0, 0, 0, 15, 137, 1, 0, 0, 0, 17, 139, 1, 0, 0, 0, 19, 144, 1, 0, 0, 0, 21, 146, 1, 0, 0, 0, 23, 148, 1, 0, 0, 0, 25, 150, 1, 0, 0, 0, 27, 152, 1, 0, 0, 0, 29, 158, 1, 0, 0, 0, 31, 162, 1, 0, 0, 0, 33, 167, 1, 0, 0, 0, 35, 173, 1, 0, 0, 0, 37, 178, 1, 0, 0, 0, 39, 184, 1, 0, 0, 0, 41, 191, 1, 0, 0, 0, 43, 200, 1, 0, 0, 0, 45, 207, 1, 0, 0, 0, 47, 219, 1, 0, 0, 0, 49, 226, 1, 0, 0, 0, 51, 231, 1, 0, 0, 0, 53, 234, 1, 0, 0, 0, 55, 243, 1, 0, 0, 0, 57, 252, 1, 0, 0, 0, 59, 262, 1, 0, 0, 0, 61, 272, 1, 0, 0, 0, 63, 281, 1, 0, 0, 0, 65, 290, 1, 0, 0, 0, 67, 297, 1, 0, 0, 0, 69, 301, 1, 0, 0, 0, 71, 306, 1, 0, 0, 0, 73, 309, 1, 0, 0, 0, 75, 313, 1, 0, 0, 0, 77, 316, 1, 0, 0, 0, 79, 318, 1, 0, 0, 0, 81, 320, 1, 0, 0, 0, 83, 323, 1, 0, 0, 0, 85, 325, 1, 0, 0, 0, 87, 328, 1, 0, 0, 0, 89, 331, 1, 0, 0, 0, 91, 334, 1, 0, 0, 0, 93, 342, 1, 0, 0, 0, 95, 355, 1, 0, 0, 0, 97, 359, 1, 0, 0, 0, 99, 370, 1, 0, 0, 0, 101, 385, 1, 0, 0, 0, 103, 391, 1, 0, 0, 0, 105, 395, 1, 0, 0, 0, 107, 397, 1, 0, 0, 0, 109, 411, 1, 0, 0, 0, 111, 112, 5, 39, 0, 0, 112, 113, 5, 39, 0, 0, 113, 114, 5, 39, 0, 0, 114, 118, 1, 0, 0, 0, 115, 117, 9, 0, 0, 0, 116, 115, 1, 0, 0, 0, 117, 120, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 121, 1, 0, 0, 0, 120, 118, 1, 0, 0, 0, 121, 122, 5, 39, 0, 0, 122, 123, 5, 39, 0, 0, 123, 124, 5, 39, 0, 0, 124, 2, 1, 0, 0, 0, 125, 126, 5, 64, 0, 0, 126, 4, 1, 0, 0, 0, 127, 128, 5, 44, 0, 0, 128, 6, 1, 0, 0, 0, 129, 130, 5, 91, 0, 0, 130, 8, 1, 0, 0, 0, 131, 132, 5, 93, 0, 0, 132, 10, 1, 0, 0, 0, 133, 134, 5, 40, 0, 0, 134, 12, 1, 0, 0, 0, 135, 136, 5, 41, 0, 0, 136, 14, 1, 0, 0, 0, 137, 138, 5, 46, 0, 0, 138, 16, 1, 0, 0, 0, 139, 140, 5, 124, 0, 0, 140, 18, 1, 0, 0, 0, 141, 145, 5, 58, 0, 0, 142, 143, 5, 58, 0, 0, 143, 145, 5, 58, 0, 0, 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 20, 1, 0, 0, 0, 146, 147, 5, 61, 0, 0, 147, 22, 1, 0, 0, 0, 148, 149, 5, 123, 0, 0, 149, 24, 1, 0, 0, 0, 150, 151, 5, 125, 0, 0, 151, 26, 1, 0, 0, 0, 152, 153, 5, 112, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 114, 0, 0, 155, 156, 5, 97, 0, 0, 156, 157, 5, 109, 0, 0, 157, 28, 1, 0, 0, 0, 158, 159, 5, 118, 0, 0, 159, 160, 5, 97, 0, 0, 160, 161, 5, 114, 0, 0, 161, 30, 1, 0, 0, 0, 162, 163, 5, 116, 0, 0, 163, 164, 5, 114, 0, 0, 164, 165, 5, 117, 0, 0, 165, 166, 5, 101, 0, 0, 166, 32, 1, 0, 0, 0, 167, 168, 5, 102, 0, 0, 168, 169, 5, 97, 0, 0, 169, 170, 5, 108, 0, 0, 170, 171, 5, 115, 0, 0, 171, 172, 5, 101, 0, 0, 172, 34, 1, 0, 0, 0, 173, 174, 5, 110, 0, 0, 174, 175, 5, 117, 0, 0, 175, 176, 5, 108, 0, 0, 176, 177, 5, 108, 0, 0, 177, 36, 1, 0, 0, 0, 178, 179, 5, 97, 0, 0, 179, 180, 5, 114, 0, 0, 180, 181, 5, 114, 0, 0, 181, 182, 5, 97, 0, 0, 182, 183, 5, 121, 0, 0, 183, 38, 1, 0, 0, 0, 184, 185, 5, 111, 0, 0, 185, 186, 5, 98, 0, 0, 186, 187, 5, 106, 0, 0, 187, 188, 5, 101, 0, 0, 188, 189, 5, 99, 0, 0, 189, 190, 5, 116, 0, 0, 190, 40, 1, 0, 0, 0, 191, 192, 5, 114, 0, 0, 192, 193, 5, 101, 0, 0, 193, 194, 5, 115, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 117, 0, 0, 196, 197, 5, 114, 0, 0, 197, 198, 5, 99, 0, 0, 198, 199, 5, 101, 0, 0, 199, 42, 1, 0, 0, 0, 200, 201, 5, 111, 0, 0, 201, 202, 5, 117, 0, 0, 202, 203, 5, 116, 0, 0, 203, 204, 5, 112, 0, 0, 204, 205, 5, 117, 0, 0, 205, 206, 5, 116, 0, 0, 206, 44, 1, 0, 0, 0, 207, 208, 5, 116, 0, 0, 208, 209, 5, 97, 0, 0, 209, 210, 5, 114, 0, 0, 210, 211, 5, 103, 0, 0, 211, 212, 5, 101, 0, 0, 212, 213, 5, 116, 0, 0, 213, 214, 5, 83, 0, 0, 214, 215, 5, 99, 0, 0, 215, 216, 5, 111, 0, 0, 216, 217, 5, 112, 0, 0, 217, 218, 5, 101, 0, 0, 218, 46, 1, 0, 0, 0, 219, 220, 5, 105, 0, 0, 220, 221, 5, 109, 0, 0, 221, 222, 5, 112, 0, 0, 222, 223, 5, 111, 0, 0, 223, 224, 5, 114, 0, 0, 224, 225, 5, 116, 0, 0, 225, 48, 1, 0, 0, 0, 226, 227, 5, 119, 0, 0, 227, 228, 5, 105, 0, 0, 228, 229, 5, 116, 0, 0, 229, 230, 5, 104, 0, 0, 230, 50, 1, 0, 0, 0, 231, 232, 5, 97, 0, 0, 232, 233, 5, 115, 0, 0, 233, 52, 1, 0, 0, 0, 234, 235, 5, 109, 0, 0, 235, 236, 5, 101, 0, 0, 236, 237, 5, 116, 0, 0, 237, 238, 5, 97, 0, 0, 238, 239, 5, 100, 0, 0, 239, 240, 5, 97, 0, 0, 240, 241, 5, 116, 0, 0, 241, 242, 5, 97, 0, 0, 242, 54, 1, 0, 0, 0, 243, 244, 5, 101, 0, 0, 244, 245, 5, 120, 0, 0, 245, 246, 5, 105, 0, 0, 246, 247, 5, 115, 0, 0, 247, 248, 5, 116, 0, 0, 248, 249, 5, 105, 0, 0, 249, 250, 5, 110, 0, 0, 250, 251, 5, 103, 0, 0, 251, 56, 1, 0, 0, 0, 252, 256, 5, 39, 0, 0, 253, 255, 3, 105, 52, 0, 254, 253, 1, 0, 0, 0, 255, 258, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 259, 1, 0, 0, 0, 258, 256, 1, 0, 0, 0, 259, 260, 5, 36, 0, 0, 260, 261, 5, 123, 0, 0, 261, 58, 1, 0, 0, 0, 262, 266, 5, 125, 0, 0, 263, 265, 3, 105, 52, 0, 264, 263, 1, 0, 0, 0, 265, 268, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 269, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 270, 5, 36, 0, 0, 270, 271, 5, 123, 0, 0, 271, 60, 1, 0, 0, 0, 272, 276, 5, 125, 0, 0, 273, 275, 3, 105, 52, 0, 274, 273, 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 279, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 279, 280, 5, 39, 0, 0, 280, 62, 1, 0, 0, 0, 281, 285, 5, 39, 0, 0, 282, 284, 3, 105, 52, 0, 283, 282, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 288, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 288, 289, 5, 39, 0, 0, 289, 64, 1, 0, 0, 0, 290, 291, 5, 115, 0, 0, 291, 292, 5, 116, 0, 0, 292, 293, 5, 114, 0, 0, 293, 294, 5, 105, 0, 0, 294, 295, 5, 110, 0, 0, 295, 296, 5, 103, 0, 0, 296, 66, 1, 0, 0, 0, 297, 298, 5, 105, 0, 0, 298, 299, 5, 110, 0, 0, 299, 300, 5, 116, 0, 0, 300, 68, 1, 0, 0, 0, 301, 302, 5, 98, 0, 0, 302, 303, 5, 111, 0, 0, 303, 304, 5, 111, 0, 0, 304, 305, 5, 108, 0, 0, 305, 70, 1, 0, 0, 0, 306, 307, 5, 105, 0, 0, 307, 308, 5, 102, 0, 0, 308, 72, 1, 0, 0, 0, 309, 310, 5, 102, 0, 0, 310, 311, 5, 111, 0, 0, 311, 312, 5, 114, 0, 0, 312, 74, 1, 0, 0, 0, 313, 314, 5, 105, 0, 0, 314, 315, 5, 110, 0, 0, 315, 76, 1, 0, 0, 0, 316, 317, 5, 63, 0, 0, 317, 78, 1, 0, 0, 0, 318, 319, 5, 62, 0, 0, 319, 80, 1, 0, 0, 0, 320, 321, 5, 62, 0, 0, 321, 322, 5, 61, 0, 0, 322, 82, 1, 0, 0, 0, 323, 324, 5, 60, 0, 0, 324, 84, 1, 0, 0, 0, 325, 326, 5, 60, 0, 0, 326, 327, 5, 61, 0, 0, 327, 86, 1, 0, 0, 0, 328, 329, 5, 61, 0, 0, 329, 330, 5, 61, 0, 0, 330, 88, 1, 0, 0, 0, 331, 332, 5, 33, 0, 0, 332, 333, 5, 61, 0, 0, 333, 90, 1, 0, 0, 0, 334, 338, 7, 0, 0, 0, 335, 337, 7, 1, 0, 0, 336, 335, 1, 0, 0, 0, 337, 340, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 92, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 341, 343, 7, 2, 0, 0, 342, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 352, 1, 0, 0, 0, 346, 348, 5, 46, 0, 0, 347, 349, 7, 2, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 353, 1, 0, 0, 0, 352, 346, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, 353, 94, 1, 0, 0, 0, 354, 356, 7, 3, 0, 0, 355, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 96, 1, 0, 0, 0, 359, 360, 5, 47, 0, 0, 360, 361, 5, 47, 0, 0, 361, 365, 1, 0, 0, 0, 362, 364, 8, 3, 0, 0, 363, 362, 1, 0, 0, 0, 364, 367, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 368, 369, 6, 48, 0, 0, 369, 98, 1, 0, 0, 0, 370, 371, 5, 47, 0, 0, 371, 372, 5, 42, 0, 0, 372, 376, 1, 0, 0, 0, 373, 375, 9, 0, 0, 0, 374, 373, 1, 0, 0, 0, 375, 378, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 376, 374, 1, 0, 0, 0, 377, 379, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 379, 380, 5, 42, 0, 0, 380, 381, 5, 47, 0, 0, 381, 382, 1, 0, 0, 0, 382, 383, 6, 49, 0, 0, 383, 100, 1, 0, 0, 0, 384, 386, 7, 4, 0, 0, 385, 384, 1, 0, 0, 0, 386, 387, 1, 0, 0, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 389, 1, 0, 0, 0, 389, 390, 6, 50, 0, 0, 390, 102, 1, 0, 0, 0, 391, 392, 9, 0, 0, 0, 392, 104, 1, 0, 0, 0, 393, 396, 8, 5, 0, 0, 394, 396, 3, 107, 53, 0, 395, 393, 1, 0, 0, 0, 395, 394, 1, 0, 0, 0, 396, 106, 1, 0, 0, 0, 397, 409, 5, 92, 0, 0, 398, 410, 7, 6, 0, 0, 399, 400, 5, 117, 0, 0, 400, 401, 5, 123, 0, 0, 401, 403, 1, 0, 0, 0, 402, 404, 3, 109, 54, 0, 403, 402, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, 403, 1, 0, 0, 0, 405, 406, 1, 0, 0, 0, 406, 407, 1, 0, 0, 0, 407, 408, 5, 125, 0, 0, 408, 410, 1, 0, 0, 0, 409, 398, 1, 0, 0, 0, 409, 399, 1, 0, 0, 0, 410, 108, 1, 0, 0, 0, 411, 412, 7, 7, 0, 0, 412, 110, 1, 0, 0, 0, 18, 0, 118, 144, 256, 266, 276, 285, 338, 344, 350, 352, 357, 365, 376, 387, 395, 405, 409, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 54, 429, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 121, 8, 0, 10, 0, 12, 0, 124, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 149, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 271, 8, 30, 10, 30, 12, 30, 274, 9, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 5, 31, 281, 8, 31, 10, 31, 12, 31, 284, 9, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 5, 32, 291, 8, 32, 10, 32, 12, 32, 294, 9, 32, 1, 32, 1, 32, 1, 33, 1, 33, 5, 33, 300, 8, 33, 10, 33, 12, 33, 303, 9, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 5, 47, 353, 8, 47, 10, 47, 12, 47, 356, 9, 47, 1, 48, 4, 48, 359, 8, 48, 11, 48, 12, 48, 360, 1, 48, 1, 48, 4, 48, 365, 8, 48, 11, 48, 12, 48, 366, 3, 48, 369, 8, 48, 1, 49, 4, 49, 372, 8, 49, 11, 49, 12, 49, 373, 1, 50, 1, 50, 1, 50, 1, 50, 5, 50, 380, 8, 50, 10, 50, 12, 50, 383, 9, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 5, 51, 391, 8, 51, 10, 51, 12, 51, 394, 9, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 4, 52, 402, 8, 52, 11, 52, 12, 52, 403, 1, 52, 1, 52, 1, 53, 1, 53, 1, 54, 1, 54, 3, 54, 412, 8, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 4, 55, 420, 8, 55, 11, 55, 12, 55, 421, 1, 55, 1, 55, 3, 55, 426, 8, 55, 1, 56, 1, 56, 2, 122, 392, 0, 57, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 0, 111, 0, 113, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 442, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 1, 115, 1, 0, 0, 0, 3, 129, 1, 0, 0, 0, 5, 131, 1, 0, 0, 0, 7, 133, 1, 0, 0, 0, 9, 135, 1, 0, 0, 0, 11, 137, 1, 0, 0, 0, 13, 139, 1, 0, 0, 0, 15, 141, 1, 0, 0, 0, 17, 143, 1, 0, 0, 0, 19, 148, 1, 0, 0, 0, 21, 150, 1, 0, 0, 0, 23, 152, 1, 0, 0, 0, 25, 154, 1, 0, 0, 0, 27, 156, 1, 0, 0, 0, 29, 162, 1, 0, 0, 0, 31, 166, 1, 0, 0, 0, 33, 171, 1, 0, 0, 0, 35, 177, 1, 0, 0, 0, 37, 182, 1, 0, 0, 0, 39, 188, 1, 0, 0, 0, 41, 195, 1, 0, 0, 0, 43, 204, 1, 0, 0, 0, 45, 211, 1, 0, 0, 0, 47, 223, 1, 0, 0, 0, 49, 230, 1, 0, 0, 0, 51, 235, 1, 0, 0, 0, 53, 238, 1, 0, 0, 0, 55, 247, 1, 0, 0, 0, 57, 256, 1, 0, 0, 0, 59, 261, 1, 0, 0, 0, 61, 268, 1, 0, 0, 0, 63, 278, 1, 0, 0, 0, 65, 288, 1, 0, 0, 0, 67, 297, 1, 0, 0, 0, 69, 306, 1, 0, 0, 0, 71, 313, 1, 0, 0, 0, 73, 317, 1, 0, 0, 0, 75, 322, 1, 0, 0, 0, 77, 325, 1, 0, 0, 0, 79, 329, 1, 0, 0, 0, 81, 332, 1, 0, 0, 0, 83, 334, 1, 0, 0, 0, 85, 336, 1, 0, 0, 0, 87, 339, 1, 0, 0, 0, 89, 341, 1, 0, 0, 0, 91, 344, 1, 0, 0, 0, 93, 347, 1, 0, 0, 0, 95, 350, 1, 0, 0, 0, 97, 358, 1, 0, 0, 0, 99, 371, 1, 0, 0, 0, 101, 375, 1, 0, 0, 0, 103, 386, 1, 0, 0, 0, 105, 401, 1, 0, 0, 0, 107, 407, 1, 0, 0, 0, 109, 411, 1, 0, 0, 0, 111, 413, 1, 0, 0, 0, 113, 427, 1, 0, 0, 0, 115, 116, 5, 39, 0, 0, 116, 117, 5, 39, 0, 0, 117, 118, 5, 39, 0, 0, 118, 122, 1, 0, 0, 0, 119, 121, 9, 0, 0, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 39, 0, 0, 126, 127, 5, 39, 0, 0, 127, 128, 5, 39, 0, 0, 128, 2, 1, 0, 0, 0, 129, 130, 5, 64, 0, 0, 130, 4, 1, 0, 0, 0, 131, 132, 5, 44, 0, 0, 132, 6, 1, 0, 0, 0, 133, 134, 5, 91, 0, 0, 134, 8, 1, 0, 0, 0, 135, 136, 5, 93, 0, 0, 136, 10, 1, 0, 0, 0, 137, 138, 5, 40, 0, 0, 138, 12, 1, 0, 0, 0, 139, 140, 5, 41, 0, 0, 140, 14, 1, 0, 0, 0, 141, 142, 5, 46, 0, 0, 142, 16, 1, 0, 0, 0, 143, 144, 5, 124, 0, 0, 144, 18, 1, 0, 0, 0, 145, 149, 5, 58, 0, 0, 146, 147, 5, 58, 0, 0, 147, 149, 5, 58, 0, 0, 148, 145, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 149, 20, 1, 0, 0, 0, 150, 151, 5, 61, 0, 0, 151, 22, 1, 0, 0, 0, 152, 153, 5, 123, 0, 0, 153, 24, 1, 0, 0, 0, 154, 155, 5, 125, 0, 0, 155, 26, 1, 0, 0, 0, 156, 157, 5, 112, 0, 0, 157, 158, 5, 97, 0, 0, 158, 159, 5, 114, 0, 0, 159, 160, 5, 97, 0, 0, 160, 161, 5, 109, 0, 0, 161, 28, 1, 0, 0, 0, 162, 163, 5, 118, 0, 0, 163, 164, 5, 97, 0, 0, 164, 165, 5, 114, 0, 0, 165, 30, 1, 0, 0, 0, 166, 167, 5, 116, 0, 0, 167, 168, 5, 114, 0, 0, 168, 169, 5, 117, 0, 0, 169, 170, 5, 101, 0, 0, 170, 32, 1, 0, 0, 0, 171, 172, 5, 102, 0, 0, 172, 173, 5, 97, 0, 0, 173, 174, 5, 108, 0, 0, 174, 175, 5, 115, 0, 0, 175, 176, 5, 101, 0, 0, 176, 34, 1, 0, 0, 0, 177, 178, 5, 110, 0, 0, 178, 179, 5, 117, 0, 0, 179, 180, 5, 108, 0, 0, 180, 181, 5, 108, 0, 0, 181, 36, 1, 0, 0, 0, 182, 183, 5, 97, 0, 0, 183, 184, 5, 114, 0, 0, 184, 185, 5, 114, 0, 0, 185, 186, 5, 97, 0, 0, 186, 187, 5, 121, 0, 0, 187, 38, 1, 0, 0, 0, 188, 189, 5, 111, 0, 0, 189, 190, 5, 98, 0, 0, 190, 191, 5, 106, 0, 0, 191, 192, 5, 101, 0, 0, 192, 193, 5, 99, 0, 0, 193, 194, 5, 116, 0, 0, 194, 40, 1, 0, 0, 0, 195, 196, 5, 114, 0, 0, 196, 197, 5, 101, 0, 0, 197, 198, 5, 115, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, 5, 117, 0, 0, 200, 201, 5, 114, 0, 0, 201, 202, 5, 99, 0, 0, 202, 203, 5, 101, 0, 0, 203, 42, 1, 0, 0, 0, 204, 205, 5, 111, 0, 0, 205, 206, 5, 117, 0, 0, 206, 207, 5, 116, 0, 0, 207, 208, 5, 112, 0, 0, 208, 209, 5, 117, 0, 0, 209, 210, 5, 116, 0, 0, 210, 44, 1, 0, 0, 0, 211, 212, 5, 116, 0, 0, 212, 213, 5, 97, 0, 0, 213, 214, 5, 114, 0, 0, 214, 215, 5, 103, 0, 0, 215, 216, 5, 101, 0, 0, 216, 217, 5, 116, 0, 0, 217, 218, 5, 83, 0, 0, 218, 219, 5, 99, 0, 0, 219, 220, 5, 111, 0, 0, 220, 221, 5, 112, 0, 0, 221, 222, 5, 101, 0, 0, 222, 46, 1, 0, 0, 0, 223, 224, 5, 105, 0, 0, 224, 225, 5, 109, 0, 0, 225, 226, 5, 112, 0, 0, 226, 227, 5, 111, 0, 0, 227, 228, 5, 114, 0, 0, 228, 229, 5, 116, 0, 0, 229, 48, 1, 0, 0, 0, 230, 231, 5, 119, 0, 0, 231, 232, 5, 105, 0, 0, 232, 233, 5, 116, 0, 0, 233, 234, 5, 104, 0, 0, 234, 50, 1, 0, 0, 0, 235, 236, 5, 97, 0, 0, 236, 237, 5, 115, 0, 0, 237, 52, 1, 0, 0, 0, 238, 239, 5, 109, 0, 0, 239, 240, 5, 101, 0, 0, 240, 241, 5, 116, 0, 0, 241, 242, 5, 97, 0, 0, 242, 243, 5, 100, 0, 0, 243, 244, 5, 97, 0, 0, 244, 245, 5, 116, 0, 0, 245, 246, 5, 97, 0, 0, 246, 54, 1, 0, 0, 0, 247, 248, 5, 101, 0, 0, 248, 249, 5, 120, 0, 0, 249, 250, 5, 105, 0, 0, 250, 251, 5, 115, 0, 0, 251, 252, 5, 116, 0, 0, 252, 253, 5, 105, 0, 0, 253, 254, 5, 110, 0, 0, 254, 255, 5, 103, 0, 0, 255, 56, 1, 0, 0, 0, 256, 257, 5, 116, 0, 0, 257, 258, 5, 121, 0, 0, 258, 259, 5, 112, 0, 0, 259, 260, 5, 101, 0, 0, 260, 58, 1, 0, 0, 0, 261, 262, 5, 109, 0, 0, 262, 263, 5, 111, 0, 0, 263, 264, 5, 100, 0, 0, 264, 265, 5, 117, 0, 0, 265, 266, 5, 108, 0, 0, 266, 267, 5, 101, 0, 0, 267, 60, 1, 0, 0, 0, 268, 272, 5, 39, 0, 0, 269, 271, 3, 109, 54, 0, 270, 269, 1, 0, 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 275, 276, 5, 36, 0, 0, 276, 277, 5, 123, 0, 0, 277, 62, 1, 0, 0, 0, 278, 282, 5, 125, 0, 0, 279, 281, 3, 109, 54, 0, 280, 279, 1, 0, 0, 0, 281, 284, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 285, 286, 5, 36, 0, 0, 286, 287, 5, 123, 0, 0, 287, 64, 1, 0, 0, 0, 288, 292, 5, 125, 0, 0, 289, 291, 3, 109, 54, 0, 290, 289, 1, 0, 0, 0, 291, 294, 1, 0, 0, 0, 292, 290, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 295, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 295, 296, 5, 39, 0, 0, 296, 66, 1, 0, 0, 0, 297, 301, 5, 39, 0, 0, 298, 300, 3, 109, 54, 0, 299, 298, 1, 0, 0, 0, 300, 303, 1, 0, 0, 0, 301, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 304, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 304, 305, 5, 39, 0, 0, 305, 68, 1, 0, 0, 0, 306, 307, 5, 115, 0, 0, 307, 308, 5, 116, 0, 0, 308, 309, 5, 114, 0, 0, 309, 310, 5, 105, 0, 0, 310, 311, 5, 110, 0, 0, 311, 312, 5, 103, 0, 0, 312, 70, 1, 0, 0, 0, 313, 314, 5, 105, 0, 0, 314, 315, 5, 110, 0, 0, 315, 316, 5, 116, 0, 0, 316, 72, 1, 0, 0, 0, 317, 318, 5, 98, 0, 0, 318, 319, 5, 111, 0, 0, 319, 320, 5, 111, 0, 0, 320, 321, 5, 108, 0, 0, 321, 74, 1, 0, 0, 0, 322, 323, 5, 105, 0, 0, 323, 324, 5, 102, 0, 0, 324, 76, 1, 0, 0, 0, 325, 326, 5, 102, 0, 0, 326, 327, 5, 111, 0, 0, 327, 328, 5, 114, 0, 0, 328, 78, 1, 0, 0, 0, 329, 330, 5, 105, 0, 0, 330, 331, 5, 110, 0, 0, 331, 80, 1, 0, 0, 0, 332, 333, 5, 63, 0, 0, 333, 82, 1, 0, 0, 0, 334, 335, 5, 62, 0, 0, 335, 84, 1, 0, 0, 0, 336, 337, 5, 62, 0, 0, 337, 338, 5, 61, 0, 0, 338, 86, 1, 0, 0, 0, 339, 340, 5, 60, 0, 0, 340, 88, 1, 0, 0, 0, 341, 342, 5, 60, 0, 0, 342, 343, 5, 61, 0, 0, 343, 90, 1, 0, 0, 0, 344, 345, 5, 61, 0, 0, 345, 346, 5, 61, 0, 0, 346, 92, 1, 0, 0, 0, 347, 348, 5, 33, 0, 0, 348, 349, 5, 61, 0, 0, 349, 94, 1, 0, 0, 0, 350, 354, 7, 0, 0, 0, 351, 353, 7, 1, 0, 0, 352, 351, 1, 0, 0, 0, 353, 356, 1, 0, 0, 0, 354, 352, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 96, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 357, 359, 7, 2, 0, 0, 358, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 368, 1, 0, 0, 0, 362, 364, 5, 46, 0, 0, 363, 365, 7, 2, 0, 0, 364, 363, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 369, 1, 0, 0, 0, 368, 362, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 98, 1, 0, 0, 0, 370, 372, 7, 3, 0, 0, 371, 370, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 100, 1, 0, 0, 0, 375, 376, 5, 47, 0, 0, 376, 377, 5, 47, 0, 0, 377, 381, 1, 0, 0, 0, 378, 380, 8, 3, 0, 0, 379, 378, 1, 0, 0, 0, 380, 383, 1, 0, 0, 0, 381, 379, 1, 0, 0, 0, 381, 382, 1, 0, 0, 0, 382, 384, 1, 0, 0, 0, 383, 381, 1, 0, 0, 0, 384, 385, 6, 50, 0, 0, 385, 102, 1, 0, 0, 0, 386, 387, 5, 47, 0, 0, 387, 388, 5, 42, 0, 0, 388, 392, 1, 0, 0, 0, 389, 391, 9, 0, 0, 0, 390, 389, 1, 0, 0, 0, 391, 394, 1, 0, 0, 0, 392, 393, 1, 0, 0, 0, 392, 390, 1, 0, 0, 0, 393, 395, 1, 0, 0, 0, 394, 392, 1, 0, 0, 0, 395, 396, 5, 42, 0, 0, 396, 397, 5, 47, 0, 0, 397, 398, 1, 0, 0, 0, 398, 399, 6, 51, 0, 0, 399, 104, 1, 0, 0, 0, 400, 402, 7, 4, 0, 0, 401, 400, 1, 0, 0, 0, 402, 403, 1, 0, 0, 0, 403, 401, 1, 0, 0, 0, 403, 404, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, 406, 6, 52, 0, 0, 406, 106, 1, 0, 0, 0, 407, 408, 9, 0, 0, 0, 408, 108, 1, 0, 0, 0, 409, 412, 8, 5, 0, 0, 410, 412, 3, 111, 55, 0, 411, 409, 1, 0, 0, 0, 411, 410, 1, 0, 0, 0, 412, 110, 1, 0, 0, 0, 413, 425, 5, 92, 0, 0, 414, 426, 7, 6, 0, 0, 415, 416, 5, 117, 0, 0, 416, 417, 5, 123, 0, 0, 417, 419, 1, 0, 0, 0, 418, 420, 3, 113, 56, 0, 419, 418, 1, 0, 0, 0, 420, 421, 1, 0, 0, 0, 421, 419, 1, 0, 0, 0, 421, 422, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 424, 5, 125, 0, 0, 424, 426, 1, 0, 0, 0, 425, 414, 1, 0, 0, 0, 425, 415, 1, 0, 0, 0, 426, 112, 1, 0, 0, 0, 427, 428, 7, 7, 0, 0, 428, 114, 1, 0, 0, 0, 18, 0, 122, 148, 272, 282, 292, 301, 354, 360, 366, 368, 373, 381, 392, 403, 411, 421, 425, 1, 6, 0, 0] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens index ec33a639e52..deb4cb3d93c 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens @@ -26,30 +26,32 @@ WITH=25 AS=26 METADATA=27 EXISTING=28 -STRING_LEFT_PIECE=29 -STRING_MIDDLE_PIECE=30 -STRING_RIGHT_PIECE=31 -STRING_COMPLETE=32 -STRING=33 -INT=34 -BOOL=35 -IF=36 -FOR=37 -IN=38 -QMARK=39 -GT=40 -GTE=41 -LT=42 -LTE=43 -EQ=44 -NEQ=45 -IDENTIFIER=46 -NUMBER=47 -NL=48 -SINGLE_LINE_COMMENT=49 -MULTI_LINE_COMMENT=50 -SPACES=51 -UNKNOWN=52 +TYPE=29 +MODULE=30 +STRING_LEFT_PIECE=31 +STRING_MIDDLE_PIECE=32 +STRING_RIGHT_PIECE=33 +STRING_COMPLETE=34 +STRING=35 +INT=36 +BOOL=37 +IF=38 +FOR=39 +IN=40 +QMARK=41 +GT=42 +GTE=43 +LT=44 +LTE=45 +EQ=46 +NEQ=47 +IDENTIFIER=48 +NUMBER=49 +NL=50 +SINGLE_LINE_COMMENT=51 +MULTI_LINE_COMMENT=52 +SPACES=53 +UNKNOWN=54 '@'=2 ','=3 '['=4 @@ -76,16 +78,18 @@ UNKNOWN=52 'as'=26 'metadata'=27 'existing'=28 -'string'=33 -'int'=34 -'bool'=35 -'if'=36 -'for'=37 -'in'=38 -'?'=39 -'>'=40 -'>='=41 -'<'=42 -'<='=43 -'=='=44 -'!='=45 +'type'=29 +'module'=30 +'string'=35 +'int'=36 +'bool'=37 +'if'=38 +'for'=39 +'in'=40 +'?'=41 +'>'=42 +'>='=43 +'<'=44 +'<='=45 +'=='=46 +'!='=47 diff --git a/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go index 18799996c85..742e0f71185 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go +++ b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go @@ -48,6 +48,14 @@ func (v *BasebicepVisitor) VisitMetadataDecl(ctx *MetadataDeclContext) interface return v.VisitChildren(ctx) } +func (v *BasebicepVisitor) VisitTypeDecl(ctx *TypeDeclContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasebicepVisitor) VisitModuleDecl(ctx *ModuleDeclContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BasebicepVisitor) VisitIfCondition(ctx *IfConditionContext) interface{} { return v.VisitChildren(ctx) } diff --git a/pkg/parser/bicep/antlr/parser/bicep_lexer.go b/pkg/parser/bicep/antlr/parser/bicep_lexer.go index 7e099ddab6b..5682532ea0a 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_lexer.go +++ b/pkg/parser/bicep/antlr/parser/bicep_lexer.go @@ -46,15 +46,15 @@ func biceplexerLexerInit() { "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", "'array'", "'object'", "'resource'", "'output'", "'targetScope'", "'import'", - "'with'", "'as'", "'metadata'", "'existing'", "", "", "", "", "'string'", - "'int'", "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", - "'<='", "'=='", "'!='", + "'with'", "'as'", "'metadata'", "'existing'", "'type'", "'module'", + "", "", "", "", "'string'", "'int'", "'bool'", "'if'", "'for'", "'in'", + "'?'", "'>'", "'>='", "'<'", "'<='", "'=='", "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", "TRUE", "FALSE", "NULL", "ARRAY", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", - "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "STRING_LEFT_PIECE", + "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "TYPE", "MODULE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", @@ -64,7 +64,7 @@ func biceplexerLexerInit() { "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", "TRUE", "FALSE", "NULL", "ARRAY", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", - "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "STRING_LEFT_PIECE", + "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "TYPE", "MODULE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", @@ -72,7 +72,7 @@ func biceplexerLexerInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 52, 413, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 54, 429, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, @@ -82,179 +82,186 @@ func biceplexerLexerInit() { 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, - 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, - 0, 117, 8, 0, 10, 0, 12, 0, 120, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, - 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, - 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 145, 8, 9, 1, 10, 1, 10, 1, 11, - 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, - 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, - 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, - 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, - 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, - 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, - 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, - 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, - 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, - 5, 28, 255, 8, 28, 10, 28, 12, 28, 258, 9, 28, 1, 28, 1, 28, 1, 28, 1, - 29, 1, 29, 5, 29, 265, 8, 29, 10, 29, 12, 29, 268, 9, 29, 1, 29, 1, 29, - 1, 29, 1, 30, 1, 30, 5, 30, 275, 8, 30, 10, 30, 12, 30, 278, 9, 30, 1, - 30, 1, 30, 1, 31, 1, 31, 5, 31, 284, 8, 31, 10, 31, 12, 31, 287, 9, 31, - 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, - 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, - 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, - 39, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, - 1, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 5, 45, 337, 8, 45, 10, 45, 12, - 45, 340, 9, 45, 1, 46, 4, 46, 343, 8, 46, 11, 46, 12, 46, 344, 1, 46, 1, - 46, 4, 46, 349, 8, 46, 11, 46, 12, 46, 350, 3, 46, 353, 8, 46, 1, 47, 4, - 47, 356, 8, 47, 11, 47, 12, 47, 357, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, - 364, 8, 48, 10, 48, 12, 48, 367, 9, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, - 49, 1, 49, 5, 49, 375, 8, 49, 10, 49, 12, 49, 378, 9, 49, 1, 49, 1, 49, - 1, 49, 1, 49, 1, 49, 1, 50, 4, 50, 386, 8, 50, 11, 50, 12, 50, 387, 1, - 50, 1, 50, 1, 51, 1, 51, 1, 52, 1, 52, 3, 52, 396, 8, 52, 1, 53, 1, 53, - 1, 53, 1, 53, 1, 53, 1, 53, 4, 53, 404, 8, 53, 11, 53, 12, 53, 405, 1, - 53, 1, 53, 3, 53, 410, 8, 53, 1, 54, 1, 54, 2, 118, 376, 0, 55, 1, 1, 3, - 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, - 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, - 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, - 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, - 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, - 97, 49, 99, 50, 101, 51, 103, 52, 105, 0, 107, 0, 109, 0, 1, 0, 8, 3, 0, - 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, - 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, - 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, - 116, 3, 0, 48, 57, 65, 70, 97, 102, 426, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, - 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, - 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, - 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, - 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, - 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, - 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, - 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, - 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, - 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, - 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, - 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, - 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, - 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, - 0, 0, 0, 1, 111, 1, 0, 0, 0, 3, 125, 1, 0, 0, 0, 5, 127, 1, 0, 0, 0, 7, - 129, 1, 0, 0, 0, 9, 131, 1, 0, 0, 0, 11, 133, 1, 0, 0, 0, 13, 135, 1, 0, - 0, 0, 15, 137, 1, 0, 0, 0, 17, 139, 1, 0, 0, 0, 19, 144, 1, 0, 0, 0, 21, - 146, 1, 0, 0, 0, 23, 148, 1, 0, 0, 0, 25, 150, 1, 0, 0, 0, 27, 152, 1, - 0, 0, 0, 29, 158, 1, 0, 0, 0, 31, 162, 1, 0, 0, 0, 33, 167, 1, 0, 0, 0, - 35, 173, 1, 0, 0, 0, 37, 178, 1, 0, 0, 0, 39, 184, 1, 0, 0, 0, 41, 191, - 1, 0, 0, 0, 43, 200, 1, 0, 0, 0, 45, 207, 1, 0, 0, 0, 47, 219, 1, 0, 0, - 0, 49, 226, 1, 0, 0, 0, 51, 231, 1, 0, 0, 0, 53, 234, 1, 0, 0, 0, 55, 243, - 1, 0, 0, 0, 57, 252, 1, 0, 0, 0, 59, 262, 1, 0, 0, 0, 61, 272, 1, 0, 0, - 0, 63, 281, 1, 0, 0, 0, 65, 290, 1, 0, 0, 0, 67, 297, 1, 0, 0, 0, 69, 301, - 1, 0, 0, 0, 71, 306, 1, 0, 0, 0, 73, 309, 1, 0, 0, 0, 75, 313, 1, 0, 0, - 0, 77, 316, 1, 0, 0, 0, 79, 318, 1, 0, 0, 0, 81, 320, 1, 0, 0, 0, 83, 323, - 1, 0, 0, 0, 85, 325, 1, 0, 0, 0, 87, 328, 1, 0, 0, 0, 89, 331, 1, 0, 0, - 0, 91, 334, 1, 0, 0, 0, 93, 342, 1, 0, 0, 0, 95, 355, 1, 0, 0, 0, 97, 359, - 1, 0, 0, 0, 99, 370, 1, 0, 0, 0, 101, 385, 1, 0, 0, 0, 103, 391, 1, 0, - 0, 0, 105, 395, 1, 0, 0, 0, 107, 397, 1, 0, 0, 0, 109, 411, 1, 0, 0, 0, - 111, 112, 5, 39, 0, 0, 112, 113, 5, 39, 0, 0, 113, 114, 5, 39, 0, 0, 114, - 118, 1, 0, 0, 0, 115, 117, 9, 0, 0, 0, 116, 115, 1, 0, 0, 0, 117, 120, - 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 121, 1, 0, - 0, 0, 120, 118, 1, 0, 0, 0, 121, 122, 5, 39, 0, 0, 122, 123, 5, 39, 0, - 0, 123, 124, 5, 39, 0, 0, 124, 2, 1, 0, 0, 0, 125, 126, 5, 64, 0, 0, 126, - 4, 1, 0, 0, 0, 127, 128, 5, 44, 0, 0, 128, 6, 1, 0, 0, 0, 129, 130, 5, - 91, 0, 0, 130, 8, 1, 0, 0, 0, 131, 132, 5, 93, 0, 0, 132, 10, 1, 0, 0, - 0, 133, 134, 5, 40, 0, 0, 134, 12, 1, 0, 0, 0, 135, 136, 5, 41, 0, 0, 136, - 14, 1, 0, 0, 0, 137, 138, 5, 46, 0, 0, 138, 16, 1, 0, 0, 0, 139, 140, 5, - 124, 0, 0, 140, 18, 1, 0, 0, 0, 141, 145, 5, 58, 0, 0, 142, 143, 5, 58, - 0, 0, 143, 145, 5, 58, 0, 0, 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, - 145, 20, 1, 0, 0, 0, 146, 147, 5, 61, 0, 0, 147, 22, 1, 0, 0, 0, 148, 149, - 5, 123, 0, 0, 149, 24, 1, 0, 0, 0, 150, 151, 5, 125, 0, 0, 151, 26, 1, - 0, 0, 0, 152, 153, 5, 112, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 114, - 0, 0, 155, 156, 5, 97, 0, 0, 156, 157, 5, 109, 0, 0, 157, 28, 1, 0, 0, - 0, 158, 159, 5, 118, 0, 0, 159, 160, 5, 97, 0, 0, 160, 161, 5, 114, 0, - 0, 161, 30, 1, 0, 0, 0, 162, 163, 5, 116, 0, 0, 163, 164, 5, 114, 0, 0, - 164, 165, 5, 117, 0, 0, 165, 166, 5, 101, 0, 0, 166, 32, 1, 0, 0, 0, 167, - 168, 5, 102, 0, 0, 168, 169, 5, 97, 0, 0, 169, 170, 5, 108, 0, 0, 170, - 171, 5, 115, 0, 0, 171, 172, 5, 101, 0, 0, 172, 34, 1, 0, 0, 0, 173, 174, - 5, 110, 0, 0, 174, 175, 5, 117, 0, 0, 175, 176, 5, 108, 0, 0, 176, 177, - 5, 108, 0, 0, 177, 36, 1, 0, 0, 0, 178, 179, 5, 97, 0, 0, 179, 180, 5, - 114, 0, 0, 180, 181, 5, 114, 0, 0, 181, 182, 5, 97, 0, 0, 182, 183, 5, - 121, 0, 0, 183, 38, 1, 0, 0, 0, 184, 185, 5, 111, 0, 0, 185, 186, 5, 98, - 0, 0, 186, 187, 5, 106, 0, 0, 187, 188, 5, 101, 0, 0, 188, 189, 5, 99, - 0, 0, 189, 190, 5, 116, 0, 0, 190, 40, 1, 0, 0, 0, 191, 192, 5, 114, 0, - 0, 192, 193, 5, 101, 0, 0, 193, 194, 5, 115, 0, 0, 194, 195, 5, 111, 0, - 0, 195, 196, 5, 117, 0, 0, 196, 197, 5, 114, 0, 0, 197, 198, 5, 99, 0, - 0, 198, 199, 5, 101, 0, 0, 199, 42, 1, 0, 0, 0, 200, 201, 5, 111, 0, 0, - 201, 202, 5, 117, 0, 0, 202, 203, 5, 116, 0, 0, 203, 204, 5, 112, 0, 0, - 204, 205, 5, 117, 0, 0, 205, 206, 5, 116, 0, 0, 206, 44, 1, 0, 0, 0, 207, - 208, 5, 116, 0, 0, 208, 209, 5, 97, 0, 0, 209, 210, 5, 114, 0, 0, 210, - 211, 5, 103, 0, 0, 211, 212, 5, 101, 0, 0, 212, 213, 5, 116, 0, 0, 213, - 214, 5, 83, 0, 0, 214, 215, 5, 99, 0, 0, 215, 216, 5, 111, 0, 0, 216, 217, - 5, 112, 0, 0, 217, 218, 5, 101, 0, 0, 218, 46, 1, 0, 0, 0, 219, 220, 5, - 105, 0, 0, 220, 221, 5, 109, 0, 0, 221, 222, 5, 112, 0, 0, 222, 223, 5, - 111, 0, 0, 223, 224, 5, 114, 0, 0, 224, 225, 5, 116, 0, 0, 225, 48, 1, - 0, 0, 0, 226, 227, 5, 119, 0, 0, 227, 228, 5, 105, 0, 0, 228, 229, 5, 116, - 0, 0, 229, 230, 5, 104, 0, 0, 230, 50, 1, 0, 0, 0, 231, 232, 5, 97, 0, - 0, 232, 233, 5, 115, 0, 0, 233, 52, 1, 0, 0, 0, 234, 235, 5, 109, 0, 0, - 235, 236, 5, 101, 0, 0, 236, 237, 5, 116, 0, 0, 237, 238, 5, 97, 0, 0, - 238, 239, 5, 100, 0, 0, 239, 240, 5, 97, 0, 0, 240, 241, 5, 116, 0, 0, - 241, 242, 5, 97, 0, 0, 242, 54, 1, 0, 0, 0, 243, 244, 5, 101, 0, 0, 244, - 245, 5, 120, 0, 0, 245, 246, 5, 105, 0, 0, 246, 247, 5, 115, 0, 0, 247, - 248, 5, 116, 0, 0, 248, 249, 5, 105, 0, 0, 249, 250, 5, 110, 0, 0, 250, - 251, 5, 103, 0, 0, 251, 56, 1, 0, 0, 0, 252, 256, 5, 39, 0, 0, 253, 255, - 3, 105, 52, 0, 254, 253, 1, 0, 0, 0, 255, 258, 1, 0, 0, 0, 256, 254, 1, - 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 259, 1, 0, 0, 0, 258, 256, 1, 0, 0, - 0, 259, 260, 5, 36, 0, 0, 260, 261, 5, 123, 0, 0, 261, 58, 1, 0, 0, 0, - 262, 266, 5, 125, 0, 0, 263, 265, 3, 105, 52, 0, 264, 263, 1, 0, 0, 0, - 265, 268, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, - 269, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 270, 5, 36, 0, 0, 270, 271, - 5, 123, 0, 0, 271, 60, 1, 0, 0, 0, 272, 276, 5, 125, 0, 0, 273, 275, 3, - 105, 52, 0, 274, 273, 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, - 0, 0, 276, 277, 1, 0, 0, 0, 277, 279, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, - 279, 280, 5, 39, 0, 0, 280, 62, 1, 0, 0, 0, 281, 285, 5, 39, 0, 0, 282, - 284, 3, 105, 52, 0, 283, 282, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 283, - 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 288, 1, 0, 0, 0, 287, 285, 1, 0, - 0, 0, 288, 289, 5, 39, 0, 0, 289, 64, 1, 0, 0, 0, 290, 291, 5, 115, 0, - 0, 291, 292, 5, 116, 0, 0, 292, 293, 5, 114, 0, 0, 293, 294, 5, 105, 0, - 0, 294, 295, 5, 110, 0, 0, 295, 296, 5, 103, 0, 0, 296, 66, 1, 0, 0, 0, - 297, 298, 5, 105, 0, 0, 298, 299, 5, 110, 0, 0, 299, 300, 5, 116, 0, 0, - 300, 68, 1, 0, 0, 0, 301, 302, 5, 98, 0, 0, 302, 303, 5, 111, 0, 0, 303, - 304, 5, 111, 0, 0, 304, 305, 5, 108, 0, 0, 305, 70, 1, 0, 0, 0, 306, 307, - 5, 105, 0, 0, 307, 308, 5, 102, 0, 0, 308, 72, 1, 0, 0, 0, 309, 310, 5, - 102, 0, 0, 310, 311, 5, 111, 0, 0, 311, 312, 5, 114, 0, 0, 312, 74, 1, - 0, 0, 0, 313, 314, 5, 105, 0, 0, 314, 315, 5, 110, 0, 0, 315, 76, 1, 0, - 0, 0, 316, 317, 5, 63, 0, 0, 317, 78, 1, 0, 0, 0, 318, 319, 5, 62, 0, 0, - 319, 80, 1, 0, 0, 0, 320, 321, 5, 62, 0, 0, 321, 322, 5, 61, 0, 0, 322, - 82, 1, 0, 0, 0, 323, 324, 5, 60, 0, 0, 324, 84, 1, 0, 0, 0, 325, 326, 5, - 60, 0, 0, 326, 327, 5, 61, 0, 0, 327, 86, 1, 0, 0, 0, 328, 329, 5, 61, - 0, 0, 329, 330, 5, 61, 0, 0, 330, 88, 1, 0, 0, 0, 331, 332, 5, 33, 0, 0, - 332, 333, 5, 61, 0, 0, 333, 90, 1, 0, 0, 0, 334, 338, 7, 0, 0, 0, 335, - 337, 7, 1, 0, 0, 336, 335, 1, 0, 0, 0, 337, 340, 1, 0, 0, 0, 338, 336, - 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 92, 1, 0, 0, 0, 340, 338, 1, 0, - 0, 0, 341, 343, 7, 2, 0, 0, 342, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, - 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 352, 1, 0, 0, 0, 346, - 348, 5, 46, 0, 0, 347, 349, 7, 2, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, - 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 353, 1, 0, - 0, 0, 352, 346, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, 353, 94, 1, 0, 0, 0, - 354, 356, 7, 3, 0, 0, 355, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, - 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 96, 1, 0, 0, 0, 359, 360, 5, - 47, 0, 0, 360, 361, 5, 47, 0, 0, 361, 365, 1, 0, 0, 0, 362, 364, 8, 3, - 0, 0, 363, 362, 1, 0, 0, 0, 364, 367, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, - 365, 366, 1, 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 368, - 369, 6, 48, 0, 0, 369, 98, 1, 0, 0, 0, 370, 371, 5, 47, 0, 0, 371, 372, - 5, 42, 0, 0, 372, 376, 1, 0, 0, 0, 373, 375, 9, 0, 0, 0, 374, 373, 1, 0, - 0, 0, 375, 378, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 376, 374, 1, 0, 0, 0, - 377, 379, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 379, 380, 5, 42, 0, 0, 380, - 381, 5, 47, 0, 0, 381, 382, 1, 0, 0, 0, 382, 383, 6, 49, 0, 0, 383, 100, - 1, 0, 0, 0, 384, 386, 7, 4, 0, 0, 385, 384, 1, 0, 0, 0, 386, 387, 1, 0, - 0, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 389, 1, 0, 0, 0, - 389, 390, 6, 50, 0, 0, 390, 102, 1, 0, 0, 0, 391, 392, 9, 0, 0, 0, 392, - 104, 1, 0, 0, 0, 393, 396, 8, 5, 0, 0, 394, 396, 3, 107, 53, 0, 395, 393, - 1, 0, 0, 0, 395, 394, 1, 0, 0, 0, 396, 106, 1, 0, 0, 0, 397, 409, 5, 92, - 0, 0, 398, 410, 7, 6, 0, 0, 399, 400, 5, 117, 0, 0, 400, 401, 5, 123, 0, - 0, 401, 403, 1, 0, 0, 0, 402, 404, 3, 109, 54, 0, 403, 402, 1, 0, 0, 0, - 404, 405, 1, 0, 0, 0, 405, 403, 1, 0, 0, 0, 405, 406, 1, 0, 0, 0, 406, - 407, 1, 0, 0, 0, 407, 408, 5, 125, 0, 0, 408, 410, 1, 0, 0, 0, 409, 398, - 1, 0, 0, 0, 409, 399, 1, 0, 0, 0, 410, 108, 1, 0, 0, 0, 411, 412, 7, 7, - 0, 0, 412, 110, 1, 0, 0, 0, 18, 0, 118, 144, 256, 266, 276, 285, 338, 344, - 350, 352, 357, 365, 376, 387, 395, 405, 409, 1, 6, 0, 0, + 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 121, 8, 0, 10, 0, 12, 0, 124, 9, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, + 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 149, + 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, + 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, + 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, + 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, + 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, + 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, + 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, + 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, + 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, + 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, + 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 271, 8, 30, 10, 30, 12, 30, + 274, 9, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 5, 31, 281, 8, 31, 10, 31, + 12, 31, 284, 9, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 5, 32, 291, 8, 32, + 10, 32, 12, 32, 294, 9, 32, 1, 32, 1, 32, 1, 33, 1, 33, 5, 33, 300, 8, + 33, 10, 33, 12, 33, 303, 9, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, + 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, + 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, + 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, + 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, + 5, 47, 353, 8, 47, 10, 47, 12, 47, 356, 9, 47, 1, 48, 4, 48, 359, 8, 48, + 11, 48, 12, 48, 360, 1, 48, 1, 48, 4, 48, 365, 8, 48, 11, 48, 12, 48, 366, + 3, 48, 369, 8, 48, 1, 49, 4, 49, 372, 8, 49, 11, 49, 12, 49, 373, 1, 50, + 1, 50, 1, 50, 1, 50, 5, 50, 380, 8, 50, 10, 50, 12, 50, 383, 9, 50, 1, + 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 5, 51, 391, 8, 51, 10, 51, 12, 51, + 394, 9, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 4, 52, 402, 8, 52, + 11, 52, 12, 52, 403, 1, 52, 1, 52, 1, 53, 1, 53, 1, 54, 1, 54, 3, 54, 412, + 8, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 4, 55, 420, 8, 55, 11, + 55, 12, 55, 421, 1, 55, 1, 55, 3, 55, 426, 8, 55, 1, 56, 1, 56, 2, 122, + 392, 0, 57, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, + 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, + 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, + 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, + 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, + 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, + 109, 0, 111, 0, 113, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, + 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, + 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, + 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, + 102, 442, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, + 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, + 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, + 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, + 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, + 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, + 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, + 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, + 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, + 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, + 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, + 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, + 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, + 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, + 107, 1, 0, 0, 0, 1, 115, 1, 0, 0, 0, 3, 129, 1, 0, 0, 0, 5, 131, 1, 0, + 0, 0, 7, 133, 1, 0, 0, 0, 9, 135, 1, 0, 0, 0, 11, 137, 1, 0, 0, 0, 13, + 139, 1, 0, 0, 0, 15, 141, 1, 0, 0, 0, 17, 143, 1, 0, 0, 0, 19, 148, 1, + 0, 0, 0, 21, 150, 1, 0, 0, 0, 23, 152, 1, 0, 0, 0, 25, 154, 1, 0, 0, 0, + 27, 156, 1, 0, 0, 0, 29, 162, 1, 0, 0, 0, 31, 166, 1, 0, 0, 0, 33, 171, + 1, 0, 0, 0, 35, 177, 1, 0, 0, 0, 37, 182, 1, 0, 0, 0, 39, 188, 1, 0, 0, + 0, 41, 195, 1, 0, 0, 0, 43, 204, 1, 0, 0, 0, 45, 211, 1, 0, 0, 0, 47, 223, + 1, 0, 0, 0, 49, 230, 1, 0, 0, 0, 51, 235, 1, 0, 0, 0, 53, 238, 1, 0, 0, + 0, 55, 247, 1, 0, 0, 0, 57, 256, 1, 0, 0, 0, 59, 261, 1, 0, 0, 0, 61, 268, + 1, 0, 0, 0, 63, 278, 1, 0, 0, 0, 65, 288, 1, 0, 0, 0, 67, 297, 1, 0, 0, + 0, 69, 306, 1, 0, 0, 0, 71, 313, 1, 0, 0, 0, 73, 317, 1, 0, 0, 0, 75, 322, + 1, 0, 0, 0, 77, 325, 1, 0, 0, 0, 79, 329, 1, 0, 0, 0, 81, 332, 1, 0, 0, + 0, 83, 334, 1, 0, 0, 0, 85, 336, 1, 0, 0, 0, 87, 339, 1, 0, 0, 0, 89, 341, + 1, 0, 0, 0, 91, 344, 1, 0, 0, 0, 93, 347, 1, 0, 0, 0, 95, 350, 1, 0, 0, + 0, 97, 358, 1, 0, 0, 0, 99, 371, 1, 0, 0, 0, 101, 375, 1, 0, 0, 0, 103, + 386, 1, 0, 0, 0, 105, 401, 1, 0, 0, 0, 107, 407, 1, 0, 0, 0, 109, 411, + 1, 0, 0, 0, 111, 413, 1, 0, 0, 0, 113, 427, 1, 0, 0, 0, 115, 116, 5, 39, + 0, 0, 116, 117, 5, 39, 0, 0, 117, 118, 5, 39, 0, 0, 118, 122, 1, 0, 0, + 0, 119, 121, 9, 0, 0, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, + 123, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, + 1, 0, 0, 0, 125, 126, 5, 39, 0, 0, 126, 127, 5, 39, 0, 0, 127, 128, 5, + 39, 0, 0, 128, 2, 1, 0, 0, 0, 129, 130, 5, 64, 0, 0, 130, 4, 1, 0, 0, 0, + 131, 132, 5, 44, 0, 0, 132, 6, 1, 0, 0, 0, 133, 134, 5, 91, 0, 0, 134, + 8, 1, 0, 0, 0, 135, 136, 5, 93, 0, 0, 136, 10, 1, 0, 0, 0, 137, 138, 5, + 40, 0, 0, 138, 12, 1, 0, 0, 0, 139, 140, 5, 41, 0, 0, 140, 14, 1, 0, 0, + 0, 141, 142, 5, 46, 0, 0, 142, 16, 1, 0, 0, 0, 143, 144, 5, 124, 0, 0, + 144, 18, 1, 0, 0, 0, 145, 149, 5, 58, 0, 0, 146, 147, 5, 58, 0, 0, 147, + 149, 5, 58, 0, 0, 148, 145, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 149, 20, + 1, 0, 0, 0, 150, 151, 5, 61, 0, 0, 151, 22, 1, 0, 0, 0, 152, 153, 5, 123, + 0, 0, 153, 24, 1, 0, 0, 0, 154, 155, 5, 125, 0, 0, 155, 26, 1, 0, 0, 0, + 156, 157, 5, 112, 0, 0, 157, 158, 5, 97, 0, 0, 158, 159, 5, 114, 0, 0, + 159, 160, 5, 97, 0, 0, 160, 161, 5, 109, 0, 0, 161, 28, 1, 0, 0, 0, 162, + 163, 5, 118, 0, 0, 163, 164, 5, 97, 0, 0, 164, 165, 5, 114, 0, 0, 165, + 30, 1, 0, 0, 0, 166, 167, 5, 116, 0, 0, 167, 168, 5, 114, 0, 0, 168, 169, + 5, 117, 0, 0, 169, 170, 5, 101, 0, 0, 170, 32, 1, 0, 0, 0, 171, 172, 5, + 102, 0, 0, 172, 173, 5, 97, 0, 0, 173, 174, 5, 108, 0, 0, 174, 175, 5, + 115, 0, 0, 175, 176, 5, 101, 0, 0, 176, 34, 1, 0, 0, 0, 177, 178, 5, 110, + 0, 0, 178, 179, 5, 117, 0, 0, 179, 180, 5, 108, 0, 0, 180, 181, 5, 108, + 0, 0, 181, 36, 1, 0, 0, 0, 182, 183, 5, 97, 0, 0, 183, 184, 5, 114, 0, + 0, 184, 185, 5, 114, 0, 0, 185, 186, 5, 97, 0, 0, 186, 187, 5, 121, 0, + 0, 187, 38, 1, 0, 0, 0, 188, 189, 5, 111, 0, 0, 189, 190, 5, 98, 0, 0, + 190, 191, 5, 106, 0, 0, 191, 192, 5, 101, 0, 0, 192, 193, 5, 99, 0, 0, + 193, 194, 5, 116, 0, 0, 194, 40, 1, 0, 0, 0, 195, 196, 5, 114, 0, 0, 196, + 197, 5, 101, 0, 0, 197, 198, 5, 115, 0, 0, 198, 199, 5, 111, 0, 0, 199, + 200, 5, 117, 0, 0, 200, 201, 5, 114, 0, 0, 201, 202, 5, 99, 0, 0, 202, + 203, 5, 101, 0, 0, 203, 42, 1, 0, 0, 0, 204, 205, 5, 111, 0, 0, 205, 206, + 5, 117, 0, 0, 206, 207, 5, 116, 0, 0, 207, 208, 5, 112, 0, 0, 208, 209, + 5, 117, 0, 0, 209, 210, 5, 116, 0, 0, 210, 44, 1, 0, 0, 0, 211, 212, 5, + 116, 0, 0, 212, 213, 5, 97, 0, 0, 213, 214, 5, 114, 0, 0, 214, 215, 5, + 103, 0, 0, 215, 216, 5, 101, 0, 0, 216, 217, 5, 116, 0, 0, 217, 218, 5, + 83, 0, 0, 218, 219, 5, 99, 0, 0, 219, 220, 5, 111, 0, 0, 220, 221, 5, 112, + 0, 0, 221, 222, 5, 101, 0, 0, 222, 46, 1, 0, 0, 0, 223, 224, 5, 105, 0, + 0, 224, 225, 5, 109, 0, 0, 225, 226, 5, 112, 0, 0, 226, 227, 5, 111, 0, + 0, 227, 228, 5, 114, 0, 0, 228, 229, 5, 116, 0, 0, 229, 48, 1, 0, 0, 0, + 230, 231, 5, 119, 0, 0, 231, 232, 5, 105, 0, 0, 232, 233, 5, 116, 0, 0, + 233, 234, 5, 104, 0, 0, 234, 50, 1, 0, 0, 0, 235, 236, 5, 97, 0, 0, 236, + 237, 5, 115, 0, 0, 237, 52, 1, 0, 0, 0, 238, 239, 5, 109, 0, 0, 239, 240, + 5, 101, 0, 0, 240, 241, 5, 116, 0, 0, 241, 242, 5, 97, 0, 0, 242, 243, + 5, 100, 0, 0, 243, 244, 5, 97, 0, 0, 244, 245, 5, 116, 0, 0, 245, 246, + 5, 97, 0, 0, 246, 54, 1, 0, 0, 0, 247, 248, 5, 101, 0, 0, 248, 249, 5, + 120, 0, 0, 249, 250, 5, 105, 0, 0, 250, 251, 5, 115, 0, 0, 251, 252, 5, + 116, 0, 0, 252, 253, 5, 105, 0, 0, 253, 254, 5, 110, 0, 0, 254, 255, 5, + 103, 0, 0, 255, 56, 1, 0, 0, 0, 256, 257, 5, 116, 0, 0, 257, 258, 5, 121, + 0, 0, 258, 259, 5, 112, 0, 0, 259, 260, 5, 101, 0, 0, 260, 58, 1, 0, 0, + 0, 261, 262, 5, 109, 0, 0, 262, 263, 5, 111, 0, 0, 263, 264, 5, 100, 0, + 0, 264, 265, 5, 117, 0, 0, 265, 266, 5, 108, 0, 0, 266, 267, 5, 101, 0, + 0, 267, 60, 1, 0, 0, 0, 268, 272, 5, 39, 0, 0, 269, 271, 3, 109, 54, 0, + 270, 269, 1, 0, 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, + 273, 1, 0, 0, 0, 273, 275, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 275, 276, + 5, 36, 0, 0, 276, 277, 5, 123, 0, 0, 277, 62, 1, 0, 0, 0, 278, 282, 5, + 125, 0, 0, 279, 281, 3, 109, 54, 0, 280, 279, 1, 0, 0, 0, 281, 284, 1, + 0, 0, 0, 282, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, + 0, 284, 282, 1, 0, 0, 0, 285, 286, 5, 36, 0, 0, 286, 287, 5, 123, 0, 0, + 287, 64, 1, 0, 0, 0, 288, 292, 5, 125, 0, 0, 289, 291, 3, 109, 54, 0, 290, + 289, 1, 0, 0, 0, 291, 294, 1, 0, 0, 0, 292, 290, 1, 0, 0, 0, 292, 293, + 1, 0, 0, 0, 293, 295, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 295, 296, 5, 39, + 0, 0, 296, 66, 1, 0, 0, 0, 297, 301, 5, 39, 0, 0, 298, 300, 3, 109, 54, + 0, 299, 298, 1, 0, 0, 0, 300, 303, 1, 0, 0, 0, 301, 299, 1, 0, 0, 0, 301, + 302, 1, 0, 0, 0, 302, 304, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 304, 305, + 5, 39, 0, 0, 305, 68, 1, 0, 0, 0, 306, 307, 5, 115, 0, 0, 307, 308, 5, + 116, 0, 0, 308, 309, 5, 114, 0, 0, 309, 310, 5, 105, 0, 0, 310, 311, 5, + 110, 0, 0, 311, 312, 5, 103, 0, 0, 312, 70, 1, 0, 0, 0, 313, 314, 5, 105, + 0, 0, 314, 315, 5, 110, 0, 0, 315, 316, 5, 116, 0, 0, 316, 72, 1, 0, 0, + 0, 317, 318, 5, 98, 0, 0, 318, 319, 5, 111, 0, 0, 319, 320, 5, 111, 0, + 0, 320, 321, 5, 108, 0, 0, 321, 74, 1, 0, 0, 0, 322, 323, 5, 105, 0, 0, + 323, 324, 5, 102, 0, 0, 324, 76, 1, 0, 0, 0, 325, 326, 5, 102, 0, 0, 326, + 327, 5, 111, 0, 0, 327, 328, 5, 114, 0, 0, 328, 78, 1, 0, 0, 0, 329, 330, + 5, 105, 0, 0, 330, 331, 5, 110, 0, 0, 331, 80, 1, 0, 0, 0, 332, 333, 5, + 63, 0, 0, 333, 82, 1, 0, 0, 0, 334, 335, 5, 62, 0, 0, 335, 84, 1, 0, 0, + 0, 336, 337, 5, 62, 0, 0, 337, 338, 5, 61, 0, 0, 338, 86, 1, 0, 0, 0, 339, + 340, 5, 60, 0, 0, 340, 88, 1, 0, 0, 0, 341, 342, 5, 60, 0, 0, 342, 343, + 5, 61, 0, 0, 343, 90, 1, 0, 0, 0, 344, 345, 5, 61, 0, 0, 345, 346, 5, 61, + 0, 0, 346, 92, 1, 0, 0, 0, 347, 348, 5, 33, 0, 0, 348, 349, 5, 61, 0, 0, + 349, 94, 1, 0, 0, 0, 350, 354, 7, 0, 0, 0, 351, 353, 7, 1, 0, 0, 352, 351, + 1, 0, 0, 0, 353, 356, 1, 0, 0, 0, 354, 352, 1, 0, 0, 0, 354, 355, 1, 0, + 0, 0, 355, 96, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 357, 359, 7, 2, 0, 0, + 358, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, + 361, 1, 0, 0, 0, 361, 368, 1, 0, 0, 0, 362, 364, 5, 46, 0, 0, 363, 365, + 7, 2, 0, 0, 364, 363, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 364, 1, 0, + 0, 0, 366, 367, 1, 0, 0, 0, 367, 369, 1, 0, 0, 0, 368, 362, 1, 0, 0, 0, + 368, 369, 1, 0, 0, 0, 369, 98, 1, 0, 0, 0, 370, 372, 7, 3, 0, 0, 371, 370, + 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 373, 374, 1, 0, + 0, 0, 374, 100, 1, 0, 0, 0, 375, 376, 5, 47, 0, 0, 376, 377, 5, 47, 0, + 0, 377, 381, 1, 0, 0, 0, 378, 380, 8, 3, 0, 0, 379, 378, 1, 0, 0, 0, 380, + 383, 1, 0, 0, 0, 381, 379, 1, 0, 0, 0, 381, 382, 1, 0, 0, 0, 382, 384, + 1, 0, 0, 0, 383, 381, 1, 0, 0, 0, 384, 385, 6, 50, 0, 0, 385, 102, 1, 0, + 0, 0, 386, 387, 5, 47, 0, 0, 387, 388, 5, 42, 0, 0, 388, 392, 1, 0, 0, + 0, 389, 391, 9, 0, 0, 0, 390, 389, 1, 0, 0, 0, 391, 394, 1, 0, 0, 0, 392, + 393, 1, 0, 0, 0, 392, 390, 1, 0, 0, 0, 393, 395, 1, 0, 0, 0, 394, 392, + 1, 0, 0, 0, 395, 396, 5, 42, 0, 0, 396, 397, 5, 47, 0, 0, 397, 398, 1, + 0, 0, 0, 398, 399, 6, 51, 0, 0, 399, 104, 1, 0, 0, 0, 400, 402, 7, 4, 0, + 0, 401, 400, 1, 0, 0, 0, 402, 403, 1, 0, 0, 0, 403, 401, 1, 0, 0, 0, 403, + 404, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, 406, 6, 52, 0, 0, 406, 106, + 1, 0, 0, 0, 407, 408, 9, 0, 0, 0, 408, 108, 1, 0, 0, 0, 409, 412, 8, 5, + 0, 0, 410, 412, 3, 111, 55, 0, 411, 409, 1, 0, 0, 0, 411, 410, 1, 0, 0, + 0, 412, 110, 1, 0, 0, 0, 413, 425, 5, 92, 0, 0, 414, 426, 7, 6, 0, 0, 415, + 416, 5, 117, 0, 0, 416, 417, 5, 123, 0, 0, 417, 419, 1, 0, 0, 0, 418, 420, + 3, 113, 56, 0, 419, 418, 1, 0, 0, 0, 420, 421, 1, 0, 0, 0, 421, 419, 1, + 0, 0, 0, 421, 422, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 424, 5, 125, + 0, 0, 424, 426, 1, 0, 0, 0, 425, 414, 1, 0, 0, 0, 425, 415, 1, 0, 0, 0, + 426, 112, 1, 0, 0, 0, 427, 428, 7, 7, 0, 0, 428, 114, 1, 0, 0, 0, 18, 0, + 122, 148, 272, 282, 292, 301, 354, 360, 366, 368, 373, 381, 392, 403, 411, + 421, 425, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -323,28 +330,30 @@ const ( bicepLexerAS = 26 bicepLexerMETADATA = 27 bicepLexerEXISTING = 28 - bicepLexerSTRING_LEFT_PIECE = 29 - bicepLexerSTRING_MIDDLE_PIECE = 30 - bicepLexerSTRING_RIGHT_PIECE = 31 - bicepLexerSTRING_COMPLETE = 32 - bicepLexerSTRING = 33 - bicepLexerINT = 34 - bicepLexerBOOL = 35 - bicepLexerIF = 36 - bicepLexerFOR = 37 - bicepLexerIN = 38 - bicepLexerQMARK = 39 - bicepLexerGT = 40 - bicepLexerGTE = 41 - bicepLexerLT = 42 - bicepLexerLTE = 43 - bicepLexerEQ = 44 - bicepLexerNEQ = 45 - bicepLexerIDENTIFIER = 46 - bicepLexerNUMBER = 47 - bicepLexerNL = 48 - bicepLexerSINGLE_LINE_COMMENT = 49 - bicepLexerMULTI_LINE_COMMENT = 50 - bicepLexerSPACES = 51 - bicepLexerUNKNOWN = 52 + bicepLexerTYPE = 29 + bicepLexerMODULE = 30 + bicepLexerSTRING_LEFT_PIECE = 31 + bicepLexerSTRING_MIDDLE_PIECE = 32 + bicepLexerSTRING_RIGHT_PIECE = 33 + bicepLexerSTRING_COMPLETE = 34 + bicepLexerSTRING = 35 + bicepLexerINT = 36 + bicepLexerBOOL = 37 + bicepLexerIF = 38 + bicepLexerFOR = 39 + bicepLexerIN = 40 + bicepLexerQMARK = 41 + bicepLexerGT = 42 + bicepLexerGTE = 43 + bicepLexerLT = 44 + bicepLexerLTE = 45 + bicepLexerEQ = 46 + bicepLexerNEQ = 47 + bicepLexerIDENTIFIER = 48 + bicepLexerNUMBER = 49 + bicepLexerNL = 50 + bicepLexerSINGLE_LINE_COMMENT = 51 + bicepLexerMULTI_LINE_COMMENT = 52 + bicepLexerSPACES = 53 + bicepLexerUNKNOWN = 54 ) diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 9ae27c55251..5c0b6f26940 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -36,15 +36,15 @@ func bicepParserInit() { "", "", "'@'", "','", "'['", "']'", "'('", "')'", "'.'", "'|'", "", "'='", "'{'", "'}'", "'param'", "'var'", "'true'", "'false'", "'null'", "'array'", "'object'", "'resource'", "'output'", "'targetScope'", "'import'", - "'with'", "'as'", "'metadata'", "'existing'", "", "", "", "", "'string'", - "'int'", "'bool'", "'if'", "'for'", "'in'", "'?'", "'>'", "'>='", "'<'", - "'<='", "'=='", "'!='", + "'with'", "'as'", "'metadata'", "'existing'", "'type'", "'module'", + "", "", "", "", "'string'", "'int'", "'bool'", "'if'", "'for'", "'in'", + "'?'", "'>'", "'>='", "'<'", "'<='", "'=='", "'!='", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", "DOT", "PIPE", "COL", "ASSIGN", "OBRACE", "CBRACE", "PARAM", "VAR", "TRUE", "FALSE", "NULL", "ARRAY", "OBJECT", "RESOURCE", "OUTPUT", "TARGET_SCOPE", - "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "STRING_LEFT_PIECE", + "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "TYPE", "MODULE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", @@ -53,187 +53,204 @@ func bicepParserInit() { staticData.RuleNames = []string{ "program", "statement", "parameterDecl", "parameterDefaultValue", "variableDecl", "resourceDecl", "outputDecl", "targetScopeDecl", "importDecl", "metadataDecl", - "ifCondition", "forExpression", "forVariableBlock", "forBody", "interpString", - "expression", "logicCharacter", "primaryExpression", "parenthesizedExpression", - "typeExpression", "literalValue", "object", "objectProperty", "array", - "arrayItem", "decorator", "decoratorExpression", "functionCall", "argumentList", - "identifier", + "typeDecl", "moduleDecl", "ifCondition", "forExpression", "forVariableBlock", + "forBody", "interpString", "expression", "logicCharacter", "primaryExpression", + "parenthesizedExpression", "typeExpression", "literalValue", "object", + "objectProperty", "array", "arrayItem", "decorator", "decoratorExpression", + "functionCall", "argumentList", "identifier", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 52, 386, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 54, 422, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, - 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 1, 0, 5, 0, 62, 8, 0, - 10, 0, 12, 0, 65, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 76, 8, 1, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, - 2, 1, 2, 1, 2, 1, 2, 3, 2, 88, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 93, 8, 2, - 3, 2, 95, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 103, 8, 4, 10, - 4, 12, 4, 106, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 115, - 8, 5, 10, 5, 12, 5, 118, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 124, 8, 5, - 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 130, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 135, 8, - 6, 10, 6, 12, 6, 138, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 145, 8, - 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 157, - 8, 8, 10, 8, 12, 8, 160, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, - 168, 8, 8, 10, 8, 12, 8, 171, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, - 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 5, 11, 187, 8, 11, - 10, 11, 12, 11, 190, 9, 11, 1, 11, 1, 11, 1, 11, 3, 11, 195, 8, 11, 1, - 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 202, 8, 11, 10, 11, 12, 11, 205, - 9, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, - 13, 3, 13, 217, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 223, 8, 14, 10, - 14, 12, 14, 226, 9, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 232, 8, 14, - 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, - 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, - 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 261, 8, 15, 10, 15, 12, - 15, 264, 9, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, - 1, 17, 1, 17, 3, 17, 276, 8, 17, 1, 18, 1, 18, 3, 18, 280, 8, 18, 1, 18, - 1, 18, 3, 18, 284, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, - 20, 1, 20, 1, 20, 3, 20, 295, 8, 20, 1, 21, 1, 21, 4, 21, 299, 8, 21, 11, - 21, 12, 21, 300, 1, 21, 1, 21, 4, 21, 305, 8, 21, 11, 21, 12, 21, 306, - 5, 21, 309, 8, 21, 10, 21, 12, 21, 312, 9, 21, 3, 21, 314, 8, 21, 1, 21, - 1, 21, 1, 22, 1, 22, 3, 22, 320, 8, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, - 23, 5, 23, 327, 8, 23, 10, 23, 12, 23, 330, 9, 23, 1, 23, 5, 23, 333, 8, - 23, 10, 23, 12, 23, 336, 9, 23, 1, 23, 1, 23, 1, 24, 1, 24, 4, 24, 342, - 8, 24, 11, 24, 12, 24, 343, 1, 24, 3, 24, 347, 8, 24, 1, 25, 1, 25, 1, - 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 358, 8, 26, 1, 27, - 1, 27, 1, 27, 3, 27, 363, 8, 27, 1, 27, 3, 27, 366, 8, 27, 1, 27, 3, 27, - 369, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 3, 28, 376, 8, 28, 1, 28, - 5, 28, 379, 8, 28, 10, 28, 12, 28, 382, 9, 28, 1, 29, 1, 29, 1, 29, 0, - 1, 30, 30, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, - 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 0, 2, 1, 0, 40, 45, - 3, 0, 14, 28, 33, 38, 46, 46, 417, 0, 63, 1, 0, 0, 0, 2, 75, 1, 0, 0, 0, - 4, 80, 1, 0, 0, 0, 6, 98, 1, 0, 0, 0, 8, 104, 1, 0, 0, 0, 10, 116, 1, 0, - 0, 0, 12, 136, 1, 0, 0, 0, 14, 150, 1, 0, 0, 0, 16, 158, 1, 0, 0, 0, 18, - 174, 1, 0, 0, 0, 20, 180, 1, 0, 0, 0, 22, 184, 1, 0, 0, 0, 24, 208, 1, - 0, 0, 0, 26, 216, 1, 0, 0, 0, 28, 231, 1, 0, 0, 0, 30, 233, 1, 0, 0, 0, - 32, 265, 1, 0, 0, 0, 34, 275, 1, 0, 0, 0, 36, 277, 1, 0, 0, 0, 38, 287, - 1, 0, 0, 0, 40, 294, 1, 0, 0, 0, 42, 296, 1, 0, 0, 0, 44, 319, 1, 0, 0, - 0, 46, 324, 1, 0, 0, 0, 48, 339, 1, 0, 0, 0, 50, 348, 1, 0, 0, 0, 52, 357, - 1, 0, 0, 0, 54, 359, 1, 0, 0, 0, 56, 372, 1, 0, 0, 0, 58, 383, 1, 0, 0, - 0, 60, 62, 3, 2, 1, 0, 61, 60, 1, 0, 0, 0, 62, 65, 1, 0, 0, 0, 63, 61, - 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 66, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, - 66, 67, 5, 0, 0, 1, 67, 1, 1, 0, 0, 0, 68, 76, 3, 4, 2, 0, 69, 76, 3, 8, - 4, 0, 70, 76, 3, 10, 5, 0, 71, 76, 3, 12, 6, 0, 72, 76, 3, 14, 7, 0, 73, - 76, 3, 16, 8, 0, 74, 76, 5, 48, 0, 0, 75, 68, 1, 0, 0, 0, 75, 69, 1, 0, - 0, 0, 75, 70, 1, 0, 0, 0, 75, 71, 1, 0, 0, 0, 75, 72, 1, 0, 0, 0, 75, 73, - 1, 0, 0, 0, 75, 74, 1, 0, 0, 0, 76, 3, 1, 0, 0, 0, 77, 79, 3, 50, 25, 0, - 78, 77, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, - 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 14, 0, 0, 84, - 94, 3, 58, 29, 0, 85, 87, 3, 38, 19, 0, 86, 88, 3, 6, 3, 0, 87, 86, 1, - 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 95, 1, 0, 0, 0, 89, 90, 5, 21, 0, 0, 90, - 92, 3, 28, 14, 0, 91, 93, 3, 6, 3, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, - 0, 0, 93, 95, 1, 0, 0, 0, 94, 85, 1, 0, 0, 0, 94, 89, 1, 0, 0, 0, 95, 96, - 1, 0, 0, 0, 96, 97, 5, 48, 0, 0, 97, 5, 1, 0, 0, 0, 98, 99, 5, 11, 0, 0, - 99, 100, 3, 30, 15, 0, 100, 7, 1, 0, 0, 0, 101, 103, 3, 50, 25, 0, 102, - 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, - 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 15, - 0, 0, 108, 109, 3, 58, 29, 0, 109, 110, 5, 11, 0, 0, 110, 111, 3, 30, 15, - 0, 111, 112, 5, 48, 0, 0, 112, 9, 1, 0, 0, 0, 113, 115, 3, 50, 25, 0, 114, - 113, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 116, 117, - 1, 0, 0, 0, 117, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 120, 5, 21, - 0, 0, 120, 121, 3, 58, 29, 0, 121, 123, 3, 28, 14, 0, 122, 124, 5, 28, - 0, 0, 123, 122, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, - 125, 129, 5, 11, 0, 0, 126, 130, 3, 20, 10, 0, 127, 130, 3, 42, 21, 0, - 128, 130, 3, 22, 11, 0, 129, 126, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 129, - 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 5, 48, 0, 0, 132, 11, - 1, 0, 0, 0, 133, 135, 3, 50, 25, 0, 134, 133, 1, 0, 0, 0, 135, 138, 1, - 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 139, 1, 0, 0, - 0, 138, 136, 1, 0, 0, 0, 139, 140, 5, 22, 0, 0, 140, 144, 3, 58, 29, 0, - 141, 145, 3, 58, 29, 0, 142, 143, 5, 21, 0, 0, 143, 145, 3, 28, 14, 0, - 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, - 147, 5, 11, 0, 0, 147, 148, 3, 30, 15, 0, 148, 149, 5, 48, 0, 0, 149, 13, - 1, 0, 0, 0, 150, 151, 5, 23, 0, 0, 151, 152, 5, 11, 0, 0, 152, 153, 3, - 30, 15, 0, 153, 154, 5, 48, 0, 0, 154, 15, 1, 0, 0, 0, 155, 157, 3, 50, - 25, 0, 156, 155, 1, 0, 0, 0, 157, 160, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, - 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 161, - 162, 5, 24, 0, 0, 162, 169, 3, 28, 14, 0, 163, 164, 5, 25, 0, 0, 164, 168, - 3, 42, 21, 0, 165, 166, 5, 26, 0, 0, 166, 168, 3, 58, 29, 0, 167, 163, - 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 171, 1, 0, 0, 0, 169, 167, 1, 0, - 0, 0, 169, 170, 1, 0, 0, 0, 170, 172, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, - 172, 173, 5, 48, 0, 0, 173, 17, 1, 0, 0, 0, 174, 175, 5, 27, 0, 0, 175, - 176, 3, 58, 29, 0, 176, 177, 5, 11, 0, 0, 177, 178, 3, 30, 15, 0, 178, - 179, 5, 48, 0, 0, 179, 19, 1, 0, 0, 0, 180, 181, 5, 36, 0, 0, 181, 182, - 3, 36, 18, 0, 182, 183, 3, 42, 21, 0, 183, 21, 1, 0, 0, 0, 184, 188, 5, - 4, 0, 0, 185, 187, 5, 48, 0, 0, 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, - 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, - 188, 1, 0, 0, 0, 191, 194, 5, 37, 0, 0, 192, 195, 3, 58, 29, 0, 193, 195, - 3, 24, 12, 0, 194, 192, 1, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 196, 1, - 0, 0, 0, 196, 197, 5, 38, 0, 0, 197, 198, 3, 30, 15, 0, 198, 199, 5, 10, - 0, 0, 199, 203, 3, 26, 13, 0, 200, 202, 5, 48, 0, 0, 201, 200, 1, 0, 0, - 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, - 206, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 207, 5, 5, 0, 0, 207, 23, 1, - 0, 0, 0, 208, 209, 5, 6, 0, 0, 209, 210, 3, 58, 29, 0, 210, 211, 5, 3, - 0, 0, 211, 212, 3, 58, 29, 0, 212, 213, 5, 7, 0, 0, 213, 25, 1, 0, 0, 0, - 214, 217, 3, 30, 15, 0, 215, 217, 3, 20, 10, 0, 216, 214, 1, 0, 0, 0, 216, - 215, 1, 0, 0, 0, 217, 27, 1, 0, 0, 0, 218, 224, 5, 29, 0, 0, 219, 220, - 3, 30, 15, 0, 220, 221, 5, 30, 0, 0, 221, 223, 1, 0, 0, 0, 222, 219, 1, - 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, - 0, 225, 227, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 228, 3, 30, 15, 0, - 228, 229, 5, 31, 0, 0, 229, 232, 1, 0, 0, 0, 230, 232, 5, 32, 0, 0, 231, - 218, 1, 0, 0, 0, 231, 230, 1, 0, 0, 0, 232, 29, 1, 0, 0, 0, 233, 234, 6, - 15, -1, 0, 234, 235, 3, 34, 17, 0, 235, 262, 1, 0, 0, 0, 236, 237, 10, - 6, 0, 0, 237, 238, 5, 39, 0, 0, 238, 239, 3, 30, 15, 0, 239, 240, 5, 10, - 0, 0, 240, 241, 3, 30, 15, 7, 241, 261, 1, 0, 0, 0, 242, 243, 10, 2, 0, - 0, 243, 244, 3, 32, 16, 0, 244, 245, 3, 30, 15, 3, 245, 261, 1, 0, 0, 0, - 246, 247, 10, 7, 0, 0, 247, 248, 5, 4, 0, 0, 248, 249, 3, 30, 15, 0, 249, - 250, 5, 5, 0, 0, 250, 261, 1, 0, 0, 0, 251, 252, 10, 5, 0, 0, 252, 253, - 5, 8, 0, 0, 253, 261, 3, 58, 29, 0, 254, 255, 10, 4, 0, 0, 255, 256, 5, - 8, 0, 0, 256, 261, 3, 54, 27, 0, 257, 258, 10, 3, 0, 0, 258, 259, 5, 10, - 0, 0, 259, 261, 3, 58, 29, 0, 260, 236, 1, 0, 0, 0, 260, 242, 1, 0, 0, - 0, 260, 246, 1, 0, 0, 0, 260, 251, 1, 0, 0, 0, 260, 254, 1, 0, 0, 0, 260, - 257, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, - 1, 0, 0, 0, 263, 31, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 7, 0, - 0, 0, 266, 33, 1, 0, 0, 0, 267, 276, 3, 40, 20, 0, 268, 276, 3, 54, 27, - 0, 269, 276, 3, 28, 14, 0, 270, 276, 5, 1, 0, 0, 271, 276, 3, 46, 23, 0, - 272, 276, 3, 42, 21, 0, 273, 276, 3, 22, 11, 0, 274, 276, 3, 36, 18, 0, - 275, 267, 1, 0, 0, 0, 275, 268, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, - 270, 1, 0, 0, 0, 275, 271, 1, 0, 0, 0, 275, 272, 1, 0, 0, 0, 275, 273, - 1, 0, 0, 0, 275, 274, 1, 0, 0, 0, 276, 35, 1, 0, 0, 0, 277, 279, 5, 6, - 0, 0, 278, 280, 5, 48, 0, 0, 279, 278, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, - 280, 281, 1, 0, 0, 0, 281, 283, 3, 30, 15, 0, 282, 284, 5, 48, 0, 0, 283, - 282, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 286, - 5, 7, 0, 0, 286, 37, 1, 0, 0, 0, 287, 288, 3, 58, 29, 0, 288, 39, 1, 0, - 0, 0, 289, 295, 5, 47, 0, 0, 290, 295, 5, 16, 0, 0, 291, 295, 5, 17, 0, - 0, 292, 295, 5, 18, 0, 0, 293, 295, 3, 58, 29, 0, 294, 289, 1, 0, 0, 0, - 294, 290, 1, 0, 0, 0, 294, 291, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, - 293, 1, 0, 0, 0, 295, 41, 1, 0, 0, 0, 296, 313, 5, 12, 0, 0, 297, 299, - 5, 48, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, - 0, 0, 300, 301, 1, 0, 0, 0, 301, 310, 1, 0, 0, 0, 302, 304, 3, 44, 22, - 0, 303, 305, 5, 48, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, - 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 302, - 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, - 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 298, 1, 0, 0, 0, - 313, 314, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 316, 5, 13, 0, 0, 316, - 43, 1, 0, 0, 0, 317, 320, 3, 58, 29, 0, 318, 320, 3, 28, 14, 0, 319, 317, - 1, 0, 0, 0, 319, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 10, - 0, 0, 322, 323, 3, 30, 15, 0, 323, 45, 1, 0, 0, 0, 324, 328, 5, 4, 0, 0, - 325, 327, 5, 48, 0, 0, 326, 325, 1, 0, 0, 0, 327, 330, 1, 0, 0, 0, 328, - 326, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 334, 1, 0, 0, 0, 330, 328, - 1, 0, 0, 0, 331, 333, 3, 48, 24, 0, 332, 331, 1, 0, 0, 0, 333, 336, 1, - 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 1, 0, 0, - 0, 336, 334, 1, 0, 0, 0, 337, 338, 5, 5, 0, 0, 338, 47, 1, 0, 0, 0, 339, - 346, 3, 30, 15, 0, 340, 342, 5, 48, 0, 0, 341, 340, 1, 0, 0, 0, 342, 343, - 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 347, 1, 0, - 0, 0, 345, 347, 5, 3, 0, 0, 346, 341, 1, 0, 0, 0, 346, 345, 1, 0, 0, 0, - 346, 347, 1, 0, 0, 0, 347, 49, 1, 0, 0, 0, 348, 349, 5, 2, 0, 0, 349, 350, - 3, 52, 26, 0, 350, 351, 5, 48, 0, 0, 351, 51, 1, 0, 0, 0, 352, 358, 3, - 54, 27, 0, 353, 354, 3, 30, 15, 0, 354, 355, 5, 8, 0, 0, 355, 356, 3, 54, - 27, 0, 356, 358, 1, 0, 0, 0, 357, 352, 1, 0, 0, 0, 357, 353, 1, 0, 0, 0, - 358, 53, 1, 0, 0, 0, 359, 360, 3, 58, 29, 0, 360, 365, 5, 6, 0, 0, 361, - 363, 5, 48, 0, 0, 362, 361, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, - 1, 0, 0, 0, 364, 366, 3, 56, 28, 0, 365, 362, 1, 0, 0, 0, 365, 366, 1, - 0, 0, 0, 366, 368, 1, 0, 0, 0, 367, 369, 5, 48, 0, 0, 368, 367, 1, 0, 0, - 0, 368, 369, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 371, 5, 7, 0, 0, 371, - 55, 1, 0, 0, 0, 372, 380, 3, 30, 15, 0, 373, 375, 5, 3, 0, 0, 374, 376, - 5, 48, 0, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, - 0, 0, 377, 379, 3, 30, 15, 0, 378, 373, 1, 0, 0, 0, 379, 382, 1, 0, 0, - 0, 380, 378, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 57, 1, 0, 0, 0, 382, - 380, 1, 0, 0, 0, 383, 384, 7, 1, 0, 0, 384, 59, 1, 0, 0, 0, 42, 63, 75, - 80, 87, 92, 94, 104, 116, 123, 129, 136, 144, 158, 167, 169, 188, 194, - 203, 216, 224, 231, 260, 262, 275, 279, 283, 294, 300, 306, 310, 313, 319, - 328, 334, 343, 346, 357, 362, 365, 368, 375, 380, + 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, + 31, 1, 0, 5, 0, 66, 8, 0, 10, 0, 12, 0, 69, 9, 0, 1, 0, 1, 0, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 83, 8, 1, 1, 2, + 5, 2, 86, 8, 2, 10, 2, 12, 2, 89, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 95, + 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 100, 8, 2, 3, 2, 102, 8, 2, 1, 2, 1, 2, 1, + 3, 1, 3, 1, 3, 1, 4, 5, 4, 110, 8, 4, 10, 4, 12, 4, 113, 9, 4, 1, 4, 1, + 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 122, 8, 5, 10, 5, 12, 5, 125, 9, + 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 131, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, + 5, 137, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 142, 8, 6, 10, 6, 12, 6, 145, 9, + 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 152, 8, 6, 1, 6, 1, 6, 1, 6, 1, + 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 164, 8, 8, 10, 8, 12, 8, 167, + 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 175, 8, 8, 10, 8, 12, 8, + 178, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 5, 10, + 189, 8, 10, 10, 10, 12, 10, 192, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, + 10, 1, 10, 1, 11, 5, 11, 201, 8, 11, 10, 11, 12, 11, 204, 9, 11, 1, 11, + 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 213, 8, 11, 1, 11, 1, + 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 5, 13, 223, 8, 13, 10, 13, + 12, 13, 226, 9, 13, 1, 13, 1, 13, 1, 13, 3, 13, 231, 8, 13, 1, 13, 1, 13, + 1, 13, 1, 13, 1, 13, 5, 13, 238, 8, 13, 10, 13, 12, 13, 241, 9, 13, 1, + 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 3, 15, + 253, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 259, 8, 16, 10, 16, 12, + 16, 262, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 268, 8, 16, 1, 17, 1, + 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, + 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, + 17, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 297, 8, 17, 10, 17, 12, 17, 300, + 9, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, + 19, 3, 19, 312, 8, 19, 1, 20, 1, 20, 3, 20, 316, 8, 20, 1, 20, 1, 20, 3, + 20, 320, 8, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, + 1, 22, 3, 22, 331, 8, 22, 1, 23, 1, 23, 4, 23, 335, 8, 23, 11, 23, 12, + 23, 336, 1, 23, 1, 23, 4, 23, 341, 8, 23, 11, 23, 12, 23, 342, 5, 23, 345, + 8, 23, 10, 23, 12, 23, 348, 9, 23, 3, 23, 350, 8, 23, 1, 23, 1, 23, 1, + 24, 1, 24, 3, 24, 356, 8, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, + 363, 8, 25, 10, 25, 12, 25, 366, 9, 25, 1, 25, 5, 25, 369, 8, 25, 10, 25, + 12, 25, 372, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 4, 26, 378, 8, 26, 11, + 26, 12, 26, 379, 1, 26, 3, 26, 383, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, + 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 394, 8, 28, 1, 29, 1, 29, 1, + 29, 3, 29, 399, 8, 29, 1, 29, 3, 29, 402, 8, 29, 1, 29, 3, 29, 405, 8, + 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 3, 30, 412, 8, 30, 1, 30, 5, 30, + 415, 8, 30, 10, 30, 12, 30, 418, 9, 30, 1, 31, 1, 31, 1, 31, 0, 1, 34, + 32, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, + 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 0, 2, 1, 0, 42, + 47, 3, 0, 14, 28, 35, 40, 48, 48, 458, 0, 67, 1, 0, 0, 0, 2, 82, 1, 0, + 0, 0, 4, 87, 1, 0, 0, 0, 6, 105, 1, 0, 0, 0, 8, 111, 1, 0, 0, 0, 10, 123, + 1, 0, 0, 0, 12, 143, 1, 0, 0, 0, 14, 157, 1, 0, 0, 0, 16, 165, 1, 0, 0, + 0, 18, 181, 1, 0, 0, 0, 20, 190, 1, 0, 0, 0, 22, 202, 1, 0, 0, 0, 24, 216, + 1, 0, 0, 0, 26, 220, 1, 0, 0, 0, 28, 244, 1, 0, 0, 0, 30, 252, 1, 0, 0, + 0, 32, 267, 1, 0, 0, 0, 34, 269, 1, 0, 0, 0, 36, 301, 1, 0, 0, 0, 38, 311, + 1, 0, 0, 0, 40, 313, 1, 0, 0, 0, 42, 323, 1, 0, 0, 0, 44, 330, 1, 0, 0, + 0, 46, 332, 1, 0, 0, 0, 48, 355, 1, 0, 0, 0, 50, 360, 1, 0, 0, 0, 52, 375, + 1, 0, 0, 0, 54, 384, 1, 0, 0, 0, 56, 393, 1, 0, 0, 0, 58, 395, 1, 0, 0, + 0, 60, 408, 1, 0, 0, 0, 62, 419, 1, 0, 0, 0, 64, 66, 3, 2, 1, 0, 65, 64, + 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, + 68, 70, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 0, 0, 1, 71, 1, 1, 0, + 0, 0, 72, 83, 3, 4, 2, 0, 73, 83, 3, 8, 4, 0, 74, 83, 3, 10, 5, 0, 75, + 83, 3, 12, 6, 0, 76, 83, 3, 14, 7, 0, 77, 83, 3, 16, 8, 0, 78, 83, 3, 18, + 9, 0, 79, 83, 3, 20, 10, 0, 80, 83, 3, 22, 11, 0, 81, 83, 5, 50, 0, 0, + 82, 72, 1, 0, 0, 0, 82, 73, 1, 0, 0, 0, 82, 74, 1, 0, 0, 0, 82, 75, 1, + 0, 0, 0, 82, 76, 1, 0, 0, 0, 82, 77, 1, 0, 0, 0, 82, 78, 1, 0, 0, 0, 82, + 79, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 81, 1, 0, 0, 0, 83, 3, 1, 0, 0, + 0, 84, 86, 3, 54, 27, 0, 85, 84, 1, 0, 0, 0, 86, 89, 1, 0, 0, 0, 87, 85, + 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 90, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, + 90, 91, 5, 14, 0, 0, 91, 101, 3, 62, 31, 0, 92, 94, 3, 42, 21, 0, 93, 95, + 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 102, 1, 0, 0, 0, + 96, 97, 5, 21, 0, 0, 97, 99, 3, 32, 16, 0, 98, 100, 3, 6, 3, 0, 99, 98, + 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 102, 1, 0, 0, 0, 101, 92, 1, 0, 0, + 0, 101, 96, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 104, 5, 50, 0, 0, 104, + 5, 1, 0, 0, 0, 105, 106, 5, 11, 0, 0, 106, 107, 3, 34, 17, 0, 107, 7, 1, + 0, 0, 0, 108, 110, 3, 54, 27, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, + 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, + 113, 111, 1, 0, 0, 0, 114, 115, 5, 15, 0, 0, 115, 116, 3, 62, 31, 0, 116, + 117, 5, 11, 0, 0, 117, 118, 3, 34, 17, 0, 118, 119, 5, 50, 0, 0, 119, 9, + 1, 0, 0, 0, 120, 122, 3, 54, 27, 0, 121, 120, 1, 0, 0, 0, 122, 125, 1, + 0, 0, 0, 123, 121, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 126, 1, 0, 0, + 0, 125, 123, 1, 0, 0, 0, 126, 127, 5, 21, 0, 0, 127, 128, 3, 62, 31, 0, + 128, 130, 3, 32, 16, 0, 129, 131, 5, 28, 0, 0, 130, 129, 1, 0, 0, 0, 130, + 131, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 136, 5, 11, 0, 0, 133, 137, + 3, 24, 12, 0, 134, 137, 3, 46, 23, 0, 135, 137, 3, 26, 13, 0, 136, 133, + 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 138, 1, 0, + 0, 0, 138, 139, 5, 50, 0, 0, 139, 11, 1, 0, 0, 0, 140, 142, 3, 54, 27, + 0, 141, 140, 1, 0, 0, 0, 142, 145, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, + 144, 1, 0, 0, 0, 144, 146, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 146, 147, + 5, 22, 0, 0, 147, 151, 3, 62, 31, 0, 148, 152, 3, 62, 31, 0, 149, 150, + 5, 21, 0, 0, 150, 152, 3, 32, 16, 0, 151, 148, 1, 0, 0, 0, 151, 149, 1, + 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 11, 0, 0, 154, 155, 3, 34, + 17, 0, 155, 156, 5, 50, 0, 0, 156, 13, 1, 0, 0, 0, 157, 158, 5, 23, 0, + 0, 158, 159, 5, 11, 0, 0, 159, 160, 3, 34, 17, 0, 160, 161, 5, 50, 0, 0, + 161, 15, 1, 0, 0, 0, 162, 164, 3, 54, 27, 0, 163, 162, 1, 0, 0, 0, 164, + 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, + 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 24, 0, 0, 169, 176, 3, 32, + 16, 0, 170, 171, 5, 25, 0, 0, 171, 175, 3, 46, 23, 0, 172, 173, 5, 26, + 0, 0, 173, 175, 3, 62, 31, 0, 174, 170, 1, 0, 0, 0, 174, 172, 1, 0, 0, + 0, 175, 178, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, + 179, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 179, 180, 5, 50, 0, 0, 180, 17, + 1, 0, 0, 0, 181, 182, 5, 27, 0, 0, 182, 183, 3, 62, 31, 0, 183, 184, 5, + 11, 0, 0, 184, 185, 3, 34, 17, 0, 185, 186, 5, 50, 0, 0, 186, 19, 1, 0, + 0, 0, 187, 189, 3, 54, 27, 0, 188, 187, 1, 0, 0, 0, 189, 192, 1, 0, 0, + 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 193, 1, 0, 0, 0, 192, + 190, 1, 0, 0, 0, 193, 194, 5, 29, 0, 0, 194, 195, 3, 62, 31, 0, 195, 196, + 5, 11, 0, 0, 196, 197, 3, 42, 21, 0, 197, 198, 5, 50, 0, 0, 198, 21, 1, + 0, 0, 0, 199, 201, 3, 54, 27, 0, 200, 199, 1, 0, 0, 0, 201, 204, 1, 0, + 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 205, 1, 0, 0, 0, + 204, 202, 1, 0, 0, 0, 205, 206, 5, 30, 0, 0, 206, 207, 3, 62, 31, 0, 207, + 208, 3, 32, 16, 0, 208, 212, 5, 11, 0, 0, 209, 213, 3, 24, 12, 0, 210, + 213, 3, 46, 23, 0, 211, 213, 3, 26, 13, 0, 212, 209, 1, 0, 0, 0, 212, 210, + 1, 0, 0, 0, 212, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 50, + 0, 0, 215, 23, 1, 0, 0, 0, 216, 217, 5, 38, 0, 0, 217, 218, 3, 40, 20, + 0, 218, 219, 3, 46, 23, 0, 219, 25, 1, 0, 0, 0, 220, 224, 5, 4, 0, 0, 221, + 223, 5, 50, 0, 0, 222, 221, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, + 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 227, 1, 0, 0, 0, 226, 224, 1, 0, + 0, 0, 227, 230, 5, 39, 0, 0, 228, 231, 3, 62, 31, 0, 229, 231, 3, 28, 14, + 0, 230, 228, 1, 0, 0, 0, 230, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, + 233, 5, 40, 0, 0, 233, 234, 3, 34, 17, 0, 234, 235, 5, 10, 0, 0, 235, 239, + 3, 30, 15, 0, 236, 238, 5, 50, 0, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, + 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, + 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 5, 0, 0, 243, 27, 1, 0, 0, 0, 244, + 245, 5, 6, 0, 0, 245, 246, 3, 62, 31, 0, 246, 247, 5, 3, 0, 0, 247, 248, + 3, 62, 31, 0, 248, 249, 5, 7, 0, 0, 249, 29, 1, 0, 0, 0, 250, 253, 3, 34, + 17, 0, 251, 253, 3, 24, 12, 0, 252, 250, 1, 0, 0, 0, 252, 251, 1, 0, 0, + 0, 253, 31, 1, 0, 0, 0, 254, 260, 5, 31, 0, 0, 255, 256, 3, 34, 17, 0, + 256, 257, 5, 32, 0, 0, 257, 259, 1, 0, 0, 0, 258, 255, 1, 0, 0, 0, 259, + 262, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 263, + 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 263, 264, 3, 34, 17, 0, 264, 265, 5, + 33, 0, 0, 265, 268, 1, 0, 0, 0, 266, 268, 5, 34, 0, 0, 267, 254, 1, 0, + 0, 0, 267, 266, 1, 0, 0, 0, 268, 33, 1, 0, 0, 0, 269, 270, 6, 17, -1, 0, + 270, 271, 3, 38, 19, 0, 271, 298, 1, 0, 0, 0, 272, 273, 10, 6, 0, 0, 273, + 274, 5, 41, 0, 0, 274, 275, 3, 34, 17, 0, 275, 276, 5, 10, 0, 0, 276, 277, + 3, 34, 17, 7, 277, 297, 1, 0, 0, 0, 278, 279, 10, 2, 0, 0, 279, 280, 3, + 36, 18, 0, 280, 281, 3, 34, 17, 3, 281, 297, 1, 0, 0, 0, 282, 283, 10, + 7, 0, 0, 283, 284, 5, 4, 0, 0, 284, 285, 3, 34, 17, 0, 285, 286, 5, 5, + 0, 0, 286, 297, 1, 0, 0, 0, 287, 288, 10, 5, 0, 0, 288, 289, 5, 8, 0, 0, + 289, 297, 3, 62, 31, 0, 290, 291, 10, 4, 0, 0, 291, 292, 5, 8, 0, 0, 292, + 297, 3, 58, 29, 0, 293, 294, 10, 3, 0, 0, 294, 295, 5, 10, 0, 0, 295, 297, + 3, 62, 31, 0, 296, 272, 1, 0, 0, 0, 296, 278, 1, 0, 0, 0, 296, 282, 1, + 0, 0, 0, 296, 287, 1, 0, 0, 0, 296, 290, 1, 0, 0, 0, 296, 293, 1, 0, 0, + 0, 297, 300, 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, + 35, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 301, 302, 7, 0, 0, 0, 302, 37, 1, + 0, 0, 0, 303, 312, 3, 44, 22, 0, 304, 312, 3, 58, 29, 0, 305, 312, 3, 32, + 16, 0, 306, 312, 5, 1, 0, 0, 307, 312, 3, 50, 25, 0, 308, 312, 3, 46, 23, + 0, 309, 312, 3, 26, 13, 0, 310, 312, 3, 40, 20, 0, 311, 303, 1, 0, 0, 0, + 311, 304, 1, 0, 0, 0, 311, 305, 1, 0, 0, 0, 311, 306, 1, 0, 0, 0, 311, + 307, 1, 0, 0, 0, 311, 308, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, 311, 310, + 1, 0, 0, 0, 312, 39, 1, 0, 0, 0, 313, 315, 5, 6, 0, 0, 314, 316, 5, 50, + 0, 0, 315, 314, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, + 317, 319, 3, 34, 17, 0, 318, 320, 5, 50, 0, 0, 319, 318, 1, 0, 0, 0, 319, + 320, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 7, 0, 0, 322, 41, 1, + 0, 0, 0, 323, 324, 3, 62, 31, 0, 324, 43, 1, 0, 0, 0, 325, 331, 5, 49, + 0, 0, 326, 331, 5, 16, 0, 0, 327, 331, 5, 17, 0, 0, 328, 331, 5, 18, 0, + 0, 329, 331, 3, 62, 31, 0, 330, 325, 1, 0, 0, 0, 330, 326, 1, 0, 0, 0, + 330, 327, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 329, 1, 0, 0, 0, 331, + 45, 1, 0, 0, 0, 332, 349, 5, 12, 0, 0, 333, 335, 5, 50, 0, 0, 334, 333, + 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, + 0, 0, 337, 346, 1, 0, 0, 0, 338, 340, 3, 48, 24, 0, 339, 341, 5, 50, 0, + 0, 340, 339, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, + 343, 1, 0, 0, 0, 343, 345, 1, 0, 0, 0, 344, 338, 1, 0, 0, 0, 345, 348, + 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 350, 1, 0, + 0, 0, 348, 346, 1, 0, 0, 0, 349, 334, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, + 350, 351, 1, 0, 0, 0, 351, 352, 5, 13, 0, 0, 352, 47, 1, 0, 0, 0, 353, + 356, 3, 62, 31, 0, 354, 356, 3, 32, 16, 0, 355, 353, 1, 0, 0, 0, 355, 354, + 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 358, 5, 10, 0, 0, 358, 359, 3, 34, + 17, 0, 359, 49, 1, 0, 0, 0, 360, 364, 5, 4, 0, 0, 361, 363, 5, 50, 0, 0, + 362, 361, 1, 0, 0, 0, 363, 366, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 364, + 365, 1, 0, 0, 0, 365, 370, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, 367, 369, + 3, 52, 26, 0, 368, 367, 1, 0, 0, 0, 369, 372, 1, 0, 0, 0, 370, 368, 1, + 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 373, 1, 0, 0, 0, 372, 370, 1, 0, 0, + 0, 373, 374, 5, 5, 0, 0, 374, 51, 1, 0, 0, 0, 375, 382, 3, 34, 17, 0, 376, + 378, 5, 50, 0, 0, 377, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 377, + 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 383, 1, 0, 0, 0, 381, 383, 5, 3, + 0, 0, 382, 377, 1, 0, 0, 0, 382, 381, 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, + 383, 53, 1, 0, 0, 0, 384, 385, 5, 2, 0, 0, 385, 386, 3, 56, 28, 0, 386, + 387, 5, 50, 0, 0, 387, 55, 1, 0, 0, 0, 388, 394, 3, 58, 29, 0, 389, 390, + 3, 34, 17, 0, 390, 391, 5, 8, 0, 0, 391, 392, 3, 58, 29, 0, 392, 394, 1, + 0, 0, 0, 393, 388, 1, 0, 0, 0, 393, 389, 1, 0, 0, 0, 394, 57, 1, 0, 0, + 0, 395, 396, 3, 62, 31, 0, 396, 401, 5, 6, 0, 0, 397, 399, 5, 50, 0, 0, + 398, 397, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 400, 1, 0, 0, 0, 400, + 402, 3, 60, 30, 0, 401, 398, 1, 0, 0, 0, 401, 402, 1, 0, 0, 0, 402, 404, + 1, 0, 0, 0, 403, 405, 5, 50, 0, 0, 404, 403, 1, 0, 0, 0, 404, 405, 1, 0, + 0, 0, 405, 406, 1, 0, 0, 0, 406, 407, 5, 7, 0, 0, 407, 59, 1, 0, 0, 0, + 408, 416, 3, 34, 17, 0, 409, 411, 5, 3, 0, 0, 410, 412, 5, 50, 0, 0, 411, + 410, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 415, + 3, 34, 17, 0, 414, 409, 1, 0, 0, 0, 415, 418, 1, 0, 0, 0, 416, 414, 1, + 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 61, 1, 0, 0, 0, 418, 416, 1, 0, 0, + 0, 419, 420, 7, 1, 0, 0, 420, 63, 1, 0, 0, 0, 45, 67, 82, 87, 94, 99, 101, + 111, 123, 130, 136, 143, 151, 165, 174, 176, 190, 202, 212, 224, 230, 239, + 252, 260, 267, 296, 298, 311, 315, 319, 330, 336, 342, 346, 349, 355, 364, + 370, 379, 382, 393, 398, 401, 404, 411, 416, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -300,30 +317,32 @@ const ( bicepParserAS = 26 bicepParserMETADATA = 27 bicepParserEXISTING = 28 - bicepParserSTRING_LEFT_PIECE = 29 - bicepParserSTRING_MIDDLE_PIECE = 30 - bicepParserSTRING_RIGHT_PIECE = 31 - bicepParserSTRING_COMPLETE = 32 - bicepParserSTRING = 33 - bicepParserINT = 34 - bicepParserBOOL = 35 - bicepParserIF = 36 - bicepParserFOR = 37 - bicepParserIN = 38 - bicepParserQMARK = 39 - bicepParserGT = 40 - bicepParserGTE = 41 - bicepParserLT = 42 - bicepParserLTE = 43 - bicepParserEQ = 44 - bicepParserNEQ = 45 - bicepParserIDENTIFIER = 46 - bicepParserNUMBER = 47 - bicepParserNL = 48 - bicepParserSINGLE_LINE_COMMENT = 49 - bicepParserMULTI_LINE_COMMENT = 50 - bicepParserSPACES = 51 - bicepParserUNKNOWN = 52 + bicepParserTYPE = 29 + bicepParserMODULE = 30 + bicepParserSTRING_LEFT_PIECE = 31 + bicepParserSTRING_MIDDLE_PIECE = 32 + bicepParserSTRING_RIGHT_PIECE = 33 + bicepParserSTRING_COMPLETE = 34 + bicepParserSTRING = 35 + bicepParserINT = 36 + bicepParserBOOL = 37 + bicepParserIF = 38 + bicepParserFOR = 39 + bicepParserIN = 40 + bicepParserQMARK = 41 + bicepParserGT = 42 + bicepParserGTE = 43 + bicepParserLT = 44 + bicepParserLTE = 45 + bicepParserEQ = 46 + bicepParserNEQ = 47 + bicepParserIDENTIFIER = 48 + bicepParserNUMBER = 49 + bicepParserNL = 50 + bicepParserSINGLE_LINE_COMMENT = 51 + bicepParserMULTI_LINE_COMMENT = 52 + bicepParserSPACES = 53 + bicepParserUNKNOWN = 54 ) // bicepParser rules. @@ -338,26 +357,28 @@ const ( bicepParserRULE_targetScopeDecl = 7 bicepParserRULE_importDecl = 8 bicepParserRULE_metadataDecl = 9 - bicepParserRULE_ifCondition = 10 - bicepParserRULE_forExpression = 11 - bicepParserRULE_forVariableBlock = 12 - bicepParserRULE_forBody = 13 - bicepParserRULE_interpString = 14 - bicepParserRULE_expression = 15 - bicepParserRULE_logicCharacter = 16 - bicepParserRULE_primaryExpression = 17 - bicepParserRULE_parenthesizedExpression = 18 - bicepParserRULE_typeExpression = 19 - bicepParserRULE_literalValue = 20 - bicepParserRULE_object = 21 - bicepParserRULE_objectProperty = 22 - bicepParserRULE_array = 23 - bicepParserRULE_arrayItem = 24 - bicepParserRULE_decorator = 25 - bicepParserRULE_decoratorExpression = 26 - bicepParserRULE_functionCall = 27 - bicepParserRULE_argumentList = 28 - bicepParserRULE_identifier = 29 + bicepParserRULE_typeDecl = 10 + bicepParserRULE_moduleDecl = 11 + bicepParserRULE_ifCondition = 12 + bicepParserRULE_forExpression = 13 + bicepParserRULE_forVariableBlock = 14 + bicepParserRULE_forBody = 15 + bicepParserRULE_interpString = 16 + bicepParserRULE_expression = 17 + bicepParserRULE_logicCharacter = 18 + bicepParserRULE_primaryExpression = 19 + bicepParserRULE_parenthesizedExpression = 20 + bicepParserRULE_typeExpression = 21 + bicepParserRULE_literalValue = 22 + bicepParserRULE_object = 23 + bicepParserRULE_objectProperty = 24 + bicepParserRULE_array = 25 + bicepParserRULE_arrayItem = 26 + bicepParserRULE_decorator = 27 + bicepParserRULE_decoratorExpression = 28 + bicepParserRULE_functionCall = 29 + bicepParserRULE_argumentList = 30 + bicepParserRULE_identifier = 31 ) // IProgramContext is an interface to support dynamic dispatch. @@ -477,20 +498,20 @@ func (p *bicepParser) Program() (localctx IProgramContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(63) + p.SetState(67) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&281475008217092) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1125901683179524) != 0 { { - p.SetState(60) + p.SetState(64) p.Statement() } - p.SetState(65) + p.SetState(69) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -498,7 +519,7 @@ func (p *bicepParser) Program() (localctx IProgramContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(66) + p.SetState(70) p.Match(bicepParserEOF) if p.HasError() { // Recognition error - abort rule @@ -533,6 +554,9 @@ type IStatementContext interface { OutputDecl() IOutputDeclContext TargetScopeDecl() ITargetScopeDeclContext ImportDecl() IImportDeclContext + MetadataDecl() IMetadataDeclContext + TypeDecl() ITypeDeclContext + ModuleDecl() IModuleDeclContext NL() antlr.TerminalNode // IsStatementContext differentiates from other interfaces. @@ -667,6 +691,54 @@ func (s *StatementContext) ImportDecl() IImportDeclContext { return t.(IImportDeclContext) } +func (s *StatementContext) MetadataDecl() IMetadataDeclContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMetadataDeclContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMetadataDeclContext) +} + +func (s *StatementContext) TypeDecl() ITypeDeclContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeDeclContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITypeDeclContext) +} + +func (s *StatementContext) ModuleDecl() IModuleDeclContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IModuleDeclContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IModuleDeclContext) +} + func (s *StatementContext) NL() antlr.TerminalNode { return s.GetToken(bicepParserNL, 0) } @@ -692,7 +764,7 @@ func (s *StatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 2, bicepParserRULE_statement) - p.SetState(75) + p.SetState(82) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -702,49 +774,70 @@ func (p *bicepParser) Statement() (localctx IStatementContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(68) + p.SetState(72) p.ParameterDecl() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(69) + p.SetState(73) p.VariableDecl() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(70) + p.SetState(74) p.ResourceDecl() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(71) + p.SetState(75) p.OutputDecl() } case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(72) + p.SetState(76) p.TargetScopeDecl() } case 6: p.EnterOuterAlt(localctx, 6) { - p.SetState(73) + p.SetState(77) p.ImportDecl() } case 7: p.EnterOuterAlt(localctx, 7) { - p.SetState(74) + p.SetState(78) + p.MetadataDecl() + } + + case 8: + p.EnterOuterAlt(localctx, 8) + { + p.SetState(79) + p.TypeDecl() + } + + case 9: + p.EnterOuterAlt(localctx, 9) + { + p.SetState(80) + p.ModuleDecl() + } + + case 10: + p.EnterOuterAlt(localctx, 10) + { + p.SetState(81) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -986,7 +1079,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(80) + p.SetState(87) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -995,11 +1088,11 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { for _la == bicepParserAT { { - p.SetState(77) + p.SetState(84) p.Decorator() } - p.SetState(82) + p.SetState(89) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1007,7 +1100,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(83) + p.SetState(90) p.Match(bicepParserPARAM) if p.HasError() { // Recognition error - abort rule @@ -1015,13 +1108,13 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { } } { - p.SetState(84) + p.SetState(91) var _x = p.Identifier() localctx.(*ParameterDeclContext).name = _x } - p.SetState(94) + p.SetState(101) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1030,10 +1123,10 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext()) { case 1: { - p.SetState(85) + p.SetState(92) p.TypeExpression() } - p.SetState(87) + p.SetState(94) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1042,7 +1135,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { if _la == bicepParserASSIGN { { - p.SetState(86) + p.SetState(93) p.ParameterDefaultValue() } @@ -1050,7 +1143,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { case 2: { - p.SetState(89) + p.SetState(96) p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule @@ -1058,13 +1151,13 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { } } { - p.SetState(90) + p.SetState(97) var _x = p.InterpString() localctx.(*ParameterDeclContext).type_ = _x } - p.SetState(92) + p.SetState(99) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1073,7 +1166,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { if _la == bicepParserASSIGN { { - p.SetState(91) + p.SetState(98) p.ParameterDefaultValue() } @@ -1083,7 +1176,7 @@ func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { goto errorExit } { - p.SetState(96) + p.SetState(103) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1194,7 +1287,7 @@ func (p *bicepParser) ParameterDefaultValue() (localctx IParameterDefaultValueCo p.EnterRule(localctx, 6, bicepParserRULE_parameterDefaultValue) p.EnterOuterAlt(localctx, 1) { - p.SetState(98) + p.SetState(105) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -1202,7 +1295,7 @@ func (p *bicepParser) ParameterDefaultValue() (localctx IParameterDefaultValueCo } } { - p.SetState(99) + p.SetState(106) p.expression(0) } @@ -1391,7 +1484,7 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(104) + p.SetState(111) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1400,11 +1493,11 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { for _la == bicepParserAT { { - p.SetState(101) + p.SetState(108) p.Decorator() } - p.SetState(106) + p.SetState(113) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1412,7 +1505,7 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(107) + p.SetState(114) p.Match(bicepParserVAR) if p.HasError() { // Recognition error - abort rule @@ -1420,14 +1513,14 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { } } { - p.SetState(108) + p.SetState(115) var _x = p.Identifier() localctx.(*VariableDeclContext).name = _x } { - p.SetState(109) + p.SetState(116) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -1435,11 +1528,11 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { } } { - p.SetState(110) + p.SetState(117) p.expression(0) } { - p.SetState(111) + p.SetState(118) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1699,7 +1792,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(116) + p.SetState(123) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1708,11 +1801,11 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { for _la == bicepParserAT { { - p.SetState(113) + p.SetState(120) p.Decorator() } - p.SetState(118) + p.SetState(125) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1720,7 +1813,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(119) + p.SetState(126) p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule @@ -1728,20 +1821,20 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { } } { - p.SetState(120) + p.SetState(127) var _x = p.Identifier() localctx.(*ResourceDeclContext).name = _x } { - p.SetState(121) + p.SetState(128) var _x = p.InterpString() localctx.(*ResourceDeclContext).type_ = _x } - p.SetState(123) + p.SetState(130) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1750,7 +1843,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { if _la == bicepParserEXISTING { { - p.SetState(122) + p.SetState(129) p.Match(bicepParserEXISTING) if p.HasError() { // Recognition error - abort rule @@ -1760,14 +1853,14 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { } { - p.SetState(125) + p.SetState(132) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(129) + p.SetState(136) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1776,19 +1869,19 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { switch p.GetTokenStream().LA(1) { case bicepParserIF: { - p.SetState(126) + p.SetState(133) p.IfCondition() } case bicepParserOBRACE: { - p.SetState(127) + p.SetState(134) p.Object() } case bicepParserOBRACK: { - p.SetState(128) + p.SetState(135) p.ForExpression() } @@ -1797,7 +1890,7 @@ func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { goto errorExit } { - p.SetState(131) + p.SetState(138) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2060,7 +2153,7 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(136) + p.SetState(143) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2069,11 +2162,11 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { for _la == bicepParserAT { { - p.SetState(133) + p.SetState(140) p.Decorator() } - p.SetState(138) + p.SetState(145) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2081,7 +2174,7 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(139) + p.SetState(146) p.Match(bicepParserOUTPUT) if p.HasError() { // Recognition error - abort rule @@ -2089,13 +2182,13 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { } } { - p.SetState(140) + p.SetState(147) var _x = p.Identifier() localctx.(*OutputDeclContext).name = _x } - p.SetState(144) + p.SetState(151) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2104,7 +2197,7 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) { case 1: { - p.SetState(141) + p.SetState(148) var _x = p.Identifier() @@ -2113,7 +2206,7 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { case 2: { - p.SetState(142) + p.SetState(149) p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule @@ -2121,7 +2214,7 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { } } { - p.SetState(143) + p.SetState(150) var _x = p.InterpString() @@ -2132,7 +2225,7 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { goto errorExit } { - p.SetState(146) + p.SetState(153) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -2140,11 +2233,11 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { } } { - p.SetState(147) + p.SetState(154) p.expression(0) } { - p.SetState(148) + p.SetState(155) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2265,7 +2358,7 @@ func (p *bicepParser) TargetScopeDecl() (localctx ITargetScopeDeclContext) { p.EnterRule(localctx, 14, bicepParserRULE_targetScopeDecl) p.EnterOuterAlt(localctx, 1) { - p.SetState(150) + p.SetState(157) p.Match(bicepParserTARGET_SCOPE) if p.HasError() { // Recognition error - abort rule @@ -2273,7 +2366,7 @@ func (p *bicepParser) TargetScopeDecl() (localctx ITargetScopeDeclContext) { } } { - p.SetState(151) + p.SetState(158) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -2281,11 +2374,11 @@ func (p *bicepParser) TargetScopeDecl() (localctx ITargetScopeDeclContext) { } } { - p.SetState(152) + p.SetState(159) p.expression(0) } { - p.SetState(153) + p.SetState(160) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2573,7 +2666,7 @@ func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(158) + p.SetState(165) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2582,11 +2675,11 @@ func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { for _la == bicepParserAT { { - p.SetState(155) + p.SetState(162) p.Decorator() } - p.SetState(160) + p.SetState(167) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2594,7 +2687,7 @@ func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(161) + p.SetState(168) p.Match(bicepParserIMPORT) if p.HasError() { // Recognition error - abort rule @@ -2602,13 +2695,13 @@ func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { } } { - p.SetState(162) + p.SetState(169) var _x = p.InterpString() localctx.(*ImportDeclContext).specification = _x } - p.SetState(169) + p.SetState(176) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2616,7 +2709,7 @@ func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { _la = p.GetTokenStream().LA(1) for _la == bicepParserWITH || _la == bicepParserAS { - p.SetState(167) + p.SetState(174) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2625,7 +2718,7 @@ func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { switch p.GetTokenStream().LA(1) { case bicepParserWITH: { - p.SetState(163) + p.SetState(170) p.Match(bicepParserWITH) if p.HasError() { // Recognition error - abort rule @@ -2633,13 +2726,13 @@ func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { } } { - p.SetState(164) + p.SetState(171) p.Object() } case bicepParserAS: { - p.SetState(165) + p.SetState(172) p.Match(bicepParserAS) if p.HasError() { // Recognition error - abort rule @@ -2647,7 +2740,7 @@ func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { } } { - p.SetState(166) + p.SetState(173) var _x = p.Identifier() @@ -2659,15 +2752,432 @@ func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { goto errorExit } - p.SetState(171) - p.GetErrorHandler().Sync(p) + p.SetState(178) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(179) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IMetadataDeclContext is an interface to support dynamic dispatch. +type IMetadataDeclContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetName returns the name rule contexts. + GetName() IIdentifierContext + + // SetName sets the name rule contexts. + SetName(IIdentifierContext) + + // Getter signatures + METADATA() antlr.TerminalNode + ASSIGN() antlr.TerminalNode + Expression() IExpressionContext + NL() antlr.TerminalNode + Identifier() IIdentifierContext + + // IsMetadataDeclContext differentiates from other interfaces. + IsMetadataDeclContext() +} + +type MetadataDeclContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + name IIdentifierContext +} + +func NewEmptyMetadataDeclContext() *MetadataDeclContext { + var p = new(MetadataDeclContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_metadataDecl + return p +} + +func InitEmptyMetadataDeclContext(p *MetadataDeclContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_metadataDecl +} + +func (*MetadataDeclContext) IsMetadataDeclContext() {} + +func NewMetadataDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MetadataDeclContext { + var p = new(MetadataDeclContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_metadataDecl + + return p +} + +func (s *MetadataDeclContext) GetParser() antlr.Parser { return s.parser } + +func (s *MetadataDeclContext) GetName() IIdentifierContext { return s.name } + +func (s *MetadataDeclContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *MetadataDeclContext) METADATA() antlr.TerminalNode { + return s.GetToken(bicepParserMETADATA, 0) +} + +func (s *MetadataDeclContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) +} + +func (s *MetadataDeclContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *MetadataDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *MetadataDeclContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *MetadataDeclContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MetadataDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MetadataDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitMetadataDecl(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) MetadataDecl() (localctx IMetadataDeclContext) { + localctx = NewMetadataDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, bicepParserRULE_metadataDecl) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(181) + p.Match(bicepParserMETADATA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(182) + + var _x = p.Identifier() + + localctx.(*MetadataDeclContext).name = _x + } + { + p.SetState(183) + p.Match(bicepParserASSIGN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(184) + p.expression(0) + } + { + p.SetState(185) + p.Match(bicepParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ITypeDeclContext is an interface to support dynamic dispatch. +type ITypeDeclContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetName returns the name rule contexts. + GetName() IIdentifierContext + + // SetName sets the name rule contexts. + SetName(IIdentifierContext) + + // Getter signatures + TYPE() antlr.TerminalNode + ASSIGN() antlr.TerminalNode + TypeExpression() ITypeExpressionContext + NL() antlr.TerminalNode + Identifier() IIdentifierContext + AllDecorator() []IDecoratorContext + Decorator(i int) IDecoratorContext + + // IsTypeDeclContext differentiates from other interfaces. + IsTypeDeclContext() +} + +type TypeDeclContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + name IIdentifierContext +} + +func NewEmptyTypeDeclContext() *TypeDeclContext { + var p = new(TypeDeclContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_typeDecl + return p +} + +func InitEmptyTypeDeclContext(p *TypeDeclContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_typeDecl +} + +func (*TypeDeclContext) IsTypeDeclContext() {} + +func NewTypeDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeDeclContext { + var p = new(TypeDeclContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_typeDecl + + return p +} + +func (s *TypeDeclContext) GetParser() antlr.Parser { return s.parser } + +func (s *TypeDeclContext) GetName() IIdentifierContext { return s.name } + +func (s *TypeDeclContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *TypeDeclContext) TYPE() antlr.TerminalNode { + return s.GetToken(bicepParserTYPE, 0) +} + +func (s *TypeDeclContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) +} + +func (s *TypeDeclContext) TypeExpression() ITypeExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITypeExpressionContext) +} + +func (s *TypeDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *TypeDeclContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *TypeDeclContext) AllDecorator() []IDecoratorContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDecoratorContext); ok { + len++ + } + } + + tst := make([]IDecoratorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) + i++ + } + } + + return tst +} + +func (s *TypeDeclContext) Decorator(i int) IDecoratorContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecoratorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDecoratorContext) +} + +func (s *TypeDeclContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TypeDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TypeDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitTypeDecl(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) TypeDecl() (localctx ITypeDeclContext) { + localctx = NewTypeDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 20, bicepParserRULE_typeDecl) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(190) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserAT { + { + p.SetState(187) + p.Decorator() + } + + p.SetState(192) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(193) + p.Match(bicepParserTYPE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(194) + + var _x = p.Identifier() + + localctx.(*TypeDeclContext).name = _x + } + { + p.SetState(195) + p.Match(bicepParserASSIGN) if p.HasError() { + // Recognition error - abort rule goto errorExit } - _la = p.GetTokenStream().LA(1) } { - p.SetState(172) + p.SetState(196) + p.TypeExpression() + } + { + p.SetState(197) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2688,8 +3198,8 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IMetadataDeclContext is an interface to support dynamic dispatch. -type IMetadataDeclContext interface { +// IModuleDeclContext is an interface to support dynamic dispatch. +type IModuleDeclContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -2698,69 +3208,89 @@ type IMetadataDeclContext interface { // GetName returns the name rule contexts. GetName() IIdentifierContext + // GetType_ returns the type_ rule contexts. + GetType_() IInterpStringContext + // SetName sets the name rule contexts. SetName(IIdentifierContext) + // SetType_ sets the type_ rule contexts. + SetType_(IInterpStringContext) + // Getter signatures - METADATA() antlr.TerminalNode + MODULE() antlr.TerminalNode ASSIGN() antlr.TerminalNode - Expression() IExpressionContext NL() antlr.TerminalNode Identifier() IIdentifierContext + InterpString() IInterpStringContext + IfCondition() IIfConditionContext + Object() IObjectContext + ForExpression() IForExpressionContext + AllDecorator() []IDecoratorContext + Decorator(i int) IDecoratorContext - // IsMetadataDeclContext differentiates from other interfaces. - IsMetadataDeclContext() + // IsModuleDeclContext differentiates from other interfaces. + IsModuleDeclContext() } -type MetadataDeclContext struct { +type ModuleDeclContext struct { antlr.BaseParserRuleContext parser antlr.Parser name IIdentifierContext + type_ IInterpStringContext } -func NewEmptyMetadataDeclContext() *MetadataDeclContext { - var p = new(MetadataDeclContext) +func NewEmptyModuleDeclContext() *ModuleDeclContext { + var p = new(ModuleDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_metadataDecl + p.RuleIndex = bicepParserRULE_moduleDecl return p } -func InitEmptyMetadataDeclContext(p *MetadataDeclContext) { +func InitEmptyModuleDeclContext(p *ModuleDeclContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_metadataDecl + p.RuleIndex = bicepParserRULE_moduleDecl } -func (*MetadataDeclContext) IsMetadataDeclContext() {} +func (*ModuleDeclContext) IsModuleDeclContext() {} -func NewMetadataDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MetadataDeclContext { - var p = new(MetadataDeclContext) +func NewModuleDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ModuleDeclContext { + var p = new(ModuleDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = bicepParserRULE_metadataDecl + p.RuleIndex = bicepParserRULE_moduleDecl return p } -func (s *MetadataDeclContext) GetParser() antlr.Parser { return s.parser } +func (s *ModuleDeclContext) GetParser() antlr.Parser { return s.parser } -func (s *MetadataDeclContext) GetName() IIdentifierContext { return s.name } +func (s *ModuleDeclContext) GetName() IIdentifierContext { return s.name } -func (s *MetadataDeclContext) SetName(v IIdentifierContext) { s.name = v } +func (s *ModuleDeclContext) GetType_() IInterpStringContext { return s.type_ } -func (s *MetadataDeclContext) METADATA() antlr.TerminalNode { - return s.GetToken(bicepParserMETADATA, 0) +func (s *ModuleDeclContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *ModuleDeclContext) SetType_(v IInterpStringContext) { s.type_ = v } + +func (s *ModuleDeclContext) MODULE() antlr.TerminalNode { + return s.GetToken(bicepParserMODULE, 0) } -func (s *MetadataDeclContext) ASSIGN() antlr.TerminalNode { +func (s *ModuleDeclContext) ASSIGN() antlr.TerminalNode { return s.GetToken(bicepParserASSIGN, 0) } -func (s *MetadataDeclContext) Expression() IExpressionContext { +func (s *ModuleDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *ModuleDeclContext) Identifier() IIdentifierContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExpressionContext); ok { + if _, ok := ctx.(IIdentifierContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2770,17 +3300,29 @@ func (s *MetadataDeclContext) Expression() IExpressionContext { return nil } - return t.(IExpressionContext) + return t.(IIdentifierContext) } -func (s *MetadataDeclContext) NL() antlr.TerminalNode { - return s.GetToken(bicepParserNL, 0) +func (s *ModuleDeclContext) InterpString() IInterpStringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInterpStringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInterpStringContext) } -func (s *MetadataDeclContext) Identifier() IIdentifierContext { +func (s *ModuleDeclContext) IfCondition() IIfConditionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { + if _, ok := ctx.(IIfConditionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2790,60 +3332,187 @@ func (s *MetadataDeclContext) Identifier() IIdentifierContext { return nil } - return t.(IIdentifierContext) + return t.(IIfConditionContext) } -func (s *MetadataDeclContext) GetRuleContext() antlr.RuleContext { +func (s *ModuleDeclContext) Object() IObjectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IObjectContext) +} + +func (s *ModuleDeclContext) ForExpression() IForExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IForExpressionContext) +} + +func (s *ModuleDeclContext) AllDecorator() []IDecoratorContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDecoratorContext); ok { + len++ + } + } + + tst := make([]IDecoratorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) + i++ + } + } + + return tst +} + +func (s *ModuleDeclContext) Decorator(i int) IDecoratorContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecoratorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDecoratorContext) +} + +func (s *ModuleDeclContext) GetRuleContext() antlr.RuleContext { return s } -func (s *MetadataDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ModuleDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *MetadataDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ModuleDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: - return t.VisitMetadataDecl(s) + return t.VisitModuleDecl(s) default: return t.VisitChildren(s) } } -func (p *bicepParser) MetadataDecl() (localctx IMetadataDeclContext) { - localctx = NewMetadataDeclContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 18, bicepParserRULE_metadataDecl) +func (p *bicepParser) ModuleDecl() (localctx IModuleDeclContext) { + localctx = NewModuleDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 22, bicepParserRULE_moduleDecl) + var _la int + p.EnterOuterAlt(localctx, 1) + p.SetState(202) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserAT { + { + p.SetState(199) + p.Decorator() + } + + p.SetState(204) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } { - p.SetState(174) - p.Match(bicepParserMETADATA) + p.SetState(205) + p.Match(bicepParserMODULE) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(175) + p.SetState(206) var _x = p.Identifier() - localctx.(*MetadataDeclContext).name = _x + localctx.(*ModuleDeclContext).name = _x + } + { + p.SetState(207) + + var _x = p.InterpString() + + localctx.(*ModuleDeclContext).type_ = _x } { - p.SetState(176) + p.SetState(208) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - { - p.SetState(177) - p.expression(0) + p.SetState(212) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case bicepParserIF: + { + p.SetState(209) + p.IfCondition() + } + + case bicepParserOBRACE: + { + p.SetState(210) + p.Object() + } + + case bicepParserOBRACK: + { + p.SetState(211) + p.ForExpression() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } { - p.SetState(178) + p.SetState(214) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2968,10 +3637,10 @@ func (s *IfConditionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) IfCondition() (localctx IIfConditionContext) { localctx = NewIfConditionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 20, bicepParserRULE_ifCondition) + p.EnterRule(localctx, 24, bicepParserRULE_ifCondition) p.EnterOuterAlt(localctx, 1) { - p.SetState(180) + p.SetState(216) p.Match(bicepParserIF) if p.HasError() { // Recognition error - abort rule @@ -2979,11 +3648,11 @@ func (p *bicepParser) IfCondition() (localctx IIfConditionContext) { } } { - p.SetState(181) + p.SetState(217) p.ParenthesizedExpression() } { - p.SetState(182) + p.SetState(218) p.Object() } @@ -3179,19 +3848,19 @@ func (s *ForExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { localctx = NewForExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 22, bicepParserRULE_forExpression) + p.EnterRule(localctx, 26, bicepParserRULE_forExpression) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(184) + p.SetState(220) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(188) + p.SetState(224) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3200,7 +3869,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { for _la == bicepParserNL { { - p.SetState(185) + p.SetState(221) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3208,7 +3877,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } - p.SetState(190) + p.SetState(226) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3216,14 +3885,14 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(191) + p.SetState(227) p.Match(bicepParserFOR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(194) + p.SetState(230) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3232,7 +3901,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: { - p.SetState(192) + p.SetState(228) var _x = p.Identifier() @@ -3241,7 +3910,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { case bicepParserOPAR: { - p.SetState(193) + p.SetState(229) p.ForVariableBlock() } @@ -3250,7 +3919,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { goto errorExit } { - p.SetState(196) + p.SetState(232) p.Match(bicepParserIN) if p.HasError() { // Recognition error - abort rule @@ -3258,11 +3927,11 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } { - p.SetState(197) + p.SetState(233) p.expression(0) } { - p.SetState(198) + p.SetState(234) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3270,10 +3939,10 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } { - p.SetState(199) + p.SetState(235) p.ForBody() } - p.SetState(203) + p.SetState(239) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3282,7 +3951,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { for _la == bicepParserNL { { - p.SetState(200) + p.SetState(236) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3290,7 +3959,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } - p.SetState(205) + p.SetState(241) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3298,7 +3967,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(206) + p.SetState(242) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -3464,10 +4133,10 @@ func (s *ForVariableBlockContext) Accept(visitor antlr.ParseTreeVisitor) interfa func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { localctx = NewForVariableBlockContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 24, bicepParserRULE_forVariableBlock) + p.EnterRule(localctx, 28, bicepParserRULE_forVariableBlock) p.EnterOuterAlt(localctx, 1) { - p.SetState(208) + p.SetState(244) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule @@ -3475,14 +4144,14 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { } } { - p.SetState(209) + p.SetState(245) var _x = p.Identifier() localctx.(*ForVariableBlockContext).item = _x } { - p.SetState(210) + p.SetState(246) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -3490,14 +4159,14 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { } } { - p.SetState(211) + p.SetState(247) var _x = p.Identifier() localctx.(*ForVariableBlockContext).index = _x } { - p.SetState(212) + p.SetState(248) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -3628,18 +4297,18 @@ func (s *ForBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) ForBody() (localctx IForBodyContext) { localctx = NewForBodyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 26, bicepParserRULE_forBody) - p.SetState(216) + p.EnterRule(localctx, 30, bicepParserRULE_forBody) + p.SetState(252) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 21, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(214) + p.SetState(250) var _x = p.expression(0) @@ -3649,7 +4318,7 @@ func (p *bicepParser) ForBody() (localctx IForBodyContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(215) + p.SetState(251) p.IfCondition() } @@ -3803,10 +4472,10 @@ func (s *InterpStringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) InterpString() (localctx IInterpStringContext) { localctx = NewInterpStringContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 28, bicepParserRULE_interpString) + p.EnterRule(localctx, 32, bicepParserRULE_interpString) var _alt int - p.SetState(231) + p.SetState(267) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3816,30 +4485,30 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_LEFT_PIECE: p.EnterOuterAlt(localctx, 1) { - p.SetState(218) + p.SetState(254) p.Match(bicepParserSTRING_LEFT_PIECE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(224) + p.SetState(260) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(219) + p.SetState(255) p.expression(0) } { - p.SetState(220) + p.SetState(256) p.Match(bicepParserSTRING_MIDDLE_PIECE) if p.HasError() { // Recognition error - abort rule @@ -3848,22 +4517,22 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { } } - p.SetState(226) + p.SetState(262) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } { - p.SetState(227) + p.SetState(263) p.expression(0) } { - p.SetState(228) + p.SetState(264) p.Match(bicepParserSTRING_RIGHT_PIECE) if p.HasError() { // Recognition error - abort rule @@ -3874,7 +4543,7 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_COMPLETE: p.EnterOuterAlt(localctx, 2) { - p.SetState(230) + p.SetState(266) p.Match(bicepParserSTRING_COMPLETE) if p.HasError() { // Recognition error - abort rule @@ -4132,23 +4801,23 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { localctx = NewExpressionContext(p, p.GetParserRuleContext(), _parentState) var _prevctx IExpressionContext = localctx var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. - _startState := 30 - p.EnterRecursionRule(localctx, 30, bicepParserRULE_expression, _p) + _startState := 34 + p.EnterRecursionRule(localctx, 34, bicepParserRULE_expression, _p) var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(234) + p.SetState(270) p.PrimaryExpression() } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(262) + p.SetState(298) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -4158,24 +4827,24 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(260) + p.SetState(296) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 21, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) { case 1: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(236) + p.SetState(272) if !(p.Precpred(p.GetParserRuleContext(), 6)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) goto errorExit } { - p.SetState(237) + p.SetState(273) p.Match(bicepParserQMARK) if p.HasError() { // Recognition error - abort rule @@ -4183,11 +4852,11 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(238) + p.SetState(274) p.expression(0) } { - p.SetState(239) + p.SetState(275) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -4195,39 +4864,39 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(240) + p.SetState(276) p.expression(7) } case 2: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(242) + p.SetState(278) if !(p.Precpred(p.GetParserRuleContext(), 2)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) goto errorExit } { - p.SetState(243) + p.SetState(279) p.LogicCharacter() } { - p.SetState(244) + p.SetState(280) p.expression(3) } case 3: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(246) + p.SetState(282) if !(p.Precpred(p.GetParserRuleContext(), 7)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) goto errorExit } { - p.SetState(247) + p.SetState(283) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule @@ -4235,11 +4904,11 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(248) + p.SetState(284) p.expression(0) } { - p.SetState(249) + p.SetState(285) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -4250,14 +4919,14 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 4: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(251) + p.SetState(287) if !(p.Precpred(p.GetParserRuleContext(), 5)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) goto errorExit } { - p.SetState(252) + p.SetState(288) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -4265,7 +4934,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(253) + p.SetState(289) var _x = p.Identifier() @@ -4275,14 +4944,14 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 5: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(254) + p.SetState(290) if !(p.Precpred(p.GetParserRuleContext(), 4)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) goto errorExit } { - p.SetState(255) + p.SetState(291) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -4290,21 +4959,21 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(256) + p.SetState(292) p.FunctionCall() } case 6: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(257) + p.SetState(293) if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(258) + p.SetState(294) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -4312,7 +4981,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(259) + p.SetState(295) var _x = p.Identifier() @@ -4324,12 +4993,12 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } - p.SetState(264) + p.SetState(300) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -4443,15 +5112,15 @@ func (s *LogicCharacterContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) LogicCharacter() (localctx ILogicCharacterContext) { localctx = NewLogicCharacterContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 32, bicepParserRULE_logicCharacter) + p.EnterRule(localctx, 36, bicepParserRULE_logicCharacter) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(265) + p.SetState(301) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&69269232549888) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&277076930199552) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -4661,39 +5330,39 @@ func (s *PrimaryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interf func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { localctx = NewPrimaryExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 34, bicepParserRULE_primaryExpression) - p.SetState(275) + p.EnterRule(localctx, 38, bicepParserRULE_primaryExpression) + p.SetState(311) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 26, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(267) + p.SetState(303) p.LiteralValue() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(268) + p.SetState(304) p.FunctionCall() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(269) + p.SetState(305) p.InterpString() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(270) + p.SetState(306) p.Match(bicepParserMULTILINE_STRING) if p.HasError() { // Recognition error - abort rule @@ -4704,28 +5373,28 @@ func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(271) + p.SetState(307) p.Array() } case 6: p.EnterOuterAlt(localctx, 6) { - p.SetState(272) + p.SetState(308) p.Object() } case 7: p.EnterOuterAlt(localctx, 7) { - p.SetState(273) + p.SetState(309) p.ForExpression() } case 8: p.EnterOuterAlt(localctx, 8) { - p.SetState(274) + p.SetState(310) p.ParenthesizedExpression() } @@ -4848,19 +5517,19 @@ func (s *ParenthesizedExpressionContext) Accept(visitor antlr.ParseTreeVisitor) func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressionContext) { localctx = NewParenthesizedExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 36, bicepParserRULE_parenthesizedExpression) + p.EnterRule(localctx, 40, bicepParserRULE_parenthesizedExpression) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(277) + p.SetState(313) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(279) + p.SetState(315) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4869,7 +5538,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(278) + p.SetState(314) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4879,10 +5548,10 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(281) + p.SetState(317) p.expression(0) } - p.SetState(283) + p.SetState(319) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4891,7 +5560,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(282) + p.SetState(318) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -4901,7 +5570,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(285) + p.SetState(321) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -5015,10 +5684,10 @@ func (s *TypeExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { localctx = NewTypeExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 38, bicepParserRULE_typeExpression) + p.EnterRule(localctx, 42, bicepParserRULE_typeExpression) p.EnterOuterAlt(localctx, 1) { - p.SetState(287) + p.SetState(323) var _x = p.Identifier() @@ -5140,18 +5809,18 @@ func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { localctx = NewLiteralValueContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 40, bicepParserRULE_literalValue) - p.SetState(294) + p.EnterRule(localctx, 44, bicepParserRULE_literalValue) + p.SetState(330) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 26, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 29, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(289) + p.SetState(325) p.Match(bicepParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -5162,7 +5831,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(290) + p.SetState(326) p.Match(bicepParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -5173,7 +5842,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(291) + p.SetState(327) p.Match(bicepParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -5184,7 +5853,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(292) + p.SetState(328) p.Match(bicepParserNULL) if p.HasError() { // Recognition error - abort rule @@ -5195,7 +5864,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(293) + p.SetState(329) p.Identifier() } @@ -5344,19 +6013,19 @@ func (s *ObjectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Object() (localctx IObjectContext) { localctx = NewObjectContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 42, bicepParserRULE_object) + p.EnterRule(localctx, 46, bicepParserRULE_object) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(296) + p.SetState(332) p.Match(bicepParserOBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(313) + p.SetState(349) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5364,7 +6033,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) if _la == bicepParserNL { - p.SetState(298) + p.SetState(334) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5373,7 +6042,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(297) + p.SetState(333) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5381,26 +6050,26 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(300) + p.SetState(336) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(310) + p.SetState(346) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&70915278749696) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&283659504435200) != 0 { { - p.SetState(302) + p.SetState(338) p.ObjectProperty() } - p.SetState(304) + p.SetState(340) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5409,7 +6078,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(303) + p.SetState(339) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5417,7 +6086,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(306) + p.SetState(342) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5425,7 +6094,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) } - p.SetState(312) + p.SetState(348) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5435,7 +6104,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } { - p.SetState(315) + p.SetState(351) p.Match(bicepParserCBRACE) if p.HasError() { // Recognition error - abort rule @@ -5588,9 +6257,9 @@ func (s *ObjectPropertyContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { localctx = NewObjectPropertyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 44, bicepParserRULE_objectProperty) + p.EnterRule(localctx, 48, bicepParserRULE_objectProperty) p.EnterOuterAlt(localctx, 1) - p.SetState(319) + p.SetState(355) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5599,7 +6268,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: { - p.SetState(317) + p.SetState(353) var _x = p.Identifier() @@ -5608,7 +6277,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: { - p.SetState(318) + p.SetState(354) p.InterpString() } @@ -5617,7 +6286,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { goto errorExit } { - p.SetState(321) + p.SetState(357) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -5625,7 +6294,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } } { - p.SetState(322) + p.SetState(358) p.expression(0) } @@ -5770,19 +6439,19 @@ func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Array() (localctx IArrayContext) { localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 46, bicepParserRULE_array) + p.EnterRule(localctx, 50, bicepParserRULE_array) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(324) + p.SetState(360) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(328) + p.SetState(364) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5791,7 +6460,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for _la == bicepParserNL { { - p.SetState(325) + p.SetState(361) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5799,27 +6468,27 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } } - p.SetState(330) + p.SetState(366) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(334) + p.SetState(370) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&211652767109202) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&846609457860690) != 0 { { - p.SetState(331) + p.SetState(367) p.ArrayItem() } - p.SetState(336) + p.SetState(372) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5827,7 +6496,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(337) + p.SetState(373) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -5945,22 +6614,22 @@ func (s *ArrayItemContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { localctx = NewArrayItemContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 48, bicepParserRULE_arrayItem) + p.EnterRule(localctx, 52, bicepParserRULE_arrayItem) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(339) + p.SetState(375) p.expression(0) } - p.SetState(346) + p.SetState(382) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { case bicepParserNL: - p.SetState(341) + p.SetState(377) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5969,7 +6638,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(340) + p.SetState(376) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5977,7 +6646,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - p.SetState(343) + p.SetState(379) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5987,7 +6656,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { case bicepParserCOMMA: { - p.SetState(345) + p.SetState(381) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -6105,10 +6774,10 @@ func (s *DecoratorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Decorator() (localctx IDecoratorContext) { localctx = NewDecoratorContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 50, bicepParserRULE_decorator) + p.EnterRule(localctx, 54, bicepParserRULE_decorator) p.EnterOuterAlt(localctx, 1) { - p.SetState(348) + p.SetState(384) p.Match(bicepParserAT) if p.HasError() { // Recognition error - abort rule @@ -6116,11 +6785,11 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { } } { - p.SetState(349) + p.SetState(385) p.DecoratorExpression() } { - p.SetState(350) + p.SetState(386) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -6245,29 +6914,29 @@ func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 52, bicepParserRULE_decoratorExpression) - p.SetState(357) + p.EnterRule(localctx, 56, bicepParserRULE_decoratorExpression) + p.SetState(393) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 36, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 39, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(352) + p.SetState(388) p.FunctionCall() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(353) + p.SetState(389) p.expression(0) } { - p.SetState(354) + p.SetState(390) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -6275,7 +6944,7 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex } } { - p.SetState(355) + p.SetState(391) p.FunctionCall() } @@ -6415,27 +7084,27 @@ func (s *FunctionCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { localctx = NewFunctionCallContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 54, bicepParserRULE_functionCall) + p.EnterRule(localctx, 58, bicepParserRULE_functionCall) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(359) + p.SetState(395) p.Identifier() } { - p.SetState(360) + p.SetState(396) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(365) + p.SetState(401) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 38, p.GetParserRuleContext()) == 1 { - p.SetState(362) + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 41, p.GetParserRuleContext()) == 1 { + p.SetState(398) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6444,7 +7113,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(361) + p.SetState(397) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -6454,14 +7123,14 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(364) + p.SetState(400) p.ArgumentList() } } else if p.HasError() { // JIM goto errorExit } - p.SetState(368) + p.SetState(404) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6470,7 +7139,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(367) + p.SetState(403) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -6480,7 +7149,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(370) + p.SetState(406) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -6629,15 +7298,15 @@ func (s *ArgumentListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { localctx = NewArgumentListContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 56, bicepParserRULE_argumentList) + p.EnterRule(localctx, 60, bicepParserRULE_argumentList) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(372) + p.SetState(408) p.expression(0) } - p.SetState(380) + p.SetState(416) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6646,14 +7315,14 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { for _la == bicepParserCOMMA { { - p.SetState(373) + p.SetState(409) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(375) + p.SetState(411) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6662,7 +7331,7 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { if _la == bicepParserNL { { - p.SetState(374) + p.SetState(410) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -6672,11 +7341,11 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { } { - p.SetState(377) + p.SetState(413) p.expression(0) } - p.SetState(382) + p.SetState(418) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6872,15 +7541,15 @@ func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Identifier() (localctx IIdentifierContext) { localctx = NewIdentifierContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 58, bicepParserRULE_identifier) + p.EnterRule(localctx, 62, bicepParserRULE_identifier) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(383) + p.SetState(419) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&70910446911488) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&283640177082368) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -6903,7 +7572,7 @@ errorExit: func (p *bicepParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { switch ruleIndex { - case 15: + case 17: var t *ExpressionContext = nil if localctx != nil { t = localctx.(*ExpressionContext) diff --git a/pkg/parser/bicep/antlr/parser/bicep_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_visitor.go index 65641864612..f3805d96c4d 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_visitor.go +++ b/pkg/parser/bicep/antlr/parser/bicep_visitor.go @@ -38,6 +38,12 @@ type bicepVisitor interface { // Visit a parse tree produced by bicepParser#metadataDecl. VisitMetadataDecl(ctx *MetadataDeclContext) interface{} + // Visit a parse tree produced by bicepParser#typeDecl. + VisitTypeDecl(ctx *TypeDeclContext) interface{} + + // Visit a parse tree produced by bicepParser#moduleDecl. + VisitModuleDecl(ctx *ModuleDeclContext) interface{} + // Visit a parse tree produced by bicepParser#ifCondition. VisitIfCondition(ctx *IfConditionContext) interface{} From 37861c76ea4bed2055903bf699ad2c811c8392d5 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 9 May 2024 11:42:07 +0100 Subject: [PATCH 106/130] fix identation from merge conflicts --- pkg/scan/scan.go | 6 +++--- test/main_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/scan/scan.go b/pkg/scan/scan.go index d7197e452a7..15e7600ced1 100644 --- a/pkg/scan/scan.go +++ b/pkg/scan/scan.go @@ -15,9 +15,9 @@ import ( "github.com/Checkmarx/kics/v2/pkg/parser" ansibleConfigParser "github.com/Checkmarx/kics/v2/pkg/parser/ansible/ini/config" ansibleHostsParser "github.com/Checkmarx/kics/v2/pkg/parser/ansible/ini/hosts" - bicepParser "github.com/Checkmarx/kics/v2/pkg/parser/bicep" - buildahParser "github.com/Checkmarx/kics/v2/pkg/parser/buildah" - dockerParser "github.com/Checkmarx/kics/v2/pkg/parser/docker" + bicepParser "github.com/Checkmarx/kics/v2/pkg/parser/bicep" + buildahParser "github.com/Checkmarx/kics/v2/pkg/parser/buildah" + dockerParser "github.com/Checkmarx/kics/v2/pkg/parser/docker" protoParser "github.com/Checkmarx/kics/v2/pkg/parser/grpc" jsonParser "github.com/Checkmarx/kics/v2/pkg/parser/json" terraformParser "github.com/Checkmarx/kics/v2/pkg/parser/terraform" diff --git a/test/main_test.go b/test/main_test.go index 6420b3a3758..5ab1a26153e 100644 --- a/test/main_test.go +++ b/test/main_test.go @@ -17,7 +17,7 @@ import ( ansibleConfigParser "github.com/Checkmarx/kics/v2/pkg/parser/ansible/ini/config" ansibleHostsParser "github.com/Checkmarx/kics/v2/pkg/parser/ansible/ini/hosts" buildahParser "github.com/Checkmarx/kics/v2/pkg/parser/buildah" - bicepParser "github.com/Checkmarx/kics/v2/pkg/parser/bicep" + bicepParser "github.com/Checkmarx/kics/v2/pkg/parser/bicep" dockerParser "github.com/Checkmarx/kics/v2/pkg/parser/docker" protoParser "github.com/Checkmarx/kics/v2/pkg/parser/grpc" jsonParser "github.com/Checkmarx/kics/v2/pkg/parser/json" From 45180ff3c7228a4c5796ad8612e88af36228ad5e Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 9 May 2024 11:54:35 +0100 Subject: [PATCH 107/130] update imports to contain v2 --- pkg/parser/bicep/parser.go | 4 ++-- pkg/parser/bicep/parser_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index a0c0d809ebb..b43d53f62ba 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -5,8 +5,8 @@ import ( "strconv" "strings" - "github.com/Checkmarx/kics/pkg/model" - "github.com/Checkmarx/kics/pkg/parser/bicep/antlr/parser" + "github.com/Checkmarx/kics/v2/pkg/model" + "github.com/Checkmarx/kics/v2/pkg/parser/bicep/antlr/parser" "github.com/antlr4-go/antlr/v4" ) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index b77a541cac8..035a9bfddc7 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -6,7 +6,7 @@ import ( "reflect" "testing" - "github.com/Checkmarx/kics/pkg/model" + "github.com/Checkmarx/kics/v2/pkg/model" "github.com/stretchr/testify/require" ) From a70d473a889972cb8f3d098b5625a181a98e5ed9 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Thu, 9 May 2024 11:58:56 +0100 Subject: [PATCH 108/130] changed grammar structure --- pkg/parser/bicep/antlr/bicep.g4 | 189 +++++++++++++++----------------- 1 file changed, 87 insertions(+), 102 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index d80f936193f..6acd78b30e0 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -3,7 +3,30 @@ grammar bicep; // program -> statement* EOF program: statement* EOF; -statement: parameterDecl | variableDecl | resourceDecl | outputDecl | targetScopeDecl | importDecl | metadataDecl | typeDecl | moduleDecl | NL; +statement: + targetScopeDecl + | importDecl + | metadataDecl + | parameterDecl + | typeDecl + | variableDecl + | resourceDecl + | moduleDecl + | outputDecl + | NL; + +// targetScopeDecl -> "targetScope" "=" expression NL +targetScopeDecl: TARGET_SCOPE ASSIGN expression NL; + +// importDecl -> decorator* "import" interpString(specification) importWithClause? importAsClause? NL +importDecl: + decorator* IMPORT specification = interpString ( + WITH object + | AS alias = identifier + )* NL; + +// metadataDecl -> "metadata" IDENTIFIER(name) "=" expression NL +metadataDecl: METADATA name = identifier ASSIGN expression NL; // parameterDecl -> decorator* "parameter" IDENTIFIER(name) typeExpression parameterDefaultValue? NL // | decorator* "parameter" IDENTIFIER(name) "resource" interpString(type) parameterDefaultValue? NL @@ -17,6 +40,10 @@ parameterDecl: // parameterDefaultValue -> "=" expression parameterDefaultValue: ASSIGN expression; +// typeDecl -> decorator* "type" IDENTIFIER(name) "=" typeExpression NL +typeDecl: + decorator* TYPE name = identifier ASSIGN typeExpression NL; + // variableDecl -> decorator* "variable" IDENTIFIER(name) "=" expression NL variableDecl: decorator* VAR name = identifier ASSIGN expression NL; @@ -25,61 +52,39 @@ variableDecl: resourceDecl: decorator* RESOURCE name = identifier type = interpString EXISTING? ASSIGN ( ifCondition - | object - | forExpression + | object + | forExpression ) NL; - -// outputDecl -> -// decorator* "output" IDENTIFIER(name) IDENTIFIER(type) "=" expression NL -// decorator* "output" IDENTIFIER(name) "resource" interpString(type) "=" expression NL -outputDecl: - decorator* OUTPUT name = identifier (type1 = identifier | RESOURCE type2 = interpString) ASSIGN expression NL; - -// targetScopeDecl -> "targetScope" "=" expression NL -targetScopeDecl: TARGET_SCOPE ASSIGN expression NL; - -// importDecl -> decorator* "import" interpString(specification) importWithClause? importAsClause? NL -importDecl: - decorator* IMPORT specification = interpString (WITH object | AS alias = identifier)* NL; - -// metadataDecl -> "metadata" IDENTIFIER(name) "=" expression NL -metadataDecl: - METADATA name = identifier ASSIGN expression NL; - -// typeDecl -> decorator* "type" IDENTIFIER(name) "=" typeExpression NL -typeDecl: - decorator* TYPE name = identifier ASSIGN typeExpression NL; - // moduleDecl -> decorator* "module" IDENTIFIER(name) interpString(type) "=" (ifCondition | object | forExpression) NL -moduleDecl - : decorator* MODULE name = identifier type = interpString ASSIGN ( - ifCondition - | object - | forExpression - ) NL - ; +moduleDecl: + decorator* MODULE name = identifier type = interpString ASSIGN ( + ifCondition + | object + | forExpression + ) NL; + +// outputDecl -> decorator* "output" IDENTIFIER(name) IDENTIFIER(type) "=" expression NL decorator* +// "output" IDENTIFIER(name) "resource" interpString(type) "=" expression NL +outputDecl: + decorator* OUTPUT name = identifier ( + type1 = identifier + | RESOURCE type2 = interpString + ) ASSIGN expression NL; // ifCondition -> "if" parenthesizedExpression object -ifCondition - : IF parenthesizedExpression object - ; +ifCondition: IF parenthesizedExpression object; // forExpression -> "[" "for" (IDENTIFIER(item) | forVariableBlock) "in" expression ":" forBody "]" -forExpression - : OBRACK NL* FOR (item = identifier | forVariableBlock) IN expression COL forBody NL* CBRACK - ; +forExpression: + OBRACK NL* FOR (item = identifier | forVariableBlock) IN expression COL forBody NL* CBRACK; // forVariableBlock -> "(" IDENTIFIER(item) "," IDENTIFIER(index) ")" -forVariableBlock - : OPAR item = identifier COMMA index = identifier CPAR - ; +forVariableBlock: + OPAR item = identifier COMMA index = identifier CPAR; // forBody -> expression(body) | ifCondition -forBody - : body = expression - | ifCondition - ; +forBody: body = expression | ifCondition; // interpString -> stringLeftPiece ( expression stringMiddlePiece )* expression stringRightPiece | stringComplete interpString: @@ -92,7 +97,7 @@ expression: expression OBRACK expression CBRACK | expression QMARK expression COL expression | expression DOT property = identifier - | expression DOT functionCall + | expression DOT functionCall | expression COL name = identifier | expression logicCharacter expression | primaryExpression; @@ -130,7 +135,7 @@ objectProperty: (name = identifier | interpString) COL expression; array: OBRACK NL* arrayItem* CBRACK; // arrayItem -> expression (NL+|COMMA)? -arrayItem: expression (NL+|COMMA)?; +arrayItem: expression (NL+ | COMMA)?; // decorator -> "@" decoratorExpression NL decorator: AT decoratorExpression NL; @@ -144,29 +149,29 @@ functionCall: identifier OPAR (NL? argumentList)? NL? CPAR; // argumentList -> expression ("," expression)* argumentList: expression (COMMA NL? expression)*; -identifier - : IDENTIFIER - | IMPORT - | WITH - | AS - | METADATA - | PARAM - | RESOURCE - | OUTPUT - | EXISTING - | VAR - | IF - | FOR - | IN - | TRUE - | FALSE - | NULL - | TARGET_SCOPE - | STRING - | INT - | BOOL +identifier: + IDENTIFIER + | IMPORT + | WITH + | AS + | METADATA + | PARAM + | RESOURCE + | OUTPUT + | EXISTING + | VAR + | IF + | FOR + | IN + | TRUE + | FALSE + | NULL + | TARGET_SCOPE + | STRING + | INT + | BOOL | ARRAY - | OBJECT; + | OBJECT; // multilineString -> "'''" + MULTILINESTRINGCHAR+ + "'''" MULTILINE_STRING: '\'\'\'' .*? '\'\'\''; @@ -214,9 +219,9 @@ RESOURCE: 'resource'; OUTPUT: 'output'; TARGET_SCOPE: 'targetScope'; - + IMPORT: 'import'; - + WITH: 'with'; AS: 'as'; @@ -247,45 +252,25 @@ INT: 'int'; BOOL: 'bool'; -IF - : 'if' - ; +IF: 'if'; -FOR - : 'for' - ; +FOR: 'for'; -IN - : 'in' - ; +IN: 'in'; -QMARK - : '?' - ; +QMARK: '?'; -GT - : '>' - ; +GT: '>'; -GTE - : '>=' - ; +GTE: '>='; -LT - : '<' - ; +LT: '<'; -LTE - : '<=' - ; +LTE: '<='; -EQ - : '==' - ; +EQ: '=='; -NEQ - : '!=' - ; +NEQ: '!='; IDENTIFIER: [a-zA-Z_] [a-zA-Z_0-9]*; @@ -306,4 +291,4 @@ fragment STRINGCHAR: ~[\\'\n\r\t$] | ESCAPE; fragment ESCAPE: '\\' ([\\'nrt$] | 'u{' HEX+ '}'); -fragment HEX: [0-9a-fA-F]; +fragment HEX: [0-9a-fA-F]; \ No newline at end of file From c7f3574a8e6d778395c4d47d7e2b2b551aecf97b Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 9 May 2024 12:09:36 +0100 Subject: [PATCH 109/130] added lambdaExpression to bicep grammar and fix lint --- pkg/parser/bicep/antlr/bicep.g4 | 9 +- pkg/parser/bicep/antlr/parser/bicep.interp | 15 +- pkg/parser/bicep/antlr/parser/bicep.tokens | 16 +- .../bicep/antlr/parser/bicepLexer.interp | 5 +- .../bicep/antlr/parser/bicepLexer.tokens | 16 +- .../bicep/antlr/parser/bicep_base_visitor.go | 24 +- pkg/parser/bicep/antlr/parser/bicep_lexer.go | 389 +- pkg/parser/bicep/antlr/parser/bicep_parser.go | 3637 +++++++++-------- .../bicep/antlr/parser/bicep_visitor.go | 33 +- pkg/scan/scan.go | 6 +- 10 files changed, 2210 insertions(+), 1940 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index 6acd78b30e0..1eb9b68d1d1 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -102,6 +102,10 @@ expression: | expression logicCharacter expression | primaryExpression; +// lambdaExpression -> ( "(" argumentList? ")" | IDENTIFIER ) "=>" expression +lambdaExpression: + (OPAR argumentList? CPAR | identifier) ARROW expression; + logicCharacter: (GT | GTE | LT | LTE | EQ | NEQ); // primaryExpression -> literalValue | interpString | multilineString | array | object | @@ -114,7 +118,8 @@ primaryExpression: | array | object | forExpression - | parenthesizedExpression; + | parenthesizedExpression + | lambdaExpression; // parenthesizedExpression -> "(" expression ")" parenthesizedExpression: OPAR NL? expression NL? CPAR; @@ -272,6 +277,8 @@ EQ: '=='; NEQ: '!='; +ARROW: '=>'; + IDENTIFIER: [a-zA-Z_] [a-zA-Z_0-9]*; NUMBER: [0-9]+ ('.' [0-9]+)?; diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index de09f84fb6e..7b020d5954e 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -47,6 +47,7 @@ null '<=' '==' '!=' +'=>' null null null @@ -104,6 +105,7 @@ LT LTE EQ NEQ +ARROW IDENTIFIER NUMBER NL @@ -115,22 +117,23 @@ UNKNOWN rule names: program statement -parameterDecl -parameterDefaultValue -variableDecl -resourceDecl -outputDecl targetScopeDecl importDecl metadataDecl +parameterDecl +parameterDefaultValue typeDecl +variableDecl +resourceDecl moduleDecl +outputDecl ifCondition forExpression forVariableBlock forBody interpString expression +lambdaExpression logicCharacter primaryExpression parenthesizedExpression @@ -148,4 +151,4 @@ identifier atn: -[4, 1, 54, 422, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 1, 0, 5, 0, 66, 8, 0, 10, 0, 12, 0, 69, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 83, 8, 1, 1, 2, 5, 2, 86, 8, 2, 10, 2, 12, 2, 89, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 95, 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 100, 8, 2, 3, 2, 102, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 110, 8, 4, 10, 4, 12, 4, 113, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 122, 8, 5, 10, 5, 12, 5, 125, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 131, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 137, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 142, 8, 6, 10, 6, 12, 6, 145, 9, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 152, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 164, 8, 8, 10, 8, 12, 8, 167, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 175, 8, 8, 10, 8, 12, 8, 178, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 5, 10, 189, 8, 10, 10, 10, 12, 10, 192, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 5, 11, 201, 8, 11, 10, 11, 12, 11, 204, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 213, 8, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 5, 13, 223, 8, 13, 10, 13, 12, 13, 226, 9, 13, 1, 13, 1, 13, 1, 13, 3, 13, 231, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 238, 8, 13, 10, 13, 12, 13, 241, 9, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 3, 15, 253, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 259, 8, 16, 10, 16, 12, 16, 262, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 268, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 297, 8, 17, 10, 17, 12, 17, 300, 9, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 312, 8, 19, 1, 20, 1, 20, 3, 20, 316, 8, 20, 1, 20, 1, 20, 3, 20, 320, 8, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 331, 8, 22, 1, 23, 1, 23, 4, 23, 335, 8, 23, 11, 23, 12, 23, 336, 1, 23, 1, 23, 4, 23, 341, 8, 23, 11, 23, 12, 23, 342, 5, 23, 345, 8, 23, 10, 23, 12, 23, 348, 9, 23, 3, 23, 350, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 3, 24, 356, 8, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 363, 8, 25, 10, 25, 12, 25, 366, 9, 25, 1, 25, 5, 25, 369, 8, 25, 10, 25, 12, 25, 372, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 4, 26, 378, 8, 26, 11, 26, 12, 26, 379, 1, 26, 3, 26, 383, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 394, 8, 28, 1, 29, 1, 29, 1, 29, 3, 29, 399, 8, 29, 1, 29, 3, 29, 402, 8, 29, 1, 29, 3, 29, 405, 8, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 3, 30, 412, 8, 30, 1, 30, 5, 30, 415, 8, 30, 10, 30, 12, 30, 418, 9, 30, 1, 31, 1, 31, 1, 31, 0, 1, 34, 32, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 0, 2, 1, 0, 42, 47, 3, 0, 14, 28, 35, 40, 48, 48, 458, 0, 67, 1, 0, 0, 0, 2, 82, 1, 0, 0, 0, 4, 87, 1, 0, 0, 0, 6, 105, 1, 0, 0, 0, 8, 111, 1, 0, 0, 0, 10, 123, 1, 0, 0, 0, 12, 143, 1, 0, 0, 0, 14, 157, 1, 0, 0, 0, 16, 165, 1, 0, 0, 0, 18, 181, 1, 0, 0, 0, 20, 190, 1, 0, 0, 0, 22, 202, 1, 0, 0, 0, 24, 216, 1, 0, 0, 0, 26, 220, 1, 0, 0, 0, 28, 244, 1, 0, 0, 0, 30, 252, 1, 0, 0, 0, 32, 267, 1, 0, 0, 0, 34, 269, 1, 0, 0, 0, 36, 301, 1, 0, 0, 0, 38, 311, 1, 0, 0, 0, 40, 313, 1, 0, 0, 0, 42, 323, 1, 0, 0, 0, 44, 330, 1, 0, 0, 0, 46, 332, 1, 0, 0, 0, 48, 355, 1, 0, 0, 0, 50, 360, 1, 0, 0, 0, 52, 375, 1, 0, 0, 0, 54, 384, 1, 0, 0, 0, 56, 393, 1, 0, 0, 0, 58, 395, 1, 0, 0, 0, 60, 408, 1, 0, 0, 0, 62, 419, 1, 0, 0, 0, 64, 66, 3, 2, 1, 0, 65, 64, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 0, 0, 1, 71, 1, 1, 0, 0, 0, 72, 83, 3, 4, 2, 0, 73, 83, 3, 8, 4, 0, 74, 83, 3, 10, 5, 0, 75, 83, 3, 12, 6, 0, 76, 83, 3, 14, 7, 0, 77, 83, 3, 16, 8, 0, 78, 83, 3, 18, 9, 0, 79, 83, 3, 20, 10, 0, 80, 83, 3, 22, 11, 0, 81, 83, 5, 50, 0, 0, 82, 72, 1, 0, 0, 0, 82, 73, 1, 0, 0, 0, 82, 74, 1, 0, 0, 0, 82, 75, 1, 0, 0, 0, 82, 76, 1, 0, 0, 0, 82, 77, 1, 0, 0, 0, 82, 78, 1, 0, 0, 0, 82, 79, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 81, 1, 0, 0, 0, 83, 3, 1, 0, 0, 0, 84, 86, 3, 54, 27, 0, 85, 84, 1, 0, 0, 0, 86, 89, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 90, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, 90, 91, 5, 14, 0, 0, 91, 101, 3, 62, 31, 0, 92, 94, 3, 42, 21, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 102, 1, 0, 0, 0, 96, 97, 5, 21, 0, 0, 97, 99, 3, 32, 16, 0, 98, 100, 3, 6, 3, 0, 99, 98, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 102, 1, 0, 0, 0, 101, 92, 1, 0, 0, 0, 101, 96, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 104, 5, 50, 0, 0, 104, 5, 1, 0, 0, 0, 105, 106, 5, 11, 0, 0, 106, 107, 3, 34, 17, 0, 107, 7, 1, 0, 0, 0, 108, 110, 3, 54, 27, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 15, 0, 0, 115, 116, 3, 62, 31, 0, 116, 117, 5, 11, 0, 0, 117, 118, 3, 34, 17, 0, 118, 119, 5, 50, 0, 0, 119, 9, 1, 0, 0, 0, 120, 122, 3, 54, 27, 0, 121, 120, 1, 0, 0, 0, 122, 125, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 126, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 126, 127, 5, 21, 0, 0, 127, 128, 3, 62, 31, 0, 128, 130, 3, 32, 16, 0, 129, 131, 5, 28, 0, 0, 130, 129, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 136, 5, 11, 0, 0, 133, 137, 3, 24, 12, 0, 134, 137, 3, 46, 23, 0, 135, 137, 3, 26, 13, 0, 136, 133, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 50, 0, 0, 139, 11, 1, 0, 0, 0, 140, 142, 3, 54, 27, 0, 141, 140, 1, 0, 0, 0, 142, 145, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 146, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 146, 147, 5, 22, 0, 0, 147, 151, 3, 62, 31, 0, 148, 152, 3, 62, 31, 0, 149, 150, 5, 21, 0, 0, 150, 152, 3, 32, 16, 0, 151, 148, 1, 0, 0, 0, 151, 149, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 11, 0, 0, 154, 155, 3, 34, 17, 0, 155, 156, 5, 50, 0, 0, 156, 13, 1, 0, 0, 0, 157, 158, 5, 23, 0, 0, 158, 159, 5, 11, 0, 0, 159, 160, 3, 34, 17, 0, 160, 161, 5, 50, 0, 0, 161, 15, 1, 0, 0, 0, 162, 164, 3, 54, 27, 0, 163, 162, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 24, 0, 0, 169, 176, 3, 32, 16, 0, 170, 171, 5, 25, 0, 0, 171, 175, 3, 46, 23, 0, 172, 173, 5, 26, 0, 0, 173, 175, 3, 62, 31, 0, 174, 170, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 175, 178, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 179, 180, 5, 50, 0, 0, 180, 17, 1, 0, 0, 0, 181, 182, 5, 27, 0, 0, 182, 183, 3, 62, 31, 0, 183, 184, 5, 11, 0, 0, 184, 185, 3, 34, 17, 0, 185, 186, 5, 50, 0, 0, 186, 19, 1, 0, 0, 0, 187, 189, 3, 54, 27, 0, 188, 187, 1, 0, 0, 0, 189, 192, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 193, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 193, 194, 5, 29, 0, 0, 194, 195, 3, 62, 31, 0, 195, 196, 5, 11, 0, 0, 196, 197, 3, 42, 21, 0, 197, 198, 5, 50, 0, 0, 198, 21, 1, 0, 0, 0, 199, 201, 3, 54, 27, 0, 200, 199, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 205, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 205, 206, 5, 30, 0, 0, 206, 207, 3, 62, 31, 0, 207, 208, 3, 32, 16, 0, 208, 212, 5, 11, 0, 0, 209, 213, 3, 24, 12, 0, 210, 213, 3, 46, 23, 0, 211, 213, 3, 26, 13, 0, 212, 209, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 50, 0, 0, 215, 23, 1, 0, 0, 0, 216, 217, 5, 38, 0, 0, 217, 218, 3, 40, 20, 0, 218, 219, 3, 46, 23, 0, 219, 25, 1, 0, 0, 0, 220, 224, 5, 4, 0, 0, 221, 223, 5, 50, 0, 0, 222, 221, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 227, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 230, 5, 39, 0, 0, 228, 231, 3, 62, 31, 0, 229, 231, 3, 28, 14, 0, 230, 228, 1, 0, 0, 0, 230, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 5, 40, 0, 0, 233, 234, 3, 34, 17, 0, 234, 235, 5, 10, 0, 0, 235, 239, 3, 30, 15, 0, 236, 238, 5, 50, 0, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 5, 0, 0, 243, 27, 1, 0, 0, 0, 244, 245, 5, 6, 0, 0, 245, 246, 3, 62, 31, 0, 246, 247, 5, 3, 0, 0, 247, 248, 3, 62, 31, 0, 248, 249, 5, 7, 0, 0, 249, 29, 1, 0, 0, 0, 250, 253, 3, 34, 17, 0, 251, 253, 3, 24, 12, 0, 252, 250, 1, 0, 0, 0, 252, 251, 1, 0, 0, 0, 253, 31, 1, 0, 0, 0, 254, 260, 5, 31, 0, 0, 255, 256, 3, 34, 17, 0, 256, 257, 5, 32, 0, 0, 257, 259, 1, 0, 0, 0, 258, 255, 1, 0, 0, 0, 259, 262, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 263, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 263, 264, 3, 34, 17, 0, 264, 265, 5, 33, 0, 0, 265, 268, 1, 0, 0, 0, 266, 268, 5, 34, 0, 0, 267, 254, 1, 0, 0, 0, 267, 266, 1, 0, 0, 0, 268, 33, 1, 0, 0, 0, 269, 270, 6, 17, -1, 0, 270, 271, 3, 38, 19, 0, 271, 298, 1, 0, 0, 0, 272, 273, 10, 6, 0, 0, 273, 274, 5, 41, 0, 0, 274, 275, 3, 34, 17, 0, 275, 276, 5, 10, 0, 0, 276, 277, 3, 34, 17, 7, 277, 297, 1, 0, 0, 0, 278, 279, 10, 2, 0, 0, 279, 280, 3, 36, 18, 0, 280, 281, 3, 34, 17, 3, 281, 297, 1, 0, 0, 0, 282, 283, 10, 7, 0, 0, 283, 284, 5, 4, 0, 0, 284, 285, 3, 34, 17, 0, 285, 286, 5, 5, 0, 0, 286, 297, 1, 0, 0, 0, 287, 288, 10, 5, 0, 0, 288, 289, 5, 8, 0, 0, 289, 297, 3, 62, 31, 0, 290, 291, 10, 4, 0, 0, 291, 292, 5, 8, 0, 0, 292, 297, 3, 58, 29, 0, 293, 294, 10, 3, 0, 0, 294, 295, 5, 10, 0, 0, 295, 297, 3, 62, 31, 0, 296, 272, 1, 0, 0, 0, 296, 278, 1, 0, 0, 0, 296, 282, 1, 0, 0, 0, 296, 287, 1, 0, 0, 0, 296, 290, 1, 0, 0, 0, 296, 293, 1, 0, 0, 0, 297, 300, 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 35, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 301, 302, 7, 0, 0, 0, 302, 37, 1, 0, 0, 0, 303, 312, 3, 44, 22, 0, 304, 312, 3, 58, 29, 0, 305, 312, 3, 32, 16, 0, 306, 312, 5, 1, 0, 0, 307, 312, 3, 50, 25, 0, 308, 312, 3, 46, 23, 0, 309, 312, 3, 26, 13, 0, 310, 312, 3, 40, 20, 0, 311, 303, 1, 0, 0, 0, 311, 304, 1, 0, 0, 0, 311, 305, 1, 0, 0, 0, 311, 306, 1, 0, 0, 0, 311, 307, 1, 0, 0, 0, 311, 308, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, 311, 310, 1, 0, 0, 0, 312, 39, 1, 0, 0, 0, 313, 315, 5, 6, 0, 0, 314, 316, 5, 50, 0, 0, 315, 314, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 319, 3, 34, 17, 0, 318, 320, 5, 50, 0, 0, 319, 318, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 7, 0, 0, 322, 41, 1, 0, 0, 0, 323, 324, 3, 62, 31, 0, 324, 43, 1, 0, 0, 0, 325, 331, 5, 49, 0, 0, 326, 331, 5, 16, 0, 0, 327, 331, 5, 17, 0, 0, 328, 331, 5, 18, 0, 0, 329, 331, 3, 62, 31, 0, 330, 325, 1, 0, 0, 0, 330, 326, 1, 0, 0, 0, 330, 327, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 329, 1, 0, 0, 0, 331, 45, 1, 0, 0, 0, 332, 349, 5, 12, 0, 0, 333, 335, 5, 50, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 346, 1, 0, 0, 0, 338, 340, 3, 48, 24, 0, 339, 341, 5, 50, 0, 0, 340, 339, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 345, 1, 0, 0, 0, 344, 338, 1, 0, 0, 0, 345, 348, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 350, 1, 0, 0, 0, 348, 346, 1, 0, 0, 0, 349, 334, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 352, 5, 13, 0, 0, 352, 47, 1, 0, 0, 0, 353, 356, 3, 62, 31, 0, 354, 356, 3, 32, 16, 0, 355, 353, 1, 0, 0, 0, 355, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 358, 5, 10, 0, 0, 358, 359, 3, 34, 17, 0, 359, 49, 1, 0, 0, 0, 360, 364, 5, 4, 0, 0, 361, 363, 5, 50, 0, 0, 362, 361, 1, 0, 0, 0, 363, 366, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 370, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, 367, 369, 3, 52, 26, 0, 368, 367, 1, 0, 0, 0, 369, 372, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 373, 1, 0, 0, 0, 372, 370, 1, 0, 0, 0, 373, 374, 5, 5, 0, 0, 374, 51, 1, 0, 0, 0, 375, 382, 3, 34, 17, 0, 376, 378, 5, 50, 0, 0, 377, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 383, 1, 0, 0, 0, 381, 383, 5, 3, 0, 0, 382, 377, 1, 0, 0, 0, 382, 381, 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, 383, 53, 1, 0, 0, 0, 384, 385, 5, 2, 0, 0, 385, 386, 3, 56, 28, 0, 386, 387, 5, 50, 0, 0, 387, 55, 1, 0, 0, 0, 388, 394, 3, 58, 29, 0, 389, 390, 3, 34, 17, 0, 390, 391, 5, 8, 0, 0, 391, 392, 3, 58, 29, 0, 392, 394, 1, 0, 0, 0, 393, 388, 1, 0, 0, 0, 393, 389, 1, 0, 0, 0, 394, 57, 1, 0, 0, 0, 395, 396, 3, 62, 31, 0, 396, 401, 5, 6, 0, 0, 397, 399, 5, 50, 0, 0, 398, 397, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 400, 1, 0, 0, 0, 400, 402, 3, 60, 30, 0, 401, 398, 1, 0, 0, 0, 401, 402, 1, 0, 0, 0, 402, 404, 1, 0, 0, 0, 403, 405, 5, 50, 0, 0, 404, 403, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, 406, 1, 0, 0, 0, 406, 407, 5, 7, 0, 0, 407, 59, 1, 0, 0, 0, 408, 416, 3, 34, 17, 0, 409, 411, 5, 3, 0, 0, 410, 412, 5, 50, 0, 0, 411, 410, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 415, 3, 34, 17, 0, 414, 409, 1, 0, 0, 0, 415, 418, 1, 0, 0, 0, 416, 414, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 61, 1, 0, 0, 0, 418, 416, 1, 0, 0, 0, 419, 420, 7, 1, 0, 0, 420, 63, 1, 0, 0, 0, 45, 67, 82, 87, 94, 99, 101, 111, 123, 130, 136, 143, 151, 165, 174, 176, 190, 202, 212, 224, 230, 239, 252, 260, 267, 296, 298, 311, 315, 319, 330, 336, 342, 346, 349, 355, 364, 370, 379, 382, 393, 398, 401, 404, 411, 416] \ No newline at end of file +[4, 1, 55, 436, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 1, 0, 5, 0, 68, 8, 0, 10, 0, 12, 0, 71, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 85, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 5, 3, 93, 8, 3, 10, 3, 12, 3, 96, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 104, 8, 3, 10, 3, 12, 3, 107, 9, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 118, 8, 5, 10, 5, 12, 5, 121, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 127, 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 132, 8, 5, 3, 5, 134, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 5, 7, 142, 8, 7, 10, 7, 12, 7, 145, 9, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 154, 8, 8, 10, 8, 12, 8, 157, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 5, 9, 166, 8, 9, 10, 9, 12, 9, 169, 9, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 175, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 181, 8, 9, 1, 9, 1, 9, 1, 10, 5, 10, 186, 8, 10, 10, 10, 12, 10, 189, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 198, 8, 10, 1, 10, 1, 10, 1, 11, 5, 11, 203, 8, 11, 10, 11, 12, 11, 206, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 213, 8, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 5, 13, 225, 8, 13, 10, 13, 12, 13, 228, 9, 13, 1, 13, 1, 13, 1, 13, 3, 13, 233, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 240, 8, 13, 10, 13, 12, 13, 243, 9, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 3, 15, 255, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 261, 8, 16, 10, 16, 12, 16, 264, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 270, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 299, 8, 17, 10, 17, 12, 17, 302, 9, 17, 1, 18, 1, 18, 3, 18, 306, 8, 18, 1, 18, 1, 18, 3, 18, 310, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 326, 8, 20, 1, 21, 1, 21, 3, 21, 330, 8, 21, 1, 21, 1, 21, 3, 21, 334, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 345, 8, 23, 1, 24, 1, 24, 4, 24, 349, 8, 24, 11, 24, 12, 24, 350, 1, 24, 1, 24, 4, 24, 355, 8, 24, 11, 24, 12, 24, 356, 5, 24, 359, 8, 24, 10, 24, 12, 24, 362, 9, 24, 3, 24, 364, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 3, 25, 370, 8, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 5, 26, 377, 8, 26, 10, 26, 12, 26, 380, 9, 26, 1, 26, 5, 26, 383, 8, 26, 10, 26, 12, 26, 386, 9, 26, 1, 26, 1, 26, 1, 27, 1, 27, 4, 27, 392, 8, 27, 11, 27, 12, 27, 393, 1, 27, 3, 27, 397, 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 3, 29, 408, 8, 29, 1, 30, 1, 30, 1, 30, 3, 30, 413, 8, 30, 1, 30, 3, 30, 416, 8, 30, 1, 30, 3, 30, 419, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 3, 31, 426, 8, 31, 1, 31, 5, 31, 429, 8, 31, 10, 31, 12, 31, 432, 9, 31, 1, 32, 1, 32, 1, 32, 0, 1, 34, 33, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 0, 2, 1, 0, 42, 47, 3, 0, 14, 28, 35, 40, 49, 49, 474, 0, 69, 1, 0, 0, 0, 2, 84, 1, 0, 0, 0, 4, 86, 1, 0, 0, 0, 6, 94, 1, 0, 0, 0, 8, 110, 1, 0, 0, 0, 10, 119, 1, 0, 0, 0, 12, 137, 1, 0, 0, 0, 14, 143, 1, 0, 0, 0, 16, 155, 1, 0, 0, 0, 18, 167, 1, 0, 0, 0, 20, 187, 1, 0, 0, 0, 22, 204, 1, 0, 0, 0, 24, 218, 1, 0, 0, 0, 26, 222, 1, 0, 0, 0, 28, 246, 1, 0, 0, 0, 30, 254, 1, 0, 0, 0, 32, 269, 1, 0, 0, 0, 34, 271, 1, 0, 0, 0, 36, 309, 1, 0, 0, 0, 38, 314, 1, 0, 0, 0, 40, 325, 1, 0, 0, 0, 42, 327, 1, 0, 0, 0, 44, 337, 1, 0, 0, 0, 46, 344, 1, 0, 0, 0, 48, 346, 1, 0, 0, 0, 50, 369, 1, 0, 0, 0, 52, 374, 1, 0, 0, 0, 54, 389, 1, 0, 0, 0, 56, 398, 1, 0, 0, 0, 58, 407, 1, 0, 0, 0, 60, 409, 1, 0, 0, 0, 62, 422, 1, 0, 0, 0, 64, 433, 1, 0, 0, 0, 66, 68, 3, 2, 1, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 0, 0, 1, 73, 1, 1, 0, 0, 0, 74, 85, 3, 4, 2, 0, 75, 85, 3, 6, 3, 0, 76, 85, 3, 8, 4, 0, 77, 85, 3, 10, 5, 0, 78, 85, 3, 14, 7, 0, 79, 85, 3, 16, 8, 0, 80, 85, 3, 18, 9, 0, 81, 85, 3, 20, 10, 0, 82, 85, 3, 22, 11, 0, 83, 85, 5, 51, 0, 0, 84, 74, 1, 0, 0, 0, 84, 75, 1, 0, 0, 0, 84, 76, 1, 0, 0, 0, 84, 77, 1, 0, 0, 0, 84, 78, 1, 0, 0, 0, 84, 79, 1, 0, 0, 0, 84, 80, 1, 0, 0, 0, 84, 81, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 84, 83, 1, 0, 0, 0, 85, 3, 1, 0, 0, 0, 86, 87, 5, 23, 0, 0, 87, 88, 5, 11, 0, 0, 88, 89, 3, 34, 17, 0, 89, 90, 5, 51, 0, 0, 90, 5, 1, 0, 0, 0, 91, 93, 3, 56, 28, 0, 92, 91, 1, 0, 0, 0, 93, 96, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 97, 98, 5, 24, 0, 0, 98, 105, 3, 32, 16, 0, 99, 100, 5, 25, 0, 0, 100, 104, 3, 48, 24, 0, 101, 102, 5, 26, 0, 0, 102, 104, 3, 64, 32, 0, 103, 99, 1, 0, 0, 0, 103, 101, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 5, 51, 0, 0, 109, 7, 1, 0, 0, 0, 110, 111, 5, 27, 0, 0, 111, 112, 3, 64, 32, 0, 112, 113, 5, 11, 0, 0, 113, 114, 3, 34, 17, 0, 114, 115, 5, 51, 0, 0, 115, 9, 1, 0, 0, 0, 116, 118, 3, 56, 28, 0, 117, 116, 1, 0, 0, 0, 118, 121, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 122, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 122, 123, 5, 14, 0, 0, 123, 133, 3, 64, 32, 0, 124, 126, 3, 44, 22, 0, 125, 127, 3, 12, 6, 0, 126, 125, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 134, 1, 0, 0, 0, 128, 129, 5, 21, 0, 0, 129, 131, 3, 32, 16, 0, 130, 132, 3, 12, 6, 0, 131, 130, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 134, 1, 0, 0, 0, 133, 124, 1, 0, 0, 0, 133, 128, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 51, 0, 0, 136, 11, 1, 0, 0, 0, 137, 138, 5, 11, 0, 0, 138, 139, 3, 34, 17, 0, 139, 13, 1, 0, 0, 0, 140, 142, 3, 56, 28, 0, 141, 140, 1, 0, 0, 0, 142, 145, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 146, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 146, 147, 5, 29, 0, 0, 147, 148, 3, 64, 32, 0, 148, 149, 5, 11, 0, 0, 149, 150, 3, 44, 22, 0, 150, 151, 5, 51, 0, 0, 151, 15, 1, 0, 0, 0, 152, 154, 3, 56, 28, 0, 153, 152, 1, 0, 0, 0, 154, 157, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 158, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 158, 159, 5, 15, 0, 0, 159, 160, 3, 64, 32, 0, 160, 161, 5, 11, 0, 0, 161, 162, 3, 34, 17, 0, 162, 163, 5, 51, 0, 0, 163, 17, 1, 0, 0, 0, 164, 166, 3, 56, 28, 0, 165, 164, 1, 0, 0, 0, 166, 169, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 170, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 170, 171, 5, 21, 0, 0, 171, 172, 3, 64, 32, 0, 172, 174, 3, 32, 16, 0, 173, 175, 5, 28, 0, 0, 174, 173, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 180, 5, 11, 0, 0, 177, 181, 3, 24, 12, 0, 178, 181, 3, 48, 24, 0, 179, 181, 3, 26, 13, 0, 180, 177, 1, 0, 0, 0, 180, 178, 1, 0, 0, 0, 180, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 183, 5, 51, 0, 0, 183, 19, 1, 0, 0, 0, 184, 186, 3, 56, 28, 0, 185, 184, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 190, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 191, 5, 30, 0, 0, 191, 192, 3, 64, 32, 0, 192, 193, 3, 32, 16, 0, 193, 197, 5, 11, 0, 0, 194, 198, 3, 24, 12, 0, 195, 198, 3, 48, 24, 0, 196, 198, 3, 26, 13, 0, 197, 194, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 197, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 200, 5, 51, 0, 0, 200, 21, 1, 0, 0, 0, 201, 203, 3, 56, 28, 0, 202, 201, 1, 0, 0, 0, 203, 206, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 207, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 207, 208, 5, 22, 0, 0, 208, 212, 3, 64, 32, 0, 209, 213, 3, 64, 32, 0, 210, 211, 5, 21, 0, 0, 211, 213, 3, 32, 16, 0, 212, 209, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 11, 0, 0, 215, 216, 3, 34, 17, 0, 216, 217, 5, 51, 0, 0, 217, 23, 1, 0, 0, 0, 218, 219, 5, 38, 0, 0, 219, 220, 3, 42, 21, 0, 220, 221, 3, 48, 24, 0, 221, 25, 1, 0, 0, 0, 222, 226, 5, 4, 0, 0, 223, 225, 5, 51, 0, 0, 224, 223, 1, 0, 0, 0, 225, 228, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 226, 227, 1, 0, 0, 0, 227, 229, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 229, 232, 5, 39, 0, 0, 230, 233, 3, 64, 32, 0, 231, 233, 3, 28, 14, 0, 232, 230, 1, 0, 0, 0, 232, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 235, 5, 40, 0, 0, 235, 236, 3, 34, 17, 0, 236, 237, 5, 10, 0, 0, 237, 241, 3, 30, 15, 0, 238, 240, 5, 51, 0, 0, 239, 238, 1, 0, 0, 0, 240, 243, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 1, 0, 0, 0, 243, 241, 1, 0, 0, 0, 244, 245, 5, 5, 0, 0, 245, 27, 1, 0, 0, 0, 246, 247, 5, 6, 0, 0, 247, 248, 3, 64, 32, 0, 248, 249, 5, 3, 0, 0, 249, 250, 3, 64, 32, 0, 250, 251, 5, 7, 0, 0, 251, 29, 1, 0, 0, 0, 252, 255, 3, 34, 17, 0, 253, 255, 3, 24, 12, 0, 254, 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, 0, 255, 31, 1, 0, 0, 0, 256, 262, 5, 31, 0, 0, 257, 258, 3, 34, 17, 0, 258, 259, 5, 32, 0, 0, 259, 261, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 3, 34, 17, 0, 266, 267, 5, 33, 0, 0, 267, 270, 1, 0, 0, 0, 268, 270, 5, 34, 0, 0, 269, 256, 1, 0, 0, 0, 269, 268, 1, 0, 0, 0, 270, 33, 1, 0, 0, 0, 271, 272, 6, 17, -1, 0, 272, 273, 3, 40, 20, 0, 273, 300, 1, 0, 0, 0, 274, 275, 10, 6, 0, 0, 275, 276, 5, 41, 0, 0, 276, 277, 3, 34, 17, 0, 277, 278, 5, 10, 0, 0, 278, 279, 3, 34, 17, 7, 279, 299, 1, 0, 0, 0, 280, 281, 10, 2, 0, 0, 281, 282, 3, 38, 19, 0, 282, 283, 3, 34, 17, 3, 283, 299, 1, 0, 0, 0, 284, 285, 10, 7, 0, 0, 285, 286, 5, 4, 0, 0, 286, 287, 3, 34, 17, 0, 287, 288, 5, 5, 0, 0, 288, 299, 1, 0, 0, 0, 289, 290, 10, 5, 0, 0, 290, 291, 5, 8, 0, 0, 291, 299, 3, 64, 32, 0, 292, 293, 10, 4, 0, 0, 293, 294, 5, 8, 0, 0, 294, 299, 3, 60, 30, 0, 295, 296, 10, 3, 0, 0, 296, 297, 5, 10, 0, 0, 297, 299, 3, 64, 32, 0, 298, 274, 1, 0, 0, 0, 298, 280, 1, 0, 0, 0, 298, 284, 1, 0, 0, 0, 298, 289, 1, 0, 0, 0, 298, 292, 1, 0, 0, 0, 298, 295, 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 35, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 303, 305, 5, 6, 0, 0, 304, 306, 3, 62, 31, 0, 305, 304, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 310, 5, 7, 0, 0, 308, 310, 3, 64, 32, 0, 309, 303, 1, 0, 0, 0, 309, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 312, 5, 48, 0, 0, 312, 313, 3, 34, 17, 0, 313, 37, 1, 0, 0, 0, 314, 315, 7, 0, 0, 0, 315, 39, 1, 0, 0, 0, 316, 326, 3, 46, 23, 0, 317, 326, 3, 60, 30, 0, 318, 326, 3, 32, 16, 0, 319, 326, 5, 1, 0, 0, 320, 326, 3, 52, 26, 0, 321, 326, 3, 48, 24, 0, 322, 326, 3, 26, 13, 0, 323, 326, 3, 42, 21, 0, 324, 326, 3, 36, 18, 0, 325, 316, 1, 0, 0, 0, 325, 317, 1, 0, 0, 0, 325, 318, 1, 0, 0, 0, 325, 319, 1, 0, 0, 0, 325, 320, 1, 0, 0, 0, 325, 321, 1, 0, 0, 0, 325, 322, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 325, 324, 1, 0, 0, 0, 326, 41, 1, 0, 0, 0, 327, 329, 5, 6, 0, 0, 328, 330, 5, 51, 0, 0, 329, 328, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 3, 34, 17, 0, 332, 334, 5, 51, 0, 0, 333, 332, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 336, 5, 7, 0, 0, 336, 43, 1, 0, 0, 0, 337, 338, 3, 64, 32, 0, 338, 45, 1, 0, 0, 0, 339, 345, 5, 50, 0, 0, 340, 345, 5, 16, 0, 0, 341, 345, 5, 17, 0, 0, 342, 345, 5, 18, 0, 0, 343, 345, 3, 64, 32, 0, 344, 339, 1, 0, 0, 0, 344, 340, 1, 0, 0, 0, 344, 341, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 343, 1, 0, 0, 0, 345, 47, 1, 0, 0, 0, 346, 363, 5, 12, 0, 0, 347, 349, 5, 51, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 360, 1, 0, 0, 0, 352, 354, 3, 50, 25, 0, 353, 355, 5, 51, 0, 0, 354, 353, 1, 0, 0, 0, 355, 356, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 359, 1, 0, 0, 0, 358, 352, 1, 0, 0, 0, 359, 362, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 364, 1, 0, 0, 0, 362, 360, 1, 0, 0, 0, 363, 348, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 366, 5, 13, 0, 0, 366, 49, 1, 0, 0, 0, 367, 370, 3, 64, 32, 0, 368, 370, 3, 32, 16, 0, 369, 367, 1, 0, 0, 0, 369, 368, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 372, 5, 10, 0, 0, 372, 373, 3, 34, 17, 0, 373, 51, 1, 0, 0, 0, 374, 378, 5, 4, 0, 0, 375, 377, 5, 51, 0, 0, 376, 375, 1, 0, 0, 0, 377, 380, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 384, 1, 0, 0, 0, 380, 378, 1, 0, 0, 0, 381, 383, 3, 54, 27, 0, 382, 381, 1, 0, 0, 0, 383, 386, 1, 0, 0, 0, 384, 382, 1, 0, 0, 0, 384, 385, 1, 0, 0, 0, 385, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 388, 5, 5, 0, 0, 388, 53, 1, 0, 0, 0, 389, 396, 3, 34, 17, 0, 390, 392, 5, 51, 0, 0, 391, 390, 1, 0, 0, 0, 392, 393, 1, 0, 0, 0, 393, 391, 1, 0, 0, 0, 393, 394, 1, 0, 0, 0, 394, 397, 1, 0, 0, 0, 395, 397, 5, 3, 0, 0, 396, 391, 1, 0, 0, 0, 396, 395, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 55, 1, 0, 0, 0, 398, 399, 5, 2, 0, 0, 399, 400, 3, 58, 29, 0, 400, 401, 5, 51, 0, 0, 401, 57, 1, 0, 0, 0, 402, 408, 3, 60, 30, 0, 403, 404, 3, 34, 17, 0, 404, 405, 5, 8, 0, 0, 405, 406, 3, 60, 30, 0, 406, 408, 1, 0, 0, 0, 407, 402, 1, 0, 0, 0, 407, 403, 1, 0, 0, 0, 408, 59, 1, 0, 0, 0, 409, 410, 3, 64, 32, 0, 410, 415, 5, 6, 0, 0, 411, 413, 5, 51, 0, 0, 412, 411, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 414, 1, 0, 0, 0, 414, 416, 3, 62, 31, 0, 415, 412, 1, 0, 0, 0, 415, 416, 1, 0, 0, 0, 416, 418, 1, 0, 0, 0, 417, 419, 5, 51, 0, 0, 418, 417, 1, 0, 0, 0, 418, 419, 1, 0, 0, 0, 419, 420, 1, 0, 0, 0, 420, 421, 5, 7, 0, 0, 421, 61, 1, 0, 0, 0, 422, 430, 3, 34, 17, 0, 423, 425, 5, 3, 0, 0, 424, 426, 5, 51, 0, 0, 425, 424, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 1, 0, 0, 0, 427, 429, 3, 34, 17, 0, 428, 423, 1, 0, 0, 0, 429, 432, 1, 0, 0, 0, 430, 428, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 431, 63, 1, 0, 0, 0, 432, 430, 1, 0, 0, 0, 433, 434, 7, 1, 0, 0, 434, 65, 1, 0, 0, 0, 47, 69, 84, 94, 103, 105, 119, 126, 131, 133, 143, 155, 167, 174, 180, 187, 197, 204, 212, 226, 232, 241, 254, 262, 269, 298, 300, 305, 309, 325, 329, 333, 344, 350, 356, 360, 363, 369, 378, 384, 393, 396, 407, 412, 415, 418, 425, 430] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep.tokens b/pkg/parser/bicep/antlr/parser/bicep.tokens index deb4cb3d93c..30828ecdad0 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.tokens +++ b/pkg/parser/bicep/antlr/parser/bicep.tokens @@ -45,13 +45,14 @@ LT=44 LTE=45 EQ=46 NEQ=47 -IDENTIFIER=48 -NUMBER=49 -NL=50 -SINGLE_LINE_COMMENT=51 -MULTI_LINE_COMMENT=52 -SPACES=53 -UNKNOWN=54 +ARROW=48 +IDENTIFIER=49 +NUMBER=50 +NL=51 +SINGLE_LINE_COMMENT=52 +MULTI_LINE_COMMENT=53 +SPACES=54 +UNKNOWN=55 '@'=2 ','=3 '['=4 @@ -93,3 +94,4 @@ UNKNOWN=54 '<='=45 '=='=46 '!='=47 +'=>'=48 diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.interp b/pkg/parser/bicep/antlr/parser/bicepLexer.interp index 666137d4574..910e27c4102 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.interp +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.interp @@ -47,6 +47,7 @@ null '<=' '==' '!=' +'=>' null null null @@ -104,6 +105,7 @@ LT LTE EQ NEQ +ARROW IDENTIFIER NUMBER NL @@ -160,6 +162,7 @@ LT LTE EQ NEQ +ARROW IDENTIFIER NUMBER NL @@ -179,4 +182,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 54, 429, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 121, 8, 0, 10, 0, 12, 0, 124, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 149, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 271, 8, 30, 10, 30, 12, 30, 274, 9, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 5, 31, 281, 8, 31, 10, 31, 12, 31, 284, 9, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 5, 32, 291, 8, 32, 10, 32, 12, 32, 294, 9, 32, 1, 32, 1, 32, 1, 33, 1, 33, 5, 33, 300, 8, 33, 10, 33, 12, 33, 303, 9, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 5, 47, 353, 8, 47, 10, 47, 12, 47, 356, 9, 47, 1, 48, 4, 48, 359, 8, 48, 11, 48, 12, 48, 360, 1, 48, 1, 48, 4, 48, 365, 8, 48, 11, 48, 12, 48, 366, 3, 48, 369, 8, 48, 1, 49, 4, 49, 372, 8, 49, 11, 49, 12, 49, 373, 1, 50, 1, 50, 1, 50, 1, 50, 5, 50, 380, 8, 50, 10, 50, 12, 50, 383, 9, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 5, 51, 391, 8, 51, 10, 51, 12, 51, 394, 9, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 4, 52, 402, 8, 52, 11, 52, 12, 52, 403, 1, 52, 1, 52, 1, 53, 1, 53, 1, 54, 1, 54, 3, 54, 412, 8, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 4, 55, 420, 8, 55, 11, 55, 12, 55, 421, 1, 55, 1, 55, 3, 55, 426, 8, 55, 1, 56, 1, 56, 2, 122, 392, 0, 57, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 0, 111, 0, 113, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 442, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 1, 115, 1, 0, 0, 0, 3, 129, 1, 0, 0, 0, 5, 131, 1, 0, 0, 0, 7, 133, 1, 0, 0, 0, 9, 135, 1, 0, 0, 0, 11, 137, 1, 0, 0, 0, 13, 139, 1, 0, 0, 0, 15, 141, 1, 0, 0, 0, 17, 143, 1, 0, 0, 0, 19, 148, 1, 0, 0, 0, 21, 150, 1, 0, 0, 0, 23, 152, 1, 0, 0, 0, 25, 154, 1, 0, 0, 0, 27, 156, 1, 0, 0, 0, 29, 162, 1, 0, 0, 0, 31, 166, 1, 0, 0, 0, 33, 171, 1, 0, 0, 0, 35, 177, 1, 0, 0, 0, 37, 182, 1, 0, 0, 0, 39, 188, 1, 0, 0, 0, 41, 195, 1, 0, 0, 0, 43, 204, 1, 0, 0, 0, 45, 211, 1, 0, 0, 0, 47, 223, 1, 0, 0, 0, 49, 230, 1, 0, 0, 0, 51, 235, 1, 0, 0, 0, 53, 238, 1, 0, 0, 0, 55, 247, 1, 0, 0, 0, 57, 256, 1, 0, 0, 0, 59, 261, 1, 0, 0, 0, 61, 268, 1, 0, 0, 0, 63, 278, 1, 0, 0, 0, 65, 288, 1, 0, 0, 0, 67, 297, 1, 0, 0, 0, 69, 306, 1, 0, 0, 0, 71, 313, 1, 0, 0, 0, 73, 317, 1, 0, 0, 0, 75, 322, 1, 0, 0, 0, 77, 325, 1, 0, 0, 0, 79, 329, 1, 0, 0, 0, 81, 332, 1, 0, 0, 0, 83, 334, 1, 0, 0, 0, 85, 336, 1, 0, 0, 0, 87, 339, 1, 0, 0, 0, 89, 341, 1, 0, 0, 0, 91, 344, 1, 0, 0, 0, 93, 347, 1, 0, 0, 0, 95, 350, 1, 0, 0, 0, 97, 358, 1, 0, 0, 0, 99, 371, 1, 0, 0, 0, 101, 375, 1, 0, 0, 0, 103, 386, 1, 0, 0, 0, 105, 401, 1, 0, 0, 0, 107, 407, 1, 0, 0, 0, 109, 411, 1, 0, 0, 0, 111, 413, 1, 0, 0, 0, 113, 427, 1, 0, 0, 0, 115, 116, 5, 39, 0, 0, 116, 117, 5, 39, 0, 0, 117, 118, 5, 39, 0, 0, 118, 122, 1, 0, 0, 0, 119, 121, 9, 0, 0, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 39, 0, 0, 126, 127, 5, 39, 0, 0, 127, 128, 5, 39, 0, 0, 128, 2, 1, 0, 0, 0, 129, 130, 5, 64, 0, 0, 130, 4, 1, 0, 0, 0, 131, 132, 5, 44, 0, 0, 132, 6, 1, 0, 0, 0, 133, 134, 5, 91, 0, 0, 134, 8, 1, 0, 0, 0, 135, 136, 5, 93, 0, 0, 136, 10, 1, 0, 0, 0, 137, 138, 5, 40, 0, 0, 138, 12, 1, 0, 0, 0, 139, 140, 5, 41, 0, 0, 140, 14, 1, 0, 0, 0, 141, 142, 5, 46, 0, 0, 142, 16, 1, 0, 0, 0, 143, 144, 5, 124, 0, 0, 144, 18, 1, 0, 0, 0, 145, 149, 5, 58, 0, 0, 146, 147, 5, 58, 0, 0, 147, 149, 5, 58, 0, 0, 148, 145, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 149, 20, 1, 0, 0, 0, 150, 151, 5, 61, 0, 0, 151, 22, 1, 0, 0, 0, 152, 153, 5, 123, 0, 0, 153, 24, 1, 0, 0, 0, 154, 155, 5, 125, 0, 0, 155, 26, 1, 0, 0, 0, 156, 157, 5, 112, 0, 0, 157, 158, 5, 97, 0, 0, 158, 159, 5, 114, 0, 0, 159, 160, 5, 97, 0, 0, 160, 161, 5, 109, 0, 0, 161, 28, 1, 0, 0, 0, 162, 163, 5, 118, 0, 0, 163, 164, 5, 97, 0, 0, 164, 165, 5, 114, 0, 0, 165, 30, 1, 0, 0, 0, 166, 167, 5, 116, 0, 0, 167, 168, 5, 114, 0, 0, 168, 169, 5, 117, 0, 0, 169, 170, 5, 101, 0, 0, 170, 32, 1, 0, 0, 0, 171, 172, 5, 102, 0, 0, 172, 173, 5, 97, 0, 0, 173, 174, 5, 108, 0, 0, 174, 175, 5, 115, 0, 0, 175, 176, 5, 101, 0, 0, 176, 34, 1, 0, 0, 0, 177, 178, 5, 110, 0, 0, 178, 179, 5, 117, 0, 0, 179, 180, 5, 108, 0, 0, 180, 181, 5, 108, 0, 0, 181, 36, 1, 0, 0, 0, 182, 183, 5, 97, 0, 0, 183, 184, 5, 114, 0, 0, 184, 185, 5, 114, 0, 0, 185, 186, 5, 97, 0, 0, 186, 187, 5, 121, 0, 0, 187, 38, 1, 0, 0, 0, 188, 189, 5, 111, 0, 0, 189, 190, 5, 98, 0, 0, 190, 191, 5, 106, 0, 0, 191, 192, 5, 101, 0, 0, 192, 193, 5, 99, 0, 0, 193, 194, 5, 116, 0, 0, 194, 40, 1, 0, 0, 0, 195, 196, 5, 114, 0, 0, 196, 197, 5, 101, 0, 0, 197, 198, 5, 115, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, 5, 117, 0, 0, 200, 201, 5, 114, 0, 0, 201, 202, 5, 99, 0, 0, 202, 203, 5, 101, 0, 0, 203, 42, 1, 0, 0, 0, 204, 205, 5, 111, 0, 0, 205, 206, 5, 117, 0, 0, 206, 207, 5, 116, 0, 0, 207, 208, 5, 112, 0, 0, 208, 209, 5, 117, 0, 0, 209, 210, 5, 116, 0, 0, 210, 44, 1, 0, 0, 0, 211, 212, 5, 116, 0, 0, 212, 213, 5, 97, 0, 0, 213, 214, 5, 114, 0, 0, 214, 215, 5, 103, 0, 0, 215, 216, 5, 101, 0, 0, 216, 217, 5, 116, 0, 0, 217, 218, 5, 83, 0, 0, 218, 219, 5, 99, 0, 0, 219, 220, 5, 111, 0, 0, 220, 221, 5, 112, 0, 0, 221, 222, 5, 101, 0, 0, 222, 46, 1, 0, 0, 0, 223, 224, 5, 105, 0, 0, 224, 225, 5, 109, 0, 0, 225, 226, 5, 112, 0, 0, 226, 227, 5, 111, 0, 0, 227, 228, 5, 114, 0, 0, 228, 229, 5, 116, 0, 0, 229, 48, 1, 0, 0, 0, 230, 231, 5, 119, 0, 0, 231, 232, 5, 105, 0, 0, 232, 233, 5, 116, 0, 0, 233, 234, 5, 104, 0, 0, 234, 50, 1, 0, 0, 0, 235, 236, 5, 97, 0, 0, 236, 237, 5, 115, 0, 0, 237, 52, 1, 0, 0, 0, 238, 239, 5, 109, 0, 0, 239, 240, 5, 101, 0, 0, 240, 241, 5, 116, 0, 0, 241, 242, 5, 97, 0, 0, 242, 243, 5, 100, 0, 0, 243, 244, 5, 97, 0, 0, 244, 245, 5, 116, 0, 0, 245, 246, 5, 97, 0, 0, 246, 54, 1, 0, 0, 0, 247, 248, 5, 101, 0, 0, 248, 249, 5, 120, 0, 0, 249, 250, 5, 105, 0, 0, 250, 251, 5, 115, 0, 0, 251, 252, 5, 116, 0, 0, 252, 253, 5, 105, 0, 0, 253, 254, 5, 110, 0, 0, 254, 255, 5, 103, 0, 0, 255, 56, 1, 0, 0, 0, 256, 257, 5, 116, 0, 0, 257, 258, 5, 121, 0, 0, 258, 259, 5, 112, 0, 0, 259, 260, 5, 101, 0, 0, 260, 58, 1, 0, 0, 0, 261, 262, 5, 109, 0, 0, 262, 263, 5, 111, 0, 0, 263, 264, 5, 100, 0, 0, 264, 265, 5, 117, 0, 0, 265, 266, 5, 108, 0, 0, 266, 267, 5, 101, 0, 0, 267, 60, 1, 0, 0, 0, 268, 272, 5, 39, 0, 0, 269, 271, 3, 109, 54, 0, 270, 269, 1, 0, 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 275, 276, 5, 36, 0, 0, 276, 277, 5, 123, 0, 0, 277, 62, 1, 0, 0, 0, 278, 282, 5, 125, 0, 0, 279, 281, 3, 109, 54, 0, 280, 279, 1, 0, 0, 0, 281, 284, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 285, 286, 5, 36, 0, 0, 286, 287, 5, 123, 0, 0, 287, 64, 1, 0, 0, 0, 288, 292, 5, 125, 0, 0, 289, 291, 3, 109, 54, 0, 290, 289, 1, 0, 0, 0, 291, 294, 1, 0, 0, 0, 292, 290, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 295, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 295, 296, 5, 39, 0, 0, 296, 66, 1, 0, 0, 0, 297, 301, 5, 39, 0, 0, 298, 300, 3, 109, 54, 0, 299, 298, 1, 0, 0, 0, 300, 303, 1, 0, 0, 0, 301, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 304, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 304, 305, 5, 39, 0, 0, 305, 68, 1, 0, 0, 0, 306, 307, 5, 115, 0, 0, 307, 308, 5, 116, 0, 0, 308, 309, 5, 114, 0, 0, 309, 310, 5, 105, 0, 0, 310, 311, 5, 110, 0, 0, 311, 312, 5, 103, 0, 0, 312, 70, 1, 0, 0, 0, 313, 314, 5, 105, 0, 0, 314, 315, 5, 110, 0, 0, 315, 316, 5, 116, 0, 0, 316, 72, 1, 0, 0, 0, 317, 318, 5, 98, 0, 0, 318, 319, 5, 111, 0, 0, 319, 320, 5, 111, 0, 0, 320, 321, 5, 108, 0, 0, 321, 74, 1, 0, 0, 0, 322, 323, 5, 105, 0, 0, 323, 324, 5, 102, 0, 0, 324, 76, 1, 0, 0, 0, 325, 326, 5, 102, 0, 0, 326, 327, 5, 111, 0, 0, 327, 328, 5, 114, 0, 0, 328, 78, 1, 0, 0, 0, 329, 330, 5, 105, 0, 0, 330, 331, 5, 110, 0, 0, 331, 80, 1, 0, 0, 0, 332, 333, 5, 63, 0, 0, 333, 82, 1, 0, 0, 0, 334, 335, 5, 62, 0, 0, 335, 84, 1, 0, 0, 0, 336, 337, 5, 62, 0, 0, 337, 338, 5, 61, 0, 0, 338, 86, 1, 0, 0, 0, 339, 340, 5, 60, 0, 0, 340, 88, 1, 0, 0, 0, 341, 342, 5, 60, 0, 0, 342, 343, 5, 61, 0, 0, 343, 90, 1, 0, 0, 0, 344, 345, 5, 61, 0, 0, 345, 346, 5, 61, 0, 0, 346, 92, 1, 0, 0, 0, 347, 348, 5, 33, 0, 0, 348, 349, 5, 61, 0, 0, 349, 94, 1, 0, 0, 0, 350, 354, 7, 0, 0, 0, 351, 353, 7, 1, 0, 0, 352, 351, 1, 0, 0, 0, 353, 356, 1, 0, 0, 0, 354, 352, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 96, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 357, 359, 7, 2, 0, 0, 358, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 368, 1, 0, 0, 0, 362, 364, 5, 46, 0, 0, 363, 365, 7, 2, 0, 0, 364, 363, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 369, 1, 0, 0, 0, 368, 362, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 98, 1, 0, 0, 0, 370, 372, 7, 3, 0, 0, 371, 370, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 100, 1, 0, 0, 0, 375, 376, 5, 47, 0, 0, 376, 377, 5, 47, 0, 0, 377, 381, 1, 0, 0, 0, 378, 380, 8, 3, 0, 0, 379, 378, 1, 0, 0, 0, 380, 383, 1, 0, 0, 0, 381, 379, 1, 0, 0, 0, 381, 382, 1, 0, 0, 0, 382, 384, 1, 0, 0, 0, 383, 381, 1, 0, 0, 0, 384, 385, 6, 50, 0, 0, 385, 102, 1, 0, 0, 0, 386, 387, 5, 47, 0, 0, 387, 388, 5, 42, 0, 0, 388, 392, 1, 0, 0, 0, 389, 391, 9, 0, 0, 0, 390, 389, 1, 0, 0, 0, 391, 394, 1, 0, 0, 0, 392, 393, 1, 0, 0, 0, 392, 390, 1, 0, 0, 0, 393, 395, 1, 0, 0, 0, 394, 392, 1, 0, 0, 0, 395, 396, 5, 42, 0, 0, 396, 397, 5, 47, 0, 0, 397, 398, 1, 0, 0, 0, 398, 399, 6, 51, 0, 0, 399, 104, 1, 0, 0, 0, 400, 402, 7, 4, 0, 0, 401, 400, 1, 0, 0, 0, 402, 403, 1, 0, 0, 0, 403, 401, 1, 0, 0, 0, 403, 404, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, 406, 6, 52, 0, 0, 406, 106, 1, 0, 0, 0, 407, 408, 9, 0, 0, 0, 408, 108, 1, 0, 0, 0, 409, 412, 8, 5, 0, 0, 410, 412, 3, 111, 55, 0, 411, 409, 1, 0, 0, 0, 411, 410, 1, 0, 0, 0, 412, 110, 1, 0, 0, 0, 413, 425, 5, 92, 0, 0, 414, 426, 7, 6, 0, 0, 415, 416, 5, 117, 0, 0, 416, 417, 5, 123, 0, 0, 417, 419, 1, 0, 0, 0, 418, 420, 3, 113, 56, 0, 419, 418, 1, 0, 0, 0, 420, 421, 1, 0, 0, 0, 421, 419, 1, 0, 0, 0, 421, 422, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 424, 5, 125, 0, 0, 424, 426, 1, 0, 0, 0, 425, 414, 1, 0, 0, 0, 425, 415, 1, 0, 0, 0, 426, 112, 1, 0, 0, 0, 427, 428, 7, 7, 0, 0, 428, 114, 1, 0, 0, 0, 18, 0, 122, 148, 272, 282, 292, 301, 354, 360, 366, 368, 373, 381, 392, 403, 411, 421, 425, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 55, 434, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 123, 8, 0, 10, 0, 12, 0, 126, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 151, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 273, 8, 30, 10, 30, 12, 30, 276, 9, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 5, 31, 283, 8, 31, 10, 31, 12, 31, 286, 9, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 5, 32, 293, 8, 32, 10, 32, 12, 32, 296, 9, 32, 1, 32, 1, 32, 1, 33, 1, 33, 5, 33, 302, 8, 33, 10, 33, 12, 33, 305, 9, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 5, 48, 358, 8, 48, 10, 48, 12, 48, 361, 9, 48, 1, 49, 4, 49, 364, 8, 49, 11, 49, 12, 49, 365, 1, 49, 1, 49, 4, 49, 370, 8, 49, 11, 49, 12, 49, 371, 3, 49, 374, 8, 49, 1, 50, 4, 50, 377, 8, 50, 11, 50, 12, 50, 378, 1, 51, 1, 51, 1, 51, 1, 51, 5, 51, 385, 8, 51, 10, 51, 12, 51, 388, 9, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 396, 8, 52, 10, 52, 12, 52, 399, 9, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 4, 53, 407, 8, 53, 11, 53, 12, 53, 408, 1, 53, 1, 53, 1, 54, 1, 54, 1, 55, 1, 55, 3, 55, 417, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 4, 56, 425, 8, 56, 11, 56, 12, 56, 426, 1, 56, 1, 56, 3, 56, 431, 8, 56, 1, 57, 1, 57, 2, 124, 397, 0, 58, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 0, 113, 0, 115, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 447, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 1, 117, 1, 0, 0, 0, 3, 131, 1, 0, 0, 0, 5, 133, 1, 0, 0, 0, 7, 135, 1, 0, 0, 0, 9, 137, 1, 0, 0, 0, 11, 139, 1, 0, 0, 0, 13, 141, 1, 0, 0, 0, 15, 143, 1, 0, 0, 0, 17, 145, 1, 0, 0, 0, 19, 150, 1, 0, 0, 0, 21, 152, 1, 0, 0, 0, 23, 154, 1, 0, 0, 0, 25, 156, 1, 0, 0, 0, 27, 158, 1, 0, 0, 0, 29, 164, 1, 0, 0, 0, 31, 168, 1, 0, 0, 0, 33, 173, 1, 0, 0, 0, 35, 179, 1, 0, 0, 0, 37, 184, 1, 0, 0, 0, 39, 190, 1, 0, 0, 0, 41, 197, 1, 0, 0, 0, 43, 206, 1, 0, 0, 0, 45, 213, 1, 0, 0, 0, 47, 225, 1, 0, 0, 0, 49, 232, 1, 0, 0, 0, 51, 237, 1, 0, 0, 0, 53, 240, 1, 0, 0, 0, 55, 249, 1, 0, 0, 0, 57, 258, 1, 0, 0, 0, 59, 263, 1, 0, 0, 0, 61, 270, 1, 0, 0, 0, 63, 280, 1, 0, 0, 0, 65, 290, 1, 0, 0, 0, 67, 299, 1, 0, 0, 0, 69, 308, 1, 0, 0, 0, 71, 315, 1, 0, 0, 0, 73, 319, 1, 0, 0, 0, 75, 324, 1, 0, 0, 0, 77, 327, 1, 0, 0, 0, 79, 331, 1, 0, 0, 0, 81, 334, 1, 0, 0, 0, 83, 336, 1, 0, 0, 0, 85, 338, 1, 0, 0, 0, 87, 341, 1, 0, 0, 0, 89, 343, 1, 0, 0, 0, 91, 346, 1, 0, 0, 0, 93, 349, 1, 0, 0, 0, 95, 352, 1, 0, 0, 0, 97, 355, 1, 0, 0, 0, 99, 363, 1, 0, 0, 0, 101, 376, 1, 0, 0, 0, 103, 380, 1, 0, 0, 0, 105, 391, 1, 0, 0, 0, 107, 406, 1, 0, 0, 0, 109, 412, 1, 0, 0, 0, 111, 416, 1, 0, 0, 0, 113, 418, 1, 0, 0, 0, 115, 432, 1, 0, 0, 0, 117, 118, 5, 39, 0, 0, 118, 119, 5, 39, 0, 0, 119, 120, 5, 39, 0, 0, 120, 124, 1, 0, 0, 0, 121, 123, 9, 0, 0, 0, 122, 121, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 39, 0, 0, 128, 129, 5, 39, 0, 0, 129, 130, 5, 39, 0, 0, 130, 2, 1, 0, 0, 0, 131, 132, 5, 64, 0, 0, 132, 4, 1, 0, 0, 0, 133, 134, 5, 44, 0, 0, 134, 6, 1, 0, 0, 0, 135, 136, 5, 91, 0, 0, 136, 8, 1, 0, 0, 0, 137, 138, 5, 93, 0, 0, 138, 10, 1, 0, 0, 0, 139, 140, 5, 40, 0, 0, 140, 12, 1, 0, 0, 0, 141, 142, 5, 41, 0, 0, 142, 14, 1, 0, 0, 0, 143, 144, 5, 46, 0, 0, 144, 16, 1, 0, 0, 0, 145, 146, 5, 124, 0, 0, 146, 18, 1, 0, 0, 0, 147, 151, 5, 58, 0, 0, 148, 149, 5, 58, 0, 0, 149, 151, 5, 58, 0, 0, 150, 147, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 151, 20, 1, 0, 0, 0, 152, 153, 5, 61, 0, 0, 153, 22, 1, 0, 0, 0, 154, 155, 5, 123, 0, 0, 155, 24, 1, 0, 0, 0, 156, 157, 5, 125, 0, 0, 157, 26, 1, 0, 0, 0, 158, 159, 5, 112, 0, 0, 159, 160, 5, 97, 0, 0, 160, 161, 5, 114, 0, 0, 161, 162, 5, 97, 0, 0, 162, 163, 5, 109, 0, 0, 163, 28, 1, 0, 0, 0, 164, 165, 5, 118, 0, 0, 165, 166, 5, 97, 0, 0, 166, 167, 5, 114, 0, 0, 167, 30, 1, 0, 0, 0, 168, 169, 5, 116, 0, 0, 169, 170, 5, 114, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 101, 0, 0, 172, 32, 1, 0, 0, 0, 173, 174, 5, 102, 0, 0, 174, 175, 5, 97, 0, 0, 175, 176, 5, 108, 0, 0, 176, 177, 5, 115, 0, 0, 177, 178, 5, 101, 0, 0, 178, 34, 1, 0, 0, 0, 179, 180, 5, 110, 0, 0, 180, 181, 5, 117, 0, 0, 181, 182, 5, 108, 0, 0, 182, 183, 5, 108, 0, 0, 183, 36, 1, 0, 0, 0, 184, 185, 5, 97, 0, 0, 185, 186, 5, 114, 0, 0, 186, 187, 5, 114, 0, 0, 187, 188, 5, 97, 0, 0, 188, 189, 5, 121, 0, 0, 189, 38, 1, 0, 0, 0, 190, 191, 5, 111, 0, 0, 191, 192, 5, 98, 0, 0, 192, 193, 5, 106, 0, 0, 193, 194, 5, 101, 0, 0, 194, 195, 5, 99, 0, 0, 195, 196, 5, 116, 0, 0, 196, 40, 1, 0, 0, 0, 197, 198, 5, 114, 0, 0, 198, 199, 5, 101, 0, 0, 199, 200, 5, 115, 0, 0, 200, 201, 5, 111, 0, 0, 201, 202, 5, 117, 0, 0, 202, 203, 5, 114, 0, 0, 203, 204, 5, 99, 0, 0, 204, 205, 5, 101, 0, 0, 205, 42, 1, 0, 0, 0, 206, 207, 5, 111, 0, 0, 207, 208, 5, 117, 0, 0, 208, 209, 5, 116, 0, 0, 209, 210, 5, 112, 0, 0, 210, 211, 5, 117, 0, 0, 211, 212, 5, 116, 0, 0, 212, 44, 1, 0, 0, 0, 213, 214, 5, 116, 0, 0, 214, 215, 5, 97, 0, 0, 215, 216, 5, 114, 0, 0, 216, 217, 5, 103, 0, 0, 217, 218, 5, 101, 0, 0, 218, 219, 5, 116, 0, 0, 219, 220, 5, 83, 0, 0, 220, 221, 5, 99, 0, 0, 221, 222, 5, 111, 0, 0, 222, 223, 5, 112, 0, 0, 223, 224, 5, 101, 0, 0, 224, 46, 1, 0, 0, 0, 225, 226, 5, 105, 0, 0, 226, 227, 5, 109, 0, 0, 227, 228, 5, 112, 0, 0, 228, 229, 5, 111, 0, 0, 229, 230, 5, 114, 0, 0, 230, 231, 5, 116, 0, 0, 231, 48, 1, 0, 0, 0, 232, 233, 5, 119, 0, 0, 233, 234, 5, 105, 0, 0, 234, 235, 5, 116, 0, 0, 235, 236, 5, 104, 0, 0, 236, 50, 1, 0, 0, 0, 237, 238, 5, 97, 0, 0, 238, 239, 5, 115, 0, 0, 239, 52, 1, 0, 0, 0, 240, 241, 5, 109, 0, 0, 241, 242, 5, 101, 0, 0, 242, 243, 5, 116, 0, 0, 243, 244, 5, 97, 0, 0, 244, 245, 5, 100, 0, 0, 245, 246, 5, 97, 0, 0, 246, 247, 5, 116, 0, 0, 247, 248, 5, 97, 0, 0, 248, 54, 1, 0, 0, 0, 249, 250, 5, 101, 0, 0, 250, 251, 5, 120, 0, 0, 251, 252, 5, 105, 0, 0, 252, 253, 5, 115, 0, 0, 253, 254, 5, 116, 0, 0, 254, 255, 5, 105, 0, 0, 255, 256, 5, 110, 0, 0, 256, 257, 5, 103, 0, 0, 257, 56, 1, 0, 0, 0, 258, 259, 5, 116, 0, 0, 259, 260, 5, 121, 0, 0, 260, 261, 5, 112, 0, 0, 261, 262, 5, 101, 0, 0, 262, 58, 1, 0, 0, 0, 263, 264, 5, 109, 0, 0, 264, 265, 5, 111, 0, 0, 265, 266, 5, 100, 0, 0, 266, 267, 5, 117, 0, 0, 267, 268, 5, 108, 0, 0, 268, 269, 5, 101, 0, 0, 269, 60, 1, 0, 0, 0, 270, 274, 5, 39, 0, 0, 271, 273, 3, 111, 55, 0, 272, 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 277, 278, 5, 36, 0, 0, 278, 279, 5, 123, 0, 0, 279, 62, 1, 0, 0, 0, 280, 284, 5, 125, 0, 0, 281, 283, 3, 111, 55, 0, 282, 281, 1, 0, 0, 0, 283, 286, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 287, 1, 0, 0, 0, 286, 284, 1, 0, 0, 0, 287, 288, 5, 36, 0, 0, 288, 289, 5, 123, 0, 0, 289, 64, 1, 0, 0, 0, 290, 294, 5, 125, 0, 0, 291, 293, 3, 111, 55, 0, 292, 291, 1, 0, 0, 0, 293, 296, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 297, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 297, 298, 5, 39, 0, 0, 298, 66, 1, 0, 0, 0, 299, 303, 5, 39, 0, 0, 300, 302, 3, 111, 55, 0, 301, 300, 1, 0, 0, 0, 302, 305, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 306, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 306, 307, 5, 39, 0, 0, 307, 68, 1, 0, 0, 0, 308, 309, 5, 115, 0, 0, 309, 310, 5, 116, 0, 0, 310, 311, 5, 114, 0, 0, 311, 312, 5, 105, 0, 0, 312, 313, 5, 110, 0, 0, 313, 314, 5, 103, 0, 0, 314, 70, 1, 0, 0, 0, 315, 316, 5, 105, 0, 0, 316, 317, 5, 110, 0, 0, 317, 318, 5, 116, 0, 0, 318, 72, 1, 0, 0, 0, 319, 320, 5, 98, 0, 0, 320, 321, 5, 111, 0, 0, 321, 322, 5, 111, 0, 0, 322, 323, 5, 108, 0, 0, 323, 74, 1, 0, 0, 0, 324, 325, 5, 105, 0, 0, 325, 326, 5, 102, 0, 0, 326, 76, 1, 0, 0, 0, 327, 328, 5, 102, 0, 0, 328, 329, 5, 111, 0, 0, 329, 330, 5, 114, 0, 0, 330, 78, 1, 0, 0, 0, 331, 332, 5, 105, 0, 0, 332, 333, 5, 110, 0, 0, 333, 80, 1, 0, 0, 0, 334, 335, 5, 63, 0, 0, 335, 82, 1, 0, 0, 0, 336, 337, 5, 62, 0, 0, 337, 84, 1, 0, 0, 0, 338, 339, 5, 62, 0, 0, 339, 340, 5, 61, 0, 0, 340, 86, 1, 0, 0, 0, 341, 342, 5, 60, 0, 0, 342, 88, 1, 0, 0, 0, 343, 344, 5, 60, 0, 0, 344, 345, 5, 61, 0, 0, 345, 90, 1, 0, 0, 0, 346, 347, 5, 61, 0, 0, 347, 348, 5, 61, 0, 0, 348, 92, 1, 0, 0, 0, 349, 350, 5, 33, 0, 0, 350, 351, 5, 61, 0, 0, 351, 94, 1, 0, 0, 0, 352, 353, 5, 61, 0, 0, 353, 354, 5, 62, 0, 0, 354, 96, 1, 0, 0, 0, 355, 359, 7, 0, 0, 0, 356, 358, 7, 1, 0, 0, 357, 356, 1, 0, 0, 0, 358, 361, 1, 0, 0, 0, 359, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 98, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 362, 364, 7, 2, 0, 0, 363, 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 373, 1, 0, 0, 0, 367, 369, 5, 46, 0, 0, 368, 370, 7, 2, 0, 0, 369, 368, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 369, 1, 0, 0, 0, 371, 372, 1, 0, 0, 0, 372, 374, 1, 0, 0, 0, 373, 367, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 100, 1, 0, 0, 0, 375, 377, 7, 3, 0, 0, 376, 375, 1, 0, 0, 0, 377, 378, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 102, 1, 0, 0, 0, 380, 381, 5, 47, 0, 0, 381, 382, 5, 47, 0, 0, 382, 386, 1, 0, 0, 0, 383, 385, 8, 3, 0, 0, 384, 383, 1, 0, 0, 0, 385, 388, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 386, 387, 1, 0, 0, 0, 387, 389, 1, 0, 0, 0, 388, 386, 1, 0, 0, 0, 389, 390, 6, 51, 0, 0, 390, 104, 1, 0, 0, 0, 391, 392, 5, 47, 0, 0, 392, 393, 5, 42, 0, 0, 393, 397, 1, 0, 0, 0, 394, 396, 9, 0, 0, 0, 395, 394, 1, 0, 0, 0, 396, 399, 1, 0, 0, 0, 397, 398, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 398, 400, 1, 0, 0, 0, 399, 397, 1, 0, 0, 0, 400, 401, 5, 42, 0, 0, 401, 402, 5, 47, 0, 0, 402, 403, 1, 0, 0, 0, 403, 404, 6, 52, 0, 0, 404, 106, 1, 0, 0, 0, 405, 407, 7, 4, 0, 0, 406, 405, 1, 0, 0, 0, 407, 408, 1, 0, 0, 0, 408, 406, 1, 0, 0, 0, 408, 409, 1, 0, 0, 0, 409, 410, 1, 0, 0, 0, 410, 411, 6, 53, 0, 0, 411, 108, 1, 0, 0, 0, 412, 413, 9, 0, 0, 0, 413, 110, 1, 0, 0, 0, 414, 417, 8, 5, 0, 0, 415, 417, 3, 113, 56, 0, 416, 414, 1, 0, 0, 0, 416, 415, 1, 0, 0, 0, 417, 112, 1, 0, 0, 0, 418, 430, 5, 92, 0, 0, 419, 431, 7, 6, 0, 0, 420, 421, 5, 117, 0, 0, 421, 422, 5, 123, 0, 0, 422, 424, 1, 0, 0, 0, 423, 425, 3, 115, 57, 0, 424, 423, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 424, 1, 0, 0, 0, 426, 427, 1, 0, 0, 0, 427, 428, 1, 0, 0, 0, 428, 429, 5, 125, 0, 0, 429, 431, 1, 0, 0, 0, 430, 419, 1, 0, 0, 0, 430, 420, 1, 0, 0, 0, 431, 114, 1, 0, 0, 0, 432, 433, 7, 7, 0, 0, 433, 116, 1, 0, 0, 0, 18, 0, 124, 150, 274, 284, 294, 303, 359, 365, 371, 373, 378, 386, 397, 408, 416, 426, 430, 1, 6, 0, 0] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens index deb4cb3d93c..30828ecdad0 100644 --- a/pkg/parser/bicep/antlr/parser/bicepLexer.tokens +++ b/pkg/parser/bicep/antlr/parser/bicepLexer.tokens @@ -45,13 +45,14 @@ LT=44 LTE=45 EQ=46 NEQ=47 -IDENTIFIER=48 -NUMBER=49 -NL=50 -SINGLE_LINE_COMMENT=51 -MULTI_LINE_COMMENT=52 -SPACES=53 -UNKNOWN=54 +ARROW=48 +IDENTIFIER=49 +NUMBER=50 +NL=51 +SINGLE_LINE_COMMENT=52 +MULTI_LINE_COMMENT=53 +SPACES=54 +UNKNOWN=55 '@'=2 ','=3 '['=4 @@ -93,3 +94,4 @@ UNKNOWN=54 '<='=45 '=='=46 '!='=47 +'=>'=48 diff --git a/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go index 742e0f71185..4af209ed435 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go +++ b/pkg/parser/bicep/antlr/parser/bicep_base_visitor.go @@ -16,43 +16,43 @@ func (v *BasebicepVisitor) VisitStatement(ctx *StatementContext) interface{} { return v.VisitChildren(ctx) } -func (v *BasebicepVisitor) VisitParameterDecl(ctx *ParameterDeclContext) interface{} { +func (v *BasebicepVisitor) VisitTargetScopeDecl(ctx *TargetScopeDeclContext) interface{} { return v.VisitChildren(ctx) } -func (v *BasebicepVisitor) VisitParameterDefaultValue(ctx *ParameterDefaultValueContext) interface{} { +func (v *BasebicepVisitor) VisitImportDecl(ctx *ImportDeclContext) interface{} { return v.VisitChildren(ctx) } -func (v *BasebicepVisitor) VisitVariableDecl(ctx *VariableDeclContext) interface{} { +func (v *BasebicepVisitor) VisitMetadataDecl(ctx *MetadataDeclContext) interface{} { return v.VisitChildren(ctx) } -func (v *BasebicepVisitor) VisitResourceDecl(ctx *ResourceDeclContext) interface{} { +func (v *BasebicepVisitor) VisitParameterDecl(ctx *ParameterDeclContext) interface{} { return v.VisitChildren(ctx) } -func (v *BasebicepVisitor) VisitOutputDecl(ctx *OutputDeclContext) interface{} { +func (v *BasebicepVisitor) VisitParameterDefaultValue(ctx *ParameterDefaultValueContext) interface{} { return v.VisitChildren(ctx) } -func (v *BasebicepVisitor) VisitTargetScopeDecl(ctx *TargetScopeDeclContext) interface{} { +func (v *BasebicepVisitor) VisitTypeDecl(ctx *TypeDeclContext) interface{} { return v.VisitChildren(ctx) } -func (v *BasebicepVisitor) VisitImportDecl(ctx *ImportDeclContext) interface{} { +func (v *BasebicepVisitor) VisitVariableDecl(ctx *VariableDeclContext) interface{} { return v.VisitChildren(ctx) } -func (v *BasebicepVisitor) VisitMetadataDecl(ctx *MetadataDeclContext) interface{} { +func (v *BasebicepVisitor) VisitResourceDecl(ctx *ResourceDeclContext) interface{} { return v.VisitChildren(ctx) } -func (v *BasebicepVisitor) VisitTypeDecl(ctx *TypeDeclContext) interface{} { +func (v *BasebicepVisitor) VisitModuleDecl(ctx *ModuleDeclContext) interface{} { return v.VisitChildren(ctx) } -func (v *BasebicepVisitor) VisitModuleDecl(ctx *ModuleDeclContext) interface{} { +func (v *BasebicepVisitor) VisitOutputDecl(ctx *OutputDeclContext) interface{} { return v.VisitChildren(ctx) } @@ -80,6 +80,10 @@ func (v *BasebicepVisitor) VisitExpression(ctx *ExpressionContext) interface{} { return v.VisitChildren(ctx) } +func (v *BasebicepVisitor) VisitLambdaExpression(ctx *LambdaExpressionContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BasebicepVisitor) VisitLogicCharacter(ctx *LogicCharacterContext) interface{} { return v.VisitChildren(ctx) } diff --git a/pkg/parser/bicep/antlr/parser/bicep_lexer.go b/pkg/parser/bicep/antlr/parser/bicep_lexer.go index 5682532ea0a..814a84be2e2 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_lexer.go +++ b/pkg/parser/bicep/antlr/parser/bicep_lexer.go @@ -48,7 +48,7 @@ func biceplexerLexerInit() { "'array'", "'object'", "'resource'", "'output'", "'targetScope'", "'import'", "'with'", "'as'", "'metadata'", "'existing'", "'type'", "'module'", "", "", "", "", "'string'", "'int'", "'bool'", "'if'", "'for'", "'in'", - "'?'", "'>'", "'>='", "'<'", "'<='", "'=='", "'!='", + "'?'", "'>'", "'>='", "'<'", "'<='", "'=='", "'!='", "'=>'", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", @@ -57,8 +57,8 @@ func biceplexerLexerInit() { "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "TYPE", "MODULE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", - "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", - "SPACES", "UNKNOWN", + "EQ", "NEQ", "ARROW", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", + "MULTI_LINE_COMMENT", "SPACES", "UNKNOWN", } staticData.RuleNames = []string{ "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", @@ -67,12 +67,12 @@ func biceplexerLexerInit() { "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "TYPE", "MODULE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", - "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", - "SPACES", "UNKNOWN", "STRINGCHAR", "ESCAPE", "HEX", + "EQ", "NEQ", "ARROW", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", + "MULTI_LINE_COMMENT", "SPACES", "UNKNOWN", "STRINGCHAR", "ESCAPE", "HEX", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 54, 429, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 55, 434, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, @@ -82,186 +82,188 @@ func biceplexerLexerInit() { 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, - 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 121, 8, 0, 10, 0, 12, 0, 124, 9, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, - 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 149, - 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, - 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, - 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, - 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, - 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, - 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, - 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, - 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, - 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, - 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, - 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, - 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 271, 8, 30, 10, 30, 12, 30, - 274, 9, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 5, 31, 281, 8, 31, 10, 31, - 12, 31, 284, 9, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 5, 32, 291, 8, 32, - 10, 32, 12, 32, 294, 9, 32, 1, 32, 1, 32, 1, 33, 1, 33, 5, 33, 300, 8, - 33, 10, 33, 12, 33, 303, 9, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, - 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, - 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, - 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, - 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, - 5, 47, 353, 8, 47, 10, 47, 12, 47, 356, 9, 47, 1, 48, 4, 48, 359, 8, 48, - 11, 48, 12, 48, 360, 1, 48, 1, 48, 4, 48, 365, 8, 48, 11, 48, 12, 48, 366, - 3, 48, 369, 8, 48, 1, 49, 4, 49, 372, 8, 49, 11, 49, 12, 49, 373, 1, 50, - 1, 50, 1, 50, 1, 50, 5, 50, 380, 8, 50, 10, 50, 12, 50, 383, 9, 50, 1, - 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 5, 51, 391, 8, 51, 10, 51, 12, 51, - 394, 9, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 4, 52, 402, 8, 52, - 11, 52, 12, 52, 403, 1, 52, 1, 52, 1, 53, 1, 53, 1, 54, 1, 54, 3, 54, 412, - 8, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 4, 55, 420, 8, 55, 11, - 55, 12, 55, 421, 1, 55, 1, 55, 3, 55, 426, 8, 55, 1, 56, 1, 56, 2, 122, - 392, 0, 57, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, - 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, - 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, - 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, - 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, - 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, - 109, 0, 111, 0, 113, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, - 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, - 9, 9, 32, 32, 5, 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, - 39, 39, 92, 92, 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, - 102, 442, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, - 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, - 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, - 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, - 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, - 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, - 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, - 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, - 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, - 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, - 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, - 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, - 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, - 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, - 107, 1, 0, 0, 0, 1, 115, 1, 0, 0, 0, 3, 129, 1, 0, 0, 0, 5, 131, 1, 0, - 0, 0, 7, 133, 1, 0, 0, 0, 9, 135, 1, 0, 0, 0, 11, 137, 1, 0, 0, 0, 13, - 139, 1, 0, 0, 0, 15, 141, 1, 0, 0, 0, 17, 143, 1, 0, 0, 0, 19, 148, 1, - 0, 0, 0, 21, 150, 1, 0, 0, 0, 23, 152, 1, 0, 0, 0, 25, 154, 1, 0, 0, 0, - 27, 156, 1, 0, 0, 0, 29, 162, 1, 0, 0, 0, 31, 166, 1, 0, 0, 0, 33, 171, - 1, 0, 0, 0, 35, 177, 1, 0, 0, 0, 37, 182, 1, 0, 0, 0, 39, 188, 1, 0, 0, - 0, 41, 195, 1, 0, 0, 0, 43, 204, 1, 0, 0, 0, 45, 211, 1, 0, 0, 0, 47, 223, - 1, 0, 0, 0, 49, 230, 1, 0, 0, 0, 51, 235, 1, 0, 0, 0, 53, 238, 1, 0, 0, - 0, 55, 247, 1, 0, 0, 0, 57, 256, 1, 0, 0, 0, 59, 261, 1, 0, 0, 0, 61, 268, - 1, 0, 0, 0, 63, 278, 1, 0, 0, 0, 65, 288, 1, 0, 0, 0, 67, 297, 1, 0, 0, - 0, 69, 306, 1, 0, 0, 0, 71, 313, 1, 0, 0, 0, 73, 317, 1, 0, 0, 0, 75, 322, - 1, 0, 0, 0, 77, 325, 1, 0, 0, 0, 79, 329, 1, 0, 0, 0, 81, 332, 1, 0, 0, - 0, 83, 334, 1, 0, 0, 0, 85, 336, 1, 0, 0, 0, 87, 339, 1, 0, 0, 0, 89, 341, - 1, 0, 0, 0, 91, 344, 1, 0, 0, 0, 93, 347, 1, 0, 0, 0, 95, 350, 1, 0, 0, - 0, 97, 358, 1, 0, 0, 0, 99, 371, 1, 0, 0, 0, 101, 375, 1, 0, 0, 0, 103, - 386, 1, 0, 0, 0, 105, 401, 1, 0, 0, 0, 107, 407, 1, 0, 0, 0, 109, 411, - 1, 0, 0, 0, 111, 413, 1, 0, 0, 0, 113, 427, 1, 0, 0, 0, 115, 116, 5, 39, - 0, 0, 116, 117, 5, 39, 0, 0, 117, 118, 5, 39, 0, 0, 118, 122, 1, 0, 0, - 0, 119, 121, 9, 0, 0, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, - 123, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, - 1, 0, 0, 0, 125, 126, 5, 39, 0, 0, 126, 127, 5, 39, 0, 0, 127, 128, 5, - 39, 0, 0, 128, 2, 1, 0, 0, 0, 129, 130, 5, 64, 0, 0, 130, 4, 1, 0, 0, 0, - 131, 132, 5, 44, 0, 0, 132, 6, 1, 0, 0, 0, 133, 134, 5, 91, 0, 0, 134, - 8, 1, 0, 0, 0, 135, 136, 5, 93, 0, 0, 136, 10, 1, 0, 0, 0, 137, 138, 5, - 40, 0, 0, 138, 12, 1, 0, 0, 0, 139, 140, 5, 41, 0, 0, 140, 14, 1, 0, 0, - 0, 141, 142, 5, 46, 0, 0, 142, 16, 1, 0, 0, 0, 143, 144, 5, 124, 0, 0, - 144, 18, 1, 0, 0, 0, 145, 149, 5, 58, 0, 0, 146, 147, 5, 58, 0, 0, 147, - 149, 5, 58, 0, 0, 148, 145, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 149, 20, - 1, 0, 0, 0, 150, 151, 5, 61, 0, 0, 151, 22, 1, 0, 0, 0, 152, 153, 5, 123, - 0, 0, 153, 24, 1, 0, 0, 0, 154, 155, 5, 125, 0, 0, 155, 26, 1, 0, 0, 0, - 156, 157, 5, 112, 0, 0, 157, 158, 5, 97, 0, 0, 158, 159, 5, 114, 0, 0, - 159, 160, 5, 97, 0, 0, 160, 161, 5, 109, 0, 0, 161, 28, 1, 0, 0, 0, 162, - 163, 5, 118, 0, 0, 163, 164, 5, 97, 0, 0, 164, 165, 5, 114, 0, 0, 165, - 30, 1, 0, 0, 0, 166, 167, 5, 116, 0, 0, 167, 168, 5, 114, 0, 0, 168, 169, - 5, 117, 0, 0, 169, 170, 5, 101, 0, 0, 170, 32, 1, 0, 0, 0, 171, 172, 5, - 102, 0, 0, 172, 173, 5, 97, 0, 0, 173, 174, 5, 108, 0, 0, 174, 175, 5, - 115, 0, 0, 175, 176, 5, 101, 0, 0, 176, 34, 1, 0, 0, 0, 177, 178, 5, 110, - 0, 0, 178, 179, 5, 117, 0, 0, 179, 180, 5, 108, 0, 0, 180, 181, 5, 108, - 0, 0, 181, 36, 1, 0, 0, 0, 182, 183, 5, 97, 0, 0, 183, 184, 5, 114, 0, - 0, 184, 185, 5, 114, 0, 0, 185, 186, 5, 97, 0, 0, 186, 187, 5, 121, 0, - 0, 187, 38, 1, 0, 0, 0, 188, 189, 5, 111, 0, 0, 189, 190, 5, 98, 0, 0, - 190, 191, 5, 106, 0, 0, 191, 192, 5, 101, 0, 0, 192, 193, 5, 99, 0, 0, - 193, 194, 5, 116, 0, 0, 194, 40, 1, 0, 0, 0, 195, 196, 5, 114, 0, 0, 196, - 197, 5, 101, 0, 0, 197, 198, 5, 115, 0, 0, 198, 199, 5, 111, 0, 0, 199, - 200, 5, 117, 0, 0, 200, 201, 5, 114, 0, 0, 201, 202, 5, 99, 0, 0, 202, - 203, 5, 101, 0, 0, 203, 42, 1, 0, 0, 0, 204, 205, 5, 111, 0, 0, 205, 206, - 5, 117, 0, 0, 206, 207, 5, 116, 0, 0, 207, 208, 5, 112, 0, 0, 208, 209, - 5, 117, 0, 0, 209, 210, 5, 116, 0, 0, 210, 44, 1, 0, 0, 0, 211, 212, 5, - 116, 0, 0, 212, 213, 5, 97, 0, 0, 213, 214, 5, 114, 0, 0, 214, 215, 5, - 103, 0, 0, 215, 216, 5, 101, 0, 0, 216, 217, 5, 116, 0, 0, 217, 218, 5, - 83, 0, 0, 218, 219, 5, 99, 0, 0, 219, 220, 5, 111, 0, 0, 220, 221, 5, 112, - 0, 0, 221, 222, 5, 101, 0, 0, 222, 46, 1, 0, 0, 0, 223, 224, 5, 105, 0, - 0, 224, 225, 5, 109, 0, 0, 225, 226, 5, 112, 0, 0, 226, 227, 5, 111, 0, - 0, 227, 228, 5, 114, 0, 0, 228, 229, 5, 116, 0, 0, 229, 48, 1, 0, 0, 0, - 230, 231, 5, 119, 0, 0, 231, 232, 5, 105, 0, 0, 232, 233, 5, 116, 0, 0, - 233, 234, 5, 104, 0, 0, 234, 50, 1, 0, 0, 0, 235, 236, 5, 97, 0, 0, 236, - 237, 5, 115, 0, 0, 237, 52, 1, 0, 0, 0, 238, 239, 5, 109, 0, 0, 239, 240, - 5, 101, 0, 0, 240, 241, 5, 116, 0, 0, 241, 242, 5, 97, 0, 0, 242, 243, - 5, 100, 0, 0, 243, 244, 5, 97, 0, 0, 244, 245, 5, 116, 0, 0, 245, 246, - 5, 97, 0, 0, 246, 54, 1, 0, 0, 0, 247, 248, 5, 101, 0, 0, 248, 249, 5, - 120, 0, 0, 249, 250, 5, 105, 0, 0, 250, 251, 5, 115, 0, 0, 251, 252, 5, - 116, 0, 0, 252, 253, 5, 105, 0, 0, 253, 254, 5, 110, 0, 0, 254, 255, 5, - 103, 0, 0, 255, 56, 1, 0, 0, 0, 256, 257, 5, 116, 0, 0, 257, 258, 5, 121, - 0, 0, 258, 259, 5, 112, 0, 0, 259, 260, 5, 101, 0, 0, 260, 58, 1, 0, 0, - 0, 261, 262, 5, 109, 0, 0, 262, 263, 5, 111, 0, 0, 263, 264, 5, 100, 0, - 0, 264, 265, 5, 117, 0, 0, 265, 266, 5, 108, 0, 0, 266, 267, 5, 101, 0, - 0, 267, 60, 1, 0, 0, 0, 268, 272, 5, 39, 0, 0, 269, 271, 3, 109, 54, 0, - 270, 269, 1, 0, 0, 0, 271, 274, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, - 273, 1, 0, 0, 0, 273, 275, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 275, 276, - 5, 36, 0, 0, 276, 277, 5, 123, 0, 0, 277, 62, 1, 0, 0, 0, 278, 282, 5, - 125, 0, 0, 279, 281, 3, 109, 54, 0, 280, 279, 1, 0, 0, 0, 281, 284, 1, - 0, 0, 0, 282, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, - 0, 284, 282, 1, 0, 0, 0, 285, 286, 5, 36, 0, 0, 286, 287, 5, 123, 0, 0, - 287, 64, 1, 0, 0, 0, 288, 292, 5, 125, 0, 0, 289, 291, 3, 109, 54, 0, 290, - 289, 1, 0, 0, 0, 291, 294, 1, 0, 0, 0, 292, 290, 1, 0, 0, 0, 292, 293, - 1, 0, 0, 0, 293, 295, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 295, 296, 5, 39, - 0, 0, 296, 66, 1, 0, 0, 0, 297, 301, 5, 39, 0, 0, 298, 300, 3, 109, 54, - 0, 299, 298, 1, 0, 0, 0, 300, 303, 1, 0, 0, 0, 301, 299, 1, 0, 0, 0, 301, - 302, 1, 0, 0, 0, 302, 304, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 304, 305, - 5, 39, 0, 0, 305, 68, 1, 0, 0, 0, 306, 307, 5, 115, 0, 0, 307, 308, 5, - 116, 0, 0, 308, 309, 5, 114, 0, 0, 309, 310, 5, 105, 0, 0, 310, 311, 5, - 110, 0, 0, 311, 312, 5, 103, 0, 0, 312, 70, 1, 0, 0, 0, 313, 314, 5, 105, - 0, 0, 314, 315, 5, 110, 0, 0, 315, 316, 5, 116, 0, 0, 316, 72, 1, 0, 0, - 0, 317, 318, 5, 98, 0, 0, 318, 319, 5, 111, 0, 0, 319, 320, 5, 111, 0, - 0, 320, 321, 5, 108, 0, 0, 321, 74, 1, 0, 0, 0, 322, 323, 5, 105, 0, 0, - 323, 324, 5, 102, 0, 0, 324, 76, 1, 0, 0, 0, 325, 326, 5, 102, 0, 0, 326, - 327, 5, 111, 0, 0, 327, 328, 5, 114, 0, 0, 328, 78, 1, 0, 0, 0, 329, 330, - 5, 105, 0, 0, 330, 331, 5, 110, 0, 0, 331, 80, 1, 0, 0, 0, 332, 333, 5, - 63, 0, 0, 333, 82, 1, 0, 0, 0, 334, 335, 5, 62, 0, 0, 335, 84, 1, 0, 0, - 0, 336, 337, 5, 62, 0, 0, 337, 338, 5, 61, 0, 0, 338, 86, 1, 0, 0, 0, 339, - 340, 5, 60, 0, 0, 340, 88, 1, 0, 0, 0, 341, 342, 5, 60, 0, 0, 342, 343, - 5, 61, 0, 0, 343, 90, 1, 0, 0, 0, 344, 345, 5, 61, 0, 0, 345, 346, 5, 61, - 0, 0, 346, 92, 1, 0, 0, 0, 347, 348, 5, 33, 0, 0, 348, 349, 5, 61, 0, 0, - 349, 94, 1, 0, 0, 0, 350, 354, 7, 0, 0, 0, 351, 353, 7, 1, 0, 0, 352, 351, - 1, 0, 0, 0, 353, 356, 1, 0, 0, 0, 354, 352, 1, 0, 0, 0, 354, 355, 1, 0, - 0, 0, 355, 96, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 357, 359, 7, 2, 0, 0, - 358, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, - 361, 1, 0, 0, 0, 361, 368, 1, 0, 0, 0, 362, 364, 5, 46, 0, 0, 363, 365, - 7, 2, 0, 0, 364, 363, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 364, 1, 0, - 0, 0, 366, 367, 1, 0, 0, 0, 367, 369, 1, 0, 0, 0, 368, 362, 1, 0, 0, 0, - 368, 369, 1, 0, 0, 0, 369, 98, 1, 0, 0, 0, 370, 372, 7, 3, 0, 0, 371, 370, - 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 373, 374, 1, 0, - 0, 0, 374, 100, 1, 0, 0, 0, 375, 376, 5, 47, 0, 0, 376, 377, 5, 47, 0, - 0, 377, 381, 1, 0, 0, 0, 378, 380, 8, 3, 0, 0, 379, 378, 1, 0, 0, 0, 380, - 383, 1, 0, 0, 0, 381, 379, 1, 0, 0, 0, 381, 382, 1, 0, 0, 0, 382, 384, - 1, 0, 0, 0, 383, 381, 1, 0, 0, 0, 384, 385, 6, 50, 0, 0, 385, 102, 1, 0, - 0, 0, 386, 387, 5, 47, 0, 0, 387, 388, 5, 42, 0, 0, 388, 392, 1, 0, 0, - 0, 389, 391, 9, 0, 0, 0, 390, 389, 1, 0, 0, 0, 391, 394, 1, 0, 0, 0, 392, - 393, 1, 0, 0, 0, 392, 390, 1, 0, 0, 0, 393, 395, 1, 0, 0, 0, 394, 392, - 1, 0, 0, 0, 395, 396, 5, 42, 0, 0, 396, 397, 5, 47, 0, 0, 397, 398, 1, - 0, 0, 0, 398, 399, 6, 51, 0, 0, 399, 104, 1, 0, 0, 0, 400, 402, 7, 4, 0, - 0, 401, 400, 1, 0, 0, 0, 402, 403, 1, 0, 0, 0, 403, 401, 1, 0, 0, 0, 403, - 404, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, 406, 6, 52, 0, 0, 406, 106, - 1, 0, 0, 0, 407, 408, 9, 0, 0, 0, 408, 108, 1, 0, 0, 0, 409, 412, 8, 5, - 0, 0, 410, 412, 3, 111, 55, 0, 411, 409, 1, 0, 0, 0, 411, 410, 1, 0, 0, - 0, 412, 110, 1, 0, 0, 0, 413, 425, 5, 92, 0, 0, 414, 426, 7, 6, 0, 0, 415, - 416, 5, 117, 0, 0, 416, 417, 5, 123, 0, 0, 417, 419, 1, 0, 0, 0, 418, 420, - 3, 113, 56, 0, 419, 418, 1, 0, 0, 0, 420, 421, 1, 0, 0, 0, 421, 419, 1, - 0, 0, 0, 421, 422, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 424, 5, 125, - 0, 0, 424, 426, 1, 0, 0, 0, 425, 414, 1, 0, 0, 0, 425, 415, 1, 0, 0, 0, - 426, 112, 1, 0, 0, 0, 427, 428, 7, 7, 0, 0, 428, 114, 1, 0, 0, 0, 18, 0, - 122, 148, 272, 282, 292, 301, 354, 360, 366, 368, 373, 381, 392, 403, 411, - 421, 425, 1, 6, 0, 0, + 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, + 7, 57, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 123, 8, 0, 10, 0, 12, 0, 126, + 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, + 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, + 3, 9, 151, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, + 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, + 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, + 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, + 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, + 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, + 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, + 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, + 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, + 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, + 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, + 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 5, 30, 273, 8, 30, 10, + 30, 12, 30, 276, 9, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 5, 31, 283, + 8, 31, 10, 31, 12, 31, 286, 9, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 5, + 32, 293, 8, 32, 10, 32, 12, 32, 296, 9, 32, 1, 32, 1, 32, 1, 33, 1, 33, + 5, 33, 302, 8, 33, 10, 33, 12, 33, 305, 9, 33, 1, 33, 1, 33, 1, 34, 1, + 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, + 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, + 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, + 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, + 46, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 5, 48, 358, 8, 48, 10, 48, 12, 48, + 361, 9, 48, 1, 49, 4, 49, 364, 8, 49, 11, 49, 12, 49, 365, 1, 49, 1, 49, + 4, 49, 370, 8, 49, 11, 49, 12, 49, 371, 3, 49, 374, 8, 49, 1, 50, 4, 50, + 377, 8, 50, 11, 50, 12, 50, 378, 1, 51, 1, 51, 1, 51, 1, 51, 5, 51, 385, + 8, 51, 10, 51, 12, 51, 388, 9, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, + 52, 5, 52, 396, 8, 52, 10, 52, 12, 52, 399, 9, 52, 1, 52, 1, 52, 1, 52, + 1, 52, 1, 52, 1, 53, 4, 53, 407, 8, 53, 11, 53, 12, 53, 408, 1, 53, 1, + 53, 1, 54, 1, 54, 1, 55, 1, 55, 3, 55, 417, 8, 55, 1, 56, 1, 56, 1, 56, + 1, 56, 1, 56, 1, 56, 4, 56, 425, 8, 56, 11, 56, 12, 56, 426, 1, 56, 1, + 56, 3, 56, 431, 8, 56, 1, 57, 1, 57, 2, 124, 397, 0, 58, 1, 1, 3, 2, 5, + 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, + 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, + 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, + 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, + 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, + 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 0, 113, 0, + 115, 0, 1, 0, 8, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, + 95, 97, 122, 1, 0, 48, 57, 2, 0, 10, 10, 13, 13, 2, 0, 9, 9, 32, 32, 5, + 0, 9, 10, 13, 13, 36, 36, 39, 39, 92, 92, 6, 0, 36, 36, 39, 39, 92, 92, + 110, 110, 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 447, 0, 1, + 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, + 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, + 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, + 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, + 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, + 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, + 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, + 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, + 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, + 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, + 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, + 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, + 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, + 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, + 0, 109, 1, 0, 0, 0, 1, 117, 1, 0, 0, 0, 3, 131, 1, 0, 0, 0, 5, 133, 1, + 0, 0, 0, 7, 135, 1, 0, 0, 0, 9, 137, 1, 0, 0, 0, 11, 139, 1, 0, 0, 0, 13, + 141, 1, 0, 0, 0, 15, 143, 1, 0, 0, 0, 17, 145, 1, 0, 0, 0, 19, 150, 1, + 0, 0, 0, 21, 152, 1, 0, 0, 0, 23, 154, 1, 0, 0, 0, 25, 156, 1, 0, 0, 0, + 27, 158, 1, 0, 0, 0, 29, 164, 1, 0, 0, 0, 31, 168, 1, 0, 0, 0, 33, 173, + 1, 0, 0, 0, 35, 179, 1, 0, 0, 0, 37, 184, 1, 0, 0, 0, 39, 190, 1, 0, 0, + 0, 41, 197, 1, 0, 0, 0, 43, 206, 1, 0, 0, 0, 45, 213, 1, 0, 0, 0, 47, 225, + 1, 0, 0, 0, 49, 232, 1, 0, 0, 0, 51, 237, 1, 0, 0, 0, 53, 240, 1, 0, 0, + 0, 55, 249, 1, 0, 0, 0, 57, 258, 1, 0, 0, 0, 59, 263, 1, 0, 0, 0, 61, 270, + 1, 0, 0, 0, 63, 280, 1, 0, 0, 0, 65, 290, 1, 0, 0, 0, 67, 299, 1, 0, 0, + 0, 69, 308, 1, 0, 0, 0, 71, 315, 1, 0, 0, 0, 73, 319, 1, 0, 0, 0, 75, 324, + 1, 0, 0, 0, 77, 327, 1, 0, 0, 0, 79, 331, 1, 0, 0, 0, 81, 334, 1, 0, 0, + 0, 83, 336, 1, 0, 0, 0, 85, 338, 1, 0, 0, 0, 87, 341, 1, 0, 0, 0, 89, 343, + 1, 0, 0, 0, 91, 346, 1, 0, 0, 0, 93, 349, 1, 0, 0, 0, 95, 352, 1, 0, 0, + 0, 97, 355, 1, 0, 0, 0, 99, 363, 1, 0, 0, 0, 101, 376, 1, 0, 0, 0, 103, + 380, 1, 0, 0, 0, 105, 391, 1, 0, 0, 0, 107, 406, 1, 0, 0, 0, 109, 412, + 1, 0, 0, 0, 111, 416, 1, 0, 0, 0, 113, 418, 1, 0, 0, 0, 115, 432, 1, 0, + 0, 0, 117, 118, 5, 39, 0, 0, 118, 119, 5, 39, 0, 0, 119, 120, 5, 39, 0, + 0, 120, 124, 1, 0, 0, 0, 121, 123, 9, 0, 0, 0, 122, 121, 1, 0, 0, 0, 123, + 126, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 127, + 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 39, 0, 0, 128, 129, 5, 39, + 0, 0, 129, 130, 5, 39, 0, 0, 130, 2, 1, 0, 0, 0, 131, 132, 5, 64, 0, 0, + 132, 4, 1, 0, 0, 0, 133, 134, 5, 44, 0, 0, 134, 6, 1, 0, 0, 0, 135, 136, + 5, 91, 0, 0, 136, 8, 1, 0, 0, 0, 137, 138, 5, 93, 0, 0, 138, 10, 1, 0, + 0, 0, 139, 140, 5, 40, 0, 0, 140, 12, 1, 0, 0, 0, 141, 142, 5, 41, 0, 0, + 142, 14, 1, 0, 0, 0, 143, 144, 5, 46, 0, 0, 144, 16, 1, 0, 0, 0, 145, 146, + 5, 124, 0, 0, 146, 18, 1, 0, 0, 0, 147, 151, 5, 58, 0, 0, 148, 149, 5, + 58, 0, 0, 149, 151, 5, 58, 0, 0, 150, 147, 1, 0, 0, 0, 150, 148, 1, 0, + 0, 0, 151, 20, 1, 0, 0, 0, 152, 153, 5, 61, 0, 0, 153, 22, 1, 0, 0, 0, + 154, 155, 5, 123, 0, 0, 155, 24, 1, 0, 0, 0, 156, 157, 5, 125, 0, 0, 157, + 26, 1, 0, 0, 0, 158, 159, 5, 112, 0, 0, 159, 160, 5, 97, 0, 0, 160, 161, + 5, 114, 0, 0, 161, 162, 5, 97, 0, 0, 162, 163, 5, 109, 0, 0, 163, 28, 1, + 0, 0, 0, 164, 165, 5, 118, 0, 0, 165, 166, 5, 97, 0, 0, 166, 167, 5, 114, + 0, 0, 167, 30, 1, 0, 0, 0, 168, 169, 5, 116, 0, 0, 169, 170, 5, 114, 0, + 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 101, 0, 0, 172, 32, 1, 0, 0, 0, + 173, 174, 5, 102, 0, 0, 174, 175, 5, 97, 0, 0, 175, 176, 5, 108, 0, 0, + 176, 177, 5, 115, 0, 0, 177, 178, 5, 101, 0, 0, 178, 34, 1, 0, 0, 0, 179, + 180, 5, 110, 0, 0, 180, 181, 5, 117, 0, 0, 181, 182, 5, 108, 0, 0, 182, + 183, 5, 108, 0, 0, 183, 36, 1, 0, 0, 0, 184, 185, 5, 97, 0, 0, 185, 186, + 5, 114, 0, 0, 186, 187, 5, 114, 0, 0, 187, 188, 5, 97, 0, 0, 188, 189, + 5, 121, 0, 0, 189, 38, 1, 0, 0, 0, 190, 191, 5, 111, 0, 0, 191, 192, 5, + 98, 0, 0, 192, 193, 5, 106, 0, 0, 193, 194, 5, 101, 0, 0, 194, 195, 5, + 99, 0, 0, 195, 196, 5, 116, 0, 0, 196, 40, 1, 0, 0, 0, 197, 198, 5, 114, + 0, 0, 198, 199, 5, 101, 0, 0, 199, 200, 5, 115, 0, 0, 200, 201, 5, 111, + 0, 0, 201, 202, 5, 117, 0, 0, 202, 203, 5, 114, 0, 0, 203, 204, 5, 99, + 0, 0, 204, 205, 5, 101, 0, 0, 205, 42, 1, 0, 0, 0, 206, 207, 5, 111, 0, + 0, 207, 208, 5, 117, 0, 0, 208, 209, 5, 116, 0, 0, 209, 210, 5, 112, 0, + 0, 210, 211, 5, 117, 0, 0, 211, 212, 5, 116, 0, 0, 212, 44, 1, 0, 0, 0, + 213, 214, 5, 116, 0, 0, 214, 215, 5, 97, 0, 0, 215, 216, 5, 114, 0, 0, + 216, 217, 5, 103, 0, 0, 217, 218, 5, 101, 0, 0, 218, 219, 5, 116, 0, 0, + 219, 220, 5, 83, 0, 0, 220, 221, 5, 99, 0, 0, 221, 222, 5, 111, 0, 0, 222, + 223, 5, 112, 0, 0, 223, 224, 5, 101, 0, 0, 224, 46, 1, 0, 0, 0, 225, 226, + 5, 105, 0, 0, 226, 227, 5, 109, 0, 0, 227, 228, 5, 112, 0, 0, 228, 229, + 5, 111, 0, 0, 229, 230, 5, 114, 0, 0, 230, 231, 5, 116, 0, 0, 231, 48, + 1, 0, 0, 0, 232, 233, 5, 119, 0, 0, 233, 234, 5, 105, 0, 0, 234, 235, 5, + 116, 0, 0, 235, 236, 5, 104, 0, 0, 236, 50, 1, 0, 0, 0, 237, 238, 5, 97, + 0, 0, 238, 239, 5, 115, 0, 0, 239, 52, 1, 0, 0, 0, 240, 241, 5, 109, 0, + 0, 241, 242, 5, 101, 0, 0, 242, 243, 5, 116, 0, 0, 243, 244, 5, 97, 0, + 0, 244, 245, 5, 100, 0, 0, 245, 246, 5, 97, 0, 0, 246, 247, 5, 116, 0, + 0, 247, 248, 5, 97, 0, 0, 248, 54, 1, 0, 0, 0, 249, 250, 5, 101, 0, 0, + 250, 251, 5, 120, 0, 0, 251, 252, 5, 105, 0, 0, 252, 253, 5, 115, 0, 0, + 253, 254, 5, 116, 0, 0, 254, 255, 5, 105, 0, 0, 255, 256, 5, 110, 0, 0, + 256, 257, 5, 103, 0, 0, 257, 56, 1, 0, 0, 0, 258, 259, 5, 116, 0, 0, 259, + 260, 5, 121, 0, 0, 260, 261, 5, 112, 0, 0, 261, 262, 5, 101, 0, 0, 262, + 58, 1, 0, 0, 0, 263, 264, 5, 109, 0, 0, 264, 265, 5, 111, 0, 0, 265, 266, + 5, 100, 0, 0, 266, 267, 5, 117, 0, 0, 267, 268, 5, 108, 0, 0, 268, 269, + 5, 101, 0, 0, 269, 60, 1, 0, 0, 0, 270, 274, 5, 39, 0, 0, 271, 273, 3, + 111, 55, 0, 272, 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, + 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, + 277, 278, 5, 36, 0, 0, 278, 279, 5, 123, 0, 0, 279, 62, 1, 0, 0, 0, 280, + 284, 5, 125, 0, 0, 281, 283, 3, 111, 55, 0, 282, 281, 1, 0, 0, 0, 283, + 286, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 287, + 1, 0, 0, 0, 286, 284, 1, 0, 0, 0, 287, 288, 5, 36, 0, 0, 288, 289, 5, 123, + 0, 0, 289, 64, 1, 0, 0, 0, 290, 294, 5, 125, 0, 0, 291, 293, 3, 111, 55, + 0, 292, 291, 1, 0, 0, 0, 293, 296, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, + 295, 1, 0, 0, 0, 295, 297, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 297, 298, + 5, 39, 0, 0, 298, 66, 1, 0, 0, 0, 299, 303, 5, 39, 0, 0, 300, 302, 3, 111, + 55, 0, 301, 300, 1, 0, 0, 0, 302, 305, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, + 303, 304, 1, 0, 0, 0, 304, 306, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 306, + 307, 5, 39, 0, 0, 307, 68, 1, 0, 0, 0, 308, 309, 5, 115, 0, 0, 309, 310, + 5, 116, 0, 0, 310, 311, 5, 114, 0, 0, 311, 312, 5, 105, 0, 0, 312, 313, + 5, 110, 0, 0, 313, 314, 5, 103, 0, 0, 314, 70, 1, 0, 0, 0, 315, 316, 5, + 105, 0, 0, 316, 317, 5, 110, 0, 0, 317, 318, 5, 116, 0, 0, 318, 72, 1, + 0, 0, 0, 319, 320, 5, 98, 0, 0, 320, 321, 5, 111, 0, 0, 321, 322, 5, 111, + 0, 0, 322, 323, 5, 108, 0, 0, 323, 74, 1, 0, 0, 0, 324, 325, 5, 105, 0, + 0, 325, 326, 5, 102, 0, 0, 326, 76, 1, 0, 0, 0, 327, 328, 5, 102, 0, 0, + 328, 329, 5, 111, 0, 0, 329, 330, 5, 114, 0, 0, 330, 78, 1, 0, 0, 0, 331, + 332, 5, 105, 0, 0, 332, 333, 5, 110, 0, 0, 333, 80, 1, 0, 0, 0, 334, 335, + 5, 63, 0, 0, 335, 82, 1, 0, 0, 0, 336, 337, 5, 62, 0, 0, 337, 84, 1, 0, + 0, 0, 338, 339, 5, 62, 0, 0, 339, 340, 5, 61, 0, 0, 340, 86, 1, 0, 0, 0, + 341, 342, 5, 60, 0, 0, 342, 88, 1, 0, 0, 0, 343, 344, 5, 60, 0, 0, 344, + 345, 5, 61, 0, 0, 345, 90, 1, 0, 0, 0, 346, 347, 5, 61, 0, 0, 347, 348, + 5, 61, 0, 0, 348, 92, 1, 0, 0, 0, 349, 350, 5, 33, 0, 0, 350, 351, 5, 61, + 0, 0, 351, 94, 1, 0, 0, 0, 352, 353, 5, 61, 0, 0, 353, 354, 5, 62, 0, 0, + 354, 96, 1, 0, 0, 0, 355, 359, 7, 0, 0, 0, 356, 358, 7, 1, 0, 0, 357, 356, + 1, 0, 0, 0, 358, 361, 1, 0, 0, 0, 359, 357, 1, 0, 0, 0, 359, 360, 1, 0, + 0, 0, 360, 98, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 362, 364, 7, 2, 0, 0, + 363, 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 365, + 366, 1, 0, 0, 0, 366, 373, 1, 0, 0, 0, 367, 369, 5, 46, 0, 0, 368, 370, + 7, 2, 0, 0, 369, 368, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 369, 1, 0, + 0, 0, 371, 372, 1, 0, 0, 0, 372, 374, 1, 0, 0, 0, 373, 367, 1, 0, 0, 0, + 373, 374, 1, 0, 0, 0, 374, 100, 1, 0, 0, 0, 375, 377, 7, 3, 0, 0, 376, + 375, 1, 0, 0, 0, 377, 378, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 378, 379, + 1, 0, 0, 0, 379, 102, 1, 0, 0, 0, 380, 381, 5, 47, 0, 0, 381, 382, 5, 47, + 0, 0, 382, 386, 1, 0, 0, 0, 383, 385, 8, 3, 0, 0, 384, 383, 1, 0, 0, 0, + 385, 388, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 386, 387, 1, 0, 0, 0, 387, + 389, 1, 0, 0, 0, 388, 386, 1, 0, 0, 0, 389, 390, 6, 51, 0, 0, 390, 104, + 1, 0, 0, 0, 391, 392, 5, 47, 0, 0, 392, 393, 5, 42, 0, 0, 393, 397, 1, + 0, 0, 0, 394, 396, 9, 0, 0, 0, 395, 394, 1, 0, 0, 0, 396, 399, 1, 0, 0, + 0, 397, 398, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 398, 400, 1, 0, 0, 0, 399, + 397, 1, 0, 0, 0, 400, 401, 5, 42, 0, 0, 401, 402, 5, 47, 0, 0, 402, 403, + 1, 0, 0, 0, 403, 404, 6, 52, 0, 0, 404, 106, 1, 0, 0, 0, 405, 407, 7, 4, + 0, 0, 406, 405, 1, 0, 0, 0, 407, 408, 1, 0, 0, 0, 408, 406, 1, 0, 0, 0, + 408, 409, 1, 0, 0, 0, 409, 410, 1, 0, 0, 0, 410, 411, 6, 53, 0, 0, 411, + 108, 1, 0, 0, 0, 412, 413, 9, 0, 0, 0, 413, 110, 1, 0, 0, 0, 414, 417, + 8, 5, 0, 0, 415, 417, 3, 113, 56, 0, 416, 414, 1, 0, 0, 0, 416, 415, 1, + 0, 0, 0, 417, 112, 1, 0, 0, 0, 418, 430, 5, 92, 0, 0, 419, 431, 7, 6, 0, + 0, 420, 421, 5, 117, 0, 0, 421, 422, 5, 123, 0, 0, 422, 424, 1, 0, 0, 0, + 423, 425, 3, 115, 57, 0, 424, 423, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, + 424, 1, 0, 0, 0, 426, 427, 1, 0, 0, 0, 427, 428, 1, 0, 0, 0, 428, 429, + 5, 125, 0, 0, 429, 431, 1, 0, 0, 0, 430, 419, 1, 0, 0, 0, 430, 420, 1, + 0, 0, 0, 431, 114, 1, 0, 0, 0, 432, 433, 7, 7, 0, 0, 433, 116, 1, 0, 0, + 0, 18, 0, 124, 150, 274, 284, 294, 303, 359, 365, 371, 373, 378, 386, 397, + 408, 416, 426, 430, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -349,11 +351,12 @@ const ( bicepLexerLTE = 45 bicepLexerEQ = 46 bicepLexerNEQ = 47 - bicepLexerIDENTIFIER = 48 - bicepLexerNUMBER = 49 - bicepLexerNL = 50 - bicepLexerSINGLE_LINE_COMMENT = 51 - bicepLexerMULTI_LINE_COMMENT = 52 - bicepLexerSPACES = 53 - bicepLexerUNKNOWN = 54 + bicepLexerARROW = 48 + bicepLexerIDENTIFIER = 49 + bicepLexerNUMBER = 50 + bicepLexerNL = 51 + bicepLexerSINGLE_LINE_COMMENT = 52 + bicepLexerMULTI_LINE_COMMENT = 53 + bicepLexerSPACES = 54 + bicepLexerUNKNOWN = 55 ) diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 5c0b6f26940..402689e27ca 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -38,7 +38,7 @@ func bicepParserInit() { "'array'", "'object'", "'resource'", "'output'", "'targetScope'", "'import'", "'with'", "'as'", "'metadata'", "'existing'", "'type'", "'module'", "", "", "", "", "'string'", "'int'", "'bool'", "'if'", "'for'", "'in'", - "'?'", "'>'", "'>='", "'<'", "'<='", "'=='", "'!='", + "'?'", "'>'", "'>='", "'<'", "'<='", "'=='", "'!='", "'=>'", } staticData.SymbolicNames = []string{ "", "MULTILINE_STRING", "AT", "COMMA", "OBRACK", "CBRACK", "OPAR", "CPAR", @@ -47,210 +47,217 @@ func bicepParserInit() { "IMPORT", "WITH", "AS", "METADATA", "EXISTING", "TYPE", "MODULE", "STRING_LEFT_PIECE", "STRING_MIDDLE_PIECE", "STRING_RIGHT_PIECE", "STRING_COMPLETE", "STRING", "INT", "BOOL", "IF", "FOR", "IN", "QMARK", "GT", "GTE", "LT", "LTE", - "EQ", "NEQ", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", - "SPACES", "UNKNOWN", + "EQ", "NEQ", "ARROW", "IDENTIFIER", "NUMBER", "NL", "SINGLE_LINE_COMMENT", + "MULTI_LINE_COMMENT", "SPACES", "UNKNOWN", } staticData.RuleNames = []string{ - "program", "statement", "parameterDecl", "parameterDefaultValue", "variableDecl", - "resourceDecl", "outputDecl", "targetScopeDecl", "importDecl", "metadataDecl", - "typeDecl", "moduleDecl", "ifCondition", "forExpression", "forVariableBlock", - "forBody", "interpString", "expression", "logicCharacter", "primaryExpression", - "parenthesizedExpression", "typeExpression", "literalValue", "object", - "objectProperty", "array", "arrayItem", "decorator", "decoratorExpression", - "functionCall", "argumentList", "identifier", + "program", "statement", "targetScopeDecl", "importDecl", "metadataDecl", + "parameterDecl", "parameterDefaultValue", "typeDecl", "variableDecl", + "resourceDecl", "moduleDecl", "outputDecl", "ifCondition", "forExpression", + "forVariableBlock", "forBody", "interpString", "expression", "lambdaExpression", + "logicCharacter", "primaryExpression", "parenthesizedExpression", "typeExpression", + "literalValue", "object", "objectProperty", "array", "arrayItem", "decorator", + "decoratorExpression", "functionCall", "argumentList", "identifier", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 54, 422, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 55, 436, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, - 31, 1, 0, 5, 0, 66, 8, 0, 10, 0, 12, 0, 69, 9, 0, 1, 0, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 83, 8, 1, 1, 2, - 5, 2, 86, 8, 2, 10, 2, 12, 2, 89, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 95, - 8, 2, 1, 2, 1, 2, 1, 2, 3, 2, 100, 8, 2, 3, 2, 102, 8, 2, 1, 2, 1, 2, 1, - 3, 1, 3, 1, 3, 1, 4, 5, 4, 110, 8, 4, 10, 4, 12, 4, 113, 9, 4, 1, 4, 1, - 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 122, 8, 5, 10, 5, 12, 5, 125, 9, - 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 131, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, - 5, 137, 8, 5, 1, 5, 1, 5, 1, 6, 5, 6, 142, 8, 6, 10, 6, 12, 6, 145, 9, - 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 152, 8, 6, 1, 6, 1, 6, 1, 6, 1, - 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 164, 8, 8, 10, 8, 12, 8, 167, - 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 175, 8, 8, 10, 8, 12, 8, - 178, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 5, 10, - 189, 8, 10, 10, 10, 12, 10, 192, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, - 10, 1, 10, 1, 11, 5, 11, 201, 8, 11, 10, 11, 12, 11, 204, 9, 11, 1, 11, - 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 213, 8, 11, 1, 11, 1, - 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 5, 13, 223, 8, 13, 10, 13, - 12, 13, 226, 9, 13, 1, 13, 1, 13, 1, 13, 3, 13, 231, 8, 13, 1, 13, 1, 13, - 1, 13, 1, 13, 1, 13, 5, 13, 238, 8, 13, 10, 13, 12, 13, 241, 9, 13, 1, - 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 3, 15, - 253, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 259, 8, 16, 10, 16, 12, - 16, 262, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 268, 8, 16, 1, 17, 1, + 31, 2, 32, 7, 32, 1, 0, 5, 0, 68, 8, 0, 10, 0, 12, 0, 71, 9, 0, 1, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 85, + 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 5, 3, 93, 8, 3, 10, 3, 12, 3, + 96, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 104, 8, 3, 10, 3, 12, + 3, 107, 9, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, + 5, 118, 8, 5, 10, 5, 12, 5, 121, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 127, + 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 132, 8, 5, 3, 5, 134, 8, 5, 1, 5, 1, 5, 1, + 6, 1, 6, 1, 6, 1, 7, 5, 7, 142, 8, 7, 10, 7, 12, 7, 145, 9, 7, 1, 7, 1, + 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 154, 8, 8, 10, 8, 12, 8, 157, 9, + 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 5, 9, 166, 8, 9, 10, 9, 12, + 9, 169, 9, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 175, 8, 9, 1, 9, 1, 9, 1, 9, + 1, 9, 3, 9, 181, 8, 9, 1, 9, 1, 9, 1, 10, 5, 10, 186, 8, 10, 10, 10, 12, + 10, 189, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, + 198, 8, 10, 1, 10, 1, 10, 1, 11, 5, 11, 203, 8, 11, 10, 11, 12, 11, 206, + 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 213, 8, 11, 1, 11, 1, + 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 5, 13, 225, + 8, 13, 10, 13, 12, 13, 228, 9, 13, 1, 13, 1, 13, 1, 13, 3, 13, 233, 8, + 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 240, 8, 13, 10, 13, 12, 13, + 243, 9, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, + 15, 1, 15, 3, 15, 255, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 261, 8, + 16, 10, 16, 12, 16, 264, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 270, + 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, - 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, - 17, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 297, 8, 17, 10, 17, 12, 17, 300, - 9, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, - 19, 3, 19, 312, 8, 19, 1, 20, 1, 20, 3, 20, 316, 8, 20, 1, 20, 1, 20, 3, - 20, 320, 8, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, - 1, 22, 3, 22, 331, 8, 22, 1, 23, 1, 23, 4, 23, 335, 8, 23, 11, 23, 12, - 23, 336, 1, 23, 1, 23, 4, 23, 341, 8, 23, 11, 23, 12, 23, 342, 5, 23, 345, - 8, 23, 10, 23, 12, 23, 348, 9, 23, 3, 23, 350, 8, 23, 1, 23, 1, 23, 1, - 24, 1, 24, 3, 24, 356, 8, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, - 363, 8, 25, 10, 25, 12, 25, 366, 9, 25, 1, 25, 5, 25, 369, 8, 25, 10, 25, - 12, 25, 372, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 4, 26, 378, 8, 26, 11, - 26, 12, 26, 379, 1, 26, 3, 26, 383, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, - 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 394, 8, 28, 1, 29, 1, 29, 1, - 29, 3, 29, 399, 8, 29, 1, 29, 3, 29, 402, 8, 29, 1, 29, 3, 29, 405, 8, - 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 3, 30, 412, 8, 30, 1, 30, 5, 30, - 415, 8, 30, 10, 30, 12, 30, 418, 9, 30, 1, 31, 1, 31, 1, 31, 0, 1, 34, - 32, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, - 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 0, 2, 1, 0, 42, - 47, 3, 0, 14, 28, 35, 40, 48, 48, 458, 0, 67, 1, 0, 0, 0, 2, 82, 1, 0, - 0, 0, 4, 87, 1, 0, 0, 0, 6, 105, 1, 0, 0, 0, 8, 111, 1, 0, 0, 0, 10, 123, - 1, 0, 0, 0, 12, 143, 1, 0, 0, 0, 14, 157, 1, 0, 0, 0, 16, 165, 1, 0, 0, - 0, 18, 181, 1, 0, 0, 0, 20, 190, 1, 0, 0, 0, 22, 202, 1, 0, 0, 0, 24, 216, - 1, 0, 0, 0, 26, 220, 1, 0, 0, 0, 28, 244, 1, 0, 0, 0, 30, 252, 1, 0, 0, - 0, 32, 267, 1, 0, 0, 0, 34, 269, 1, 0, 0, 0, 36, 301, 1, 0, 0, 0, 38, 311, - 1, 0, 0, 0, 40, 313, 1, 0, 0, 0, 42, 323, 1, 0, 0, 0, 44, 330, 1, 0, 0, - 0, 46, 332, 1, 0, 0, 0, 48, 355, 1, 0, 0, 0, 50, 360, 1, 0, 0, 0, 52, 375, - 1, 0, 0, 0, 54, 384, 1, 0, 0, 0, 56, 393, 1, 0, 0, 0, 58, 395, 1, 0, 0, - 0, 60, 408, 1, 0, 0, 0, 62, 419, 1, 0, 0, 0, 64, 66, 3, 2, 1, 0, 65, 64, - 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, - 68, 70, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 0, 0, 1, 71, 1, 1, 0, - 0, 0, 72, 83, 3, 4, 2, 0, 73, 83, 3, 8, 4, 0, 74, 83, 3, 10, 5, 0, 75, - 83, 3, 12, 6, 0, 76, 83, 3, 14, 7, 0, 77, 83, 3, 16, 8, 0, 78, 83, 3, 18, - 9, 0, 79, 83, 3, 20, 10, 0, 80, 83, 3, 22, 11, 0, 81, 83, 5, 50, 0, 0, - 82, 72, 1, 0, 0, 0, 82, 73, 1, 0, 0, 0, 82, 74, 1, 0, 0, 0, 82, 75, 1, - 0, 0, 0, 82, 76, 1, 0, 0, 0, 82, 77, 1, 0, 0, 0, 82, 78, 1, 0, 0, 0, 82, - 79, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 81, 1, 0, 0, 0, 83, 3, 1, 0, 0, - 0, 84, 86, 3, 54, 27, 0, 85, 84, 1, 0, 0, 0, 86, 89, 1, 0, 0, 0, 87, 85, - 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 90, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, - 90, 91, 5, 14, 0, 0, 91, 101, 3, 62, 31, 0, 92, 94, 3, 42, 21, 0, 93, 95, - 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 102, 1, 0, 0, 0, - 96, 97, 5, 21, 0, 0, 97, 99, 3, 32, 16, 0, 98, 100, 3, 6, 3, 0, 99, 98, - 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 102, 1, 0, 0, 0, 101, 92, 1, 0, 0, - 0, 101, 96, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 104, 5, 50, 0, 0, 104, - 5, 1, 0, 0, 0, 105, 106, 5, 11, 0, 0, 106, 107, 3, 34, 17, 0, 107, 7, 1, - 0, 0, 0, 108, 110, 3, 54, 27, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, - 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, - 113, 111, 1, 0, 0, 0, 114, 115, 5, 15, 0, 0, 115, 116, 3, 62, 31, 0, 116, - 117, 5, 11, 0, 0, 117, 118, 3, 34, 17, 0, 118, 119, 5, 50, 0, 0, 119, 9, - 1, 0, 0, 0, 120, 122, 3, 54, 27, 0, 121, 120, 1, 0, 0, 0, 122, 125, 1, - 0, 0, 0, 123, 121, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 126, 1, 0, 0, - 0, 125, 123, 1, 0, 0, 0, 126, 127, 5, 21, 0, 0, 127, 128, 3, 62, 31, 0, - 128, 130, 3, 32, 16, 0, 129, 131, 5, 28, 0, 0, 130, 129, 1, 0, 0, 0, 130, - 131, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 136, 5, 11, 0, 0, 133, 137, - 3, 24, 12, 0, 134, 137, 3, 46, 23, 0, 135, 137, 3, 26, 13, 0, 136, 133, - 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 138, 1, 0, - 0, 0, 138, 139, 5, 50, 0, 0, 139, 11, 1, 0, 0, 0, 140, 142, 3, 54, 27, - 0, 141, 140, 1, 0, 0, 0, 142, 145, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, - 144, 1, 0, 0, 0, 144, 146, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 146, 147, - 5, 22, 0, 0, 147, 151, 3, 62, 31, 0, 148, 152, 3, 62, 31, 0, 149, 150, - 5, 21, 0, 0, 150, 152, 3, 32, 16, 0, 151, 148, 1, 0, 0, 0, 151, 149, 1, - 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 11, 0, 0, 154, 155, 3, 34, - 17, 0, 155, 156, 5, 50, 0, 0, 156, 13, 1, 0, 0, 0, 157, 158, 5, 23, 0, - 0, 158, 159, 5, 11, 0, 0, 159, 160, 3, 34, 17, 0, 160, 161, 5, 50, 0, 0, - 161, 15, 1, 0, 0, 0, 162, 164, 3, 54, 27, 0, 163, 162, 1, 0, 0, 0, 164, - 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, - 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 24, 0, 0, 169, 176, 3, 32, - 16, 0, 170, 171, 5, 25, 0, 0, 171, 175, 3, 46, 23, 0, 172, 173, 5, 26, - 0, 0, 173, 175, 3, 62, 31, 0, 174, 170, 1, 0, 0, 0, 174, 172, 1, 0, 0, - 0, 175, 178, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, - 179, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 179, 180, 5, 50, 0, 0, 180, 17, - 1, 0, 0, 0, 181, 182, 5, 27, 0, 0, 182, 183, 3, 62, 31, 0, 183, 184, 5, - 11, 0, 0, 184, 185, 3, 34, 17, 0, 185, 186, 5, 50, 0, 0, 186, 19, 1, 0, - 0, 0, 187, 189, 3, 54, 27, 0, 188, 187, 1, 0, 0, 0, 189, 192, 1, 0, 0, - 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 193, 1, 0, 0, 0, 192, - 190, 1, 0, 0, 0, 193, 194, 5, 29, 0, 0, 194, 195, 3, 62, 31, 0, 195, 196, - 5, 11, 0, 0, 196, 197, 3, 42, 21, 0, 197, 198, 5, 50, 0, 0, 198, 21, 1, - 0, 0, 0, 199, 201, 3, 54, 27, 0, 200, 199, 1, 0, 0, 0, 201, 204, 1, 0, - 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 205, 1, 0, 0, 0, - 204, 202, 1, 0, 0, 0, 205, 206, 5, 30, 0, 0, 206, 207, 3, 62, 31, 0, 207, - 208, 3, 32, 16, 0, 208, 212, 5, 11, 0, 0, 209, 213, 3, 24, 12, 0, 210, - 213, 3, 46, 23, 0, 211, 213, 3, 26, 13, 0, 212, 209, 1, 0, 0, 0, 212, 210, - 1, 0, 0, 0, 212, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 50, - 0, 0, 215, 23, 1, 0, 0, 0, 216, 217, 5, 38, 0, 0, 217, 218, 3, 40, 20, - 0, 218, 219, 3, 46, 23, 0, 219, 25, 1, 0, 0, 0, 220, 224, 5, 4, 0, 0, 221, - 223, 5, 50, 0, 0, 222, 221, 1, 0, 0, 0, 223, 226, 1, 0, 0, 0, 224, 222, - 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 227, 1, 0, 0, 0, 226, 224, 1, 0, - 0, 0, 227, 230, 5, 39, 0, 0, 228, 231, 3, 62, 31, 0, 229, 231, 3, 28, 14, - 0, 230, 228, 1, 0, 0, 0, 230, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, - 233, 5, 40, 0, 0, 233, 234, 3, 34, 17, 0, 234, 235, 5, 10, 0, 0, 235, 239, - 3, 30, 15, 0, 236, 238, 5, 50, 0, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, - 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, - 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 5, 0, 0, 243, 27, 1, 0, 0, 0, 244, - 245, 5, 6, 0, 0, 245, 246, 3, 62, 31, 0, 246, 247, 5, 3, 0, 0, 247, 248, - 3, 62, 31, 0, 248, 249, 5, 7, 0, 0, 249, 29, 1, 0, 0, 0, 250, 253, 3, 34, - 17, 0, 251, 253, 3, 24, 12, 0, 252, 250, 1, 0, 0, 0, 252, 251, 1, 0, 0, - 0, 253, 31, 1, 0, 0, 0, 254, 260, 5, 31, 0, 0, 255, 256, 3, 34, 17, 0, - 256, 257, 5, 32, 0, 0, 257, 259, 1, 0, 0, 0, 258, 255, 1, 0, 0, 0, 259, - 262, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 263, - 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 263, 264, 3, 34, 17, 0, 264, 265, 5, - 33, 0, 0, 265, 268, 1, 0, 0, 0, 266, 268, 5, 34, 0, 0, 267, 254, 1, 0, - 0, 0, 267, 266, 1, 0, 0, 0, 268, 33, 1, 0, 0, 0, 269, 270, 6, 17, -1, 0, - 270, 271, 3, 38, 19, 0, 271, 298, 1, 0, 0, 0, 272, 273, 10, 6, 0, 0, 273, - 274, 5, 41, 0, 0, 274, 275, 3, 34, 17, 0, 275, 276, 5, 10, 0, 0, 276, 277, - 3, 34, 17, 7, 277, 297, 1, 0, 0, 0, 278, 279, 10, 2, 0, 0, 279, 280, 3, - 36, 18, 0, 280, 281, 3, 34, 17, 3, 281, 297, 1, 0, 0, 0, 282, 283, 10, - 7, 0, 0, 283, 284, 5, 4, 0, 0, 284, 285, 3, 34, 17, 0, 285, 286, 5, 5, - 0, 0, 286, 297, 1, 0, 0, 0, 287, 288, 10, 5, 0, 0, 288, 289, 5, 8, 0, 0, - 289, 297, 3, 62, 31, 0, 290, 291, 10, 4, 0, 0, 291, 292, 5, 8, 0, 0, 292, - 297, 3, 58, 29, 0, 293, 294, 10, 3, 0, 0, 294, 295, 5, 10, 0, 0, 295, 297, - 3, 62, 31, 0, 296, 272, 1, 0, 0, 0, 296, 278, 1, 0, 0, 0, 296, 282, 1, - 0, 0, 0, 296, 287, 1, 0, 0, 0, 296, 290, 1, 0, 0, 0, 296, 293, 1, 0, 0, - 0, 297, 300, 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, - 35, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 301, 302, 7, 0, 0, 0, 302, 37, 1, - 0, 0, 0, 303, 312, 3, 44, 22, 0, 304, 312, 3, 58, 29, 0, 305, 312, 3, 32, - 16, 0, 306, 312, 5, 1, 0, 0, 307, 312, 3, 50, 25, 0, 308, 312, 3, 46, 23, - 0, 309, 312, 3, 26, 13, 0, 310, 312, 3, 40, 20, 0, 311, 303, 1, 0, 0, 0, - 311, 304, 1, 0, 0, 0, 311, 305, 1, 0, 0, 0, 311, 306, 1, 0, 0, 0, 311, - 307, 1, 0, 0, 0, 311, 308, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, 311, 310, - 1, 0, 0, 0, 312, 39, 1, 0, 0, 0, 313, 315, 5, 6, 0, 0, 314, 316, 5, 50, - 0, 0, 315, 314, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, - 317, 319, 3, 34, 17, 0, 318, 320, 5, 50, 0, 0, 319, 318, 1, 0, 0, 0, 319, - 320, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, 5, 7, 0, 0, 322, 41, 1, - 0, 0, 0, 323, 324, 3, 62, 31, 0, 324, 43, 1, 0, 0, 0, 325, 331, 5, 49, - 0, 0, 326, 331, 5, 16, 0, 0, 327, 331, 5, 17, 0, 0, 328, 331, 5, 18, 0, - 0, 329, 331, 3, 62, 31, 0, 330, 325, 1, 0, 0, 0, 330, 326, 1, 0, 0, 0, - 330, 327, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 329, 1, 0, 0, 0, 331, - 45, 1, 0, 0, 0, 332, 349, 5, 12, 0, 0, 333, 335, 5, 50, 0, 0, 334, 333, - 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, - 0, 0, 337, 346, 1, 0, 0, 0, 338, 340, 3, 48, 24, 0, 339, 341, 5, 50, 0, - 0, 340, 339, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, - 343, 1, 0, 0, 0, 343, 345, 1, 0, 0, 0, 344, 338, 1, 0, 0, 0, 345, 348, - 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 350, 1, 0, - 0, 0, 348, 346, 1, 0, 0, 0, 349, 334, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, - 350, 351, 1, 0, 0, 0, 351, 352, 5, 13, 0, 0, 352, 47, 1, 0, 0, 0, 353, - 356, 3, 62, 31, 0, 354, 356, 3, 32, 16, 0, 355, 353, 1, 0, 0, 0, 355, 354, - 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 358, 5, 10, 0, 0, 358, 359, 3, 34, - 17, 0, 359, 49, 1, 0, 0, 0, 360, 364, 5, 4, 0, 0, 361, 363, 5, 50, 0, 0, - 362, 361, 1, 0, 0, 0, 363, 366, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 364, - 365, 1, 0, 0, 0, 365, 370, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, 367, 369, - 3, 52, 26, 0, 368, 367, 1, 0, 0, 0, 369, 372, 1, 0, 0, 0, 370, 368, 1, - 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 373, 1, 0, 0, 0, 372, 370, 1, 0, 0, - 0, 373, 374, 5, 5, 0, 0, 374, 51, 1, 0, 0, 0, 375, 382, 3, 34, 17, 0, 376, - 378, 5, 50, 0, 0, 377, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 377, - 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 383, 1, 0, 0, 0, 381, 383, 5, 3, - 0, 0, 382, 377, 1, 0, 0, 0, 382, 381, 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, - 383, 53, 1, 0, 0, 0, 384, 385, 5, 2, 0, 0, 385, 386, 3, 56, 28, 0, 386, - 387, 5, 50, 0, 0, 387, 55, 1, 0, 0, 0, 388, 394, 3, 58, 29, 0, 389, 390, - 3, 34, 17, 0, 390, 391, 5, 8, 0, 0, 391, 392, 3, 58, 29, 0, 392, 394, 1, - 0, 0, 0, 393, 388, 1, 0, 0, 0, 393, 389, 1, 0, 0, 0, 394, 57, 1, 0, 0, - 0, 395, 396, 3, 62, 31, 0, 396, 401, 5, 6, 0, 0, 397, 399, 5, 50, 0, 0, - 398, 397, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 400, 1, 0, 0, 0, 400, - 402, 3, 60, 30, 0, 401, 398, 1, 0, 0, 0, 401, 402, 1, 0, 0, 0, 402, 404, - 1, 0, 0, 0, 403, 405, 5, 50, 0, 0, 404, 403, 1, 0, 0, 0, 404, 405, 1, 0, - 0, 0, 405, 406, 1, 0, 0, 0, 406, 407, 5, 7, 0, 0, 407, 59, 1, 0, 0, 0, - 408, 416, 3, 34, 17, 0, 409, 411, 5, 3, 0, 0, 410, 412, 5, 50, 0, 0, 411, - 410, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 415, - 3, 34, 17, 0, 414, 409, 1, 0, 0, 0, 415, 418, 1, 0, 0, 0, 416, 414, 1, - 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 61, 1, 0, 0, 0, 418, 416, 1, 0, 0, - 0, 419, 420, 7, 1, 0, 0, 420, 63, 1, 0, 0, 0, 45, 67, 82, 87, 94, 99, 101, - 111, 123, 130, 136, 143, 151, 165, 174, 176, 190, 202, 212, 224, 230, 239, - 252, 260, 267, 296, 298, 311, 315, 319, 330, 336, 342, 346, 349, 355, 364, - 370, 379, 382, 393, 398, 401, 404, 411, 416, + 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 299, 8, 17, 10, + 17, 12, 17, 302, 9, 17, 1, 18, 1, 18, 3, 18, 306, 8, 18, 1, 18, 1, 18, + 3, 18, 310, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 326, 8, 20, 1, 21, + 1, 21, 3, 21, 330, 8, 21, 1, 21, 1, 21, 3, 21, 334, 8, 21, 1, 21, 1, 21, + 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 345, 8, 23, 1, + 24, 1, 24, 4, 24, 349, 8, 24, 11, 24, 12, 24, 350, 1, 24, 1, 24, 4, 24, + 355, 8, 24, 11, 24, 12, 24, 356, 5, 24, 359, 8, 24, 10, 24, 12, 24, 362, + 9, 24, 3, 24, 364, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 3, 25, 370, 8, 25, + 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 5, 26, 377, 8, 26, 10, 26, 12, 26, 380, + 9, 26, 1, 26, 5, 26, 383, 8, 26, 10, 26, 12, 26, 386, 9, 26, 1, 26, 1, + 26, 1, 27, 1, 27, 4, 27, 392, 8, 27, 11, 27, 12, 27, 393, 1, 27, 3, 27, + 397, 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, + 29, 3, 29, 408, 8, 29, 1, 30, 1, 30, 1, 30, 3, 30, 413, 8, 30, 1, 30, 3, + 30, 416, 8, 30, 1, 30, 3, 30, 419, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, + 31, 3, 31, 426, 8, 31, 1, 31, 5, 31, 429, 8, 31, 10, 31, 12, 31, 432, 9, + 31, 1, 32, 1, 32, 1, 32, 0, 1, 34, 33, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, + 56, 58, 60, 62, 64, 0, 2, 1, 0, 42, 47, 3, 0, 14, 28, 35, 40, 49, 49, 474, + 0, 69, 1, 0, 0, 0, 2, 84, 1, 0, 0, 0, 4, 86, 1, 0, 0, 0, 6, 94, 1, 0, 0, + 0, 8, 110, 1, 0, 0, 0, 10, 119, 1, 0, 0, 0, 12, 137, 1, 0, 0, 0, 14, 143, + 1, 0, 0, 0, 16, 155, 1, 0, 0, 0, 18, 167, 1, 0, 0, 0, 20, 187, 1, 0, 0, + 0, 22, 204, 1, 0, 0, 0, 24, 218, 1, 0, 0, 0, 26, 222, 1, 0, 0, 0, 28, 246, + 1, 0, 0, 0, 30, 254, 1, 0, 0, 0, 32, 269, 1, 0, 0, 0, 34, 271, 1, 0, 0, + 0, 36, 309, 1, 0, 0, 0, 38, 314, 1, 0, 0, 0, 40, 325, 1, 0, 0, 0, 42, 327, + 1, 0, 0, 0, 44, 337, 1, 0, 0, 0, 46, 344, 1, 0, 0, 0, 48, 346, 1, 0, 0, + 0, 50, 369, 1, 0, 0, 0, 52, 374, 1, 0, 0, 0, 54, 389, 1, 0, 0, 0, 56, 398, + 1, 0, 0, 0, 58, 407, 1, 0, 0, 0, 60, 409, 1, 0, 0, 0, 62, 422, 1, 0, 0, + 0, 64, 433, 1, 0, 0, 0, 66, 68, 3, 2, 1, 0, 67, 66, 1, 0, 0, 0, 68, 71, + 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, + 71, 69, 1, 0, 0, 0, 72, 73, 5, 0, 0, 1, 73, 1, 1, 0, 0, 0, 74, 85, 3, 4, + 2, 0, 75, 85, 3, 6, 3, 0, 76, 85, 3, 8, 4, 0, 77, 85, 3, 10, 5, 0, 78, + 85, 3, 14, 7, 0, 79, 85, 3, 16, 8, 0, 80, 85, 3, 18, 9, 0, 81, 85, 3, 20, + 10, 0, 82, 85, 3, 22, 11, 0, 83, 85, 5, 51, 0, 0, 84, 74, 1, 0, 0, 0, 84, + 75, 1, 0, 0, 0, 84, 76, 1, 0, 0, 0, 84, 77, 1, 0, 0, 0, 84, 78, 1, 0, 0, + 0, 84, 79, 1, 0, 0, 0, 84, 80, 1, 0, 0, 0, 84, 81, 1, 0, 0, 0, 84, 82, + 1, 0, 0, 0, 84, 83, 1, 0, 0, 0, 85, 3, 1, 0, 0, 0, 86, 87, 5, 23, 0, 0, + 87, 88, 5, 11, 0, 0, 88, 89, 3, 34, 17, 0, 89, 90, 5, 51, 0, 0, 90, 5, + 1, 0, 0, 0, 91, 93, 3, 56, 28, 0, 92, 91, 1, 0, 0, 0, 93, 96, 1, 0, 0, + 0, 94, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 1, 0, 0, 0, 96, 94, + 1, 0, 0, 0, 97, 98, 5, 24, 0, 0, 98, 105, 3, 32, 16, 0, 99, 100, 5, 25, + 0, 0, 100, 104, 3, 48, 24, 0, 101, 102, 5, 26, 0, 0, 102, 104, 3, 64, 32, + 0, 103, 99, 1, 0, 0, 0, 103, 101, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, + 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, + 1, 0, 0, 0, 108, 109, 5, 51, 0, 0, 109, 7, 1, 0, 0, 0, 110, 111, 5, 27, + 0, 0, 111, 112, 3, 64, 32, 0, 112, 113, 5, 11, 0, 0, 113, 114, 3, 34, 17, + 0, 114, 115, 5, 51, 0, 0, 115, 9, 1, 0, 0, 0, 116, 118, 3, 56, 28, 0, 117, + 116, 1, 0, 0, 0, 118, 121, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, + 1, 0, 0, 0, 120, 122, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 122, 123, 5, 14, + 0, 0, 123, 133, 3, 64, 32, 0, 124, 126, 3, 44, 22, 0, 125, 127, 3, 12, + 6, 0, 126, 125, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 134, 1, 0, 0, 0, + 128, 129, 5, 21, 0, 0, 129, 131, 3, 32, 16, 0, 130, 132, 3, 12, 6, 0, 131, + 130, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 134, 1, 0, 0, 0, 133, 124, + 1, 0, 0, 0, 133, 128, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 51, + 0, 0, 136, 11, 1, 0, 0, 0, 137, 138, 5, 11, 0, 0, 138, 139, 3, 34, 17, + 0, 139, 13, 1, 0, 0, 0, 140, 142, 3, 56, 28, 0, 141, 140, 1, 0, 0, 0, 142, + 145, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 146, + 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 146, 147, 5, 29, 0, 0, 147, 148, 3, 64, + 32, 0, 148, 149, 5, 11, 0, 0, 149, 150, 3, 44, 22, 0, 150, 151, 5, 51, + 0, 0, 151, 15, 1, 0, 0, 0, 152, 154, 3, 56, 28, 0, 153, 152, 1, 0, 0, 0, + 154, 157, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, + 158, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 158, 159, 5, 15, 0, 0, 159, 160, + 3, 64, 32, 0, 160, 161, 5, 11, 0, 0, 161, 162, 3, 34, 17, 0, 162, 163, + 5, 51, 0, 0, 163, 17, 1, 0, 0, 0, 164, 166, 3, 56, 28, 0, 165, 164, 1, + 0, 0, 0, 166, 169, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 167, 168, 1, 0, 0, + 0, 168, 170, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 170, 171, 5, 21, 0, 0, 171, + 172, 3, 64, 32, 0, 172, 174, 3, 32, 16, 0, 173, 175, 5, 28, 0, 0, 174, + 173, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 180, + 5, 11, 0, 0, 177, 181, 3, 24, 12, 0, 178, 181, 3, 48, 24, 0, 179, 181, + 3, 26, 13, 0, 180, 177, 1, 0, 0, 0, 180, 178, 1, 0, 0, 0, 180, 179, 1, + 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 183, 5, 51, 0, 0, 183, 19, 1, 0, 0, + 0, 184, 186, 3, 56, 28, 0, 185, 184, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, + 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 190, 1, 0, 0, 0, 189, + 187, 1, 0, 0, 0, 190, 191, 5, 30, 0, 0, 191, 192, 3, 64, 32, 0, 192, 193, + 3, 32, 16, 0, 193, 197, 5, 11, 0, 0, 194, 198, 3, 24, 12, 0, 195, 198, + 3, 48, 24, 0, 196, 198, 3, 26, 13, 0, 197, 194, 1, 0, 0, 0, 197, 195, 1, + 0, 0, 0, 197, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 200, 5, 51, 0, + 0, 200, 21, 1, 0, 0, 0, 201, 203, 3, 56, 28, 0, 202, 201, 1, 0, 0, 0, 203, + 206, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 207, + 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 207, 208, 5, 22, 0, 0, 208, 212, 3, 64, + 32, 0, 209, 213, 3, 64, 32, 0, 210, 211, 5, 21, 0, 0, 211, 213, 3, 32, + 16, 0, 212, 209, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, + 214, 215, 5, 11, 0, 0, 215, 216, 3, 34, 17, 0, 216, 217, 5, 51, 0, 0, 217, + 23, 1, 0, 0, 0, 218, 219, 5, 38, 0, 0, 219, 220, 3, 42, 21, 0, 220, 221, + 3, 48, 24, 0, 221, 25, 1, 0, 0, 0, 222, 226, 5, 4, 0, 0, 223, 225, 5, 51, + 0, 0, 224, 223, 1, 0, 0, 0, 225, 228, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, + 226, 227, 1, 0, 0, 0, 227, 229, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 229, + 232, 5, 39, 0, 0, 230, 233, 3, 64, 32, 0, 231, 233, 3, 28, 14, 0, 232, + 230, 1, 0, 0, 0, 232, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 235, + 5, 40, 0, 0, 235, 236, 3, 34, 17, 0, 236, 237, 5, 10, 0, 0, 237, 241, 3, + 30, 15, 0, 238, 240, 5, 51, 0, 0, 239, 238, 1, 0, 0, 0, 240, 243, 1, 0, + 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 1, 0, 0, 0, + 243, 241, 1, 0, 0, 0, 244, 245, 5, 5, 0, 0, 245, 27, 1, 0, 0, 0, 246, 247, + 5, 6, 0, 0, 247, 248, 3, 64, 32, 0, 248, 249, 5, 3, 0, 0, 249, 250, 3, + 64, 32, 0, 250, 251, 5, 7, 0, 0, 251, 29, 1, 0, 0, 0, 252, 255, 3, 34, + 17, 0, 253, 255, 3, 24, 12, 0, 254, 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, + 0, 255, 31, 1, 0, 0, 0, 256, 262, 5, 31, 0, 0, 257, 258, 3, 34, 17, 0, + 258, 259, 5, 32, 0, 0, 259, 261, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 261, + 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, + 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 3, 34, 17, 0, 266, 267, 5, + 33, 0, 0, 267, 270, 1, 0, 0, 0, 268, 270, 5, 34, 0, 0, 269, 256, 1, 0, + 0, 0, 269, 268, 1, 0, 0, 0, 270, 33, 1, 0, 0, 0, 271, 272, 6, 17, -1, 0, + 272, 273, 3, 40, 20, 0, 273, 300, 1, 0, 0, 0, 274, 275, 10, 6, 0, 0, 275, + 276, 5, 41, 0, 0, 276, 277, 3, 34, 17, 0, 277, 278, 5, 10, 0, 0, 278, 279, + 3, 34, 17, 7, 279, 299, 1, 0, 0, 0, 280, 281, 10, 2, 0, 0, 281, 282, 3, + 38, 19, 0, 282, 283, 3, 34, 17, 3, 283, 299, 1, 0, 0, 0, 284, 285, 10, + 7, 0, 0, 285, 286, 5, 4, 0, 0, 286, 287, 3, 34, 17, 0, 287, 288, 5, 5, + 0, 0, 288, 299, 1, 0, 0, 0, 289, 290, 10, 5, 0, 0, 290, 291, 5, 8, 0, 0, + 291, 299, 3, 64, 32, 0, 292, 293, 10, 4, 0, 0, 293, 294, 5, 8, 0, 0, 294, + 299, 3, 60, 30, 0, 295, 296, 10, 3, 0, 0, 296, 297, 5, 10, 0, 0, 297, 299, + 3, 64, 32, 0, 298, 274, 1, 0, 0, 0, 298, 280, 1, 0, 0, 0, 298, 284, 1, + 0, 0, 0, 298, 289, 1, 0, 0, 0, 298, 292, 1, 0, 0, 0, 298, 295, 1, 0, 0, + 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, + 35, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 303, 305, 5, 6, 0, 0, 304, 306, 3, + 62, 31, 0, 305, 304, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 1, 0, + 0, 0, 307, 310, 5, 7, 0, 0, 308, 310, 3, 64, 32, 0, 309, 303, 1, 0, 0, + 0, 309, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 312, 5, 48, 0, 0, 312, + 313, 3, 34, 17, 0, 313, 37, 1, 0, 0, 0, 314, 315, 7, 0, 0, 0, 315, 39, + 1, 0, 0, 0, 316, 326, 3, 46, 23, 0, 317, 326, 3, 60, 30, 0, 318, 326, 3, + 32, 16, 0, 319, 326, 5, 1, 0, 0, 320, 326, 3, 52, 26, 0, 321, 326, 3, 48, + 24, 0, 322, 326, 3, 26, 13, 0, 323, 326, 3, 42, 21, 0, 324, 326, 3, 36, + 18, 0, 325, 316, 1, 0, 0, 0, 325, 317, 1, 0, 0, 0, 325, 318, 1, 0, 0, 0, + 325, 319, 1, 0, 0, 0, 325, 320, 1, 0, 0, 0, 325, 321, 1, 0, 0, 0, 325, + 322, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 325, 324, 1, 0, 0, 0, 326, 41, 1, + 0, 0, 0, 327, 329, 5, 6, 0, 0, 328, 330, 5, 51, 0, 0, 329, 328, 1, 0, 0, + 0, 329, 330, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 3, 34, 17, 0, + 332, 334, 5, 51, 0, 0, 333, 332, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, + 335, 1, 0, 0, 0, 335, 336, 5, 7, 0, 0, 336, 43, 1, 0, 0, 0, 337, 338, 3, + 64, 32, 0, 338, 45, 1, 0, 0, 0, 339, 345, 5, 50, 0, 0, 340, 345, 5, 16, + 0, 0, 341, 345, 5, 17, 0, 0, 342, 345, 5, 18, 0, 0, 343, 345, 3, 64, 32, + 0, 344, 339, 1, 0, 0, 0, 344, 340, 1, 0, 0, 0, 344, 341, 1, 0, 0, 0, 344, + 342, 1, 0, 0, 0, 344, 343, 1, 0, 0, 0, 345, 47, 1, 0, 0, 0, 346, 363, 5, + 12, 0, 0, 347, 349, 5, 51, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, + 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 360, 1, 0, 0, 0, + 352, 354, 3, 50, 25, 0, 353, 355, 5, 51, 0, 0, 354, 353, 1, 0, 0, 0, 355, + 356, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 359, + 1, 0, 0, 0, 358, 352, 1, 0, 0, 0, 359, 362, 1, 0, 0, 0, 360, 358, 1, 0, + 0, 0, 360, 361, 1, 0, 0, 0, 361, 364, 1, 0, 0, 0, 362, 360, 1, 0, 0, 0, + 363, 348, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, + 366, 5, 13, 0, 0, 366, 49, 1, 0, 0, 0, 367, 370, 3, 64, 32, 0, 368, 370, + 3, 32, 16, 0, 369, 367, 1, 0, 0, 0, 369, 368, 1, 0, 0, 0, 370, 371, 1, + 0, 0, 0, 371, 372, 5, 10, 0, 0, 372, 373, 3, 34, 17, 0, 373, 51, 1, 0, + 0, 0, 374, 378, 5, 4, 0, 0, 375, 377, 5, 51, 0, 0, 376, 375, 1, 0, 0, 0, + 377, 380, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, + 384, 1, 0, 0, 0, 380, 378, 1, 0, 0, 0, 381, 383, 3, 54, 27, 0, 382, 381, + 1, 0, 0, 0, 383, 386, 1, 0, 0, 0, 384, 382, 1, 0, 0, 0, 384, 385, 1, 0, + 0, 0, 385, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 388, 5, 5, 0, 0, + 388, 53, 1, 0, 0, 0, 389, 396, 3, 34, 17, 0, 390, 392, 5, 51, 0, 0, 391, + 390, 1, 0, 0, 0, 392, 393, 1, 0, 0, 0, 393, 391, 1, 0, 0, 0, 393, 394, + 1, 0, 0, 0, 394, 397, 1, 0, 0, 0, 395, 397, 5, 3, 0, 0, 396, 391, 1, 0, + 0, 0, 396, 395, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 55, 1, 0, 0, 0, + 398, 399, 5, 2, 0, 0, 399, 400, 3, 58, 29, 0, 400, 401, 5, 51, 0, 0, 401, + 57, 1, 0, 0, 0, 402, 408, 3, 60, 30, 0, 403, 404, 3, 34, 17, 0, 404, 405, + 5, 8, 0, 0, 405, 406, 3, 60, 30, 0, 406, 408, 1, 0, 0, 0, 407, 402, 1, + 0, 0, 0, 407, 403, 1, 0, 0, 0, 408, 59, 1, 0, 0, 0, 409, 410, 3, 64, 32, + 0, 410, 415, 5, 6, 0, 0, 411, 413, 5, 51, 0, 0, 412, 411, 1, 0, 0, 0, 412, + 413, 1, 0, 0, 0, 413, 414, 1, 0, 0, 0, 414, 416, 3, 62, 31, 0, 415, 412, + 1, 0, 0, 0, 415, 416, 1, 0, 0, 0, 416, 418, 1, 0, 0, 0, 417, 419, 5, 51, + 0, 0, 418, 417, 1, 0, 0, 0, 418, 419, 1, 0, 0, 0, 419, 420, 1, 0, 0, 0, + 420, 421, 5, 7, 0, 0, 421, 61, 1, 0, 0, 0, 422, 430, 3, 34, 17, 0, 423, + 425, 5, 3, 0, 0, 424, 426, 5, 51, 0, 0, 425, 424, 1, 0, 0, 0, 425, 426, + 1, 0, 0, 0, 426, 427, 1, 0, 0, 0, 427, 429, 3, 34, 17, 0, 428, 423, 1, + 0, 0, 0, 429, 432, 1, 0, 0, 0, 430, 428, 1, 0, 0, 0, 430, 431, 1, 0, 0, + 0, 431, 63, 1, 0, 0, 0, 432, 430, 1, 0, 0, 0, 433, 434, 7, 1, 0, 0, 434, + 65, 1, 0, 0, 0, 47, 69, 84, 94, 103, 105, 119, 126, 131, 133, 143, 155, + 167, 174, 180, 187, 197, 204, 212, 226, 232, 241, 254, 262, 269, 298, 300, + 305, 309, 325, 329, 333, 344, 350, 356, 360, 363, 369, 378, 384, 393, 396, + 407, 412, 415, 418, 425, 430, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -336,49 +343,51 @@ const ( bicepParserLTE = 45 bicepParserEQ = 46 bicepParserNEQ = 47 - bicepParserIDENTIFIER = 48 - bicepParserNUMBER = 49 - bicepParserNL = 50 - bicepParserSINGLE_LINE_COMMENT = 51 - bicepParserMULTI_LINE_COMMENT = 52 - bicepParserSPACES = 53 - bicepParserUNKNOWN = 54 + bicepParserARROW = 48 + bicepParserIDENTIFIER = 49 + bicepParserNUMBER = 50 + bicepParserNL = 51 + bicepParserSINGLE_LINE_COMMENT = 52 + bicepParserMULTI_LINE_COMMENT = 53 + bicepParserSPACES = 54 + bicepParserUNKNOWN = 55 ) // bicepParser rules. const ( bicepParserRULE_program = 0 bicepParserRULE_statement = 1 - bicepParserRULE_parameterDecl = 2 - bicepParserRULE_parameterDefaultValue = 3 - bicepParserRULE_variableDecl = 4 - bicepParserRULE_resourceDecl = 5 - bicepParserRULE_outputDecl = 6 - bicepParserRULE_targetScopeDecl = 7 - bicepParserRULE_importDecl = 8 - bicepParserRULE_metadataDecl = 9 - bicepParserRULE_typeDecl = 10 - bicepParserRULE_moduleDecl = 11 + bicepParserRULE_targetScopeDecl = 2 + bicepParserRULE_importDecl = 3 + bicepParserRULE_metadataDecl = 4 + bicepParserRULE_parameterDecl = 5 + bicepParserRULE_parameterDefaultValue = 6 + bicepParserRULE_typeDecl = 7 + bicepParserRULE_variableDecl = 8 + bicepParserRULE_resourceDecl = 9 + bicepParserRULE_moduleDecl = 10 + bicepParserRULE_outputDecl = 11 bicepParserRULE_ifCondition = 12 bicepParserRULE_forExpression = 13 bicepParserRULE_forVariableBlock = 14 bicepParserRULE_forBody = 15 bicepParserRULE_interpString = 16 bicepParserRULE_expression = 17 - bicepParserRULE_logicCharacter = 18 - bicepParserRULE_primaryExpression = 19 - bicepParserRULE_parenthesizedExpression = 20 - bicepParserRULE_typeExpression = 21 - bicepParserRULE_literalValue = 22 - bicepParserRULE_object = 23 - bicepParserRULE_objectProperty = 24 - bicepParserRULE_array = 25 - bicepParserRULE_arrayItem = 26 - bicepParserRULE_decorator = 27 - bicepParserRULE_decoratorExpression = 28 - bicepParserRULE_functionCall = 29 - bicepParserRULE_argumentList = 30 - bicepParserRULE_identifier = 31 + bicepParserRULE_lambdaExpression = 18 + bicepParserRULE_logicCharacter = 19 + bicepParserRULE_primaryExpression = 20 + bicepParserRULE_parenthesizedExpression = 21 + bicepParserRULE_typeExpression = 22 + bicepParserRULE_literalValue = 23 + bicepParserRULE_object = 24 + bicepParserRULE_objectProperty = 25 + bicepParserRULE_array = 26 + bicepParserRULE_arrayItem = 27 + bicepParserRULE_decorator = 28 + bicepParserRULE_decoratorExpression = 29 + bicepParserRULE_functionCall = 30 + bicepParserRULE_argumentList = 31 + bicepParserRULE_identifier = 32 ) // IProgramContext is an interface to support dynamic dispatch. @@ -498,20 +507,20 @@ func (p *bicepParser) Program() (localctx IProgramContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(67) + p.SetState(69) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1125901683179524) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&2251801590022148) != 0 { { - p.SetState(64) + p.SetState(66) p.Statement() } - p.SetState(69) + p.SetState(71) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -519,7 +528,7 @@ func (p *bicepParser) Program() (localctx IProgramContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(70) + p.SetState(72) p.Match(bicepParserEOF) if p.HasError() { // Recognition error - abort rule @@ -548,15 +557,15 @@ type IStatementContext interface { GetParser() antlr.Parser // Getter signatures - ParameterDecl() IParameterDeclContext - VariableDecl() IVariableDeclContext - ResourceDecl() IResourceDeclContext - OutputDecl() IOutputDeclContext TargetScopeDecl() ITargetScopeDeclContext ImportDecl() IImportDeclContext MetadataDecl() IMetadataDeclContext + ParameterDecl() IParameterDeclContext TypeDecl() ITypeDeclContext + VariableDecl() IVariableDeclContext + ResourceDecl() IResourceDeclContext ModuleDecl() IModuleDeclContext + OutputDecl() IOutputDeclContext NL() antlr.TerminalNode // IsStatementContext differentiates from other interfaces. @@ -595,10 +604,10 @@ func NewStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, in func (s *StatementContext) GetParser() antlr.Parser { return s.parser } -func (s *StatementContext) ParameterDecl() IParameterDeclContext { +func (s *StatementContext) TargetScopeDecl() ITargetScopeDeclContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IParameterDeclContext); ok { + if _, ok := ctx.(ITargetScopeDeclContext); ok { t = ctx.(antlr.RuleContext) break } @@ -608,13 +617,13 @@ func (s *StatementContext) ParameterDecl() IParameterDeclContext { return nil } - return t.(IParameterDeclContext) + return t.(ITargetScopeDeclContext) } -func (s *StatementContext) VariableDecl() IVariableDeclContext { +func (s *StatementContext) ImportDecl() IImportDeclContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IVariableDeclContext); ok { + if _, ok := ctx.(IImportDeclContext); ok { t = ctx.(antlr.RuleContext) break } @@ -624,13 +633,13 @@ func (s *StatementContext) VariableDecl() IVariableDeclContext { return nil } - return t.(IVariableDeclContext) + return t.(IImportDeclContext) } -func (s *StatementContext) ResourceDecl() IResourceDeclContext { +func (s *StatementContext) MetadataDecl() IMetadataDeclContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IResourceDeclContext); ok { + if _, ok := ctx.(IMetadataDeclContext); ok { t = ctx.(antlr.RuleContext) break } @@ -640,13 +649,13 @@ func (s *StatementContext) ResourceDecl() IResourceDeclContext { return nil } - return t.(IResourceDeclContext) + return t.(IMetadataDeclContext) } -func (s *StatementContext) OutputDecl() IOutputDeclContext { +func (s *StatementContext) ParameterDecl() IParameterDeclContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IOutputDeclContext); ok { + if _, ok := ctx.(IParameterDeclContext); ok { t = ctx.(antlr.RuleContext) break } @@ -656,13 +665,13 @@ func (s *StatementContext) OutputDecl() IOutputDeclContext { return nil } - return t.(IOutputDeclContext) + return t.(IParameterDeclContext) } -func (s *StatementContext) TargetScopeDecl() ITargetScopeDeclContext { +func (s *StatementContext) TypeDecl() ITypeDeclContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITargetScopeDeclContext); ok { + if _, ok := ctx.(ITypeDeclContext); ok { t = ctx.(antlr.RuleContext) break } @@ -672,13 +681,13 @@ func (s *StatementContext) TargetScopeDecl() ITargetScopeDeclContext { return nil } - return t.(ITargetScopeDeclContext) + return t.(ITypeDeclContext) } -func (s *StatementContext) ImportDecl() IImportDeclContext { +func (s *StatementContext) VariableDecl() IVariableDeclContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IImportDeclContext); ok { + if _, ok := ctx.(IVariableDeclContext); ok { t = ctx.(antlr.RuleContext) break } @@ -688,13 +697,13 @@ func (s *StatementContext) ImportDecl() IImportDeclContext { return nil } - return t.(IImportDeclContext) + return t.(IVariableDeclContext) } -func (s *StatementContext) MetadataDecl() IMetadataDeclContext { +func (s *StatementContext) ResourceDecl() IResourceDeclContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMetadataDeclContext); ok { + if _, ok := ctx.(IResourceDeclContext); ok { t = ctx.(antlr.RuleContext) break } @@ -704,13 +713,13 @@ func (s *StatementContext) MetadataDecl() IMetadataDeclContext { return nil } - return t.(IMetadataDeclContext) + return t.(IResourceDeclContext) } -func (s *StatementContext) TypeDecl() ITypeDeclContext { +func (s *StatementContext) ModuleDecl() IModuleDeclContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeDeclContext); ok { + if _, ok := ctx.(IModuleDeclContext); ok { t = ctx.(antlr.RuleContext) break } @@ -720,13 +729,13 @@ func (s *StatementContext) TypeDecl() ITypeDeclContext { return nil } - return t.(ITypeDeclContext) + return t.(IModuleDeclContext) } -func (s *StatementContext) ModuleDecl() IModuleDeclContext { +func (s *StatementContext) OutputDecl() IOutputDeclContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IModuleDeclContext); ok { + if _, ok := ctx.(IOutputDeclContext); ok { t = ctx.(antlr.RuleContext) break } @@ -736,7 +745,7 @@ func (s *StatementContext) ModuleDecl() IModuleDeclContext { return nil } - return t.(IModuleDeclContext) + return t.(IOutputDeclContext) } func (s *StatementContext) NL() antlr.TerminalNode { @@ -764,7 +773,7 @@ func (s *StatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 2, bicepParserRULE_statement) - p.SetState(82) + p.SetState(84) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -774,70 +783,70 @@ func (p *bicepParser) Statement() (localctx IStatementContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(72) - p.ParameterDecl() + p.SetState(74) + p.TargetScopeDecl() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(73) - p.VariableDecl() + p.SetState(75) + p.ImportDecl() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(74) - p.ResourceDecl() + p.SetState(76) + p.MetadataDecl() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(75) - p.OutputDecl() + p.SetState(77) + p.ParameterDecl() } case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(76) - p.TargetScopeDecl() + p.SetState(78) + p.TypeDecl() } case 6: p.EnterOuterAlt(localctx, 6) { - p.SetState(77) - p.ImportDecl() + p.SetState(79) + p.VariableDecl() } case 7: p.EnterOuterAlt(localctx, 7) { - p.SetState(78) - p.MetadataDecl() + p.SetState(80) + p.ResourceDecl() } case 8: p.EnterOuterAlt(localctx, 8) { - p.SetState(79) - p.TypeDecl() + p.SetState(81) + p.ModuleDecl() } case 9: p.EnterOuterAlt(localctx, 9) { - p.SetState(80) - p.ModuleDecl() + p.SetState(82) + p.OutputDecl() } case 10: p.EnterOuterAlt(localctx, 10) { - p.SetState(81) + p.SetState(83) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -862,94 +871,67 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IParameterDeclContext is an interface to support dynamic dispatch. -type IParameterDeclContext interface { +// ITargetScopeDeclContext is an interface to support dynamic dispatch. +type ITargetScopeDeclContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser - // GetName returns the name rule contexts. - GetName() IIdentifierContext - - // GetType_ returns the type_ rule contexts. - GetType_() IInterpStringContext - - // SetName sets the name rule contexts. - SetName(IIdentifierContext) - - // SetType_ sets the type_ rule contexts. - SetType_(IInterpStringContext) - // Getter signatures - PARAM() antlr.TerminalNode + TARGET_SCOPE() antlr.TerminalNode + ASSIGN() antlr.TerminalNode + Expression() IExpressionContext NL() antlr.TerminalNode - Identifier() IIdentifierContext - TypeExpression() ITypeExpressionContext - RESOURCE() antlr.TerminalNode - AllDecorator() []IDecoratorContext - Decorator(i int) IDecoratorContext - InterpString() IInterpStringContext - ParameterDefaultValue() IParameterDefaultValueContext - // IsParameterDeclContext differentiates from other interfaces. - IsParameterDeclContext() + // IsTargetScopeDeclContext differentiates from other interfaces. + IsTargetScopeDeclContext() } -type ParameterDeclContext struct { +type TargetScopeDeclContext struct { antlr.BaseParserRuleContext parser antlr.Parser - name IIdentifierContext - type_ IInterpStringContext } -func NewEmptyParameterDeclContext() *ParameterDeclContext { - var p = new(ParameterDeclContext) +func NewEmptyTargetScopeDeclContext() *TargetScopeDeclContext { + var p = new(TargetScopeDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_parameterDecl + p.RuleIndex = bicepParserRULE_targetScopeDecl return p } -func InitEmptyParameterDeclContext(p *ParameterDeclContext) { +func InitEmptyTargetScopeDeclContext(p *TargetScopeDeclContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_parameterDecl + p.RuleIndex = bicepParserRULE_targetScopeDecl } -func (*ParameterDeclContext) IsParameterDeclContext() {} +func (*TargetScopeDeclContext) IsTargetScopeDeclContext() {} -func NewParameterDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParameterDeclContext { - var p = new(ParameterDeclContext) +func NewTargetScopeDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TargetScopeDeclContext { + var p = new(TargetScopeDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = bicepParserRULE_parameterDecl + p.RuleIndex = bicepParserRULE_targetScopeDecl return p } -func (s *ParameterDeclContext) GetParser() antlr.Parser { return s.parser } - -func (s *ParameterDeclContext) GetName() IIdentifierContext { return s.name } - -func (s *ParameterDeclContext) GetType_() IInterpStringContext { return s.type_ } - -func (s *ParameterDeclContext) SetName(v IIdentifierContext) { s.name = v } - -func (s *ParameterDeclContext) SetType_(v IInterpStringContext) { s.type_ = v } +func (s *TargetScopeDeclContext) GetParser() antlr.Parser { return s.parser } -func (s *ParameterDeclContext) PARAM() antlr.TerminalNode { - return s.GetToken(bicepParserPARAM, 0) +func (s *TargetScopeDeclContext) TARGET_SCOPE() antlr.TerminalNode { + return s.GetToken(bicepParserTARGET_SCOPE, 0) } -func (s *ParameterDeclContext) NL() antlr.TerminalNode { - return s.GetToken(bicepParserNL, 0) +func (s *TargetScopeDeclContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) } -func (s *ParameterDeclContext) Identifier() IIdentifierContext { +func (s *TargetScopeDeclContext) Expression() IExpressionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { + if _, ok := ctx.(IExpressionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -959,224 +941,57 @@ func (s *ParameterDeclContext) Identifier() IIdentifierContext { return nil } - return t.(IIdentifierContext) + return t.(IExpressionContext) } -func (s *ParameterDeclContext) TypeExpression() ITypeExpressionContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeExpressionContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } +func (s *TargetScopeDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} - return t.(ITypeExpressionContext) +func (s *TargetScopeDeclContext) GetRuleContext() antlr.RuleContext { + return s } -func (s *ParameterDeclContext) RESOURCE() antlr.TerminalNode { - return s.GetToken(bicepParserRESOURCE, 0) +func (s *TargetScopeDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ParameterDeclContext) AllDecorator() []IDecoratorContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IDecoratorContext); ok { - len++ - } - } +func (s *TargetScopeDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitTargetScopeDecl(s) - tst := make([]IDecoratorContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IDecoratorContext); ok { - tst[i] = t.(IDecoratorContext) - i++ - } + default: + return t.VisitChildren(s) } - - return tst } -func (s *ParameterDeclContext) Decorator(i int) IDecoratorContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDecoratorContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ +func (p *bicepParser) TargetScopeDecl() (localctx ITargetScopeDeclContext) { + localctx = NewTargetScopeDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 4, bicepParserRULE_targetScopeDecl) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(86) + p.Match(bicepParserTARGET_SCOPE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } } - - if t == nil { - return nil - } - - return t.(IDecoratorContext) -} - -func (s *ParameterDeclContext) InterpString() IInterpStringContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IInterpStringContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IInterpStringContext) -} - -func (s *ParameterDeclContext) ParameterDefaultValue() IParameterDefaultValueContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IParameterDefaultValueContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IParameterDefaultValueContext) -} - -func (s *ParameterDeclContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *ParameterDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *ParameterDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case bicepVisitor: - return t.VisitParameterDecl(s) - - default: - return t.VisitChildren(s) - } -} - -func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { - localctx = NewParameterDeclContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 4, bicepParserRULE_parameterDecl) - var _la int - - p.EnterOuterAlt(localctx, 1) - p.SetState(87) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == bicepParserAT { - { - p.SetState(84) - p.Decorator() - } - - p.SetState(89) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(90) - p.Match(bicepParserPARAM) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + { + p.SetState(87) + p.Match(bicepParserASSIGN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } } { - p.SetState(91) - - var _x = p.Identifier() - - localctx.(*ParameterDeclContext).name = _x - } - p.SetState(101) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext()) { - case 1: - { - p.SetState(92) - p.TypeExpression() - } - p.SetState(94) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == bicepParserASSIGN { - { - p.SetState(93) - p.ParameterDefaultValue() - } - - } - - case 2: - { - p.SetState(96) - p.Match(bicepParserRESOURCE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(97) - - var _x = p.InterpString() - - localctx.(*ParameterDeclContext).type_ = _x - } - p.SetState(99) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == bicepParserASSIGN { - { - p.SetState(98) - p.ParameterDefaultValue() - } - - } - - case antlr.ATNInvalidAltNumber: - goto errorExit + p.SetState(88) + p.expression(0) } { - p.SetState(103) + p.SetState(89) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1197,61 +1012,98 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IParameterDefaultValueContext is an interface to support dynamic dispatch. -type IParameterDefaultValueContext interface { +// IImportDeclContext is an interface to support dynamic dispatch. +type IImportDeclContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser + // GetSpecification returns the specification rule contexts. + GetSpecification() IInterpStringContext + + // GetAlias returns the alias rule contexts. + GetAlias() IIdentifierContext + + // SetSpecification sets the specification rule contexts. + SetSpecification(IInterpStringContext) + + // SetAlias sets the alias rule contexts. + SetAlias(IIdentifierContext) + // Getter signatures - ASSIGN() antlr.TerminalNode - Expression() IExpressionContext + IMPORT() antlr.TerminalNode + NL() antlr.TerminalNode + InterpString() IInterpStringContext + AllDecorator() []IDecoratorContext + Decorator(i int) IDecoratorContext + AllWITH() []antlr.TerminalNode + WITH(i int) antlr.TerminalNode + AllObject() []IObjectContext + Object(i int) IObjectContext + AllAS() []antlr.TerminalNode + AS(i int) antlr.TerminalNode + AllIdentifier() []IIdentifierContext + Identifier(i int) IIdentifierContext - // IsParameterDefaultValueContext differentiates from other interfaces. - IsParameterDefaultValueContext() + // IsImportDeclContext differentiates from other interfaces. + IsImportDeclContext() } -type ParameterDefaultValueContext struct { +type ImportDeclContext struct { antlr.BaseParserRuleContext - parser antlr.Parser + parser antlr.Parser + specification IInterpStringContext + alias IIdentifierContext } -func NewEmptyParameterDefaultValueContext() *ParameterDefaultValueContext { - var p = new(ParameterDefaultValueContext) +func NewEmptyImportDeclContext() *ImportDeclContext { + var p = new(ImportDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_parameterDefaultValue + p.RuleIndex = bicepParserRULE_importDecl return p } -func InitEmptyParameterDefaultValueContext(p *ParameterDefaultValueContext) { +func InitEmptyImportDeclContext(p *ImportDeclContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_parameterDefaultValue + p.RuleIndex = bicepParserRULE_importDecl } -func (*ParameterDefaultValueContext) IsParameterDefaultValueContext() {} +func (*ImportDeclContext) IsImportDeclContext() {} -func NewParameterDefaultValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParameterDefaultValueContext { - var p = new(ParameterDefaultValueContext) +func NewImportDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportDeclContext { + var p = new(ImportDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = bicepParserRULE_parameterDefaultValue + p.RuleIndex = bicepParserRULE_importDecl return p } -func (s *ParameterDefaultValueContext) GetParser() antlr.Parser { return s.parser } +func (s *ImportDeclContext) GetParser() antlr.Parser { return s.parser } -func (s *ParameterDefaultValueContext) ASSIGN() antlr.TerminalNode { - return s.GetToken(bicepParserASSIGN, 0) +func (s *ImportDeclContext) GetSpecification() IInterpStringContext { return s.specification } + +func (s *ImportDeclContext) GetAlias() IIdentifierContext { return s.alias } + +func (s *ImportDeclContext) SetSpecification(v IInterpStringContext) { s.specification = v } + +func (s *ImportDeclContext) SetAlias(v IIdentifierContext) { s.alias = v } + +func (s *ImportDeclContext) IMPORT() antlr.TerminalNode { + return s.GetToken(bicepParserIMPORT, 0) } -func (s *ParameterDefaultValueContext) Expression() IExpressionContext { +func (s *ImportDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *ImportDeclContext) InterpString() IInterpStringContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExpressionContext); ok { + if _, ok := ctx.(IInterpStringContext); ok { t = ctx.(antlr.RuleContext) break } @@ -1261,134 +1113,89 @@ func (s *ParameterDefaultValueContext) Expression() IExpressionContext { return nil } - return t.(IExpressionContext) -} - -func (s *ParameterDefaultValueContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *ParameterDefaultValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) + return t.(IInterpStringContext) } -func (s *ParameterDefaultValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case bicepVisitor: - return t.VisitParameterDefaultValue(s) - - default: - return t.VisitChildren(s) +func (s *ImportDeclContext) AllDecorator() []IDecoratorContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDecoratorContext); ok { + len++ + } } -} -func (p *bicepParser) ParameterDefaultValue() (localctx IParameterDefaultValueContext) { - localctx = NewParameterDefaultValueContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 6, bicepParserRULE_parameterDefaultValue) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(105) - p.Match(bicepParserASSIGN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + tst := make([]IDecoratorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) + i++ } } - { - p.SetState(106) - p.expression(0) - } -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used + return tst } -// IVariableDeclContext is an interface to support dynamic dispatch. -type IVariableDeclContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // GetName returns the name rule contexts. - GetName() IIdentifierContext - - // SetName sets the name rule contexts. - SetName(IIdentifierContext) - - // Getter signatures - VAR() antlr.TerminalNode - ASSIGN() antlr.TerminalNode - Expression() IExpressionContext - NL() antlr.TerminalNode - Identifier() IIdentifierContext - AllDecorator() []IDecoratorContext - Decorator(i int) IDecoratorContext - - // IsVariableDeclContext differentiates from other interfaces. - IsVariableDeclContext() -} +func (s *ImportDeclContext) Decorator(i int) IDecoratorContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecoratorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } -type VariableDeclContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser - name IIdentifierContext -} + if t == nil { + return nil + } -func NewEmptyVariableDeclContext() *VariableDeclContext { - var p = new(VariableDeclContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_variableDecl - return p + return t.(IDecoratorContext) } -func InitEmptyVariableDeclContext(p *VariableDeclContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_variableDecl +func (s *ImportDeclContext) AllWITH() []antlr.TerminalNode { + return s.GetTokens(bicepParserWITH) } -func (*VariableDeclContext) IsVariableDeclContext() {} - -func NewVariableDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *VariableDeclContext { - var p = new(VariableDeclContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = bicepParserRULE_variableDecl - - return p +func (s *ImportDeclContext) WITH(i int) antlr.TerminalNode { + return s.GetToken(bicepParserWITH, i) } -func (s *VariableDeclContext) GetParser() antlr.Parser { return s.parser } - -func (s *VariableDeclContext) GetName() IIdentifierContext { return s.name } - -func (s *VariableDeclContext) SetName(v IIdentifierContext) { s.name = v } +func (s *ImportDeclContext) AllObject() []IObjectContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IObjectContext); ok { + len++ + } + } -func (s *VariableDeclContext) VAR() antlr.TerminalNode { - return s.GetToken(bicepParserVAR, 0) -} + tst := make([]IObjectContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IObjectContext); ok { + tst[i] = t.(IObjectContext) + i++ + } + } -func (s *VariableDeclContext) ASSIGN() antlr.TerminalNode { - return s.GetToken(bicepParserASSIGN, 0) + return tst } -func (s *VariableDeclContext) Expression() IExpressionContext { +func (s *ImportDeclContext) Object(i int) IObjectContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExpressionContext); ok { - t = ctx.(antlr.RuleContext) - break + if _, ok := ctx.(IObjectContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -1396,43 +1203,31 @@ func (s *VariableDeclContext) Expression() IExpressionContext { return nil } - return t.(IExpressionContext) + return t.(IObjectContext) } -func (s *VariableDeclContext) NL() antlr.TerminalNode { - return s.GetToken(bicepParserNL, 0) +func (s *ImportDeclContext) AllAS() []antlr.TerminalNode { + return s.GetTokens(bicepParserAS) } -func (s *VariableDeclContext) Identifier() IIdentifierContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IIdentifierContext) +func (s *ImportDeclContext) AS(i int) antlr.TerminalNode { + return s.GetToken(bicepParserAS, i) } -func (s *VariableDeclContext) AllDecorator() []IDecoratorContext { +func (s *ImportDeclContext) AllIdentifier() []IIdentifierContext { children := s.GetChildren() len := 0 for _, ctx := range children { - if _, ok := ctx.(IDecoratorContext); ok { + if _, ok := ctx.(IIdentifierContext); ok { len++ } } - tst := make([]IDecoratorContext, len) + tst := make([]IIdentifierContext, len) i := 0 for _, ctx := range children { - if t, ok := ctx.(IDecoratorContext); ok { - tst[i] = t.(IDecoratorContext) + if t, ok := ctx.(IIdentifierContext); ok { + tst[i] = t.(IIdentifierContext) i++ } } @@ -1440,11 +1235,11 @@ func (s *VariableDeclContext) AllDecorator() []IDecoratorContext { return tst } -func (s *VariableDeclContext) Decorator(i int) IDecoratorContext { +func (s *ImportDeclContext) Identifier(i int) IIdentifierContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDecoratorContext); ok { + if _, ok := ctx.(IIdentifierContext); ok { if j == i { t = ctx.(antlr.RuleContext) break @@ -1457,34 +1252,34 @@ func (s *VariableDeclContext) Decorator(i int) IDecoratorContext { return nil } - return t.(IDecoratorContext) + return t.(IIdentifierContext) } -func (s *VariableDeclContext) GetRuleContext() antlr.RuleContext { +func (s *ImportDeclContext) GetRuleContext() antlr.RuleContext { return s } -func (s *VariableDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ImportDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *VariableDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ImportDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: - return t.VisitVariableDecl(s) + return t.VisitImportDecl(s) default: return t.VisitChildren(s) } } -func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { - localctx = NewVariableDeclContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 8, bicepParserRULE_variableDecl) +func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { + localctx = NewImportDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 6, bicepParserRULE_importDecl) var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(111) + p.SetState(94) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1493,11 +1288,11 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { for _la == bicepParserAT { { - p.SetState(108) + p.SetState(91) p.Decorator() } - p.SetState(113) + p.SetState(96) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1505,34 +1300,80 @@ func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(114) - p.Match(bicepParserVAR) + p.SetState(97) + p.Match(bicepParserIMPORT) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(115) + p.SetState(98) - var _x = p.Identifier() + var _x = p.InterpString() - localctx.(*VariableDeclContext).name = _x + localctx.(*ImportDeclContext).specification = _x } - { - p.SetState(116) - p.Match(bicepParserASSIGN) + p.SetState(105) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserWITH || _la == bicepParserAS { + p.SetState(103) + p.GetErrorHandler().Sync(p) if p.HasError() { - // Recognition error - abort rule goto errorExit } + + switch p.GetTokenStream().LA(1) { + case bicepParserWITH: + { + p.SetState(99) + p.Match(bicepParserWITH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(100) + p.Object() + } + + case bicepParserAS: + { + p.SetState(101) + p.Match(bicepParserAS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(102) + + var _x = p.Identifier() + + localctx.(*ImportDeclContext).alias = _x + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + + p.SetState(107) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) } { - p.SetState(117) - p.expression(0) - } - { - p.SetState(118) + p.SetState(108) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1553,8 +1394,8 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IResourceDeclContext is an interface to support dynamic dispatch. -type IResourceDeclContext interface { +// IMetadataDeclContext is an interface to support dynamic dispatch. +type IMetadataDeclContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -1563,154 +1404,69 @@ type IResourceDeclContext interface { // GetName returns the name rule contexts. GetName() IIdentifierContext - // GetType_ returns the type_ rule contexts. - GetType_() IInterpStringContext - // SetName sets the name rule contexts. SetName(IIdentifierContext) - // SetType_ sets the type_ rule contexts. - SetType_(IInterpStringContext) - // Getter signatures - RESOURCE() antlr.TerminalNode + METADATA() antlr.TerminalNode ASSIGN() antlr.TerminalNode + Expression() IExpressionContext NL() antlr.TerminalNode Identifier() IIdentifierContext - InterpString() IInterpStringContext - IfCondition() IIfConditionContext - Object() IObjectContext - ForExpression() IForExpressionContext - AllDecorator() []IDecoratorContext - Decorator(i int) IDecoratorContext - EXISTING() antlr.TerminalNode - // IsResourceDeclContext differentiates from other interfaces. - IsResourceDeclContext() + // IsMetadataDeclContext differentiates from other interfaces. + IsMetadataDeclContext() } -type ResourceDeclContext struct { +type MetadataDeclContext struct { antlr.BaseParserRuleContext parser antlr.Parser name IIdentifierContext - type_ IInterpStringContext } -func NewEmptyResourceDeclContext() *ResourceDeclContext { - var p = new(ResourceDeclContext) +func NewEmptyMetadataDeclContext() *MetadataDeclContext { + var p = new(MetadataDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_resourceDecl + p.RuleIndex = bicepParserRULE_metadataDecl return p } -func InitEmptyResourceDeclContext(p *ResourceDeclContext) { +func InitEmptyMetadataDeclContext(p *MetadataDeclContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_resourceDecl + p.RuleIndex = bicepParserRULE_metadataDecl } -func (*ResourceDeclContext) IsResourceDeclContext() {} +func (*MetadataDeclContext) IsMetadataDeclContext() {} -func NewResourceDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ResourceDeclContext { - var p = new(ResourceDeclContext) +func NewMetadataDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MetadataDeclContext { + var p = new(MetadataDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = bicepParserRULE_resourceDecl + p.RuleIndex = bicepParserRULE_metadataDecl return p } -func (s *ResourceDeclContext) GetParser() antlr.Parser { return s.parser } - -func (s *ResourceDeclContext) GetName() IIdentifierContext { return s.name } - -func (s *ResourceDeclContext) GetType_() IInterpStringContext { return s.type_ } +func (s *MetadataDeclContext) GetParser() antlr.Parser { return s.parser } -func (s *ResourceDeclContext) SetName(v IIdentifierContext) { s.name = v } +func (s *MetadataDeclContext) GetName() IIdentifierContext { return s.name } -func (s *ResourceDeclContext) SetType_(v IInterpStringContext) { s.type_ = v } +func (s *MetadataDeclContext) SetName(v IIdentifierContext) { s.name = v } -func (s *ResourceDeclContext) RESOURCE() antlr.TerminalNode { - return s.GetToken(bicepParserRESOURCE, 0) +func (s *MetadataDeclContext) METADATA() antlr.TerminalNode { + return s.GetToken(bicepParserMETADATA, 0) } -func (s *ResourceDeclContext) ASSIGN() antlr.TerminalNode { +func (s *MetadataDeclContext) ASSIGN() antlr.TerminalNode { return s.GetToken(bicepParserASSIGN, 0) } -func (s *ResourceDeclContext) NL() antlr.TerminalNode { - return s.GetToken(bicepParserNL, 0) -} - -func (s *ResourceDeclContext) Identifier() IIdentifierContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IIdentifierContext) -} - -func (s *ResourceDeclContext) InterpString() IInterpStringContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IInterpStringContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IInterpStringContext) -} - -func (s *ResourceDeclContext) IfCondition() IIfConditionContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIfConditionContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IIfConditionContext) -} - -func (s *ResourceDeclContext) Object() IObjectContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IObjectContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IObjectContext) -} - -func (s *ResourceDeclContext) ForExpression() IForExpressionContext { +func (s *MetadataDeclContext) Expression() IExpressionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IForExpressionContext); ok { + if _, ok := ctx.(IExpressionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -1720,40 +1476,19 @@ func (s *ResourceDeclContext) ForExpression() IForExpressionContext { return nil } - return t.(IForExpressionContext) + return t.(IExpressionContext) } -func (s *ResourceDeclContext) AllDecorator() []IDecoratorContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IDecoratorContext); ok { - len++ - } - } - - tst := make([]IDecoratorContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IDecoratorContext); ok { - tst[i] = t.(IDecoratorContext) - i++ - } - } - - return tst +func (s *MetadataDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) } -func (s *ResourceDeclContext) Decorator(i int) IDecoratorContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDecoratorContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ +func (s *MetadataDeclContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -1761,136 +1496,60 @@ func (s *ResourceDeclContext) Decorator(i int) IDecoratorContext { return nil } - return t.(IDecoratorContext) -} - -func (s *ResourceDeclContext) EXISTING() antlr.TerminalNode { - return s.GetToken(bicepParserEXISTING, 0) + return t.(IIdentifierContext) } -func (s *ResourceDeclContext) GetRuleContext() antlr.RuleContext { +func (s *MetadataDeclContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ResourceDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *MetadataDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ResourceDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *MetadataDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: - return t.VisitResourceDecl(s) + return t.VisitMetadataDecl(s) default: return t.VisitChildren(s) } } -func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { - localctx = NewResourceDeclContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 10, bicepParserRULE_resourceDecl) - var _la int - +func (p *bicepParser) MetadataDecl() (localctx IMetadataDeclContext) { + localctx = NewMetadataDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 8, bicepParserRULE_metadataDecl) p.EnterOuterAlt(localctx, 1) - p.SetState(123) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == bicepParserAT { - { - p.SetState(120) - p.Decorator() - } - - p.SetState(125) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } { - p.SetState(126) - p.Match(bicepParserRESOURCE) + p.SetState(110) + p.Match(bicepParserMETADATA) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(127) + p.SetState(111) var _x = p.Identifier() - localctx.(*ResourceDeclContext).name = _x - } - { - p.SetState(128) - - var _x = p.InterpString() - - localctx.(*ResourceDeclContext).type_ = _x - } - p.SetState(130) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == bicepParserEXISTING { - { - p.SetState(129) - p.Match(bicepParserEXISTING) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - + localctx.(*MetadataDeclContext).name = _x } { - p.SetState(132) + p.SetState(112) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(136) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetTokenStream().LA(1) { - case bicepParserIF: - { - p.SetState(133) - p.IfCondition() - } - - case bicepParserOBRACE: - { - p.SetState(134) - p.Object() - } - - case bicepParserOBRACK: - { - p.SetState(135) - p.ForExpression() - } - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit + { + p.SetState(113) + p.expression(0) } { - p.SetState(138) + p.SetState(114) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -1911,8 +1570,8 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IOutputDeclContext is an interface to support dynamic dispatch. -type IOutputDeclContext interface { +// IParameterDeclContext is an interface to support dynamic dispatch. +type IParameterDeclContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -1921,96 +1580,84 @@ type IOutputDeclContext interface { // GetName returns the name rule contexts. GetName() IIdentifierContext - // GetType1 returns the type1 rule contexts. - GetType1() IIdentifierContext - - // GetType2 returns the type2 rule contexts. - GetType2() IInterpStringContext + // GetType_ returns the type_ rule contexts. + GetType_() IInterpStringContext // SetName sets the name rule contexts. SetName(IIdentifierContext) - // SetType1 sets the type1 rule contexts. - SetType1(IIdentifierContext) - - // SetType2 sets the type2 rule contexts. - SetType2(IInterpStringContext) + // SetType_ sets the type_ rule contexts. + SetType_(IInterpStringContext) // Getter signatures - OUTPUT() antlr.TerminalNode - ASSIGN() antlr.TerminalNode - Expression() IExpressionContext + PARAM() antlr.TerminalNode NL() antlr.TerminalNode - AllIdentifier() []IIdentifierContext - Identifier(i int) IIdentifierContext + Identifier() IIdentifierContext + TypeExpression() ITypeExpressionContext RESOURCE() antlr.TerminalNode AllDecorator() []IDecoratorContext Decorator(i int) IDecoratorContext InterpString() IInterpStringContext + ParameterDefaultValue() IParameterDefaultValueContext - // IsOutputDeclContext differentiates from other interfaces. - IsOutputDeclContext() + // IsParameterDeclContext differentiates from other interfaces. + IsParameterDeclContext() } -type OutputDeclContext struct { +type ParameterDeclContext struct { antlr.BaseParserRuleContext parser antlr.Parser name IIdentifierContext - type1 IIdentifierContext - type2 IInterpStringContext + type_ IInterpStringContext } -func NewEmptyOutputDeclContext() *OutputDeclContext { - var p = new(OutputDeclContext) +func NewEmptyParameterDeclContext() *ParameterDeclContext { + var p = new(ParameterDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_outputDecl + p.RuleIndex = bicepParserRULE_parameterDecl return p } -func InitEmptyOutputDeclContext(p *OutputDeclContext) { +func InitEmptyParameterDeclContext(p *ParameterDeclContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_outputDecl + p.RuleIndex = bicepParserRULE_parameterDecl } -func (*OutputDeclContext) IsOutputDeclContext() {} +func (*ParameterDeclContext) IsParameterDeclContext() {} -func NewOutputDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OutputDeclContext { - var p = new(OutputDeclContext) +func NewParameterDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParameterDeclContext { + var p = new(ParameterDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = bicepParserRULE_outputDecl + p.RuleIndex = bicepParserRULE_parameterDecl return p } -func (s *OutputDeclContext) GetParser() antlr.Parser { return s.parser } - -func (s *OutputDeclContext) GetName() IIdentifierContext { return s.name } - -func (s *OutputDeclContext) GetType1() IIdentifierContext { return s.type1 } +func (s *ParameterDeclContext) GetParser() antlr.Parser { return s.parser } -func (s *OutputDeclContext) GetType2() IInterpStringContext { return s.type2 } +func (s *ParameterDeclContext) GetName() IIdentifierContext { return s.name } -func (s *OutputDeclContext) SetName(v IIdentifierContext) { s.name = v } +func (s *ParameterDeclContext) GetType_() IInterpStringContext { return s.type_ } -func (s *OutputDeclContext) SetType1(v IIdentifierContext) { s.type1 = v } +func (s *ParameterDeclContext) SetName(v IIdentifierContext) { s.name = v } -func (s *OutputDeclContext) SetType2(v IInterpStringContext) { s.type2 = v } +func (s *ParameterDeclContext) SetType_(v IInterpStringContext) { s.type_ = v } -func (s *OutputDeclContext) OUTPUT() antlr.TerminalNode { - return s.GetToken(bicepParserOUTPUT, 0) +func (s *ParameterDeclContext) PARAM() antlr.TerminalNode { + return s.GetToken(bicepParserPARAM, 0) } -func (s *OutputDeclContext) ASSIGN() antlr.TerminalNode { - return s.GetToken(bicepParserASSIGN, 0) +func (s *ParameterDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) } -func (s *OutputDeclContext) Expression() IExpressionContext { +func (s *ParameterDeclContext) Identifier() IIdentifierContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExpressionContext); ok { + if _, ok := ctx.(IIdentifierContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2020,44 +1667,15 @@ func (s *OutputDeclContext) Expression() IExpressionContext { return nil } - return t.(IExpressionContext) -} - -func (s *OutputDeclContext) NL() antlr.TerminalNode { - return s.GetToken(bicepParserNL, 0) -} - -func (s *OutputDeclContext) AllIdentifier() []IIdentifierContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IIdentifierContext); ok { - len++ - } - } - - tst := make([]IIdentifierContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IIdentifierContext); ok { - tst[i] = t.(IIdentifierContext) - i++ - } - } - - return tst + return t.(IIdentifierContext) } -func (s *OutputDeclContext) Identifier(i int) IIdentifierContext { +func (s *ParameterDeclContext) TypeExpression() ITypeExpressionContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(ITypeExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -2065,14 +1683,14 @@ func (s *OutputDeclContext) Identifier(i int) IIdentifierContext { return nil } - return t.(IIdentifierContext) + return t.(ITypeExpressionContext) } -func (s *OutputDeclContext) RESOURCE() antlr.TerminalNode { +func (s *ParameterDeclContext) RESOURCE() antlr.TerminalNode { return s.GetToken(bicepParserRESOURCE, 0) } -func (s *OutputDeclContext) AllDecorator() []IDecoratorContext { +func (s *ParameterDeclContext) AllDecorator() []IDecoratorContext { children := s.GetChildren() len := 0 for _, ctx := range children { @@ -2093,7 +1711,7 @@ func (s *OutputDeclContext) AllDecorator() []IDecoratorContext { return tst } -func (s *OutputDeclContext) Decorator(i int) IDecoratorContext { +func (s *ParameterDeclContext) Decorator(i int) IDecoratorContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { @@ -2113,7 +1731,7 @@ func (s *OutputDeclContext) Decorator(i int) IDecoratorContext { return t.(IDecoratorContext) } -func (s *OutputDeclContext) InterpString() IInterpStringContext { +func (s *ParameterDeclContext) InterpString() IInterpStringContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IInterpStringContext); ok { @@ -2129,31 +1747,47 @@ func (s *OutputDeclContext) InterpString() IInterpStringContext { return t.(IInterpStringContext) } -func (s *OutputDeclContext) GetRuleContext() antlr.RuleContext { +func (s *ParameterDeclContext) ParameterDefaultValue() IParameterDefaultValueContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IParameterDefaultValueContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IParameterDefaultValueContext) +} + +func (s *ParameterDeclContext) GetRuleContext() antlr.RuleContext { return s } -func (s *OutputDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ParameterDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *OutputDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ParameterDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: - return t.VisitOutputDecl(s) + return t.VisitParameterDecl(s) default: return t.VisitChildren(s) } } -func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { - localctx = NewOutputDeclContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 12, bicepParserRULE_outputDecl) +func (p *bicepParser) ParameterDecl() (localctx IParameterDeclContext) { + localctx = NewParameterDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 10, bicepParserRULE_parameterDecl) var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(143) + p.SetState(119) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2162,11 +1796,11 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { for _la == bicepParserAT { { - p.SetState(140) + p.SetState(116) p.Decorator() } - p.SetState(145) + p.SetState(121) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2174,39 +1808,50 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(146) - p.Match(bicepParserOUTPUT) + p.SetState(122) + p.Match(bicepParserPARAM) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(147) + p.SetState(123) var _x = p.Identifier() - localctx.(*OutputDeclContext).name = _x + localctx.(*ParameterDeclContext).name = _x } - p.SetState(151) + p.SetState(133) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) { case 1: { - p.SetState(148) + p.SetState(124) + p.TypeExpression() + } + p.SetState(126) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) - var _x = p.Identifier() + if _la == bicepParserASSIGN { + { + p.SetState(125) + p.ParameterDefaultValue() + } - localctx.(*OutputDeclContext).type1 = _x } case 2: { - p.SetState(149) + p.SetState(128) p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule @@ -2214,36 +1859,153 @@ func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { } } { - p.SetState(150) + p.SetState(129) var _x = p.InterpString() - localctx.(*OutputDeclContext).type2 = _x + localctx.(*ParameterDeclContext).type_ = _x + } + p.SetState(131) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == bicepParserASSIGN { + { + p.SetState(130) + p.ParameterDefaultValue() + } + } case antlr.ATNInvalidAltNumber: goto errorExit } { - p.SetState(153) - p.Match(bicepParserASSIGN) + p.SetState(135) + p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule goto errorExit } } - { - p.SetState(154) - p.expression(0) + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IParameterDefaultValueContext is an interface to support dynamic dispatch. +type IParameterDefaultValueContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + ASSIGN() antlr.TerminalNode + Expression() IExpressionContext + + // IsParameterDefaultValueContext differentiates from other interfaces. + IsParameterDefaultValueContext() +} + +type ParameterDefaultValueContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyParameterDefaultValueContext() *ParameterDefaultValueContext { + var p = new(ParameterDefaultValueContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_parameterDefaultValue + return p +} + +func InitEmptyParameterDefaultValueContext(p *ParameterDefaultValueContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_parameterDefaultValue +} + +func (*ParameterDefaultValueContext) IsParameterDefaultValueContext() {} + +func NewParameterDefaultValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParameterDefaultValueContext { + var p = new(ParameterDefaultValueContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_parameterDefaultValue + + return p +} + +func (s *ParameterDefaultValueContext) GetParser() antlr.Parser { return s.parser } + +func (s *ParameterDefaultValueContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) +} + +func (s *ParameterDefaultValueContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *ParameterDefaultValueContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ParameterDefaultValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ParameterDefaultValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitParameterDefaultValue(s) + + default: + return t.VisitChildren(s) } +} + +func (p *bicepParser) ParameterDefaultValue() (localctx IParameterDefaultValueContext) { + localctx = NewParameterDefaultValueContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 12, bicepParserRULE_parameterDefaultValue) + p.EnterOuterAlt(localctx, 1) { - p.SetState(155) - p.Match(bicepParserNL) + p.SetState(137) + p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule goto errorExit } } + { + p.SetState(138) + p.expression(0) + } errorExit: if p.HasError() { @@ -2258,69 +2020,144 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ITargetScopeDeclContext is an interface to support dynamic dispatch. -type ITargetScopeDeclContext interface { +// ITypeDeclContext is an interface to support dynamic dispatch. +type ITypeDeclContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser + // GetName returns the name rule contexts. + GetName() IIdentifierContext + + // SetName sets the name rule contexts. + SetName(IIdentifierContext) + // Getter signatures - TARGET_SCOPE() antlr.TerminalNode + TYPE() antlr.TerminalNode ASSIGN() antlr.TerminalNode - Expression() IExpressionContext + TypeExpression() ITypeExpressionContext NL() antlr.TerminalNode + Identifier() IIdentifierContext + AllDecorator() []IDecoratorContext + Decorator(i int) IDecoratorContext - // IsTargetScopeDeclContext differentiates from other interfaces. - IsTargetScopeDeclContext() + // IsTypeDeclContext differentiates from other interfaces. + IsTypeDeclContext() } -type TargetScopeDeclContext struct { +type TypeDeclContext struct { antlr.BaseParserRuleContext parser antlr.Parser + name IIdentifierContext } -func NewEmptyTargetScopeDeclContext() *TargetScopeDeclContext { - var p = new(TargetScopeDeclContext) +func NewEmptyTypeDeclContext() *TypeDeclContext { + var p = new(TypeDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_targetScopeDecl + p.RuleIndex = bicepParserRULE_typeDecl return p } -func InitEmptyTargetScopeDeclContext(p *TargetScopeDeclContext) { +func InitEmptyTypeDeclContext(p *TypeDeclContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_targetScopeDecl + p.RuleIndex = bicepParserRULE_typeDecl } -func (*TargetScopeDeclContext) IsTargetScopeDeclContext() {} +func (*TypeDeclContext) IsTypeDeclContext() {} -func NewTargetScopeDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TargetScopeDeclContext { - var p = new(TargetScopeDeclContext) +func NewTypeDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeDeclContext { + var p = new(TypeDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = bicepParserRULE_targetScopeDecl + p.RuleIndex = bicepParserRULE_typeDecl return p } -func (s *TargetScopeDeclContext) GetParser() antlr.Parser { return s.parser } +func (s *TypeDeclContext) GetParser() antlr.Parser { return s.parser } -func (s *TargetScopeDeclContext) TARGET_SCOPE() antlr.TerminalNode { - return s.GetToken(bicepParserTARGET_SCOPE, 0) +func (s *TypeDeclContext) GetName() IIdentifierContext { return s.name } + +func (s *TypeDeclContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *TypeDeclContext) TYPE() antlr.TerminalNode { + return s.GetToken(bicepParserTYPE, 0) +} + +func (s *TypeDeclContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) +} + +func (s *TypeDeclContext) TypeExpression() ITypeExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITypeExpressionContext) +} + +func (s *TypeDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *TypeDeclContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) } -func (s *TargetScopeDeclContext) ASSIGN() antlr.TerminalNode { - return s.GetToken(bicepParserASSIGN, 0) +func (s *TypeDeclContext) AllDecorator() []IDecoratorContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDecoratorContext); ok { + len++ + } + } + + tst := make([]IDecoratorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) + i++ + } + } + + return tst } -func (s *TargetScopeDeclContext) Expression() IExpressionContext { +func (s *TypeDeclContext) Decorator(i int) IDecoratorContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExpressionContext); ok { - t = ctx.(antlr.RuleContext) - break + if _, ok := ctx.(IDecoratorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -2328,45 +2165,70 @@ func (s *TargetScopeDeclContext) Expression() IExpressionContext { return nil } - return t.(IExpressionContext) -} - -func (s *TargetScopeDeclContext) NL() antlr.TerminalNode { - return s.GetToken(bicepParserNL, 0) + return t.(IDecoratorContext) } -func (s *TargetScopeDeclContext) GetRuleContext() antlr.RuleContext { +func (s *TypeDeclContext) GetRuleContext() antlr.RuleContext { return s } -func (s *TargetScopeDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *TypeDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *TargetScopeDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *TypeDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: - return t.VisitTargetScopeDecl(s) + return t.VisitTypeDecl(s) default: return t.VisitChildren(s) } } -func (p *bicepParser) TargetScopeDecl() (localctx ITargetScopeDeclContext) { - localctx = NewTargetScopeDeclContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 14, bicepParserRULE_targetScopeDecl) +func (p *bicepParser) TypeDecl() (localctx ITypeDeclContext) { + localctx = NewTypeDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 14, bicepParserRULE_typeDecl) + var _la int + p.EnterOuterAlt(localctx, 1) + p.SetState(143) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserAT { + { + p.SetState(140) + p.Decorator() + } + + p.SetState(145) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } { - p.SetState(157) - p.Match(bicepParserTARGET_SCOPE) + p.SetState(146) + p.Match(bicepParserTYPE) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(158) + p.SetState(147) + + var _x = p.Identifier() + + localctx.(*TypeDeclContext).name = _x + } + { + p.SetState(148) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule @@ -2374,11 +2236,11 @@ func (p *bicepParser) TargetScopeDecl() (localctx ITargetScopeDeclContext) { } } { - p.SetState(159) - p.expression(0) + p.SetState(149) + p.TypeExpression() } { - p.SetState(160) + p.SetState(150) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2399,98 +2261,81 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IImportDeclContext is an interface to support dynamic dispatch. -type IImportDeclContext interface { +// IVariableDeclContext is an interface to support dynamic dispatch. +type IVariableDeclContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser - // GetSpecification returns the specification rule contexts. - GetSpecification() IInterpStringContext - - // GetAlias returns the alias rule contexts. - GetAlias() IIdentifierContext - - // SetSpecification sets the specification rule contexts. - SetSpecification(IInterpStringContext) + // GetName returns the name rule contexts. + GetName() IIdentifierContext - // SetAlias sets the alias rule contexts. - SetAlias(IIdentifierContext) + // SetName sets the name rule contexts. + SetName(IIdentifierContext) // Getter signatures - IMPORT() antlr.TerminalNode + VAR() antlr.TerminalNode + ASSIGN() antlr.TerminalNode + Expression() IExpressionContext NL() antlr.TerminalNode - InterpString() IInterpStringContext + Identifier() IIdentifierContext AllDecorator() []IDecoratorContext Decorator(i int) IDecoratorContext - AllWITH() []antlr.TerminalNode - WITH(i int) antlr.TerminalNode - AllObject() []IObjectContext - Object(i int) IObjectContext - AllAS() []antlr.TerminalNode - AS(i int) antlr.TerminalNode - AllIdentifier() []IIdentifierContext - Identifier(i int) IIdentifierContext - // IsImportDeclContext differentiates from other interfaces. - IsImportDeclContext() + // IsVariableDeclContext differentiates from other interfaces. + IsVariableDeclContext() } -type ImportDeclContext struct { +type VariableDeclContext struct { antlr.BaseParserRuleContext - parser antlr.Parser - specification IInterpStringContext - alias IIdentifierContext + parser antlr.Parser + name IIdentifierContext } -func NewEmptyImportDeclContext() *ImportDeclContext { - var p = new(ImportDeclContext) +func NewEmptyVariableDeclContext() *VariableDeclContext { + var p = new(VariableDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_importDecl + p.RuleIndex = bicepParserRULE_variableDecl return p } -func InitEmptyImportDeclContext(p *ImportDeclContext) { +func InitEmptyVariableDeclContext(p *VariableDeclContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_importDecl + p.RuleIndex = bicepParserRULE_variableDecl } -func (*ImportDeclContext) IsImportDeclContext() {} +func (*VariableDeclContext) IsVariableDeclContext() {} -func NewImportDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportDeclContext { - var p = new(ImportDeclContext) +func NewVariableDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *VariableDeclContext { + var p = new(VariableDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = bicepParserRULE_importDecl + p.RuleIndex = bicepParserRULE_variableDecl return p } -func (s *ImportDeclContext) GetParser() antlr.Parser { return s.parser } - -func (s *ImportDeclContext) GetSpecification() IInterpStringContext { return s.specification } - -func (s *ImportDeclContext) GetAlias() IIdentifierContext { return s.alias } +func (s *VariableDeclContext) GetParser() antlr.Parser { return s.parser } -func (s *ImportDeclContext) SetSpecification(v IInterpStringContext) { s.specification = v } +func (s *VariableDeclContext) GetName() IIdentifierContext { return s.name } -func (s *ImportDeclContext) SetAlias(v IIdentifierContext) { s.alias = v } +func (s *VariableDeclContext) SetName(v IIdentifierContext) { s.name = v } -func (s *ImportDeclContext) IMPORT() antlr.TerminalNode { - return s.GetToken(bicepParserIMPORT, 0) +func (s *VariableDeclContext) VAR() antlr.TerminalNode { + return s.GetToken(bicepParserVAR, 0) } -func (s *ImportDeclContext) NL() antlr.TerminalNode { - return s.GetToken(bicepParserNL, 0) +func (s *VariableDeclContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) } -func (s *ImportDeclContext) InterpString() IInterpStringContext { +func (s *VariableDeclContext) Expression() IExpressionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IInterpStringContext); ok { + if _, ok := ctx.(IExpressionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2500,89 +2345,19 @@ func (s *ImportDeclContext) InterpString() IInterpStringContext { return nil } - return t.(IInterpStringContext) -} - -func (s *ImportDeclContext) AllDecorator() []IDecoratorContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IDecoratorContext); ok { - len++ - } - } - - tst := make([]IDecoratorContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IDecoratorContext); ok { - tst[i] = t.(IDecoratorContext) - i++ - } - } - - return tst -} - -func (s *ImportDeclContext) Decorator(i int) IDecoratorContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDecoratorContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IDecoratorContext) -} - -func (s *ImportDeclContext) AllWITH() []antlr.TerminalNode { - return s.GetTokens(bicepParserWITH) -} - -func (s *ImportDeclContext) WITH(i int) antlr.TerminalNode { - return s.GetToken(bicepParserWITH, i) + return t.(IExpressionContext) } -func (s *ImportDeclContext) AllObject() []IObjectContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IObjectContext); ok { - len++ - } - } - - tst := make([]IObjectContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IObjectContext); ok { - tst[i] = t.(IObjectContext) - i++ - } - } - - return tst +func (s *VariableDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) } -func (s *ImportDeclContext) Object(i int) IObjectContext { +func (s *VariableDeclContext) Identifier() IIdentifierContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IObjectContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -2590,31 +2365,23 @@ func (s *ImportDeclContext) Object(i int) IObjectContext { return nil } - return t.(IObjectContext) -} - -func (s *ImportDeclContext) AllAS() []antlr.TerminalNode { - return s.GetTokens(bicepParserAS) -} - -func (s *ImportDeclContext) AS(i int) antlr.TerminalNode { - return s.GetToken(bicepParserAS, i) + return t.(IIdentifierContext) } -func (s *ImportDeclContext) AllIdentifier() []IIdentifierContext { +func (s *VariableDeclContext) AllDecorator() []IDecoratorContext { children := s.GetChildren() len := 0 for _, ctx := range children { - if _, ok := ctx.(IIdentifierContext); ok { + if _, ok := ctx.(IDecoratorContext); ok { len++ } } - tst := make([]IIdentifierContext, len) + tst := make([]IDecoratorContext, len) i := 0 for _, ctx := range children { - if t, ok := ctx.(IIdentifierContext); ok { - tst[i] = t.(IIdentifierContext) + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) i++ } } @@ -2622,11 +2389,11 @@ func (s *ImportDeclContext) AllIdentifier() []IIdentifierContext { return tst } -func (s *ImportDeclContext) Identifier(i int) IIdentifierContext { +func (s *VariableDeclContext) Decorator(i int) IDecoratorContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { + if _, ok := ctx.(IDecoratorContext); ok { if j == i { t = ctx.(antlr.RuleContext) break @@ -2639,34 +2406,34 @@ func (s *ImportDeclContext) Identifier(i int) IIdentifierContext { return nil } - return t.(IIdentifierContext) + return t.(IDecoratorContext) } -func (s *ImportDeclContext) GetRuleContext() antlr.RuleContext { +func (s *VariableDeclContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ImportDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *VariableDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ImportDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *VariableDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: - return t.VisitImportDecl(s) + return t.VisitVariableDecl(s) default: return t.VisitChildren(s) } } -func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { - localctx = NewImportDeclContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 16, bicepParserRULE_importDecl) +func (p *bicepParser) VariableDecl() (localctx IVariableDeclContext) { + localctx = NewVariableDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 16, bicepParserRULE_variableDecl) var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(165) + p.SetState(155) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2675,11 +2442,11 @@ func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { for _la == bicepParserAT { { - p.SetState(162) + p.SetState(152) p.Decorator() } - p.SetState(167) + p.SetState(157) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2687,80 +2454,34 @@ func (p *bicepParser) ImportDecl() (localctx IImportDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(168) - p.Match(bicepParserIMPORT) + p.SetState(158) + p.Match(bicepParserVAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(169) + p.SetState(159) - var _x = p.InterpString() + var _x = p.Identifier() - localctx.(*ImportDeclContext).specification = _x - } - p.SetState(176) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit + localctx.(*VariableDeclContext).name = _x } - _la = p.GetTokenStream().LA(1) - - for _la == bicepParserWITH || _la == bicepParserAS { - p.SetState(174) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetTokenStream().LA(1) { - case bicepParserWITH: - { - p.SetState(170) - p.Match(bicepParserWITH) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(171) - p.Object() - } - - case bicepParserAS: - { - p.SetState(172) - p.Match(bicepParserAS) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(173) - - var _x = p.Identifier() - - localctx.(*ImportDeclContext).alias = _x - } - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit - } - - p.SetState(178) - p.GetErrorHandler().Sync(p) + { + p.SetState(160) + p.Match(bicepParserASSIGN) if p.HasError() { + // Recognition error - abort rule goto errorExit } - _la = p.GetTokenStream().LA(1) } { - p.SetState(179) + p.SetState(161) + p.expression(0) + } + { + p.SetState(162) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2781,8 +2502,8 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IMetadataDeclContext is an interface to support dynamic dispatch. -type IMetadataDeclContext interface { +// IResourceDeclContext is an interface to support dynamic dispatch. +type IResourceDeclContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -2791,69 +2512,90 @@ type IMetadataDeclContext interface { // GetName returns the name rule contexts. GetName() IIdentifierContext + // GetType_ returns the type_ rule contexts. + GetType_() IInterpStringContext + // SetName sets the name rule contexts. SetName(IIdentifierContext) + // SetType_ sets the type_ rule contexts. + SetType_(IInterpStringContext) + // Getter signatures - METADATA() antlr.TerminalNode + RESOURCE() antlr.TerminalNode ASSIGN() antlr.TerminalNode - Expression() IExpressionContext NL() antlr.TerminalNode Identifier() IIdentifierContext + InterpString() IInterpStringContext + IfCondition() IIfConditionContext + Object() IObjectContext + ForExpression() IForExpressionContext + AllDecorator() []IDecoratorContext + Decorator(i int) IDecoratorContext + EXISTING() antlr.TerminalNode - // IsMetadataDeclContext differentiates from other interfaces. - IsMetadataDeclContext() + // IsResourceDeclContext differentiates from other interfaces. + IsResourceDeclContext() } -type MetadataDeclContext struct { +type ResourceDeclContext struct { antlr.BaseParserRuleContext parser antlr.Parser name IIdentifierContext + type_ IInterpStringContext } -func NewEmptyMetadataDeclContext() *MetadataDeclContext { - var p = new(MetadataDeclContext) +func NewEmptyResourceDeclContext() *ResourceDeclContext { + var p = new(ResourceDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_metadataDecl + p.RuleIndex = bicepParserRULE_resourceDecl return p } -func InitEmptyMetadataDeclContext(p *MetadataDeclContext) { +func InitEmptyResourceDeclContext(p *ResourceDeclContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_metadataDecl + p.RuleIndex = bicepParserRULE_resourceDecl } -func (*MetadataDeclContext) IsMetadataDeclContext() {} +func (*ResourceDeclContext) IsResourceDeclContext() {} -func NewMetadataDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MetadataDeclContext { - var p = new(MetadataDeclContext) +func NewResourceDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ResourceDeclContext { + var p = new(ResourceDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = bicepParserRULE_metadataDecl + p.RuleIndex = bicepParserRULE_resourceDecl return p } -func (s *MetadataDeclContext) GetParser() antlr.Parser { return s.parser } +func (s *ResourceDeclContext) GetParser() antlr.Parser { return s.parser } -func (s *MetadataDeclContext) GetName() IIdentifierContext { return s.name } +func (s *ResourceDeclContext) GetName() IIdentifierContext { return s.name } -func (s *MetadataDeclContext) SetName(v IIdentifierContext) { s.name = v } +func (s *ResourceDeclContext) GetType_() IInterpStringContext { return s.type_ } -func (s *MetadataDeclContext) METADATA() antlr.TerminalNode { - return s.GetToken(bicepParserMETADATA, 0) +func (s *ResourceDeclContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *ResourceDeclContext) SetType_(v IInterpStringContext) { s.type_ = v } + +func (s *ResourceDeclContext) RESOURCE() antlr.TerminalNode { + return s.GetToken(bicepParserRESOURCE, 0) } -func (s *MetadataDeclContext) ASSIGN() antlr.TerminalNode { +func (s *ResourceDeclContext) ASSIGN() antlr.TerminalNode { return s.GetToken(bicepParserASSIGN, 0) } -func (s *MetadataDeclContext) Expression() IExpressionContext { +func (s *ResourceDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *ResourceDeclContext) Identifier() IIdentifierContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IExpressionContext); ok { + if _, ok := ctx.(IIdentifierContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2863,17 +2605,29 @@ func (s *MetadataDeclContext) Expression() IExpressionContext { return nil } - return t.(IExpressionContext) + return t.(IIdentifierContext) } -func (s *MetadataDeclContext) NL() antlr.TerminalNode { - return s.GetToken(bicepParserNL, 0) +func (s *ResourceDeclContext) InterpString() IInterpStringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInterpStringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInterpStringContext) } -func (s *MetadataDeclContext) Identifier() IIdentifierContext { +func (s *ResourceDeclContext) IfCondition() IIfConditionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { + if _, ok := ctx.(IIfConditionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2883,60 +2637,209 @@ func (s *MetadataDeclContext) Identifier() IIdentifierContext { return nil } - return t.(IIdentifierContext) + return t.(IIfConditionContext) +} + +func (s *ResourceDeclContext) Object() IObjectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IObjectContext) +} + +func (s *ResourceDeclContext) ForExpression() IForExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IForExpressionContext) +} + +func (s *ResourceDeclContext) AllDecorator() []IDecoratorContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDecoratorContext); ok { + len++ + } + } + + tst := make([]IDecoratorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDecoratorContext); ok { + tst[i] = t.(IDecoratorContext) + i++ + } + } + + return tst +} + +func (s *ResourceDeclContext) Decorator(i int) IDecoratorContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecoratorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDecoratorContext) +} + +func (s *ResourceDeclContext) EXISTING() antlr.TerminalNode { + return s.GetToken(bicepParserEXISTING, 0) } -func (s *MetadataDeclContext) GetRuleContext() antlr.RuleContext { +func (s *ResourceDeclContext) GetRuleContext() antlr.RuleContext { return s } -func (s *MetadataDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ResourceDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *MetadataDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ResourceDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: - return t.VisitMetadataDecl(s) + return t.VisitResourceDecl(s) default: return t.VisitChildren(s) } } -func (p *bicepParser) MetadataDecl() (localctx IMetadataDeclContext) { - localctx = NewMetadataDeclContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 18, bicepParserRULE_metadataDecl) +func (p *bicepParser) ResourceDecl() (localctx IResourceDeclContext) { + localctx = NewResourceDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, bicepParserRULE_resourceDecl) + var _la int + p.EnterOuterAlt(localctx, 1) + p.SetState(167) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == bicepParserAT { + { + p.SetState(164) + p.Decorator() + } + + p.SetState(169) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } { - p.SetState(181) - p.Match(bicepParserMETADATA) + p.SetState(170) + p.Match(bicepParserRESOURCE) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(182) + p.SetState(171) var _x = p.Identifier() - localctx.(*MetadataDeclContext).name = _x + localctx.(*ResourceDeclContext).name = _x + } + { + p.SetState(172) + + var _x = p.InterpString() + + localctx.(*ResourceDeclContext).type_ = _x + } + p.SetState(174) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == bicepParserEXISTING { + { + p.SetState(173) + p.Match(bicepParserEXISTING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + } { - p.SetState(183) + p.SetState(176) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - { - p.SetState(184) - p.expression(0) + p.SetState(180) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case bicepParserIF: + { + p.SetState(177) + p.IfCondition() + } + + case bicepParserOBRACE: + { + p.SetState(178) + p.Object() + } + + case bicepParserOBRACK: + { + p.SetState(179) + p.ForExpression() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } { - p.SetState(185) + p.SetState(182) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -2957,8 +2860,8 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ITypeDeclContext is an interface to support dynamic dispatch. -type ITypeDeclContext interface { +// IModuleDeclContext is an interface to support dynamic dispatch. +type IModuleDeclContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -2967,71 +2870,89 @@ type ITypeDeclContext interface { // GetName returns the name rule contexts. GetName() IIdentifierContext + // GetType_ returns the type_ rule contexts. + GetType_() IInterpStringContext + // SetName sets the name rule contexts. SetName(IIdentifierContext) + // SetType_ sets the type_ rule contexts. + SetType_(IInterpStringContext) + // Getter signatures - TYPE() antlr.TerminalNode + MODULE() antlr.TerminalNode ASSIGN() antlr.TerminalNode - TypeExpression() ITypeExpressionContext NL() antlr.TerminalNode Identifier() IIdentifierContext + InterpString() IInterpStringContext + IfCondition() IIfConditionContext + Object() IObjectContext + ForExpression() IForExpressionContext AllDecorator() []IDecoratorContext Decorator(i int) IDecoratorContext - // IsTypeDeclContext differentiates from other interfaces. - IsTypeDeclContext() + // IsModuleDeclContext differentiates from other interfaces. + IsModuleDeclContext() } -type TypeDeclContext struct { +type ModuleDeclContext struct { antlr.BaseParserRuleContext parser antlr.Parser name IIdentifierContext + type_ IInterpStringContext } -func NewEmptyTypeDeclContext() *TypeDeclContext { - var p = new(TypeDeclContext) +func NewEmptyModuleDeclContext() *ModuleDeclContext { + var p = new(ModuleDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_typeDecl + p.RuleIndex = bicepParserRULE_moduleDecl return p } -func InitEmptyTypeDeclContext(p *TypeDeclContext) { +func InitEmptyModuleDeclContext(p *ModuleDeclContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_typeDecl + p.RuleIndex = bicepParserRULE_moduleDecl } -func (*TypeDeclContext) IsTypeDeclContext() {} +func (*ModuleDeclContext) IsModuleDeclContext() {} -func NewTypeDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeDeclContext { - var p = new(TypeDeclContext) +func NewModuleDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ModuleDeclContext { + var p = new(ModuleDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = bicepParserRULE_typeDecl + p.RuleIndex = bicepParserRULE_moduleDecl return p } -func (s *TypeDeclContext) GetParser() antlr.Parser { return s.parser } +func (s *ModuleDeclContext) GetParser() antlr.Parser { return s.parser } -func (s *TypeDeclContext) GetName() IIdentifierContext { return s.name } +func (s *ModuleDeclContext) GetName() IIdentifierContext { return s.name } -func (s *TypeDeclContext) SetName(v IIdentifierContext) { s.name = v } +func (s *ModuleDeclContext) GetType_() IInterpStringContext { return s.type_ } -func (s *TypeDeclContext) TYPE() antlr.TerminalNode { - return s.GetToken(bicepParserTYPE, 0) +func (s *ModuleDeclContext) SetName(v IIdentifierContext) { s.name = v } + +func (s *ModuleDeclContext) SetType_(v IInterpStringContext) { s.type_ = v } + +func (s *ModuleDeclContext) MODULE() antlr.TerminalNode { + return s.GetToken(bicepParserMODULE, 0) } -func (s *TypeDeclContext) ASSIGN() antlr.TerminalNode { +func (s *ModuleDeclContext) ASSIGN() antlr.TerminalNode { return s.GetToken(bicepParserASSIGN, 0) } -func (s *TypeDeclContext) TypeExpression() ITypeExpressionContext { +func (s *ModuleDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) +} + +func (s *ModuleDeclContext) Identifier() IIdentifierContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeExpressionContext); ok { + if _, ok := ctx.(IIdentifierContext); ok { t = ctx.(antlr.RuleContext) break } @@ -3041,17 +2962,29 @@ func (s *TypeDeclContext) TypeExpression() ITypeExpressionContext { return nil } - return t.(ITypeExpressionContext) + return t.(IIdentifierContext) } -func (s *TypeDeclContext) NL() antlr.TerminalNode { - return s.GetToken(bicepParserNL, 0) +func (s *ModuleDeclContext) InterpString() IInterpStringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInterpStringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInterpStringContext) } -func (s *TypeDeclContext) Identifier() IIdentifierContext { +func (s *ModuleDeclContext) IfCondition() IIfConditionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { + if _, ok := ctx.(IIfConditionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -3061,10 +2994,42 @@ func (s *TypeDeclContext) Identifier() IIdentifierContext { return nil } - return t.(IIdentifierContext) + return t.(IIfConditionContext) } -func (s *TypeDeclContext) AllDecorator() []IDecoratorContext { +func (s *ModuleDeclContext) Object() IObjectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IObjectContext) +} + +func (s *ModuleDeclContext) ForExpression() IForExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IForExpressionContext) +} + +func (s *ModuleDeclContext) AllDecorator() []IDecoratorContext { children := s.GetChildren() len := 0 for _, ctx := range children { @@ -3085,7 +3050,7 @@ func (s *TypeDeclContext) AllDecorator() []IDecoratorContext { return tst } -func (s *TypeDeclContext) Decorator(i int) IDecoratorContext { +func (s *ModuleDeclContext) Decorator(i int) IDecoratorContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { @@ -3105,31 +3070,31 @@ func (s *TypeDeclContext) Decorator(i int) IDecoratorContext { return t.(IDecoratorContext) } -func (s *TypeDeclContext) GetRuleContext() antlr.RuleContext { +func (s *ModuleDeclContext) GetRuleContext() antlr.RuleContext { return s } -func (s *TypeDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ModuleDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *TypeDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ModuleDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: - return t.VisitTypeDecl(s) + return t.VisitModuleDecl(s) default: return t.VisitChildren(s) } } -func (p *bicepParser) TypeDecl() (localctx ITypeDeclContext) { - localctx = NewTypeDeclContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 20, bicepParserRULE_typeDecl) +func (p *bicepParser) ModuleDecl() (localctx IModuleDeclContext) { + localctx = NewModuleDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 20, bicepParserRULE_moduleDecl) var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(190) + p.SetState(187) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3138,11 +3103,11 @@ func (p *bicepParser) TypeDecl() (localctx ITypeDeclContext) { for _la == bicepParserAT { { - p.SetState(187) + p.SetState(184) p.Decorator() } - p.SetState(192) + p.SetState(189) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3150,34 +3115,66 @@ func (p *bicepParser) TypeDecl() (localctx ITypeDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(193) - p.Match(bicepParserTYPE) + p.SetState(190) + p.Match(bicepParserMODULE) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(194) + p.SetState(191) var _x = p.Identifier() - localctx.(*TypeDeclContext).name = _x + localctx.(*ModuleDeclContext).name = _x } { - p.SetState(195) + p.SetState(192) + + var _x = p.InterpString() + + localctx.(*ModuleDeclContext).type_ = _x + } + { + p.SetState(193) p.Match(bicepParserASSIGN) if p.HasError() { // Recognition error - abort rule goto errorExit } } + p.SetState(197) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case bicepParserIF: + { + p.SetState(194) + p.IfCondition() + } + + case bicepParserOBRACE: + { + p.SetState(195) + p.Object() + } + + case bicepParserOBRACK: + { + p.SetState(196) + p.ForExpression() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } { - p.SetState(196) - p.TypeExpression() - } - { - p.SetState(197) + p.SetState(199) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3198,8 +3195,8 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IModuleDeclContext is an interface to support dynamic dispatch. -type IModuleDeclContext interface { +// IOutputDeclContext is an interface to support dynamic dispatch. +type IOutputDeclContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -3208,89 +3205,96 @@ type IModuleDeclContext interface { // GetName returns the name rule contexts. GetName() IIdentifierContext - // GetType_ returns the type_ rule contexts. - GetType_() IInterpStringContext + // GetType1 returns the type1 rule contexts. + GetType1() IIdentifierContext + + // GetType2 returns the type2 rule contexts. + GetType2() IInterpStringContext // SetName sets the name rule contexts. SetName(IIdentifierContext) - // SetType_ sets the type_ rule contexts. - SetType_(IInterpStringContext) + // SetType1 sets the type1 rule contexts. + SetType1(IIdentifierContext) + + // SetType2 sets the type2 rule contexts. + SetType2(IInterpStringContext) // Getter signatures - MODULE() antlr.TerminalNode + OUTPUT() antlr.TerminalNode ASSIGN() antlr.TerminalNode + Expression() IExpressionContext NL() antlr.TerminalNode - Identifier() IIdentifierContext - InterpString() IInterpStringContext - IfCondition() IIfConditionContext - Object() IObjectContext - ForExpression() IForExpressionContext + AllIdentifier() []IIdentifierContext + Identifier(i int) IIdentifierContext + RESOURCE() antlr.TerminalNode AllDecorator() []IDecoratorContext Decorator(i int) IDecoratorContext + InterpString() IInterpStringContext - // IsModuleDeclContext differentiates from other interfaces. - IsModuleDeclContext() + // IsOutputDeclContext differentiates from other interfaces. + IsOutputDeclContext() } -type ModuleDeclContext struct { +type OutputDeclContext struct { antlr.BaseParserRuleContext parser antlr.Parser name IIdentifierContext - type_ IInterpStringContext + type1 IIdentifierContext + type2 IInterpStringContext } -func NewEmptyModuleDeclContext() *ModuleDeclContext { - var p = new(ModuleDeclContext) +func NewEmptyOutputDeclContext() *OutputDeclContext { + var p = new(OutputDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_moduleDecl + p.RuleIndex = bicepParserRULE_outputDecl return p } -func InitEmptyModuleDeclContext(p *ModuleDeclContext) { +func InitEmptyOutputDeclContext(p *OutputDeclContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = bicepParserRULE_moduleDecl + p.RuleIndex = bicepParserRULE_outputDecl } -func (*ModuleDeclContext) IsModuleDeclContext() {} +func (*OutputDeclContext) IsOutputDeclContext() {} -func NewModuleDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ModuleDeclContext { - var p = new(ModuleDeclContext) +func NewOutputDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OutputDeclContext { + var p = new(OutputDeclContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = bicepParserRULE_moduleDecl + p.RuleIndex = bicepParserRULE_outputDecl return p } -func (s *ModuleDeclContext) GetParser() antlr.Parser { return s.parser } +func (s *OutputDeclContext) GetParser() antlr.Parser { return s.parser } -func (s *ModuleDeclContext) GetName() IIdentifierContext { return s.name } +func (s *OutputDeclContext) GetName() IIdentifierContext { return s.name } -func (s *ModuleDeclContext) GetType_() IInterpStringContext { return s.type_ } +func (s *OutputDeclContext) GetType1() IIdentifierContext { return s.type1 } -func (s *ModuleDeclContext) SetName(v IIdentifierContext) { s.name = v } +func (s *OutputDeclContext) GetType2() IInterpStringContext { return s.type2 } -func (s *ModuleDeclContext) SetType_(v IInterpStringContext) { s.type_ = v } +func (s *OutputDeclContext) SetName(v IIdentifierContext) { s.name = v } -func (s *ModuleDeclContext) MODULE() antlr.TerminalNode { - return s.GetToken(bicepParserMODULE, 0) -} +func (s *OutputDeclContext) SetType1(v IIdentifierContext) { s.type1 = v } -func (s *ModuleDeclContext) ASSIGN() antlr.TerminalNode { - return s.GetToken(bicepParserASSIGN, 0) +func (s *OutputDeclContext) SetType2(v IInterpStringContext) { s.type2 = v } + +func (s *OutputDeclContext) OUTPUT() antlr.TerminalNode { + return s.GetToken(bicepParserOUTPUT, 0) } -func (s *ModuleDeclContext) NL() antlr.TerminalNode { - return s.GetToken(bicepParserNL, 0) +func (s *OutputDeclContext) ASSIGN() antlr.TerminalNode { + return s.GetToken(bicepParserASSIGN, 0) } -func (s *ModuleDeclContext) Identifier() IIdentifierContext { +func (s *OutputDeclContext) Expression() IExpressionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { + if _, ok := ctx.(IExpressionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -3300,47 +3304,44 @@ func (s *ModuleDeclContext) Identifier() IIdentifierContext { return nil } - return t.(IIdentifierContext) + return t.(IExpressionContext) } -func (s *ModuleDeclContext) InterpString() IInterpStringContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IInterpStringContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IInterpStringContext) +func (s *OutputDeclContext) NL() antlr.TerminalNode { + return s.GetToken(bicepParserNL, 0) } -func (s *ModuleDeclContext) IfCondition() IIfConditionContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIfConditionContext); ok { - t = ctx.(antlr.RuleContext) - break +func (s *OutputDeclContext) AllIdentifier() []IIdentifierContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IIdentifierContext); ok { + len++ } } - if t == nil { - return nil + tst := make([]IIdentifierContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IIdentifierContext); ok { + tst[i] = t.(IIdentifierContext) + i++ + } } - return t.(IIfConditionContext) + return tst } -func (s *ModuleDeclContext) Object() IObjectContext { +func (s *OutputDeclContext) Identifier(i int) IIdentifierContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IObjectContext); ok { - t = ctx.(antlr.RuleContext) - break + if _, ok := ctx.(IIdentifierContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -3348,26 +3349,14 @@ func (s *ModuleDeclContext) Object() IObjectContext { return nil } - return t.(IObjectContext) + return t.(IIdentifierContext) } -func (s *ModuleDeclContext) ForExpression() IForExpressionContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IForExpressionContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IForExpressionContext) +func (s *OutputDeclContext) RESOURCE() antlr.TerminalNode { + return s.GetToken(bicepParserRESOURCE, 0) } -func (s *ModuleDeclContext) AllDecorator() []IDecoratorContext { +func (s *OutputDeclContext) AllDecorator() []IDecoratorContext { children := s.GetChildren() len := 0 for _, ctx := range children { @@ -3388,7 +3377,7 @@ func (s *ModuleDeclContext) AllDecorator() []IDecoratorContext { return tst } -func (s *ModuleDeclContext) Decorator(i int) IDecoratorContext { +func (s *OutputDeclContext) Decorator(i int) IDecoratorContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { @@ -3408,31 +3397,47 @@ func (s *ModuleDeclContext) Decorator(i int) IDecoratorContext { return t.(IDecoratorContext) } -func (s *ModuleDeclContext) GetRuleContext() antlr.RuleContext { +func (s *OutputDeclContext) InterpString() IInterpStringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInterpStringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInterpStringContext) +} + +func (s *OutputDeclContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ModuleDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *OutputDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ModuleDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *OutputDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case bicepVisitor: - return t.VisitModuleDecl(s) + return t.VisitOutputDecl(s) default: return t.VisitChildren(s) } } -func (p *bicepParser) ModuleDecl() (localctx IModuleDeclContext) { - localctx = NewModuleDeclContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 22, bicepParserRULE_moduleDecl) +func (p *bicepParser) OutputDecl() (localctx IOutputDeclContext) { + localctx = NewOutputDeclContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 22, bicepParserRULE_outputDecl) var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(202) + p.SetState(204) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3441,11 +3446,11 @@ func (p *bicepParser) ModuleDecl() (localctx IModuleDeclContext) { for _la == bicepParserAT { { - p.SetState(199) + p.SetState(201) p.Decorator() } - p.SetState(204) + p.SetState(206) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3453,34 +3458,19 @@ func (p *bicepParser) ModuleDecl() (localctx IModuleDeclContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(205) - p.Match(bicepParserMODULE) + p.SetState(207) + p.Match(bicepParserOUTPUT) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(206) + p.SetState(208) var _x = p.Identifier() - localctx.(*ModuleDeclContext).name = _x - } - { - p.SetState(207) - - var _x = p.InterpString() - - localctx.(*ModuleDeclContext).type_ = _x - } - { - p.SetState(208) - p.Match(bicepParserASSIGN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + localctx.(*OutputDeclContext).name = _x } p.SetState(212) p.GetErrorHandler().Sync(p) @@ -3488,31 +3478,50 @@ func (p *bicepParser) ModuleDecl() (localctx IModuleDeclContext) { goto errorExit } - switch p.GetTokenStream().LA(1) { - case bicepParserIF: + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) { + case 1: { p.SetState(209) - p.IfCondition() + + var _x = p.Identifier() + + localctx.(*OutputDeclContext).type1 = _x } - case bicepParserOBRACE: + case 2: { p.SetState(210) - p.Object() + p.Match(bicepParserRESOURCE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case bicepParserOBRACK: { p.SetState(211) - p.ForExpression() + + var _x = p.InterpString() + + localctx.(*OutputDeclContext).type2 = _x + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + { + p.SetState(214) + p.Match(bicepParserASSIGN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit } { - p.SetState(214) + p.SetState(215) + p.expression(0) + } + { + p.SetState(216) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3640,7 +3649,7 @@ func (p *bicepParser) IfCondition() (localctx IIfConditionContext) { p.EnterRule(localctx, 24, bicepParserRULE_ifCondition) p.EnterOuterAlt(localctx, 1) { - p.SetState(216) + p.SetState(218) p.Match(bicepParserIF) if p.HasError() { // Recognition error - abort rule @@ -3648,11 +3657,11 @@ func (p *bicepParser) IfCondition() (localctx IIfConditionContext) { } } { - p.SetState(217) + p.SetState(219) p.ParenthesizedExpression() } { - p.SetState(218) + p.SetState(220) p.Object() } @@ -3853,14 +3862,14 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(220) + p.SetState(222) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(224) + p.SetState(226) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3869,7 +3878,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { for _la == bicepParserNL { { - p.SetState(221) + p.SetState(223) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3877,7 +3886,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } - p.SetState(226) + p.SetState(228) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3885,14 +3894,14 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(227) + p.SetState(229) p.Match(bicepParserFOR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(230) + p.SetState(232) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3901,7 +3910,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: { - p.SetState(228) + p.SetState(230) var _x = p.Identifier() @@ -3910,7 +3919,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { case bicepParserOPAR: { - p.SetState(229) + p.SetState(231) p.ForVariableBlock() } @@ -3919,7 +3928,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { goto errorExit } { - p.SetState(232) + p.SetState(234) p.Match(bicepParserIN) if p.HasError() { // Recognition error - abort rule @@ -3927,11 +3936,11 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } { - p.SetState(233) + p.SetState(235) p.expression(0) } { - p.SetState(234) + p.SetState(236) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -3939,10 +3948,10 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } { - p.SetState(235) + p.SetState(237) p.ForBody() } - p.SetState(239) + p.SetState(241) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3951,7 +3960,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { for _la == bicepParserNL { { - p.SetState(236) + p.SetState(238) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -3959,7 +3968,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } } - p.SetState(241) + p.SetState(243) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3967,7 +3976,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(242) + p.SetState(244) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -4136,7 +4145,7 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { p.EnterRule(localctx, 28, bicepParserRULE_forVariableBlock) p.EnterOuterAlt(localctx, 1) { - p.SetState(244) + p.SetState(246) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule @@ -4144,14 +4153,14 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { } } { - p.SetState(245) + p.SetState(247) var _x = p.Identifier() localctx.(*ForVariableBlockContext).item = _x } { - p.SetState(246) + p.SetState(248) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -4159,14 +4168,14 @@ func (p *bicepParser) ForVariableBlock() (localctx IForVariableBlockContext) { } } { - p.SetState(247) + p.SetState(249) var _x = p.Identifier() localctx.(*ForVariableBlockContext).index = _x } { - p.SetState(248) + p.SetState(250) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -4298,7 +4307,7 @@ func (s *ForBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) ForBody() (localctx IForBodyContext) { localctx = NewForBodyContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 30, bicepParserRULE_forBody) - p.SetState(252) + p.SetState(254) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4308,7 +4317,7 @@ func (p *bicepParser) ForBody() (localctx IForBodyContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(250) + p.SetState(252) var _x = p.expression(0) @@ -4318,7 +4327,7 @@ func (p *bicepParser) ForBody() (localctx IForBodyContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(251) + p.SetState(253) p.IfCondition() } @@ -4475,7 +4484,7 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { p.EnterRule(localctx, 32, bicepParserRULE_interpString) var _alt int - p.SetState(267) + p.SetState(269) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4485,14 +4494,14 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_LEFT_PIECE: p.EnterOuterAlt(localctx, 1) { - p.SetState(254) + p.SetState(256) p.Match(bicepParserSTRING_LEFT_PIECE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(260) + p.SetState(262) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4504,11 +4513,11 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(255) + p.SetState(257) p.expression(0) } { - p.SetState(256) + p.SetState(258) p.Match(bicepParserSTRING_MIDDLE_PIECE) if p.HasError() { // Recognition error - abort rule @@ -4517,7 +4526,7 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { } } - p.SetState(262) + p.SetState(264) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4528,11 +4537,11 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { } } { - p.SetState(263) + p.SetState(265) p.expression(0) } { - p.SetState(264) + p.SetState(266) p.Match(bicepParserSTRING_RIGHT_PIECE) if p.HasError() { // Recognition error - abort rule @@ -4543,7 +4552,7 @@ func (p *bicepParser) InterpString() (localctx IInterpStringContext) { case bicepParserSTRING_COMPLETE: p.EnterOuterAlt(localctx, 2) { - p.SetState(266) + p.SetState(268) p.Match(bicepParserSTRING_COMPLETE) if p.HasError() { // Recognition error - abort rule @@ -4807,12 +4816,12 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(270) + p.SetState(272) p.PrimaryExpression() } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(298) + p.SetState(300) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4827,7 +4836,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(296) + p.SetState(298) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4837,14 +4846,14 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 1: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(272) + p.SetState(274) if !(p.Precpred(p.GetParserRuleContext(), 6)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) goto errorExit } { - p.SetState(273) + p.SetState(275) p.Match(bicepParserQMARK) if p.HasError() { // Recognition error - abort rule @@ -4852,11 +4861,11 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(274) + p.SetState(276) p.expression(0) } { - p.SetState(275) + p.SetState(277) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -4864,39 +4873,39 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(276) + p.SetState(278) p.expression(7) } case 2: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(278) + p.SetState(280) if !(p.Precpred(p.GetParserRuleContext(), 2)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) goto errorExit } { - p.SetState(279) + p.SetState(281) p.LogicCharacter() } { - p.SetState(280) + p.SetState(282) p.expression(3) } case 3: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(282) + p.SetState(284) if !(p.Precpred(p.GetParserRuleContext(), 7)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) goto errorExit } { - p.SetState(283) + p.SetState(285) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule @@ -4904,11 +4913,11 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(284) + p.SetState(286) p.expression(0) } { - p.SetState(285) + p.SetState(287) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -4919,14 +4928,14 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 4: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(287) + p.SetState(289) if !(p.Precpred(p.GetParserRuleContext(), 5)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) goto errorExit } { - p.SetState(288) + p.SetState(290) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -4934,7 +4943,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(289) + p.SetState(291) var _x = p.Identifier() @@ -4944,14 +4953,14 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { case 5: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(290) + p.SetState(292) if !(p.Precpred(p.GetParserRuleContext(), 4)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) goto errorExit } { - p.SetState(291) + p.SetState(293) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -4959,21 +4968,21 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(292) + p.SetState(294) p.FunctionCall() } case 6: localctx = NewExpressionContext(p, _parentctx, _parentState) p.PushNewRecursionContext(localctx, _startState, bicepParserRULE_expression) - p.SetState(293) + p.SetState(295) if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(294) + p.SetState(296) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -4981,7 +4990,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } { - p.SetState(295) + p.SetState(297) var _x = p.Identifier() @@ -4993,7 +5002,7 @@ func (p *bicepParser) expression(_p int) (localctx IExpressionContext) { } } - p.SetState(300) + p.SetState(302) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5017,6 +5026,216 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } +// ILambdaExpressionContext is an interface to support dynamic dispatch. +type ILambdaExpressionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + ARROW() antlr.TerminalNode + Expression() IExpressionContext + OPAR() antlr.TerminalNode + CPAR() antlr.TerminalNode + Identifier() IIdentifierContext + ArgumentList() IArgumentListContext + + // IsLambdaExpressionContext differentiates from other interfaces. + IsLambdaExpressionContext() +} + +type LambdaExpressionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyLambdaExpressionContext() *LambdaExpressionContext { + var p = new(LambdaExpressionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_lambdaExpression + return p +} + +func InitEmptyLambdaExpressionContext(p *LambdaExpressionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = bicepParserRULE_lambdaExpression +} + +func (*LambdaExpressionContext) IsLambdaExpressionContext() {} + +func NewLambdaExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LambdaExpressionContext { + var p = new(LambdaExpressionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = bicepParserRULE_lambdaExpression + + return p +} + +func (s *LambdaExpressionContext) GetParser() antlr.Parser { return s.parser } + +func (s *LambdaExpressionContext) ARROW() antlr.TerminalNode { + return s.GetToken(bicepParserARROW, 0) +} + +func (s *LambdaExpressionContext) Expression() IExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *LambdaExpressionContext) OPAR() antlr.TerminalNode { + return s.GetToken(bicepParserOPAR, 0) +} + +func (s *LambdaExpressionContext) CPAR() antlr.TerminalNode { + return s.GetToken(bicepParserCPAR, 0) +} + +func (s *LambdaExpressionContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *LambdaExpressionContext) ArgumentList() IArgumentListContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentListContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentListContext) +} + +func (s *LambdaExpressionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LambdaExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LambdaExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case bicepVisitor: + return t.VisitLambdaExpression(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *bicepParser) LambdaExpression() (localctx ILambdaExpressionContext) { + localctx = NewLambdaExpressionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 36, bicepParserRULE_lambdaExpression) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(309) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case bicepParserOPAR: + { + p.SetState(303) + p.Match(bicepParserOPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(305) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1691034387992658) != 0 { + { + p.SetState(304) + p.ArgumentList() + } + + } + { + p.SetState(307) + p.Match(bicepParserCPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: + { + p.SetState(308) + p.Identifier() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + { + p.SetState(311) + p.Match(bicepParserARROW) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(312) + p.expression(0) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + // ILogicCharacterContext is an interface to support dynamic dispatch. type ILogicCharacterContext interface { antlr.ParserRuleContext @@ -5112,12 +5331,12 @@ func (s *LogicCharacterContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) LogicCharacter() (localctx ILogicCharacterContext) { localctx = NewLogicCharacterContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 36, bicepParserRULE_logicCharacter) + p.EnterRule(localctx, 38, bicepParserRULE_logicCharacter) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(301) + p.SetState(314) _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&277076930199552) != 0) { @@ -5157,6 +5376,7 @@ type IPrimaryExpressionContext interface { Object() IObjectContext ForExpression() IForExpressionContext ParenthesizedExpression() IParenthesizedExpressionContext + LambdaExpression() ILambdaExpressionContext // IsPrimaryExpressionContext differentiates from other interfaces. IsPrimaryExpressionContext() @@ -5310,6 +5530,22 @@ func (s *PrimaryExpressionContext) ParenthesizedExpression() IParenthesizedExpre return t.(IParenthesizedExpressionContext) } +func (s *PrimaryExpressionContext) LambdaExpression() ILambdaExpressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILambdaExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ILambdaExpressionContext) +} + func (s *PrimaryExpressionContext) GetRuleContext() antlr.RuleContext { return s } @@ -5330,39 +5566,39 @@ func (s *PrimaryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interf func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { localctx = NewPrimaryExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 38, bicepParserRULE_primaryExpression) - p.SetState(311) + p.EnterRule(localctx, 40, bicepParserRULE_primaryExpression) + p.SetState(325) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 26, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(303) + p.SetState(316) p.LiteralValue() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(304) + p.SetState(317) p.FunctionCall() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(305) + p.SetState(318) p.InterpString() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(306) + p.SetState(319) p.Match(bicepParserMULTILINE_STRING) if p.HasError() { // Recognition error - abort rule @@ -5373,31 +5609,38 @@ func (p *bicepParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(307) + p.SetState(320) p.Array() } case 6: p.EnterOuterAlt(localctx, 6) { - p.SetState(308) + p.SetState(321) p.Object() } case 7: p.EnterOuterAlt(localctx, 7) { - p.SetState(309) + p.SetState(322) p.ForExpression() } case 8: p.EnterOuterAlt(localctx, 8) { - p.SetState(310) + p.SetState(323) p.ParenthesizedExpression() } + case 9: + p.EnterOuterAlt(localctx, 9) + { + p.SetState(324) + p.LambdaExpression() + } + case antlr.ATNInvalidAltNumber: goto errorExit } @@ -5517,19 +5760,19 @@ func (s *ParenthesizedExpressionContext) Accept(visitor antlr.ParseTreeVisitor) func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressionContext) { localctx = NewParenthesizedExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 40, bicepParserRULE_parenthesizedExpression) + p.EnterRule(localctx, 42, bicepParserRULE_parenthesizedExpression) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(313) + p.SetState(327) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(315) + p.SetState(329) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5538,7 +5781,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(314) + p.SetState(328) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5548,10 +5791,10 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(317) + p.SetState(331) p.expression(0) } - p.SetState(319) + p.SetState(333) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5560,7 +5803,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi if _la == bicepParserNL { { - p.SetState(318) + p.SetState(332) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -5570,7 +5813,7 @@ func (p *bicepParser) ParenthesizedExpression() (localctx IParenthesizedExpressi } { - p.SetState(321) + p.SetState(335) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -5684,10 +5927,10 @@ func (s *TypeExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) TypeExpression() (localctx ITypeExpressionContext) { localctx = NewTypeExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 42, bicepParserRULE_typeExpression) + p.EnterRule(localctx, 44, bicepParserRULE_typeExpression) p.EnterOuterAlt(localctx, 1) { - p.SetState(323) + p.SetState(337) var _x = p.Identifier() @@ -5809,18 +6052,18 @@ func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { localctx = NewLiteralValueContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 44, bicepParserRULE_literalValue) - p.SetState(330) + p.EnterRule(localctx, 46, bicepParserRULE_literalValue) + p.SetState(344) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 29, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 31, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(325) + p.SetState(339) p.Match(bicepParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -5831,7 +6074,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(326) + p.SetState(340) p.Match(bicepParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -5842,7 +6085,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(327) + p.SetState(341) p.Match(bicepParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -5853,7 +6096,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(328) + p.SetState(342) p.Match(bicepParserNULL) if p.HasError() { // Recognition error - abort rule @@ -5864,7 +6107,7 @@ func (p *bicepParser) LiteralValue() (localctx ILiteralValueContext) { case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(329) + p.SetState(343) p.Identifier() } @@ -6013,19 +6256,19 @@ func (s *ObjectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Object() (localctx IObjectContext) { localctx = NewObjectContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 46, bicepParserRULE_object) + p.EnterRule(localctx, 48, bicepParserRULE_object) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(332) + p.SetState(346) p.Match(bicepParserOBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(349) + p.SetState(363) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6033,7 +6276,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) if _la == bicepParserNL { - p.SetState(334) + p.SetState(348) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6042,7 +6285,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(333) + p.SetState(347) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -6050,26 +6293,26 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(336) + p.SetState(350) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(346) + p.SetState(360) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&283659504435200) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&565134481145856) != 0 { { - p.SetState(338) + p.SetState(352) p.ObjectProperty() } - p.SetState(340) + p.SetState(354) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6078,7 +6321,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(339) + p.SetState(353) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -6086,7 +6329,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } } - p.SetState(342) + p.SetState(356) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6094,7 +6337,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { _la = p.GetTokenStream().LA(1) } - p.SetState(348) + p.SetState(362) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6104,7 +6347,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } { - p.SetState(351) + p.SetState(365) p.Match(bicepParserCBRACE) if p.HasError() { // Recognition error - abort rule @@ -6257,9 +6500,9 @@ func (s *ObjectPropertyContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { localctx = NewObjectPropertyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 48, bicepParserRULE_objectProperty) + p.EnterRule(localctx, 50, bicepParserRULE_objectProperty) p.EnterOuterAlt(localctx, 1) - p.SetState(355) + p.SetState(369) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6268,7 +6511,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { switch p.GetTokenStream().LA(1) { case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: { - p.SetState(353) + p.SetState(367) var _x = p.Identifier() @@ -6277,7 +6520,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { case bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE: { - p.SetState(354) + p.SetState(368) p.InterpString() } @@ -6286,7 +6529,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { goto errorExit } { - p.SetState(357) + p.SetState(371) p.Match(bicepParserCOL) if p.HasError() { // Recognition error - abort rule @@ -6294,7 +6537,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } } { - p.SetState(358) + p.SetState(372) p.expression(0) } @@ -6439,19 +6682,19 @@ func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Array() (localctx IArrayContext) { localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 50, bicepParserRULE_array) + p.EnterRule(localctx, 52, bicepParserRULE_array) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(360) + p.SetState(374) p.Match(bicepParserOBRACK) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(364) + p.SetState(378) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6460,7 +6703,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { for _la == bicepParserNL { { - p.SetState(361) + p.SetState(375) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -6468,27 +6711,27 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } } - p.SetState(366) + p.SetState(380) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(370) + p.SetState(384) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&846609457860690) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1691034387992658) != 0 { { - p.SetState(367) + p.SetState(381) p.ArrayItem() } - p.SetState(372) + p.SetState(386) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6496,7 +6739,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(373) + p.SetState(387) p.Match(bicepParserCBRACK) if p.HasError() { // Recognition error - abort rule @@ -6614,22 +6857,22 @@ func (s *ArrayItemContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { localctx = NewArrayItemContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 52, bicepParserRULE_arrayItem) + p.EnterRule(localctx, 54, bicepParserRULE_arrayItem) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(375) + p.SetState(389) p.expression(0) } - p.SetState(382) + p.SetState(396) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { case bicepParserNL: - p.SetState(377) + p.SetState(391) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6638,7 +6881,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { for ok := true; ok; ok = _la == bicepParserNL { { - p.SetState(376) + p.SetState(390) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -6646,7 +6889,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - p.SetState(379) + p.SetState(393) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6656,7 +6899,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { case bicepParserCOMMA: { - p.SetState(381) + p.SetState(395) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -6774,10 +7017,10 @@ func (s *DecoratorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Decorator() (localctx IDecoratorContext) { localctx = NewDecoratorContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 54, bicepParserRULE_decorator) + p.EnterRule(localctx, 56, bicepParserRULE_decorator) p.EnterOuterAlt(localctx, 1) { - p.SetState(384) + p.SetState(398) p.Match(bicepParserAT) if p.HasError() { // Recognition error - abort rule @@ -6785,11 +7028,11 @@ func (p *bicepParser) Decorator() (localctx IDecoratorContext) { } } { - p.SetState(385) + p.SetState(399) p.DecoratorExpression() } { - p.SetState(386) + p.SetState(400) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -6914,29 +7157,29 @@ func (s *DecoratorExpressionContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContext) { localctx = NewDecoratorExpressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 56, bicepParserRULE_decoratorExpression) - p.SetState(393) + p.EnterRule(localctx, 58, bicepParserRULE_decoratorExpression) + p.SetState(407) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 39, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 41, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(388) + p.SetState(402) p.FunctionCall() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(389) + p.SetState(403) p.expression(0) } { - p.SetState(390) + p.SetState(404) p.Match(bicepParserDOT) if p.HasError() { // Recognition error - abort rule @@ -6944,7 +7187,7 @@ func (p *bicepParser) DecoratorExpression() (localctx IDecoratorExpressionContex } } { - p.SetState(391) + p.SetState(405) p.FunctionCall() } @@ -7084,27 +7327,27 @@ func (s *FunctionCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { localctx = NewFunctionCallContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 58, bicepParserRULE_functionCall) + p.EnterRule(localctx, 60, bicepParserRULE_functionCall) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(395) + p.SetState(409) p.Identifier() } { - p.SetState(396) + p.SetState(410) p.Match(bicepParserOPAR) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(401) + p.SetState(415) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 41, p.GetParserRuleContext()) == 1 { - p.SetState(398) + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 43, p.GetParserRuleContext()) == 1 { + p.SetState(412) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -7113,7 +7356,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(397) + p.SetState(411) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -7123,14 +7366,14 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(400) + p.SetState(414) p.ArgumentList() } } else if p.HasError() { // JIM goto errorExit } - p.SetState(404) + p.SetState(418) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -7139,7 +7382,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { if _la == bicepParserNL { { - p.SetState(403) + p.SetState(417) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -7149,7 +7392,7 @@ func (p *bicepParser) FunctionCall() (localctx IFunctionCallContext) { } { - p.SetState(406) + p.SetState(420) p.Match(bicepParserCPAR) if p.HasError() { // Recognition error - abort rule @@ -7298,15 +7541,15 @@ func (s *ArgumentListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { localctx = NewArgumentListContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 60, bicepParserRULE_argumentList) + p.EnterRule(localctx, 62, bicepParserRULE_argumentList) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(408) + p.SetState(422) p.expression(0) } - p.SetState(416) + p.SetState(430) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -7315,14 +7558,14 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { for _la == bicepParserCOMMA { { - p.SetState(409) + p.SetState(423) p.Match(bicepParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(411) + p.SetState(425) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -7331,7 +7574,7 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { if _la == bicepParserNL { { - p.SetState(410) + p.SetState(424) p.Match(bicepParserNL) if p.HasError() { // Recognition error - abort rule @@ -7341,11 +7584,11 @@ func (p *bicepParser) ArgumentList() (localctx IArgumentListContext) { } { - p.SetState(413) + p.SetState(427) p.expression(0) } - p.SetState(418) + p.SetState(432) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -7541,15 +7784,15 @@ func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *bicepParser) Identifier() (localctx IIdentifierContext) { localctx = NewIdentifierContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 62, bicepParserRULE_identifier) + p.EnterRule(localctx, 64, bicepParserRULE_identifier) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(419) + p.SetState(433) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&283640177082368) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&565115153793024) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) diff --git a/pkg/parser/bicep/antlr/parser/bicep_visitor.go b/pkg/parser/bicep/antlr/parser/bicep_visitor.go index f3805d96c4d..73793c7a585 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_visitor.go +++ b/pkg/parser/bicep/antlr/parser/bicep_visitor.go @@ -14,21 +14,6 @@ type bicepVisitor interface { // Visit a parse tree produced by bicepParser#statement. VisitStatement(ctx *StatementContext) interface{} - // Visit a parse tree produced by bicepParser#parameterDecl. - VisitParameterDecl(ctx *ParameterDeclContext) interface{} - - // Visit a parse tree produced by bicepParser#parameterDefaultValue. - VisitParameterDefaultValue(ctx *ParameterDefaultValueContext) interface{} - - // Visit a parse tree produced by bicepParser#variableDecl. - VisitVariableDecl(ctx *VariableDeclContext) interface{} - - // Visit a parse tree produced by bicepParser#resourceDecl. - VisitResourceDecl(ctx *ResourceDeclContext) interface{} - - // Visit a parse tree produced by bicepParser#outputDecl. - VisitOutputDecl(ctx *OutputDeclContext) interface{} - // Visit a parse tree produced by bicepParser#targetScopeDecl. VisitTargetScopeDecl(ctx *TargetScopeDeclContext) interface{} @@ -38,12 +23,27 @@ type bicepVisitor interface { // Visit a parse tree produced by bicepParser#metadataDecl. VisitMetadataDecl(ctx *MetadataDeclContext) interface{} + // Visit a parse tree produced by bicepParser#parameterDecl. + VisitParameterDecl(ctx *ParameterDeclContext) interface{} + + // Visit a parse tree produced by bicepParser#parameterDefaultValue. + VisitParameterDefaultValue(ctx *ParameterDefaultValueContext) interface{} + // Visit a parse tree produced by bicepParser#typeDecl. VisitTypeDecl(ctx *TypeDeclContext) interface{} + // Visit a parse tree produced by bicepParser#variableDecl. + VisitVariableDecl(ctx *VariableDeclContext) interface{} + + // Visit a parse tree produced by bicepParser#resourceDecl. + VisitResourceDecl(ctx *ResourceDeclContext) interface{} + // Visit a parse tree produced by bicepParser#moduleDecl. VisitModuleDecl(ctx *ModuleDeclContext) interface{} + // Visit a parse tree produced by bicepParser#outputDecl. + VisitOutputDecl(ctx *OutputDeclContext) interface{} + // Visit a parse tree produced by bicepParser#ifCondition. VisitIfCondition(ctx *IfConditionContext) interface{} @@ -62,6 +62,9 @@ type bicepVisitor interface { // Visit a parse tree produced by bicepParser#expression. VisitExpression(ctx *ExpressionContext) interface{} + // Visit a parse tree produced by bicepParser#lambdaExpression. + VisitLambdaExpression(ctx *LambdaExpressionContext) interface{} + // Visit a parse tree produced by bicepParser#logicCharacter. VisitLogicCharacter(ctx *LogicCharacterContext) interface{} diff --git a/pkg/scan/scan.go b/pkg/scan/scan.go index 15e7600ced1..90064790cd8 100644 --- a/pkg/scan/scan.go +++ b/pkg/scan/scan.go @@ -15,9 +15,9 @@ import ( "github.com/Checkmarx/kics/v2/pkg/parser" ansibleConfigParser "github.com/Checkmarx/kics/v2/pkg/parser/ansible/ini/config" ansibleHostsParser "github.com/Checkmarx/kics/v2/pkg/parser/ansible/ini/hosts" - bicepParser "github.com/Checkmarx/kics/v2/pkg/parser/bicep" - buildahParser "github.com/Checkmarx/kics/v2/pkg/parser/buildah" - dockerParser "github.com/Checkmarx/kics/v2/pkg/parser/docker" + bicepParser "github.com/Checkmarx/kics/v2/pkg/parser/bicep" + buildahParser "github.com/Checkmarx/kics/v2/pkg/parser/buildah" + dockerParser "github.com/Checkmarx/kics/v2/pkg/parser/docker" protoParser "github.com/Checkmarx/kics/v2/pkg/parser/grpc" jsonParser "github.com/Checkmarx/kics/v2/pkg/parser/json" terraformParser "github.com/Checkmarx/kics/v2/pkg/parser/terraform" From 9332f9ad5b37071540e8d6528b217aaf98272a67 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 9 May 2024 12:31:15 +0100 Subject: [PATCH 110/130] update unit tests --- pkg/parser/bicep/parser_test.go | 761 ++++++++++++++++++++++++++------ 1 file changed, 619 insertions(+), 142 deletions(-) diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 035a9bfddc7..164e91ba74c 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -244,10 +244,10 @@ func TestParseBicepFile(t *testing.T) { "OSVersion": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 33 + "_kics_line": 42 }, "_kics_type": { - "_kics_line": 33 + "_kics_line": 42 } }, "allowedValues": [ @@ -303,13 +303,144 @@ func TestParseBicepFile(t *testing.T) { }, "type": "string" }, + "arrayP": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 136 + }, + "_kics_type": { + "_kics_line": 136 + } + }, + "defaultValue": [ + "allLogs", + "ConnectedClientList" + ], + "type": "array" + }, + "capacity": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 65 + }, + "_kics_type": { + "_kics_line": 65 + } + }, + "allowedValues": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ] + ], + "defaultValue": 2, + "metadata": { + "description": "Optional. The size of the Redis cache to deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P (Premium) family (1, 2, 3, 4)." + }, + "type": "int" + }, + "diagnosticLogCategoriesToEnable": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 18 + }, + "_kics_type": { + "_kics_line": 18 + } + }, + "allowedValues": [ + [ + "allLogs", + "ConnectedClientList" + ] + ], + "defaultValue": [ + "allLogs" + ], + "metadata": { + "description": "Optional. The name of logs that will be streamed. \"allLogs\" includes all possible logs for the resource." + }, + "type": "array" + }, + "diagnosticMetricsToEnable": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 93 + }, + "_kics_type": { + "_kics_line": 93 + } + }, + "allowedValues": [ + [ + "AllMetrics" + ] + ], + "defaultValue": [ + "AllMetrics" + ], + "metadata": { + "description": "Optional. The name of metrics that will be streamed." + }, + "type": "array" + }, + "diagnosticSettingsName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 82 + }, + "_kics_type": { + "_kics_line": 82 + } + }, + "defaultValue": "'${name}-diagnosticSettings'", + "metadata": { + "description": "Optional. The name of the diagnostic setting, if deployed." + }, + "type": "string" + }, + "diagnosticWorkspaceId": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 85 + }, + "_kics_type": { + "_kics_line": 85 + } + }, + "defaultValue": "", + "metadata": { + "description": "Optional. Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub." + }, + "type": "string" + }, + "enableNonSslPort": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 99 + }, + "_kics_type": { + "_kics_line": 99 + } + }, + "defaultValue": false, + "metadata": { + "description": "Optional. Specifies whether the non-ssl Redis server port (6379) is enabled." + }, + "type": "bool" + }, "existingContainerSubnetName": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 53 + "_kics_line": 126 }, "_kics_type": { - "_kics_line": 53 + "_kics_line": 126 } }, "metadata": { @@ -320,10 +451,10 @@ func TestParseBicepFile(t *testing.T) { "existingStorageSubnetName": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 50 + "_kics_line": 123 }, "_kics_type": { - "_kics_line": 50 + "_kics_line": 123 } }, "metadata": { @@ -334,10 +465,10 @@ func TestParseBicepFile(t *testing.T) { "existingVNETName": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 47 + "_kics_line": 120 }, "_kics_type": { - "_kics_line": 47 + "_kics_line": 120 } }, "metadata": { @@ -345,13 +476,42 @@ func TestParseBicepFile(t *testing.T) { }, "type": "string" }, + "hasPrivateLink": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 96 + }, + "_kics_type": { + "_kics_line": 96 + } + }, + "defaultValue": false, + "metadata": { + "description": "Has the resource private endpoint?" + }, + "type": "bool" + }, + "keyvaultName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 68 + }, + "_kics_type": { + "_kics_line": 68 + } + }, + "metadata": { + "description": "The name of an existing keyvault, that it will be used to store secrets (connection string)" + }, + "type": "string" + }, "location": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 39 + "_kics_line": 112 }, "_kics_type": { - "_kics_line": 39 + "_kics_line": 112 } }, "defaultValue": "[resourceGroup().location]", @@ -360,25 +520,168 @@ func TestParseBicepFile(t *testing.T) { }, "type": "string" }, + "name": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 131 + }, + "_kics_type": { + "_kics_line": 131 + } + }, + "maxLength": 63, + "metadata": { + "description": "Required. The name of the Redis cache resource. Start and end with alphanumeric. Consecutive hyphens not allowed" + }, + "minLength": 1, + "type": "string" + }, "parenthesis": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 44 + "_kics_line": 117 }, "_kics_type": { - "_kics_line": 44 + "_kics_line": 117 } }, "defaultValue": "simple-vm", "type": "string" }, + "redisConfiguration": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 102 + }, + "_kics_type": { + "_kics_line": 102 + } + }, + "defaultValue": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 102 + } + } + }, + "metadata": { + "description": "Optional. All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc." + }, + "type": "object" + }, + "replicasPerMaster": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 106 + }, + "_kics_type": { + "_kics_line": 106 + } + }, + "defaultValue": 1, + "metadata": { + "description": "Optional. The number of replicas to be created per primary." + }, + "minValue": 1, + "type": "int" + }, + "replicasPerPrimary": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 49 + }, + "_kics_type": { + "_kics_line": 49 + } + }, + "defaultValue": 1, + "metadata": { + "description": "Optional. The number of replicas to be created per primary." + }, + "minValue": 1, + "type": "int" + }, + "shardCount": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 53 + }, + "_kics_type": { + "_kics_line": 53 + } + }, + "defaultValue": 1, + "metadata": { + "description": "Optional. The number of shards to be created on a Premium Cluster Cache." + }, + "minValue": 1, + "type": "int" + }, + "skuName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 76 + }, + "_kics_type": { + "_kics_line": 76 + } + }, + "allowedValues": [ + [ + "Basic", + "Premium", + "Standard" + ] + ], + "defaultValue": "Standard", + "metadata": { + "description": "Optional, default is Standard. The type of Redis cache to deploy." + }, + "type": "string" + }, + "subnetId": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 79 + }, + "_kics_type": { + "_kics_line": 79 + } + }, + "defaultValue": "", + "metadata": { + "description": "Optional. The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1." + }, + "type": "string" + }, + "tags": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 45 + }, + "_kics_type": { + "_kics_line": 45 + } + }, + "defaultValue": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 45 + } + } + }, + "metadata": { + "description": "Optional. Tags of the resource." + }, + "type": "object" + }, "vmName": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 42 + "_kics_line": 115 }, "_kics_type": { - "_kics_line": 42 + "_kics_line": 115 } }, "defaultValue": "simple-vm", @@ -390,10 +693,10 @@ func TestParseBicepFile(t *testing.T) { "vmSize": { "_kics_lines": { "_kics_defaultValue": { - "_kics_line": 36 + "_kics_line": 109 }, "_kics_type": { - "_kics_line": 36 + "_kics_line": 109 } }, "defaultValue": "Standard_D2_v3", @@ -407,32 +710,32 @@ func TestParseBicepFile(t *testing.T) { { "_kics_lines": { "_kics__default": { - "_kics_line": 72 + "_kics_line": 173 }, "_kics_apiVersion": { - "_kics_line": 71 + "_kics_line": 172 }, "_kics_dependsOn": { "_kics_arr": [ { "_kics__default": { - "_kics_line": 121 + "_kics_line": 222 } } ], - "_kics_line": 121 + "_kics_line": 222 }, "_kics_location": { - "_kics_line": 74 + "_kics_line": 175 }, "_kics_name": { - "_kics_line": 73 + "_kics_line": 174 }, "_kics_properties": { - "_kics_line": 75 + "_kics_line": 176 }, "_kics_type": { - "_kics_line": 71 + "_kics_line": 172 } }, "apiVersion": "2021-03-01", @@ -459,43 +762,43 @@ func TestParseBicepFile(t *testing.T) { "properties": { "_kics_lines": { "_kics__default": { - "_kics_line": 75 + "_kics_line": 176 }, "_kics_diagnosticsProfile": { - "_kics_line": 112 + "_kics_line": 213 }, "_kics_hardwareProfile": { - "_kics_line": 76 + "_kics_line": 177 }, "_kics_networkProfile": { - "_kics_line": 105 + "_kics_line": 206 }, "_kics_osProfile": { - "_kics_line": 79 + "_kics_line": 180 }, "_kics_storageProfile": { - "_kics_line": 84 + "_kics_line": 185 } }, "diagnosticsProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 112 + "_kics_line": 213 }, "_kics_bootDiagnostics": { - "_kics_line": 113 + "_kics_line": 214 } }, "bootDiagnostics": { "_kics_lines": { "_kics__default": { - "_kics_line": 113 + "_kics_line": 214 }, "_kics_enabled": { - "_kics_line": 114 + "_kics_line": 215 }, "_kics_storageUri": { - "_kics_line": 115 + "_kics_line": 216 } }, "enabled": true, @@ -505,10 +808,10 @@ func TestParseBicepFile(t *testing.T) { "hardwareProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 76 + "_kics_line": 177 }, "_kics_vmSize": { - "_kics_line": 77 + "_kics_line": 178 } }, "vmSize": "[parameters('vmSize')]" @@ -516,33 +819,33 @@ func TestParseBicepFile(t *testing.T) { "networkProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 105 + "_kics_line": 206 }, "_kics_networkInterfaces": { "_kics_arr": [ { "_kics__default": { - "_kics_line": 106 + "_kics_line": 207 } } ], - "_kics_line": 106 + "_kics_line": 207 } }, "networkInterfaces": [ { "_kics_lines": { "_kics__default": { - "_kics_line": 107 + "_kics_line": 208 }, "_kics_id": { - "_kics_line": 108 + "_kics_line": 209 } }, "id": { "resourceId": [ "Microsoft.Network/networkInterfaces", - "nick.variables('nicName')" + "nick" ] } } @@ -551,58 +854,58 @@ func TestParseBicepFile(t *testing.T) { "osProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 79 + "_kics_line": 180 }, "_kics_adminPassword": { - "_kics_line": 82 + "_kics_line": 183 }, "_kics_adminUsername": { - "_kics_line": 81 + "_kics_line": 182 }, "_kics_computerName": { - "_kics_line": 80 + "_kics_line": 181 } }, "adminPassword": "[parameters('adminPassword')]", "adminUsername": "[parameters('adminUsername')]", - "computerName": "[computer.parameters('vmName')]" + "computerName": "computer" }, "storageProfile": { "_kics_lines": { "_kics__default": { - "_kics_line": 84 + "_kics_line": 185 }, "_kics_dataDisks": { "_kics_arr": [ { "_kics__default": { - "_kics_line": 97 + "_kics_line": 198 } } ], - "_kics_line": 97 + "_kics_line": 198 }, "_kics_imageReference": { - "_kics_line": 85 + "_kics_line": 186 }, "_kics_osDisk": { - "_kics_line": 91 + "_kics_line": 192 } }, "dataDisks": [ { "_kics_lines": { "_kics__default": { - "_kics_line": 98 + "_kics_line": 199 }, "_kics_createOption": { - "_kics_line": 101 + "_kics_line": 202 }, "_kics_diskSizeGB": { - "_kics_line": 99 + "_kics_line": 200 }, "_kics_lun": { - "_kics_line": 100 + "_kics_line": 201 } }, "createOption": "Empty", @@ -613,19 +916,19 @@ func TestParseBicepFile(t *testing.T) { "imageReference": { "_kics_lines": { "_kics__default": { - "_kics_line": 85 + "_kics_line": 186 }, "_kics_offer": { - "_kics_line": 87 + "_kics_line": 188 }, "_kics_publisher": { - "_kics_line": 86 + "_kics_line": 187 }, "_kics_sku": { - "_kics_line": 88 + "_kics_line": 189 }, "_kics_version": { - "_kics_line": 89 + "_kics_line": 190 } }, "offer": "WindowsServer", @@ -636,23 +939,23 @@ func TestParseBicepFile(t *testing.T) { "osDisk": { "_kics_lines": { "_kics__default": { - "_kics_line": 91 + "_kics_line": 192 }, "_kics_createOption": { - "_kics_line": 92 + "_kics_line": 193 }, "_kics_managedDisk": { - "_kics_line": 93 + "_kics_line": 194 } }, "createOption": "FromImage", "managedDisk": { "_kics_lines": { "_kics__default": { - "_kics_line": 93 + "_kics_line": 194 }, "_kics_storageAccountType": { - "_kics_line": 94 + "_kics_line": 195 } }, "storageAccountType": "StandardSSD_LRS" @@ -665,32 +968,32 @@ func TestParseBicepFile(t *testing.T) { { "_kics_lines": { "_kics__default": { - "_kics_line": 127 + "_kics_line": 228 }, "_kics_apiVersion": { - "_kics_line": 127 + "_kics_line": 228 }, "_kics_assignableScopes": { "_kics_arr": [ { "_kics__default": { - "_kics_line": 137 + "_kics_line": 238 } } ], - "_kics_line": 137 + "_kics_line": 238 }, "_kics_location": { - "_kics_line": 129 + "_kics_line": 230 }, "_kics_name": { - "_kics_line": 128 + "_kics_line": 229 }, "_kics_type": { - "_kics_line": 127 + "_kics_line": 228 }, "_kics_userAssignedIdentities": { - "_kics_line": 134 + "_kics_line": 235 } }, "apiVersion": "2021-03-01", @@ -705,16 +1008,16 @@ func TestParseBicepFile(t *testing.T) { "'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { "_kics_lines": { "_kics__default": { - "_kics_line": 135 + "_kics_line": 236 } } }, "_kics_lines": { "_kics_'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { - "_kics_line": 135 + "_kics_line": 236 }, "_kics__default": { - "_kics_line": 134 + "_kics_line": 235 } } } @@ -722,28 +1025,28 @@ func TestParseBicepFile(t *testing.T) { { "_kics_lines": { "_kics__default": { - "_kics_line": 140 + "_kics_line": 241 }, "_kics_apiVersion": { - "_kics_line": 140 + "_kics_line": 241 }, "_kics_kind": { - "_kics_line": 147 + "_kics_line": 248 }, "_kics_location": { - "_kics_line": 142 + "_kics_line": 243 }, "_kics_name": { - "_kics_line": 141 + "_kics_line": 242 }, "_kics_properties": { - "_kics_line": 148 + "_kics_line": 249 }, "_kics_sku": { - "_kics_line": 143 + "_kics_line": 244 }, "_kics_type": { - "_kics_line": 140 + "_kics_line": 241 } }, "apiVersion": "2019-06-01", @@ -754,57 +1057,57 @@ func TestParseBicepFile(t *testing.T) { "properties": { "_kics_lines": { "_kics__default": { - "_kics_line": 148 + "_kics_line": 249 }, "_kics_accessTier": { - "_kics_line": 177 + "_kics_line": 278 }, "_kics_encryption": { - "_kics_line": 164 + "_kics_line": 265 }, "_kics_networkAcls": { - "_kics_line": 149 + "_kics_line": 250 }, "_kics_supportsHttpsTrafficOnly": { - "_kics_line": 163 + "_kics_line": 264 } }, "accessTier": "Cool", "encryption": { "_kics_lines": { "_kics__default": { - "_kics_line": 164 + "_kics_line": 265 }, "_kics_keySource": { - "_kics_line": 175 + "_kics_line": 276 }, "_kics_services": { - "_kics_line": 165 + "_kics_line": 266 } }, "keySource": "Microsoft.Storage", "services": { "_kics_lines": { "_kics__default": { - "_kics_line": 165 + "_kics_line": 266 }, "_kics_blob": { - "_kics_line": 170 + "_kics_line": 271 }, "_kics_file": { - "_kics_line": 166 + "_kics_line": 267 } }, "blob": { "_kics_lines": { "_kics__default": { - "_kics_line": 170 + "_kics_line": 271 }, "_kics_enabled": { - "_kics_line": 172 + "_kics_line": 273 }, "_kics_keyType": { - "_kics_line": 171 + "_kics_line": 272 } }, "enabled": true, @@ -813,13 +1116,13 @@ func TestParseBicepFile(t *testing.T) { "file": { "_kics_lines": { "_kics__default": { - "_kics_line": 166 + "_kics_line": 267 }, "_kics_enabled": { - "_kics_line": 168 + "_kics_line": 269 }, "_kics_keyType": { - "_kics_line": 167 + "_kics_line": 268 } }, "enabled": true, @@ -830,23 +1133,23 @@ func TestParseBicepFile(t *testing.T) { "networkAcls": { "_kics_lines": { "_kics__default": { - "_kics_line": 149 + "_kics_line": 250 }, "_kics_bypass": { - "_kics_line": 150 + "_kics_line": 251 }, "_kics_defaultAction": { - "_kics_line": 161 + "_kics_line": 262 }, "_kics_virtualNetworkRules": { "_kics_arr": [ { "_kics__default": { - "_kics_line": 151 + "_kics_line": 252 } } ], - "_kics_line": 151 + "_kics_line": 252 } }, "bypass": "None", @@ -855,13 +1158,13 @@ func TestParseBicepFile(t *testing.T) { { "_kics_lines": { "_kics__default": { - "_kics_line": 152 + "_kics_line": 253 }, "_kics_action": { - "_kics_line": 154 + "_kics_line": 255 }, "_kics_id": { - "_kics_line": 153 + "_kics_line": 254 } }, "action": "Allow", @@ -870,13 +1173,13 @@ func TestParseBicepFile(t *testing.T) { { "_kics_lines": { "_kics__default": { - "_kics_line": 156 + "_kics_line": 257 }, "_kics_action": { - "_kics_line": 158 + "_kics_line": 259 }, "_kics_id": { - "_kics_line": 157 + "_kics_line": 258 } }, "action": "Allow", @@ -890,25 +1193,25 @@ func TestParseBicepFile(t *testing.T) { { "_kics_lines": { "_kics__default": { - "_kics_line": 181 + "_kics_line": 282 }, "_kics_apiVersion": { - "_kics_line": 181 + "_kics_line": 282 }, "_kics_name": { - "_kics_line": 183 + "_kics_line": 284 }, "_kics_parent": { - "_kics_line": 182 + "_kics_line": 283 }, "_kics_properties": { - "_kics_line": 188 + "_kics_line": 289 }, "_kics_sku": { - "_kics_line": 184 + "_kics_line": 285 }, "_kics_type": { - "_kics_line": 181 + "_kics_line": 282 } }, "apiVersion": "2019-06-01", @@ -918,19 +1221,19 @@ func TestParseBicepFile(t *testing.T) { "properties": { "_kics_lines": { "_kics__default": { - "_kics_line": 188 + "_kics_line": 289 }, "_kics_deleteRetentionPolicy": { - "_kics_line": 189 + "_kics_line": 290 } }, "deleteRetentionPolicy": { "_kics_lines": { "_kics__default": { - "_kics_line": 189 + "_kics_line": 290 }, "_kics_enabled": { - "_kics_line": 190 + "_kics_line": 291 } }, "enabled": false @@ -940,22 +1243,22 @@ func TestParseBicepFile(t *testing.T) { { "_kics_lines": { "_kics__default": { - "_kics_line": 195 + "_kics_line": 296 }, "_kics_apiVersion": { - "_kics_line": 195 + "_kics_line": 296 }, "_kics_name": { - "_kics_line": 197 + "_kics_line": 298 }, "_kics_parent": { - "_kics_line": 196 + "_kics_line": 297 }, "_kics_properties": { - "_kics_line": 198 + "_kics_line": 299 }, "_kics_type": { - "_kics_line": 195 + "_kics_line": 296 } }, "apiVersion": "2019-06-01", @@ -965,23 +1268,23 @@ func TestParseBicepFile(t *testing.T) { "properties": { "_kics_lines": { "_kics__default": { - "_kics_line": 198 + "_kics_line": 299 }, "_kics_denyEncryptionScopeOverride": { - "_kics_line": 199 + "_kics_line": 300 }, "_kics_metadata": { - "_kics_line": 201 + "_kics_line": 302 }, "_kics_publicAccess": { - "_kics_line": 200 + "_kics_line": 301 } }, "denyEncryptionScopeOverride": true, "metadata": { "_kics_lines": { "_kics__default": { - "_kics_line": 201 + "_kics_line": 302 } } }, @@ -993,13 +1296,13 @@ func TestParseBicepFile(t *testing.T) { "sku": { "_kics_lines": { "_kics__default": { - "_kics_line": 184 + "_kics_line": 285 }, "_kics_name": { - "_kics_line": 185 + "_kics_line": 286 }, "_kics_tier": { - "_kics_line": 186 + "_kics_line": 287 } }, "name": "Standard_LRS", @@ -1011,19 +1314,184 @@ func TestParseBicepFile(t *testing.T) { "sku": { "_kics_lines": { "_kics__default": { - "_kics_line": 143 + "_kics_line": 244 }, "_kics_name": { - "_kics_line": 144 + "_kics_line": 245 }, "_kics_tier": { - "_kics_line": 145 + "_kics_line": 246 } }, "name": "Standard_LRS", "tier": "Standard" }, "type": "Microsoft.Storage/storageAccounts" + }, + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 306 + }, + "_kics_apiVersion": { + "_kics_line": 306 + }, + "_kics_location": { + "_kics_line": 308 + }, + "_kics_name": { + "_kics_line": 307 + }, + "_kics_properties": { + "_kics_line": 311 + }, + "_kics_tags": { + "_kics_line": 309 + }, + "_kics_type": { + "_kics_line": 306 + }, + "_kics_zones": { + "_kics_line": 327 + } + }, + "apiVersion": "2021-06-01", + "identifier": "redisCache", + "location": "[parameters('location')]", + "name": "[parameters('name')]", + "properties": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 311 + }, + "_kics_enableNonSslPort": { + "_kics_line": 312 + }, + "_kics_minimumTlsVersion": { + "_kics_line": 313 + }, + "_kics_publicNetworkAccess": { + "_kics_line": 314 + }, + "_kics_redisConfiguration": { + "_kics_line": 315 + }, + "_kics_redisVersion": { + "_kics_line": 316 + }, + "_kics_replicasPerMaster": { + "_kics_line": 317 + }, + "_kics_replicasPerPrimary": { + "_kics_line": 318 + }, + "_kics_shardCount": { + "_kics_line": 319 + }, + "_kics_sku": { + "_kics_line": 320 + }, + "_kics_subnetId": { + "_kics_line": 325 + } + }, + "enableNonSslPort": "[parameters('enableNonSslPort')]", + "minimumTlsVersion": "1.2", + "publicNetworkAccess": "", + "redisConfiguration": "", + "redisVersion": "6", + "replicasPerMaster": "", + "replicasPerPrimary": "", + "shardCount": "", + "sku": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 320 + }, + "_kics_capacity": { + "_kics_line": 321 + }, + "_kics_family": { + "_kics_line": 322 + }, + "_kics_name": { + "_kics_line": 323 + } + }, + "capacity": "[parameters('capacity')]", + "family": "", + "name": "[parameters('skuName')]" + }, + "subnetId": "" + }, + "tags": "[parameters('tags')]", + "type": "Microsoft.Cache/redis", + "zones": "" + }, + { + "apiVersion": "2021-05-01-preview", + "identifier": "redisCache_diagnosticSettings", + "type": "Microsoft.Insights/diagnosticSettings" + }, + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 351 + }, + "_kics_apiVersion": { + "_kics_line": 351 + }, + "_kics_name": { + "_kics_line": 352 + }, + "_kics_type": { + "_kics_line": 351 + } + }, + "apiVersion": "2022-11-01", + "identifier": "keyVault", + "name": "[parameters('keyvaultName')]", + "resources": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 330 + }, + "_kics_apiVersion": { + "_kics_line": 330 + }, + "_kics_name": { + "_kics_line": 331 + }, + "_kics_parent": { + "_kics_line": 332 + }, + "_kics_properties": { + "_kics_line": 333 + }, + "_kics_type": { + "_kics_line": 330 + } + }, + "apiVersion": "2018-02-14", + "identifier": "redisConnectionStringSecret", + "name": "redisConStrSecret", + "parent": "keyVault", + "properties": { + "_kics_lines": { + "_kics__default": { + "_kics_line": 333 + }, + "_kics_value": { + "_kics_line": 334 + } + }, + "value": "'${redisCache.properties.hostName},password=${.primaryKey},ssl=True,abortConnect=False'" + }, + "type": "secrets" + } + ], + "type": "Microsoft.KeyVault/vaults" } ], "variables": { @@ -1036,6 +1504,15 @@ func TestParseBicepFile(t *testing.T) { ] } }, + "diagnosticsLogs": { + "value": "" + }, + "diagnosticsLogsSpecified": { + "value": null + }, + "diagnosticsMetrics": { + "value": null + }, "nicName": { "value": "myVMNic" }, From 0e388100c201a14336231a16bd5c77a91c0ef09a Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 9 May 2024 15:57:01 +0100 Subject: [PATCH 111/130] added missing contexts to visit identifier --- pkg/parser/bicep/antlr/bicep.g4 | 2 + pkg/parser/bicep/antlr/parser/bicep.interp | 2 +- pkg/parser/bicep/antlr/parser/bicep_parser.go | 28 +++- pkg/parser/bicep/parser.go | 61 ++++++- test/fixtures/bicep_test/resources.bicep | 156 +++++++++++++++++- 5 files changed, 229 insertions(+), 20 deletions(-) diff --git a/pkg/parser/bicep/antlr/bicep.g4 b/pkg/parser/bicep/antlr/bicep.g4 index 1eb9b68d1d1..441325e0ec0 100644 --- a/pkg/parser/bicep/antlr/bicep.g4 +++ b/pkg/parser/bicep/antlr/bicep.g4 @@ -162,8 +162,10 @@ identifier: | METADATA | PARAM | RESOURCE + | MODULE | OUTPUT | EXISTING + | TYPE | VAR | IF | FOR diff --git a/pkg/parser/bicep/antlr/parser/bicep.interp b/pkg/parser/bicep/antlr/parser/bicep.interp index 7b020d5954e..b4bc97baaf6 100644 --- a/pkg/parser/bicep/antlr/parser/bicep.interp +++ b/pkg/parser/bicep/antlr/parser/bicep.interp @@ -151,4 +151,4 @@ identifier atn: -[4, 1, 55, 436, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 1, 0, 5, 0, 68, 8, 0, 10, 0, 12, 0, 71, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 85, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 5, 3, 93, 8, 3, 10, 3, 12, 3, 96, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 104, 8, 3, 10, 3, 12, 3, 107, 9, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 118, 8, 5, 10, 5, 12, 5, 121, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 127, 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 132, 8, 5, 3, 5, 134, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 5, 7, 142, 8, 7, 10, 7, 12, 7, 145, 9, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 154, 8, 8, 10, 8, 12, 8, 157, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 5, 9, 166, 8, 9, 10, 9, 12, 9, 169, 9, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 175, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 181, 8, 9, 1, 9, 1, 9, 1, 10, 5, 10, 186, 8, 10, 10, 10, 12, 10, 189, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 198, 8, 10, 1, 10, 1, 10, 1, 11, 5, 11, 203, 8, 11, 10, 11, 12, 11, 206, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 213, 8, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 5, 13, 225, 8, 13, 10, 13, 12, 13, 228, 9, 13, 1, 13, 1, 13, 1, 13, 3, 13, 233, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 240, 8, 13, 10, 13, 12, 13, 243, 9, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 3, 15, 255, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 261, 8, 16, 10, 16, 12, 16, 264, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 270, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 299, 8, 17, 10, 17, 12, 17, 302, 9, 17, 1, 18, 1, 18, 3, 18, 306, 8, 18, 1, 18, 1, 18, 3, 18, 310, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 326, 8, 20, 1, 21, 1, 21, 3, 21, 330, 8, 21, 1, 21, 1, 21, 3, 21, 334, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 345, 8, 23, 1, 24, 1, 24, 4, 24, 349, 8, 24, 11, 24, 12, 24, 350, 1, 24, 1, 24, 4, 24, 355, 8, 24, 11, 24, 12, 24, 356, 5, 24, 359, 8, 24, 10, 24, 12, 24, 362, 9, 24, 3, 24, 364, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 3, 25, 370, 8, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 5, 26, 377, 8, 26, 10, 26, 12, 26, 380, 9, 26, 1, 26, 5, 26, 383, 8, 26, 10, 26, 12, 26, 386, 9, 26, 1, 26, 1, 26, 1, 27, 1, 27, 4, 27, 392, 8, 27, 11, 27, 12, 27, 393, 1, 27, 3, 27, 397, 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 3, 29, 408, 8, 29, 1, 30, 1, 30, 1, 30, 3, 30, 413, 8, 30, 1, 30, 3, 30, 416, 8, 30, 1, 30, 3, 30, 419, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 3, 31, 426, 8, 31, 1, 31, 5, 31, 429, 8, 31, 10, 31, 12, 31, 432, 9, 31, 1, 32, 1, 32, 1, 32, 0, 1, 34, 33, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 0, 2, 1, 0, 42, 47, 3, 0, 14, 28, 35, 40, 49, 49, 474, 0, 69, 1, 0, 0, 0, 2, 84, 1, 0, 0, 0, 4, 86, 1, 0, 0, 0, 6, 94, 1, 0, 0, 0, 8, 110, 1, 0, 0, 0, 10, 119, 1, 0, 0, 0, 12, 137, 1, 0, 0, 0, 14, 143, 1, 0, 0, 0, 16, 155, 1, 0, 0, 0, 18, 167, 1, 0, 0, 0, 20, 187, 1, 0, 0, 0, 22, 204, 1, 0, 0, 0, 24, 218, 1, 0, 0, 0, 26, 222, 1, 0, 0, 0, 28, 246, 1, 0, 0, 0, 30, 254, 1, 0, 0, 0, 32, 269, 1, 0, 0, 0, 34, 271, 1, 0, 0, 0, 36, 309, 1, 0, 0, 0, 38, 314, 1, 0, 0, 0, 40, 325, 1, 0, 0, 0, 42, 327, 1, 0, 0, 0, 44, 337, 1, 0, 0, 0, 46, 344, 1, 0, 0, 0, 48, 346, 1, 0, 0, 0, 50, 369, 1, 0, 0, 0, 52, 374, 1, 0, 0, 0, 54, 389, 1, 0, 0, 0, 56, 398, 1, 0, 0, 0, 58, 407, 1, 0, 0, 0, 60, 409, 1, 0, 0, 0, 62, 422, 1, 0, 0, 0, 64, 433, 1, 0, 0, 0, 66, 68, 3, 2, 1, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 0, 0, 1, 73, 1, 1, 0, 0, 0, 74, 85, 3, 4, 2, 0, 75, 85, 3, 6, 3, 0, 76, 85, 3, 8, 4, 0, 77, 85, 3, 10, 5, 0, 78, 85, 3, 14, 7, 0, 79, 85, 3, 16, 8, 0, 80, 85, 3, 18, 9, 0, 81, 85, 3, 20, 10, 0, 82, 85, 3, 22, 11, 0, 83, 85, 5, 51, 0, 0, 84, 74, 1, 0, 0, 0, 84, 75, 1, 0, 0, 0, 84, 76, 1, 0, 0, 0, 84, 77, 1, 0, 0, 0, 84, 78, 1, 0, 0, 0, 84, 79, 1, 0, 0, 0, 84, 80, 1, 0, 0, 0, 84, 81, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 84, 83, 1, 0, 0, 0, 85, 3, 1, 0, 0, 0, 86, 87, 5, 23, 0, 0, 87, 88, 5, 11, 0, 0, 88, 89, 3, 34, 17, 0, 89, 90, 5, 51, 0, 0, 90, 5, 1, 0, 0, 0, 91, 93, 3, 56, 28, 0, 92, 91, 1, 0, 0, 0, 93, 96, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 97, 98, 5, 24, 0, 0, 98, 105, 3, 32, 16, 0, 99, 100, 5, 25, 0, 0, 100, 104, 3, 48, 24, 0, 101, 102, 5, 26, 0, 0, 102, 104, 3, 64, 32, 0, 103, 99, 1, 0, 0, 0, 103, 101, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 5, 51, 0, 0, 109, 7, 1, 0, 0, 0, 110, 111, 5, 27, 0, 0, 111, 112, 3, 64, 32, 0, 112, 113, 5, 11, 0, 0, 113, 114, 3, 34, 17, 0, 114, 115, 5, 51, 0, 0, 115, 9, 1, 0, 0, 0, 116, 118, 3, 56, 28, 0, 117, 116, 1, 0, 0, 0, 118, 121, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 122, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 122, 123, 5, 14, 0, 0, 123, 133, 3, 64, 32, 0, 124, 126, 3, 44, 22, 0, 125, 127, 3, 12, 6, 0, 126, 125, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 134, 1, 0, 0, 0, 128, 129, 5, 21, 0, 0, 129, 131, 3, 32, 16, 0, 130, 132, 3, 12, 6, 0, 131, 130, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 134, 1, 0, 0, 0, 133, 124, 1, 0, 0, 0, 133, 128, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 51, 0, 0, 136, 11, 1, 0, 0, 0, 137, 138, 5, 11, 0, 0, 138, 139, 3, 34, 17, 0, 139, 13, 1, 0, 0, 0, 140, 142, 3, 56, 28, 0, 141, 140, 1, 0, 0, 0, 142, 145, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 146, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 146, 147, 5, 29, 0, 0, 147, 148, 3, 64, 32, 0, 148, 149, 5, 11, 0, 0, 149, 150, 3, 44, 22, 0, 150, 151, 5, 51, 0, 0, 151, 15, 1, 0, 0, 0, 152, 154, 3, 56, 28, 0, 153, 152, 1, 0, 0, 0, 154, 157, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 158, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 158, 159, 5, 15, 0, 0, 159, 160, 3, 64, 32, 0, 160, 161, 5, 11, 0, 0, 161, 162, 3, 34, 17, 0, 162, 163, 5, 51, 0, 0, 163, 17, 1, 0, 0, 0, 164, 166, 3, 56, 28, 0, 165, 164, 1, 0, 0, 0, 166, 169, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 170, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 170, 171, 5, 21, 0, 0, 171, 172, 3, 64, 32, 0, 172, 174, 3, 32, 16, 0, 173, 175, 5, 28, 0, 0, 174, 173, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 180, 5, 11, 0, 0, 177, 181, 3, 24, 12, 0, 178, 181, 3, 48, 24, 0, 179, 181, 3, 26, 13, 0, 180, 177, 1, 0, 0, 0, 180, 178, 1, 0, 0, 0, 180, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 183, 5, 51, 0, 0, 183, 19, 1, 0, 0, 0, 184, 186, 3, 56, 28, 0, 185, 184, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 190, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 191, 5, 30, 0, 0, 191, 192, 3, 64, 32, 0, 192, 193, 3, 32, 16, 0, 193, 197, 5, 11, 0, 0, 194, 198, 3, 24, 12, 0, 195, 198, 3, 48, 24, 0, 196, 198, 3, 26, 13, 0, 197, 194, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 197, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 200, 5, 51, 0, 0, 200, 21, 1, 0, 0, 0, 201, 203, 3, 56, 28, 0, 202, 201, 1, 0, 0, 0, 203, 206, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 207, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 207, 208, 5, 22, 0, 0, 208, 212, 3, 64, 32, 0, 209, 213, 3, 64, 32, 0, 210, 211, 5, 21, 0, 0, 211, 213, 3, 32, 16, 0, 212, 209, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 11, 0, 0, 215, 216, 3, 34, 17, 0, 216, 217, 5, 51, 0, 0, 217, 23, 1, 0, 0, 0, 218, 219, 5, 38, 0, 0, 219, 220, 3, 42, 21, 0, 220, 221, 3, 48, 24, 0, 221, 25, 1, 0, 0, 0, 222, 226, 5, 4, 0, 0, 223, 225, 5, 51, 0, 0, 224, 223, 1, 0, 0, 0, 225, 228, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 226, 227, 1, 0, 0, 0, 227, 229, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 229, 232, 5, 39, 0, 0, 230, 233, 3, 64, 32, 0, 231, 233, 3, 28, 14, 0, 232, 230, 1, 0, 0, 0, 232, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 235, 5, 40, 0, 0, 235, 236, 3, 34, 17, 0, 236, 237, 5, 10, 0, 0, 237, 241, 3, 30, 15, 0, 238, 240, 5, 51, 0, 0, 239, 238, 1, 0, 0, 0, 240, 243, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 1, 0, 0, 0, 243, 241, 1, 0, 0, 0, 244, 245, 5, 5, 0, 0, 245, 27, 1, 0, 0, 0, 246, 247, 5, 6, 0, 0, 247, 248, 3, 64, 32, 0, 248, 249, 5, 3, 0, 0, 249, 250, 3, 64, 32, 0, 250, 251, 5, 7, 0, 0, 251, 29, 1, 0, 0, 0, 252, 255, 3, 34, 17, 0, 253, 255, 3, 24, 12, 0, 254, 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, 0, 255, 31, 1, 0, 0, 0, 256, 262, 5, 31, 0, 0, 257, 258, 3, 34, 17, 0, 258, 259, 5, 32, 0, 0, 259, 261, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 3, 34, 17, 0, 266, 267, 5, 33, 0, 0, 267, 270, 1, 0, 0, 0, 268, 270, 5, 34, 0, 0, 269, 256, 1, 0, 0, 0, 269, 268, 1, 0, 0, 0, 270, 33, 1, 0, 0, 0, 271, 272, 6, 17, -1, 0, 272, 273, 3, 40, 20, 0, 273, 300, 1, 0, 0, 0, 274, 275, 10, 6, 0, 0, 275, 276, 5, 41, 0, 0, 276, 277, 3, 34, 17, 0, 277, 278, 5, 10, 0, 0, 278, 279, 3, 34, 17, 7, 279, 299, 1, 0, 0, 0, 280, 281, 10, 2, 0, 0, 281, 282, 3, 38, 19, 0, 282, 283, 3, 34, 17, 3, 283, 299, 1, 0, 0, 0, 284, 285, 10, 7, 0, 0, 285, 286, 5, 4, 0, 0, 286, 287, 3, 34, 17, 0, 287, 288, 5, 5, 0, 0, 288, 299, 1, 0, 0, 0, 289, 290, 10, 5, 0, 0, 290, 291, 5, 8, 0, 0, 291, 299, 3, 64, 32, 0, 292, 293, 10, 4, 0, 0, 293, 294, 5, 8, 0, 0, 294, 299, 3, 60, 30, 0, 295, 296, 10, 3, 0, 0, 296, 297, 5, 10, 0, 0, 297, 299, 3, 64, 32, 0, 298, 274, 1, 0, 0, 0, 298, 280, 1, 0, 0, 0, 298, 284, 1, 0, 0, 0, 298, 289, 1, 0, 0, 0, 298, 292, 1, 0, 0, 0, 298, 295, 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 35, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 303, 305, 5, 6, 0, 0, 304, 306, 3, 62, 31, 0, 305, 304, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 310, 5, 7, 0, 0, 308, 310, 3, 64, 32, 0, 309, 303, 1, 0, 0, 0, 309, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 312, 5, 48, 0, 0, 312, 313, 3, 34, 17, 0, 313, 37, 1, 0, 0, 0, 314, 315, 7, 0, 0, 0, 315, 39, 1, 0, 0, 0, 316, 326, 3, 46, 23, 0, 317, 326, 3, 60, 30, 0, 318, 326, 3, 32, 16, 0, 319, 326, 5, 1, 0, 0, 320, 326, 3, 52, 26, 0, 321, 326, 3, 48, 24, 0, 322, 326, 3, 26, 13, 0, 323, 326, 3, 42, 21, 0, 324, 326, 3, 36, 18, 0, 325, 316, 1, 0, 0, 0, 325, 317, 1, 0, 0, 0, 325, 318, 1, 0, 0, 0, 325, 319, 1, 0, 0, 0, 325, 320, 1, 0, 0, 0, 325, 321, 1, 0, 0, 0, 325, 322, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 325, 324, 1, 0, 0, 0, 326, 41, 1, 0, 0, 0, 327, 329, 5, 6, 0, 0, 328, 330, 5, 51, 0, 0, 329, 328, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 3, 34, 17, 0, 332, 334, 5, 51, 0, 0, 333, 332, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 336, 5, 7, 0, 0, 336, 43, 1, 0, 0, 0, 337, 338, 3, 64, 32, 0, 338, 45, 1, 0, 0, 0, 339, 345, 5, 50, 0, 0, 340, 345, 5, 16, 0, 0, 341, 345, 5, 17, 0, 0, 342, 345, 5, 18, 0, 0, 343, 345, 3, 64, 32, 0, 344, 339, 1, 0, 0, 0, 344, 340, 1, 0, 0, 0, 344, 341, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 343, 1, 0, 0, 0, 345, 47, 1, 0, 0, 0, 346, 363, 5, 12, 0, 0, 347, 349, 5, 51, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 360, 1, 0, 0, 0, 352, 354, 3, 50, 25, 0, 353, 355, 5, 51, 0, 0, 354, 353, 1, 0, 0, 0, 355, 356, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 359, 1, 0, 0, 0, 358, 352, 1, 0, 0, 0, 359, 362, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 364, 1, 0, 0, 0, 362, 360, 1, 0, 0, 0, 363, 348, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 366, 5, 13, 0, 0, 366, 49, 1, 0, 0, 0, 367, 370, 3, 64, 32, 0, 368, 370, 3, 32, 16, 0, 369, 367, 1, 0, 0, 0, 369, 368, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 372, 5, 10, 0, 0, 372, 373, 3, 34, 17, 0, 373, 51, 1, 0, 0, 0, 374, 378, 5, 4, 0, 0, 375, 377, 5, 51, 0, 0, 376, 375, 1, 0, 0, 0, 377, 380, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 384, 1, 0, 0, 0, 380, 378, 1, 0, 0, 0, 381, 383, 3, 54, 27, 0, 382, 381, 1, 0, 0, 0, 383, 386, 1, 0, 0, 0, 384, 382, 1, 0, 0, 0, 384, 385, 1, 0, 0, 0, 385, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 388, 5, 5, 0, 0, 388, 53, 1, 0, 0, 0, 389, 396, 3, 34, 17, 0, 390, 392, 5, 51, 0, 0, 391, 390, 1, 0, 0, 0, 392, 393, 1, 0, 0, 0, 393, 391, 1, 0, 0, 0, 393, 394, 1, 0, 0, 0, 394, 397, 1, 0, 0, 0, 395, 397, 5, 3, 0, 0, 396, 391, 1, 0, 0, 0, 396, 395, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 55, 1, 0, 0, 0, 398, 399, 5, 2, 0, 0, 399, 400, 3, 58, 29, 0, 400, 401, 5, 51, 0, 0, 401, 57, 1, 0, 0, 0, 402, 408, 3, 60, 30, 0, 403, 404, 3, 34, 17, 0, 404, 405, 5, 8, 0, 0, 405, 406, 3, 60, 30, 0, 406, 408, 1, 0, 0, 0, 407, 402, 1, 0, 0, 0, 407, 403, 1, 0, 0, 0, 408, 59, 1, 0, 0, 0, 409, 410, 3, 64, 32, 0, 410, 415, 5, 6, 0, 0, 411, 413, 5, 51, 0, 0, 412, 411, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 414, 1, 0, 0, 0, 414, 416, 3, 62, 31, 0, 415, 412, 1, 0, 0, 0, 415, 416, 1, 0, 0, 0, 416, 418, 1, 0, 0, 0, 417, 419, 5, 51, 0, 0, 418, 417, 1, 0, 0, 0, 418, 419, 1, 0, 0, 0, 419, 420, 1, 0, 0, 0, 420, 421, 5, 7, 0, 0, 421, 61, 1, 0, 0, 0, 422, 430, 3, 34, 17, 0, 423, 425, 5, 3, 0, 0, 424, 426, 5, 51, 0, 0, 425, 424, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 1, 0, 0, 0, 427, 429, 3, 34, 17, 0, 428, 423, 1, 0, 0, 0, 429, 432, 1, 0, 0, 0, 430, 428, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 431, 63, 1, 0, 0, 0, 432, 430, 1, 0, 0, 0, 433, 434, 7, 1, 0, 0, 434, 65, 1, 0, 0, 0, 47, 69, 84, 94, 103, 105, 119, 126, 131, 133, 143, 155, 167, 174, 180, 187, 197, 204, 212, 226, 232, 241, 254, 262, 269, 298, 300, 305, 309, 325, 329, 333, 344, 350, 356, 360, 363, 369, 378, 384, 393, 396, 407, 412, 415, 418, 425, 430] \ No newline at end of file +[4, 1, 55, 436, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 1, 0, 5, 0, 68, 8, 0, 10, 0, 12, 0, 71, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 85, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 5, 3, 93, 8, 3, 10, 3, 12, 3, 96, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 104, 8, 3, 10, 3, 12, 3, 107, 9, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 5, 5, 118, 8, 5, 10, 5, 12, 5, 121, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 127, 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 132, 8, 5, 3, 5, 134, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 5, 7, 142, 8, 7, 10, 7, 12, 7, 145, 9, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 5, 8, 154, 8, 8, 10, 8, 12, 8, 157, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 5, 9, 166, 8, 9, 10, 9, 12, 9, 169, 9, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 175, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 181, 8, 9, 1, 9, 1, 9, 1, 10, 5, 10, 186, 8, 10, 10, 10, 12, 10, 189, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 198, 8, 10, 1, 10, 1, 10, 1, 11, 5, 11, 203, 8, 11, 10, 11, 12, 11, 206, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 213, 8, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 5, 13, 225, 8, 13, 10, 13, 12, 13, 228, 9, 13, 1, 13, 1, 13, 1, 13, 3, 13, 233, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 240, 8, 13, 10, 13, 12, 13, 243, 9, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 3, 15, 255, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 261, 8, 16, 10, 16, 12, 16, 264, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 270, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 299, 8, 17, 10, 17, 12, 17, 302, 9, 17, 1, 18, 1, 18, 3, 18, 306, 8, 18, 1, 18, 1, 18, 3, 18, 310, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 326, 8, 20, 1, 21, 1, 21, 3, 21, 330, 8, 21, 1, 21, 1, 21, 3, 21, 334, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 345, 8, 23, 1, 24, 1, 24, 4, 24, 349, 8, 24, 11, 24, 12, 24, 350, 1, 24, 1, 24, 4, 24, 355, 8, 24, 11, 24, 12, 24, 356, 5, 24, 359, 8, 24, 10, 24, 12, 24, 362, 9, 24, 3, 24, 364, 8, 24, 1, 24, 1, 24, 1, 25, 1, 25, 3, 25, 370, 8, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 5, 26, 377, 8, 26, 10, 26, 12, 26, 380, 9, 26, 1, 26, 5, 26, 383, 8, 26, 10, 26, 12, 26, 386, 9, 26, 1, 26, 1, 26, 1, 27, 1, 27, 4, 27, 392, 8, 27, 11, 27, 12, 27, 393, 1, 27, 3, 27, 397, 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 3, 29, 408, 8, 29, 1, 30, 1, 30, 1, 30, 3, 30, 413, 8, 30, 1, 30, 3, 30, 416, 8, 30, 1, 30, 3, 30, 419, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 3, 31, 426, 8, 31, 1, 31, 5, 31, 429, 8, 31, 10, 31, 12, 31, 432, 9, 31, 1, 32, 1, 32, 1, 32, 0, 1, 34, 33, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 0, 2, 1, 0, 42, 47, 3, 0, 14, 30, 35, 40, 49, 49, 474, 0, 69, 1, 0, 0, 0, 2, 84, 1, 0, 0, 0, 4, 86, 1, 0, 0, 0, 6, 94, 1, 0, 0, 0, 8, 110, 1, 0, 0, 0, 10, 119, 1, 0, 0, 0, 12, 137, 1, 0, 0, 0, 14, 143, 1, 0, 0, 0, 16, 155, 1, 0, 0, 0, 18, 167, 1, 0, 0, 0, 20, 187, 1, 0, 0, 0, 22, 204, 1, 0, 0, 0, 24, 218, 1, 0, 0, 0, 26, 222, 1, 0, 0, 0, 28, 246, 1, 0, 0, 0, 30, 254, 1, 0, 0, 0, 32, 269, 1, 0, 0, 0, 34, 271, 1, 0, 0, 0, 36, 309, 1, 0, 0, 0, 38, 314, 1, 0, 0, 0, 40, 325, 1, 0, 0, 0, 42, 327, 1, 0, 0, 0, 44, 337, 1, 0, 0, 0, 46, 344, 1, 0, 0, 0, 48, 346, 1, 0, 0, 0, 50, 369, 1, 0, 0, 0, 52, 374, 1, 0, 0, 0, 54, 389, 1, 0, 0, 0, 56, 398, 1, 0, 0, 0, 58, 407, 1, 0, 0, 0, 60, 409, 1, 0, 0, 0, 62, 422, 1, 0, 0, 0, 64, 433, 1, 0, 0, 0, 66, 68, 3, 2, 1, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 72, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 0, 0, 1, 73, 1, 1, 0, 0, 0, 74, 85, 3, 4, 2, 0, 75, 85, 3, 6, 3, 0, 76, 85, 3, 8, 4, 0, 77, 85, 3, 10, 5, 0, 78, 85, 3, 14, 7, 0, 79, 85, 3, 16, 8, 0, 80, 85, 3, 18, 9, 0, 81, 85, 3, 20, 10, 0, 82, 85, 3, 22, 11, 0, 83, 85, 5, 51, 0, 0, 84, 74, 1, 0, 0, 0, 84, 75, 1, 0, 0, 0, 84, 76, 1, 0, 0, 0, 84, 77, 1, 0, 0, 0, 84, 78, 1, 0, 0, 0, 84, 79, 1, 0, 0, 0, 84, 80, 1, 0, 0, 0, 84, 81, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 84, 83, 1, 0, 0, 0, 85, 3, 1, 0, 0, 0, 86, 87, 5, 23, 0, 0, 87, 88, 5, 11, 0, 0, 88, 89, 3, 34, 17, 0, 89, 90, 5, 51, 0, 0, 90, 5, 1, 0, 0, 0, 91, 93, 3, 56, 28, 0, 92, 91, 1, 0, 0, 0, 93, 96, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 97, 98, 5, 24, 0, 0, 98, 105, 3, 32, 16, 0, 99, 100, 5, 25, 0, 0, 100, 104, 3, 48, 24, 0, 101, 102, 5, 26, 0, 0, 102, 104, 3, 64, 32, 0, 103, 99, 1, 0, 0, 0, 103, 101, 1, 0, 0, 0, 104, 107, 1, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 109, 5, 51, 0, 0, 109, 7, 1, 0, 0, 0, 110, 111, 5, 27, 0, 0, 111, 112, 3, 64, 32, 0, 112, 113, 5, 11, 0, 0, 113, 114, 3, 34, 17, 0, 114, 115, 5, 51, 0, 0, 115, 9, 1, 0, 0, 0, 116, 118, 3, 56, 28, 0, 117, 116, 1, 0, 0, 0, 118, 121, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 122, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 122, 123, 5, 14, 0, 0, 123, 133, 3, 64, 32, 0, 124, 126, 3, 44, 22, 0, 125, 127, 3, 12, 6, 0, 126, 125, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 134, 1, 0, 0, 0, 128, 129, 5, 21, 0, 0, 129, 131, 3, 32, 16, 0, 130, 132, 3, 12, 6, 0, 131, 130, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 134, 1, 0, 0, 0, 133, 124, 1, 0, 0, 0, 133, 128, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 5, 51, 0, 0, 136, 11, 1, 0, 0, 0, 137, 138, 5, 11, 0, 0, 138, 139, 3, 34, 17, 0, 139, 13, 1, 0, 0, 0, 140, 142, 3, 56, 28, 0, 141, 140, 1, 0, 0, 0, 142, 145, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 146, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 146, 147, 5, 29, 0, 0, 147, 148, 3, 64, 32, 0, 148, 149, 5, 11, 0, 0, 149, 150, 3, 44, 22, 0, 150, 151, 5, 51, 0, 0, 151, 15, 1, 0, 0, 0, 152, 154, 3, 56, 28, 0, 153, 152, 1, 0, 0, 0, 154, 157, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 158, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 158, 159, 5, 15, 0, 0, 159, 160, 3, 64, 32, 0, 160, 161, 5, 11, 0, 0, 161, 162, 3, 34, 17, 0, 162, 163, 5, 51, 0, 0, 163, 17, 1, 0, 0, 0, 164, 166, 3, 56, 28, 0, 165, 164, 1, 0, 0, 0, 166, 169, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 170, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 170, 171, 5, 21, 0, 0, 171, 172, 3, 64, 32, 0, 172, 174, 3, 32, 16, 0, 173, 175, 5, 28, 0, 0, 174, 173, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 180, 5, 11, 0, 0, 177, 181, 3, 24, 12, 0, 178, 181, 3, 48, 24, 0, 179, 181, 3, 26, 13, 0, 180, 177, 1, 0, 0, 0, 180, 178, 1, 0, 0, 0, 180, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 183, 5, 51, 0, 0, 183, 19, 1, 0, 0, 0, 184, 186, 3, 56, 28, 0, 185, 184, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 190, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 191, 5, 30, 0, 0, 191, 192, 3, 64, 32, 0, 192, 193, 3, 32, 16, 0, 193, 197, 5, 11, 0, 0, 194, 198, 3, 24, 12, 0, 195, 198, 3, 48, 24, 0, 196, 198, 3, 26, 13, 0, 197, 194, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 197, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 200, 5, 51, 0, 0, 200, 21, 1, 0, 0, 0, 201, 203, 3, 56, 28, 0, 202, 201, 1, 0, 0, 0, 203, 206, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 207, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 207, 208, 5, 22, 0, 0, 208, 212, 3, 64, 32, 0, 209, 213, 3, 64, 32, 0, 210, 211, 5, 21, 0, 0, 211, 213, 3, 32, 16, 0, 212, 209, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 11, 0, 0, 215, 216, 3, 34, 17, 0, 216, 217, 5, 51, 0, 0, 217, 23, 1, 0, 0, 0, 218, 219, 5, 38, 0, 0, 219, 220, 3, 42, 21, 0, 220, 221, 3, 48, 24, 0, 221, 25, 1, 0, 0, 0, 222, 226, 5, 4, 0, 0, 223, 225, 5, 51, 0, 0, 224, 223, 1, 0, 0, 0, 225, 228, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 226, 227, 1, 0, 0, 0, 227, 229, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 229, 232, 5, 39, 0, 0, 230, 233, 3, 64, 32, 0, 231, 233, 3, 28, 14, 0, 232, 230, 1, 0, 0, 0, 232, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 235, 5, 40, 0, 0, 235, 236, 3, 34, 17, 0, 236, 237, 5, 10, 0, 0, 237, 241, 3, 30, 15, 0, 238, 240, 5, 51, 0, 0, 239, 238, 1, 0, 0, 0, 240, 243, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 1, 0, 0, 0, 243, 241, 1, 0, 0, 0, 244, 245, 5, 5, 0, 0, 245, 27, 1, 0, 0, 0, 246, 247, 5, 6, 0, 0, 247, 248, 3, 64, 32, 0, 248, 249, 5, 3, 0, 0, 249, 250, 3, 64, 32, 0, 250, 251, 5, 7, 0, 0, 251, 29, 1, 0, 0, 0, 252, 255, 3, 34, 17, 0, 253, 255, 3, 24, 12, 0, 254, 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, 0, 255, 31, 1, 0, 0, 0, 256, 262, 5, 31, 0, 0, 257, 258, 3, 34, 17, 0, 258, 259, 5, 32, 0, 0, 259, 261, 1, 0, 0, 0, 260, 257, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 265, 266, 3, 34, 17, 0, 266, 267, 5, 33, 0, 0, 267, 270, 1, 0, 0, 0, 268, 270, 5, 34, 0, 0, 269, 256, 1, 0, 0, 0, 269, 268, 1, 0, 0, 0, 270, 33, 1, 0, 0, 0, 271, 272, 6, 17, -1, 0, 272, 273, 3, 40, 20, 0, 273, 300, 1, 0, 0, 0, 274, 275, 10, 6, 0, 0, 275, 276, 5, 41, 0, 0, 276, 277, 3, 34, 17, 0, 277, 278, 5, 10, 0, 0, 278, 279, 3, 34, 17, 7, 279, 299, 1, 0, 0, 0, 280, 281, 10, 2, 0, 0, 281, 282, 3, 38, 19, 0, 282, 283, 3, 34, 17, 3, 283, 299, 1, 0, 0, 0, 284, 285, 10, 7, 0, 0, 285, 286, 5, 4, 0, 0, 286, 287, 3, 34, 17, 0, 287, 288, 5, 5, 0, 0, 288, 299, 1, 0, 0, 0, 289, 290, 10, 5, 0, 0, 290, 291, 5, 8, 0, 0, 291, 299, 3, 64, 32, 0, 292, 293, 10, 4, 0, 0, 293, 294, 5, 8, 0, 0, 294, 299, 3, 60, 30, 0, 295, 296, 10, 3, 0, 0, 296, 297, 5, 10, 0, 0, 297, 299, 3, 64, 32, 0, 298, 274, 1, 0, 0, 0, 298, 280, 1, 0, 0, 0, 298, 284, 1, 0, 0, 0, 298, 289, 1, 0, 0, 0, 298, 292, 1, 0, 0, 0, 298, 295, 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 35, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 303, 305, 5, 6, 0, 0, 304, 306, 3, 62, 31, 0, 305, 304, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 310, 5, 7, 0, 0, 308, 310, 3, 64, 32, 0, 309, 303, 1, 0, 0, 0, 309, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 312, 5, 48, 0, 0, 312, 313, 3, 34, 17, 0, 313, 37, 1, 0, 0, 0, 314, 315, 7, 0, 0, 0, 315, 39, 1, 0, 0, 0, 316, 326, 3, 46, 23, 0, 317, 326, 3, 60, 30, 0, 318, 326, 3, 32, 16, 0, 319, 326, 5, 1, 0, 0, 320, 326, 3, 52, 26, 0, 321, 326, 3, 48, 24, 0, 322, 326, 3, 26, 13, 0, 323, 326, 3, 42, 21, 0, 324, 326, 3, 36, 18, 0, 325, 316, 1, 0, 0, 0, 325, 317, 1, 0, 0, 0, 325, 318, 1, 0, 0, 0, 325, 319, 1, 0, 0, 0, 325, 320, 1, 0, 0, 0, 325, 321, 1, 0, 0, 0, 325, 322, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 325, 324, 1, 0, 0, 0, 326, 41, 1, 0, 0, 0, 327, 329, 5, 6, 0, 0, 328, 330, 5, 51, 0, 0, 329, 328, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 3, 34, 17, 0, 332, 334, 5, 51, 0, 0, 333, 332, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 336, 5, 7, 0, 0, 336, 43, 1, 0, 0, 0, 337, 338, 3, 64, 32, 0, 338, 45, 1, 0, 0, 0, 339, 345, 5, 50, 0, 0, 340, 345, 5, 16, 0, 0, 341, 345, 5, 17, 0, 0, 342, 345, 5, 18, 0, 0, 343, 345, 3, 64, 32, 0, 344, 339, 1, 0, 0, 0, 344, 340, 1, 0, 0, 0, 344, 341, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 343, 1, 0, 0, 0, 345, 47, 1, 0, 0, 0, 346, 363, 5, 12, 0, 0, 347, 349, 5, 51, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 360, 1, 0, 0, 0, 352, 354, 3, 50, 25, 0, 353, 355, 5, 51, 0, 0, 354, 353, 1, 0, 0, 0, 355, 356, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 359, 1, 0, 0, 0, 358, 352, 1, 0, 0, 0, 359, 362, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 364, 1, 0, 0, 0, 362, 360, 1, 0, 0, 0, 363, 348, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 366, 5, 13, 0, 0, 366, 49, 1, 0, 0, 0, 367, 370, 3, 64, 32, 0, 368, 370, 3, 32, 16, 0, 369, 367, 1, 0, 0, 0, 369, 368, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 372, 5, 10, 0, 0, 372, 373, 3, 34, 17, 0, 373, 51, 1, 0, 0, 0, 374, 378, 5, 4, 0, 0, 375, 377, 5, 51, 0, 0, 376, 375, 1, 0, 0, 0, 377, 380, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 384, 1, 0, 0, 0, 380, 378, 1, 0, 0, 0, 381, 383, 3, 54, 27, 0, 382, 381, 1, 0, 0, 0, 383, 386, 1, 0, 0, 0, 384, 382, 1, 0, 0, 0, 384, 385, 1, 0, 0, 0, 385, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 388, 5, 5, 0, 0, 388, 53, 1, 0, 0, 0, 389, 396, 3, 34, 17, 0, 390, 392, 5, 51, 0, 0, 391, 390, 1, 0, 0, 0, 392, 393, 1, 0, 0, 0, 393, 391, 1, 0, 0, 0, 393, 394, 1, 0, 0, 0, 394, 397, 1, 0, 0, 0, 395, 397, 5, 3, 0, 0, 396, 391, 1, 0, 0, 0, 396, 395, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 55, 1, 0, 0, 0, 398, 399, 5, 2, 0, 0, 399, 400, 3, 58, 29, 0, 400, 401, 5, 51, 0, 0, 401, 57, 1, 0, 0, 0, 402, 408, 3, 60, 30, 0, 403, 404, 3, 34, 17, 0, 404, 405, 5, 8, 0, 0, 405, 406, 3, 60, 30, 0, 406, 408, 1, 0, 0, 0, 407, 402, 1, 0, 0, 0, 407, 403, 1, 0, 0, 0, 408, 59, 1, 0, 0, 0, 409, 410, 3, 64, 32, 0, 410, 415, 5, 6, 0, 0, 411, 413, 5, 51, 0, 0, 412, 411, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 414, 1, 0, 0, 0, 414, 416, 3, 62, 31, 0, 415, 412, 1, 0, 0, 0, 415, 416, 1, 0, 0, 0, 416, 418, 1, 0, 0, 0, 417, 419, 5, 51, 0, 0, 418, 417, 1, 0, 0, 0, 418, 419, 1, 0, 0, 0, 419, 420, 1, 0, 0, 0, 420, 421, 5, 7, 0, 0, 421, 61, 1, 0, 0, 0, 422, 430, 3, 34, 17, 0, 423, 425, 5, 3, 0, 0, 424, 426, 5, 51, 0, 0, 425, 424, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 1, 0, 0, 0, 427, 429, 3, 34, 17, 0, 428, 423, 1, 0, 0, 0, 429, 432, 1, 0, 0, 0, 430, 428, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 431, 63, 1, 0, 0, 0, 432, 430, 1, 0, 0, 0, 433, 434, 7, 1, 0, 0, 434, 65, 1, 0, 0, 0, 47, 69, 84, 94, 103, 105, 119, 126, 131, 133, 143, 155, 167, 174, 180, 187, 197, 204, 212, 226, 232, 241, 254, 262, 269, 298, 300, 305, 309, 325, 329, 333, 344, 350, 356, 360, 363, 369, 378, 384, 393, 396, 407, 412, 415, 418, 425, 430] \ No newline at end of file diff --git a/pkg/parser/bicep/antlr/parser/bicep_parser.go b/pkg/parser/bicep/antlr/parser/bicep_parser.go index 402689e27ca..b2fcf1bc93b 100644 --- a/pkg/parser/bicep/antlr/parser/bicep_parser.go +++ b/pkg/parser/bicep/antlr/parser/bicep_parser.go @@ -108,7 +108,7 @@ func bicepParserInit() { 31, 3, 31, 426, 8, 31, 1, 31, 5, 31, 429, 8, 31, 10, 31, 12, 31, 432, 9, 31, 1, 32, 1, 32, 1, 32, 0, 1, 34, 33, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, - 56, 58, 60, 62, 64, 0, 2, 1, 0, 42, 47, 3, 0, 14, 28, 35, 40, 49, 49, 474, + 56, 58, 60, 62, 64, 0, 2, 1, 0, 42, 47, 3, 0, 14, 30, 35, 40, 49, 49, 474, 0, 69, 1, 0, 0, 0, 2, 84, 1, 0, 0, 0, 4, 86, 1, 0, 0, 0, 6, 94, 1, 0, 0, 0, 8, 110, 1, 0, 0, 0, 10, 119, 1, 0, 0, 0, 12, 137, 1, 0, 0, 0, 14, 143, 1, 0, 0, 0, 16, 155, 1, 0, 0, 0, 18, 167, 1, 0, 0, 0, 20, 187, 1, 0, 0, @@ -3908,7 +3908,7 @@ func (p *bicepParser) ForExpression() (localctx IForExpressionContext) { } switch p.GetTokenStream().LA(1) { - case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: + case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserTYPE, bicepParserMODULE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: { p.SetState(230) @@ -5184,7 +5184,7 @@ func (p *bicepParser) LambdaExpression() (localctx ILambdaExpressionContext) { } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1691034387992658) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1691035998605394) != 0 { { p.SetState(304) p.ArgumentList() @@ -5200,7 +5200,7 @@ func (p *bicepParser) LambdaExpression() (localctx ILambdaExpressionContext) { } } - case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: + case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserTYPE, bicepParserMODULE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: { p.SetState(308) p.Identifier() @@ -6307,7 +6307,7 @@ func (p *bicepParser) Object() (localctx IObjectContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&565134481145856) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&565136091758592) != 0 { { p.SetState(352) p.ObjectProperty() @@ -6509,7 +6509,7 @@ func (p *bicepParser) ObjectProperty() (localctx IObjectPropertyContext) { } switch p.GetTokenStream().LA(1) { - case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: + case bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserTYPE, bicepParserMODULE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER: { p.SetState(367) @@ -6725,7 +6725,7 @@ func (p *bicepParser) Array() (localctx IArrayContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1691034387992658) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1691035998605394) != 0 { { p.SetState(381) p.ArrayItem() @@ -6907,7 +6907,7 @@ func (p *bicepParser) ArrayItem() (localctx IArrayItemContext) { } } - case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserCBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER, bicepParserNUMBER: + case bicepParserMULTILINE_STRING, bicepParserOBRACK, bicepParserCBRACK, bicepParserOPAR, bicepParserOBRACE, bicepParserPARAM, bicepParserVAR, bicepParserTRUE, bicepParserFALSE, bicepParserNULL, bicepParserARRAY, bicepParserOBJECT, bicepParserRESOURCE, bicepParserOUTPUT, bicepParserTARGET_SCOPE, bicepParserIMPORT, bicepParserWITH, bicepParserAS, bicepParserMETADATA, bicepParserEXISTING, bicepParserTYPE, bicepParserMODULE, bicepParserSTRING_LEFT_PIECE, bicepParserSTRING_COMPLETE, bicepParserSTRING, bicepParserINT, bicepParserBOOL, bicepParserIF, bicepParserFOR, bicepParserIN, bicepParserIDENTIFIER, bicepParserNUMBER: default: } @@ -7624,8 +7624,10 @@ type IIdentifierContext interface { METADATA() antlr.TerminalNode PARAM() antlr.TerminalNode RESOURCE() antlr.TerminalNode + MODULE() antlr.TerminalNode OUTPUT() antlr.TerminalNode EXISTING() antlr.TerminalNode + TYPE() antlr.TerminalNode VAR() antlr.TerminalNode IF() antlr.TerminalNode FOR() antlr.TerminalNode @@ -7704,6 +7706,10 @@ func (s *IdentifierContext) RESOURCE() antlr.TerminalNode { return s.GetToken(bicepParserRESOURCE, 0) } +func (s *IdentifierContext) MODULE() antlr.TerminalNode { + return s.GetToken(bicepParserMODULE, 0) +} + func (s *IdentifierContext) OUTPUT() antlr.TerminalNode { return s.GetToken(bicepParserOUTPUT, 0) } @@ -7712,6 +7718,10 @@ func (s *IdentifierContext) EXISTING() antlr.TerminalNode { return s.GetToken(bicepParserEXISTING, 0) } +func (s *IdentifierContext) TYPE() antlr.TerminalNode { + return s.GetToken(bicepParserTYPE, 0) +} + func (s *IdentifierContext) VAR() antlr.TerminalNode { return s.GetToken(bicepParserVAR, 0) } @@ -7792,7 +7802,7 @@ func (p *bicepParser) Identifier() (localctx IIdentifierContext) { p.SetState(433) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&565115153793024) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&565116764405760) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index b43d53f62ba..528a7cf6e60 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -639,13 +639,57 @@ func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) in } func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{} { - if ctx.IDENTIFIER() != nil { - identifier := ctx.IDENTIFIER().GetText() - return identifier + if (ctx.IDENTIFIER()) != nil { + return ctx.IDENTIFIER().GetText() + } + if (ctx.IMPORT()) != nil { + return ctx.IMPORT().GetText() + } + if (ctx.WITH()) != nil { + return ctx.WITH().GetText() + } + if (ctx.AS()) != nil { + return ctx.AS().GetText() + } + if (ctx.METADATA()) != nil { + return ctx.METADATA().GetText() + } + if (ctx.PARAM()) != nil { + return ctx.PARAM().GetText() + } + if (ctx.RESOURCE()) != nil { + return ctx.RESOURCE().GetText() + } + if (ctx.OUTPUT()) != nil { + return ctx.OUTPUT().GetText() + } + if (ctx.EXISTING()) != nil { + return ctx.EXISTING().GetText() + } + if (ctx.VAR()) != nil { + return ctx.VAR().GetText() + } + if (ctx.IF()) != nil { + return ctx.IF().GetText() + } + if (ctx.FOR()) != nil { + return ctx.FOR().GetText() + } + if (ctx.IN()) != nil { + return ctx.IN().GetText() + } + if (ctx.TRUE()) != nil { + return ctx.TRUE().GetText() + } + if (ctx.FALSE()) != nil { + return ctx.FALSE().GetText() } if (ctx.NULL()) != nil { return ctx.NULL().GetText() } + if (ctx.TARGET_SCOPE()) != nil { + return ctx.TARGET_SCOPE().GetText() + } if (ctx.STRING()) != nil { return ctx.STRING().GetText() } @@ -655,14 +699,17 @@ func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{ if (ctx.BOOL()) != nil { return ctx.BOOL().GetText() } + if (ctx.ARRAY()) != nil { + return ctx.ARRAY().GetText() + } if (ctx.OBJECT()) != nil { return ctx.OBJECT().GetText() } - if (ctx.ARRAY()) != nil { - return ctx.ARRAY().GetText() + if (ctx.TYPE()) != nil { + return ctx.TYPE().GetText() } - if (ctx.METADATA()) != nil { - return ctx.METADATA().GetText() + if (ctx.MODULE()) != nil { + return ctx.MODULE().GetText() } return "" } diff --git a/test/fixtures/bicep_test/resources.bicep b/test/fixtures/bicep_test/resources.bicep index 9786ae20421..55d950f3775 100644 --- a/test/fixtures/bicep_test/resources.bicep +++ b/test/fixtures/bicep_test/resources.bicep @@ -8,6 +8,15 @@ param adminUsername string @secure() param adminPassword string +@description('Optional. The name of logs that will be streamed. "allLogs" includes all possible logs for the resource.') +@allowed([ + 'allLogs' + 'ConnectedClientList' +]) +param diagnosticLogCategoriesToEnable array = [ + 'allLogs' +] + @description( '''The Windows version for the VM. This will pick a fully patched image of this given Windows version.''' @@ -32,6 +41,70 @@ param adminPassword string ) param OSVersion string = '2019-Datacenter' +@description('Optional. Tags of the resource.') +param tags object = {} + +@minValue(1) +@description('Optional. The number of replicas to be created per primary.') +param replicasPerPrimary int = 1 + +@minValue(1) +@description('Optional. The number of shards to be created on a Premium Cluster Cache.') +param shardCount int = 1 + +@allowed([ + 0 + 1 + 2 + 3 + 4 + 5 + 6 +]) +@description('Optional. The size of the Redis cache to deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P (Premium) family (1, 2, 3, 4).') +param capacity int = 2 + +@description('The name of an existing keyvault, that it will be used to store secrets (connection string)' ) +param keyvaultName string + +@allowed([ + 'Basic' + 'Premium' + 'Standard' +]) +@description('Optional, default is Standard. The type of Redis cache to deploy.') +param skuName string = 'Standard' + +@description('Optional. The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1.') +param subnetId string = '' + +@description('Optional. The name of the diagnostic setting, if deployed.') +param diagnosticSettingsName string = '${name}-diagnosticSettings' + +@description('Optional. Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.') +param diagnosticWorkspaceId string = '' + +@description('Optional. The name of metrics that will be streamed.') +@allowed([ + 'AllMetrics' +]) +param diagnosticMetricsToEnable array = [ + 'AllMetrics' +] + +@description('Has the resource private endpoint?') +param hasPrivateLink bool = false + +@description('Optional. Specifies whether the non-ssl Redis server port (6379) is enabled.') +param enableNonSslPort bool = false + +@description('Optional. All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc.') +param redisConfiguration object = {} + +@minValue(1) +@description('Optional. The number of replicas to be created per primary.') +param replicasPerMaster int = 1 + @description('Size of the virtual machine.') param vmSize string = 'Standard_D2_v3' @@ -52,6 +125,16 @@ param existingStorageSubnetName string @description('Name of the subnet to use for cloud shell containers.') param existingContainerSubnetName string +@description('Required. The name of the Redis cache resource. Start and end with alphanumeric. Consecutive hyphens not allowed') +@maxLength(63) +@minLength(1) +param name string + +param arrayP array = [ + 'allLogs' + 'ConnectedClientList' +] + var storageAccountName = 'bootdiags${uniqueString(resourceGroup().id)}' var nicName = 'myVMNic' @@ -68,6 +151,24 @@ var storageSubnetRef = resourceId( existingStorageSubnetName ) +var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs'): { + category: category + enabled: true +}] + +var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [ + { + categoryGroup: 'allLogs' + enabled: true + } +] : diagnosticsLogsSpecified + +var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: { + category: metric + timeGrain: null + enabled: true +}] + @sys.description('This is a test description for resources') resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { name: vmName @@ -77,7 +178,7 @@ resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { vmSize: vmSize } osProfile: { - computerName: 'computer'.vmName + computerName: 'computer' adminUsername: adminUsername adminPassword: adminPassword } @@ -105,7 +206,7 @@ resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { networkProfile: { networkInterfaces: [ { - id: resourceId('Microsoft.Network/networkInterfaces', 'nick'.nicName) + id: resourceId('Microsoft.Network/networkInterfaces', 'nick') } ] } @@ -125,7 +226,7 @@ resource vm 'Microsoft.Compute/virtualMachines@2021-03-01' = { } resource nic 'Microsoft.Network/networkInterfaces@2021-03-01' = { - name: nicName[0] + name: arrayP[0] location: [ for i in name: { name: nicName @@ -201,3 +302,52 @@ resource storageAccountName_default_container 'Microsoft.Storage/storageAccounts metadata: {} } } + +resource redisCache 'Microsoft.Cache/redis@2021-06-01' = { + name: name + location: location + tags: tags +// identity: identity //20230301-getting a strange error that publcNetworkAccess and Identity cannot be set at the same time. The following updates can't be processed in one single request, please send seperate request to update them: 'properties.publicNetworkAccess,identity + properties: { + enableNonSslPort: enableNonSslPort + minimumTlsVersion: '1.2' + publicNetworkAccess: hasPrivateLink ? 'Disabled' : null + redisConfiguration: !empty(redisConfiguration) ? redisConfiguration : null + redisVersion: '6' + replicasPerMaster: skuName == 'Premium' ? replicasPerMaster : null + replicasPerPrimary: skuName == 'Premium' ? replicasPerPrimary : null + shardCount: skuName == 'Premium' ? shardCount : null // Not supported in free tier + sku: { + capacity: capacity + family: skuName == 'Premium' ? 'P' : 'C' + name: skuName + } + subnetId: !empty(subnetId) ? subnetId : null + } + zones: skuName == 'Premium' ? pickZones('Microsoft.Cache', 'redis', location, 1) : null +} + +resource redisConnectionStringSecret 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = { + name: 'redisConStrSecret' + parent: keyVault + properties: { + value: '${redisCache.properties.hostName},password=${redisCache.listKeys().primaryKey},ssl=True,abortConnect=False' //'${name}.redis.cache.windows.net,abortConnect=false,ssl=true,password=${listKeys(redis.id, redis.apiVersion).primaryKey}' + } +} + +resource redisCache_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if ( !empty(diagnosticWorkspaceId) ) { + name: diagnosticSettingsName + properties: { + storageAccountId: null + workspaceId: empty(diagnosticWorkspaceId) ? null : diagnosticWorkspaceId + eventHubAuthorizationRuleId: null + eventHubName: null + metrics: empty(diagnosticWorkspaceId) ? null : diagnosticsMetrics + logs: empty(diagnosticWorkspaceId) ? null : diagnosticsLogs + } + scope: redisCache +} + +resource keyVault 'Microsoft.KeyVault/vaults@2022-11-01' existing = { + name: keyvaultName +} From 3e8c366c5ba123c2b488332219c6370e44481cbe Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 9 May 2024 16:17:24 +0100 Subject: [PATCH 112/130] fix gocyclo lint --- pkg/parser/bicep/parser.go | 103 ++++++++++++------------------------- 1 file changed, 32 insertions(+), 71 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 528a7cf6e60..6809d6cd920 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -639,78 +639,39 @@ func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) in } func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{} { - if (ctx.IDENTIFIER()) != nil { - return ctx.IDENTIFIER().GetText() - } - if (ctx.IMPORT()) != nil { - return ctx.IMPORT().GetText() - } - if (ctx.WITH()) != nil { - return ctx.WITH().GetText() - } - if (ctx.AS()) != nil { - return ctx.AS().GetText() - } - if (ctx.METADATA()) != nil { - return ctx.METADATA().GetText() - } - if (ctx.PARAM()) != nil { - return ctx.PARAM().GetText() - } - if (ctx.RESOURCE()) != nil { - return ctx.RESOURCE().GetText() - } - if (ctx.OUTPUT()) != nil { - return ctx.OUTPUT().GetText() - } - if (ctx.EXISTING()) != nil { - return ctx.EXISTING().GetText() - } - if (ctx.VAR()) != nil { - return ctx.VAR().GetText() - } - if (ctx.IF()) != nil { - return ctx.IF().GetText() - } - if (ctx.FOR()) != nil { - return ctx.FOR().GetText() - } - if (ctx.IN()) != nil { - return ctx.IN().GetText() - } - if (ctx.TRUE()) != nil { - return ctx.TRUE().GetText() - } - if (ctx.FALSE()) != nil { - return ctx.FALSE().GetText() - } - if (ctx.NULL()) != nil { - return ctx.NULL().GetText() - } - if (ctx.TARGET_SCOPE()) != nil { - return ctx.TARGET_SCOPE().GetText() - } - if (ctx.STRING()) != nil { - return ctx.STRING().GetText() - } - if (ctx.INT()) != nil { - return ctx.INT().GetText() - } - if (ctx.BOOL()) != nil { - return ctx.BOOL().GetText() - } - if (ctx.ARRAY()) != nil { - return ctx.ARRAY().GetText() - } - if (ctx.OBJECT()) != nil { - return ctx.OBJECT().GetText() - } - if (ctx.TYPE()) != nil { - return ctx.TYPE().GetText() - } - if (ctx.MODULE()) != nil { - return ctx.MODULE().GetText() + contexts := []antlr.TerminalNode{ + ctx.IDENTIFIER(), + ctx.IMPORT(), + ctx.WITH(), + ctx.AS(), + ctx.METADATA(), + ctx.PARAM(), + ctx.RESOURCE(), + ctx.OUTPUT(), + ctx.EXISTING(), + ctx.VAR(), + ctx.IF(), + ctx.FOR(), + ctx.IN(), + ctx.TRUE(), + ctx.FALSE(), + ctx.NULL(), + ctx.TARGET_SCOPE(), + ctx.STRING(), + ctx.INT(), + ctx.BOOL(), + ctx.ARRAY(), + ctx.OBJECT(), + ctx.TYPE(), + ctx.MODULE(), + } + + for _, context := range contexts { + if context != nil { + return context.GetText() + } } + return "" } From 1b738d9a7b4205abe17f5b390b3f407af3711d40 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 9 May 2024 16:28:47 +0100 Subject: [PATCH 113/130] fix LOC on analyze test bicep --- pkg/analyzer/analyzer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/analyzer/analyzer_test.go b/pkg/analyzer/analyzer_test.go index 8354a1d4e60..be86079f697 100644 --- a/pkg/analyzer/analyzer_test.go +++ b/pkg/analyzer/analyzer_test.go @@ -430,7 +430,7 @@ func TestAnalyzer_Analyze(t *testing.T) { wantExclude: []string{}, typesFromFlag: []string{""}, excludeTypesFromFlag: []string{""}, - wantLOC: 227, + wantLOC: 377, wantErr: false, gitIgnoreFileName: "", excludeGitIgnore: false, From 54ee88850d2755d140d8ee3fef130bb1d63e5714 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Thu, 9 May 2024 16:32:14 +0100 Subject: [PATCH 114/130] added security checks --- pkg/parser/bicep/parser.go | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index b43d53f62ba..6e044980e84 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -302,10 +302,20 @@ func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interf func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interface{} { resource := map[string]interface{}{} - interpString := ctx.InterpString().Accept(s).(string) - identifier := ctx.Identifier().Accept(s).(string) - resourceType := strings.Split(interpString, "@")[0] - apiVersion := strings.Split(interpString, "@")[1] + resourceType := "" + apiVersion := "" + + interpString := checkAcceptAntlrString(ctx.InterpString(), s) + identifier := checkAcceptAntlrString(ctx.Identifier(), s) + + fullType := strings.Split(interpString, "@") + if len(fullType) > 0 { + resourceType = fullType[0] + } + if len(fullType) > 1 { + apiVersion = fullType[1] + } + resource["type"] = resourceType resource["apiVersion"] = apiVersion decoratorsMap := parseDecorators(ctx.AllDecorator(), s) @@ -338,6 +348,20 @@ func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interf return nil } +func checkAcceptAntlrString(ctx antlr.ParserRuleContext, s *BicepVisitor) string { + resultString := "" + ok := false + + if ctx != nil { + resultString, ok = ctx.Accept(s).(string) + if !ok { + resultString = "" + } + } + + return resultString +} + func (s *BicepVisitor) VisitParameterDefaultValue(ctx *parser.ParameterDefaultValueContext) interface{} { param := ctx.Expression().Accept(s) return param From de1f32d086eb71c267d50304d9d15787a09469c1 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Thu, 9 May 2024 17:12:56 +0100 Subject: [PATCH 115/130] added safety checks --- pkg/parser/bicep/parser.go | 54 +++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 3e47358362c..0d0e4c5dfeb 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -215,17 +215,25 @@ func parseDecorators(decorators []parser.IDecoratorContext, s *BicepVisitor) map decoratorsMap := map[string]interface{}{} for _, val := range decorators { + if val == nil { + continue + } + decorator, ok := val.Accept(s).(map[string][]interface{}) if !ok { - return nil + return map[string]interface{}{} } for name, values := range decorator { if name == "description" { - metadata := map[string]interface{}{} - metadata["description"] = values[0] - decoratorsMap["metadata"] = metadata + if len(values) > 0 { + metadata := map[string]interface{}{} + metadata["description"] = values[0] + decoratorsMap["metadata"] = metadata + } } else if name == "maxLength" || name == "minLength" || name == "minValue" || name == "maxValue" { - decoratorsMap[name] = values[0] + if len(values) > 0 { + decoratorsMap[name] = values[0] + } } else { decoratorsMap[name] = values } @@ -287,13 +295,15 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte func (s *BicepVisitor) VisitVariableDecl(ctx *parser.VariableDeclContext) interface{} { var variable = map[string]interface{}{} - identifier := ctx.Identifier().Accept(s).(string) - expression := ctx.Expression().Accept(s) + + identifier := checkAcceptAntlrString(ctx.Identifier(), s) + decoratorsMap := parseDecorators(ctx.AllDecorator(), s) for name, values := range decoratorsMap { variable[name] = values } + expression := checkAcceptExpression(ctx.Expression(), s) variable["value"] = expression s.varList[identifier] = variable @@ -316,27 +326,31 @@ func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interf apiVersion = fullType[1] } + resource["identifier"] = identifier resource["type"] = resourceType resource["apiVersion"] = apiVersion + decoratorsMap := parseDecorators(ctx.AllDecorator(), s) for name, values := range decoratorsMap { resource[name] = values } - resource["identifier"] = identifier if ctx.Object() != nil { object, ok := ctx.Object().Accept(s).(map[string]interface{}) - if !ok { - return nil - } - for key, val := range object { - resource[key] = val + if ok { + for key, val := range object { + resource[key] = val + } } } - lines, ok := resource[kicsLines].(map[string]interface{}) - if !ok { - lines = map[string]interface{}{} + lines := map[string]interface{}{} + if resKicsLines, hasLines := resource[kicsLines]; hasLines { + var ok bool + lines, ok = resKicsLines.(map[string]interface{}) + if !ok { + lines = map[string]interface{}{} + } } line := map[string]int{kicsLine: ctx.GetStart().GetLine()} @@ -362,6 +376,14 @@ func checkAcceptAntlrString(ctx antlr.ParserRuleContext, s *BicepVisitor) string return resultString } +func checkAcceptExpression(ctx antlr.ParserRuleContext, s *BicepVisitor) interface{} { + if ctx != nil { + return ctx.Accept(s) + } + + return "" +} + func (s *BicepVisitor) VisitParameterDefaultValue(ctx *parser.ParameterDefaultValueContext) interface{} { param := ctx.Expression().Accept(s) return param From 8f39af47681b4f2e1c4f8456dfda6b0599880062 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Thu, 9 May 2024 18:05:37 +0100 Subject: [PATCH 116/130] added safety checks --- pkg/parser/bicep/parser.go | 102 +++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 38 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 0d0e4c5dfeb..c209a77d8d5 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -245,10 +245,11 @@ func parseDecorators(decorators []parser.IDecoratorContext, s *BicepVisitor) map func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) interface{} { param := map[string]interface{}{} - identifier := ctx.Identifier().Accept(s).(string) + + identifier := checkAcceptAntlrString(ctx.Identifier(), s) + if ctx.ParameterDefaultValue() != nil { paramVal := ctx.ParameterDefaultValue().Accept(s) - param["defaultValue"] = nil switch paramVal := paramVal.(type) { case map[string][]interface{}: stringifiedFunction := parseFunctionCall(paramVal) @@ -258,12 +259,16 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte paramVal = "[" + paramVal.(string) + "]" } param["defaultValue"] = paramVal + default: + param["defaultValue"] = nil } } + if ctx.TypeExpression() != nil { typeExpression := ctx.TypeExpression().Accept(s) param["type"] = typeExpression } + decoratorsMap := parseDecorators(ctx.AllDecorator(), s) for name, values := range decoratorsMap { if name == "secure" { @@ -274,7 +279,7 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte } } else { if name == "allowed" { - param["allowedValues"] = decoratorsMap["allowed"] + param["allowedValues"] = values } else { param[name] = values } @@ -290,6 +295,7 @@ func (s *BicepVisitor) VisitParameterDecl(ctx *parser.ParameterDeclContext) inte param[kicsLines] = lines s.paramList[identifier] = param + return nil } @@ -385,7 +391,7 @@ func checkAcceptExpression(ctx antlr.ParserRuleContext, s *BicepVisitor) interfa } func (s *BicepVisitor) VisitParameterDefaultValue(ctx *parser.ParameterDefaultValueContext) interface{} { - param := ctx.Expression().Accept(s) + param := checkAcceptExpression(ctx.Expression(), s) return param } @@ -415,8 +421,8 @@ func parseFunctionCall(functionData map[string][]interface{}) string { stringifiedFunctionCall += ", " } } + stringifiedFunctionCall += ")" } - stringifiedFunctionCall += ")" return stringifiedFunctionCall } @@ -508,9 +514,11 @@ func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interf return false } if ctx.Identifier() != nil { - identifier := ctx.Identifier().Accept(s).(string) - identifier = convertToParamVar(identifier, s) - return identifier + identifier, ok := ctx.Identifier().Accept(s).(string) + if ok { + identifier = convertToParamVar(identifier, s) + return identifier + } } return nil @@ -591,9 +599,13 @@ func (s *BicepVisitor) VisitInterpString(ctx *parser.InterpStringContext) interf return complexInterpString } - unformattedString := ctx.STRING_COMPLETE().GetText() - finalString := strings.ReplaceAll(unformattedString, "'", "") - return finalString + if ctx.STRING_COMPLETE() != nil { + unformattedString := ctx.STRING_COMPLETE().GetText() + finalString := strings.ReplaceAll(unformattedString, "'", "") + return finalString + } + + return "" } func (s *BicepVisitor) VisitArray(ctx *parser.ArrayContext) interface{} { @@ -609,12 +621,31 @@ func (s *BicepVisitor) VisitArray(ctx *parser.ArrayContext) interface{} { } func (s *BicepVisitor) VisitArrayItem(ctx *parser.ArrayItemContext) interface{} { - return ctx.Expression().Accept(s) + return checkAcceptExpression(ctx.Expression(), s) +} + +func isParameter(expression interface{}) bool { + exp, ok := expression.(string) + if !ok { + return false + } + + return strings.Contains(exp, "parameters(") || strings.Contains(exp, "variables(") +} + +func isDotFunction(expression interface{}) bool { + exp, ok := expression.(string) + if !ok { + return false + } + + return strings.Contains(exp, ").") } func (s *BicepVisitor) VisitObject(ctx *parser.ObjectContext) interface{} { object := map[string]interface{}{} propertiesLines := map[string]interface{}{} + for _, val := range ctx.AllObjectProperty() { objectProperty, ok := val.Accept(s).(KicsObjectProperty) if !ok { @@ -645,26 +676,9 @@ func (s *BicepVisitor) VisitObject(ctx *parser.ObjectContext) interface{} { return object } -func isParameter(expression interface{}) bool { - exp, ok := expression.(string) - if !ok { - return false - } - - return strings.Contains(exp, "parameters(") || strings.Contains(exp, "variables(") -} - -func isDotFunction(expression interface{}) bool { - exp, ok := expression.(string) - if !ok { - return false - } - - return strings.Contains(exp, ").") -} - func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) interface{} { objectProperty := map[string]interface{}{} + if ctx.Expression() != nil { objectValue := ctx.Expression().Accept(s) if isParameter(objectValue) || isDotFunction(objectValue) { @@ -672,12 +686,16 @@ func (s *BicepVisitor) VisitObjectProperty(ctx *parser.ObjectPropertyContext) in } if ctx.Identifier() != nil { - identifier := ctx.Identifier().Accept(s).(string) - objectProperty[identifier] = objectValue + identifier, ok := ctx.Identifier().Accept(s).(string) + if ok { + objectProperty[identifier] = objectValue + } } if ctx.InterpString() != nil { - interpString := ctx.InterpString().Accept(s).(string) - objectProperty[interpString] = objectValue + interpString, ok := ctx.InterpString().Accept(s).(string) + if ok { + objectProperty[interpString] = objectValue + } } } @@ -722,23 +740,30 @@ func (s *BicepVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{ } func (s *BicepVisitor) VisitParenthesizedExpression(ctx *parser.ParenthesizedExpressionContext) interface{} { - return ctx.Expression().Accept(s) + return checkAcceptExpression(ctx.Expression(), s) } func (s *BicepVisitor) VisitDecorator(ctx *parser.DecoratorContext) interface{} { + if ctx.DecoratorExpression() == nil { + return map[string][]interface{}{} + } decorator := ctx.DecoratorExpression().Accept(s) return decorator } func (s *BicepVisitor) VisitDecoratorExpression(ctx *parser.DecoratorExpressionContext) interface{} { + if ctx.FunctionCall() == nil { + return map[string][]interface{}{} + } return ctx.FunctionCall().Accept(s) } func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interface{} { - identifier := ctx.Identifier().Accept(s).(string) var argumentList []interface{} - var ok bool + identifier := checkAcceptAntlrString(ctx.Identifier(), s) + if ctx.ArgumentList() != nil { + var ok bool argumentList, ok = ctx.ArgumentList().Accept(s).([]interface{}) if !ok { return map[string]interface{}{} @@ -753,6 +778,7 @@ func (s *BicepVisitor) VisitFunctionCall(ctx *parser.FunctionCallContext) interf func (s *BicepVisitor) VisitArgumentList(ctx *parser.ArgumentListContext) interface{} { var argumentList []interface{} + for _, val := range ctx.AllExpression() { argument := val.Accept(s) argumentList = append(argumentList, argument) @@ -761,7 +787,7 @@ func (s *BicepVisitor) VisitArgumentList(ctx *parser.ArgumentListContext) interf } func (s *BicepVisitor) VisitTypeExpression(ctx *parser.TypeExpressionContext) interface{} { - return ctx.Identifier().Accept(s) + return checkAcceptAntlrString(ctx.Identifier(), s) } // GetKind returns the kind of the parser From db2a9ae78c9e7f9744823626a6ee0e4eb975456e Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Fri, 10 May 2024 12:31:50 +0100 Subject: [PATCH 117/130] added safety verifications --- pkg/parser/bicep/parser.go | 126 +++++++++++++++++++++++--------- pkg/parser/bicep/parser_test.go | 22 +++--- 2 files changed, 102 insertions(+), 46 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index c209a77d8d5..7249f40d76e 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -61,7 +61,7 @@ type Resource struct { ResourceData interface{} } -// Encurta o array de Resources deixando apenas aquelas do nivel mais alto (não tem parent) +// Filters the Resource array in order to keep only the top-level resources while reformatting them func filterParentStructs(resources []*Resource) []interface{} { filteredResources := []interface{}{} @@ -76,13 +76,21 @@ func filterParentStructs(resources []*Resource) []interface{} { } func setChildType(child map[string]interface{}, parentType string) { + childType, hasType := child["type"] + if !hasType { + return + } + childTypeString, ok := childType.(string) + if !ok { + return + } if parentType != "" { - newType := strings.Replace((child)["type"].(string), parentType+"/", "", 1) - (child)["type"] = newType + childTypeString = strings.Replace(childTypeString, parentType+"/", "", 1) + child["type"] = childTypeString } } -// Reverte um objeto do tipo struct Resource para a estrutura original do JBicep (inverso do convertOriginalResourcesToStruct) +// Converts Resource struct array back to a JBicep structure func reformatTestTree(resource *Resource) map[string]interface{} { reformattedResource := map[string]interface{}{} @@ -107,38 +115,63 @@ func reformatTestTree(resource *Resource) map[string]interface{} { return reformattedResource } -// Adiciona as resources ao array "resources" do seu parent caso exista +// Adds resource to its parent's children array func addChildrenToParents(resources []*Resource) { resourceMap := map[string]*Resource{} + // Loops twice through the resources array in order to first fill the resourceMap with the required data for _, resource := range resources { resourceMap[resource.Name] = resource } for _, resource := range resources { if resource.Parent != "" { - parent := resourceMap[resource.Parent] + parent, ok := resourceMap[resource.Parent] + if !ok { + continue + } parent.Children = append(parent.Children, resource) } } } -// Converte array de objetos com a estrutura original do JBicep para um array de Resource +// Converts JBicep structure to a Resource struct array func convertOriginalResourcesToStruct(resources []interface{}) []*Resource { newResources := []*Resource{} for _, res := range resources { - actualRes := res.(map[string]interface{}) - resName := actualRes["identifier"].(string) - resType := actualRes["type"].(string) + actualRes, ok := res.(map[string]interface{}) + if !ok { + return newResources + } + resName, hasName := actualRes["identifier"] + resType, hasType := actualRes["type"] + + if !hasName || !hasType { + return newResources + } + + resNameString, ok := resName.(string) + if !ok { + return newResources + } + resTypeString, ok := resType.(string) + if !ok { + return newResources + } + newRes := Resource{ - Name: resName, - FullType: resType, + Name: resNameString, + FullType: resTypeString, ResourceData: res, } - if resParent, ok := actualRes["parent"]; ok { - newRes.Parent = resParent.(string) + if resParent, hasParent := actualRes["parent"]; hasParent { + var ok bool + newRes.Parent, ok = resParent.(string) + if !ok { + return newResources + } } newResources = append(newResources, &newRes) @@ -160,22 +193,30 @@ func makeResourcesNestedStructure(jBicep *JSONBicep) []interface{} { // Parse - parses bicep to BicepVisitor template (json file) func (p *Parser) Parse(file string, _ []byte) ([]model.Document, []int, error) { bicepVisitor := NewBicepVisitor() - stream, _ := antlr.NewFileStream(file) + stream, err := antlr.NewFileStream(file) + if err != nil { + return nil, nil, err + } lexer := parser.NewbicepLexer(stream) tokenStream := antlr.NewCommonTokenStream(lexer, antlr.TokenDefaultChannel) bicepParser := parser.NewbicepParser(tokenStream) + bicepParser.RemoveErrorListeners() bicepParser.AddErrorListener(antlr.NewDiagnosticErrorListener(true)) - bicepParser.Program().Accept(bicepVisitor) + program := bicepParser.Program() + if program != nil { + program.Accept(bicepVisitor) + } var doc model.Document jBicep := convertVisitorToJSONBicep(bicepVisitor) - testeResources := makeResourcesNestedStructure(jBicep) - jBicep.Resources = testeResources + nestedResources := makeResourcesNestedStructure(jBicep) + jBicep.Resources = nestedResources + bicepBytes, err := json.Marshal(jBicep) if err != nil { return nil, nil, err @@ -445,23 +486,38 @@ func convertToParamVar(str string, s *BicepVisitor) string { func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{} { if ctx.GetChildCount() > 1 { - if ctx.Identifier() != nil { - identifier := ctx.Identifier().Accept(s).(string) - identifier = convertToParamVar(identifier, s) - exp := ctx.Expression(0).Accept(s) - if ctx.DOT() != nil { - switch exp := exp.(type) { - case map[string][]interface{}: - return parseFunctionCall(exp) + "." + identifier - case string: - return exp + "." + identifier - default: - return nil - } + if ctx.DOT() != nil { + var expressionString string + + var exp interface{} = "" + if ctx.Expression(0) != nil { + exp = ctx.Expression(0).Accept(s) + } + + switch exp := exp.(type) { + case map[string][]interface{}: + expressionString = parseFunctionCall(exp) + case string: + expressionString = exp + default: + expressionString = "" } - } else if ctx.LogicCharacter() == nil { - for _, val := range ctx.AllExpression() { - val.Accept(s) + + if ctx.Identifier() != nil { + identifier := checkAcceptAntlrString(ctx.Identifier(), s) + identifier = convertToParamVar(identifier, s) + + return expressionString + "." + identifier + } + + if ctx.FunctionCall() != nil { + fc := ctx.FunctionCall().Accept(s) + fcData, ok := fc.(map[string][]interface{}) + if !ok { + return "" + } + functionCallString := parseFunctionCall(fcData) + return expressionString + "." + functionCallString } } } @@ -470,7 +526,7 @@ func (s *BicepVisitor) VisitExpression(ctx *parser.ExpressionContext) interface{ return ctx.PrimaryExpression().Accept(s) } - return "" + return nil } func (s *BicepVisitor) VisitPrimaryExpression(ctx *parser.PrimaryExpressionContext) interface{} { diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 164e91ba74c..a154e50101a 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -1002,7 +1002,7 @@ func TestParseBicepFile(t *testing.T) { ], "identifier": "nic", "location": null, - "name": "", + "name": null, "type": "Microsoft.Network/networkInterfaces", "userAssignedIdentities": { "'${[resourceId(Microsoft.ManagedIdentity/userAssignedIdentities, variables('nicName'))]}'": { @@ -1397,12 +1397,12 @@ func TestParseBicepFile(t *testing.T) { }, "enableNonSslPort": "[parameters('enableNonSslPort')]", "minimumTlsVersion": "1.2", - "publicNetworkAccess": "", - "redisConfiguration": "", + "publicNetworkAccess": null, + "redisConfiguration": null, "redisVersion": "6", - "replicasPerMaster": "", - "replicasPerPrimary": "", - "shardCount": "", + "replicasPerMaster": null, + "replicasPerPrimary": null, + "shardCount": null, "sku": { "_kics_lines": { "_kics__default": { @@ -1419,14 +1419,14 @@ func TestParseBicepFile(t *testing.T) { } }, "capacity": "[parameters('capacity')]", - "family": "", + "family": null, "name": "[parameters('skuName')]" }, - "subnetId": "" + "subnetId": null }, "tags": "[parameters('tags')]", "type": "Microsoft.Cache/redis", - "zones": "" + "zones": null }, { "apiVersion": "2021-05-01-preview", @@ -1486,7 +1486,7 @@ func TestParseBicepFile(t *testing.T) { "_kics_line": 334 } }, - "value": "'${redisCache.properties.hostName},password=${.primaryKey},ssl=True,abortConnect=False'" + "value": "['${redisCache.properties.hostName},password=${redisCache.listKeys().primaryKey},ssl=True,abortConnect=False']" }, "type": "secrets" } @@ -1505,7 +1505,7 @@ func TestParseBicepFile(t *testing.T) { } }, "diagnosticsLogs": { - "value": "" + "value": null }, "diagnosticsLogsSpecified": { "value": null From b8814c52186eb4955aac1346e2aceaeaf4dcf29f Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Fri, 10 May 2024 15:22:06 +0100 Subject: [PATCH 118/130] update future improvements documentation for commands on comments --- docs/future_improvements.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/future_improvements.md b/docs/future_improvements.md index 59274d993b8..23de0de8658 100644 --- a/docs/future_improvements.md +++ b/docs/future_improvements.md @@ -26,6 +26,14 @@ To avoid potential false positives and improve the accuracy of scans when workin We advise reviewing your project's specific security needs to determine if this flag is appropriate. More information about the passwords and secrets query is available in our [Password and Secrets documentation](https://github.com/Checkmarx/kics/blob/master/docs/secrets.md). +### Commands on Bicep Files as Comments + +The current version does not support **ignoring sections using special commands in comments** when scanning Bicep files. Unlike other file types, where comments starting with `kics-scan` can control the scan behavior, this feature is not yet available for Bicep. + +We are working on adding this capability in future updates. Until then, please note that Bicep files will be scanned in their entirety, and commands in comments will be ignored. + +More information about commands on comments in files is available on [Running KICS documentation page](https://docs.kics.io/latest/running-kics/#using_commands_on_scanned_files_as_comments) + --- ## Contribution From 019bcf25d39e5db05943362194516147ddb6a3fa Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Mon, 13 May 2024 11:43:26 +0100 Subject: [PATCH 119/130] refactored functions to make them simpler --- pkg/parser/bicep/parser.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 7249f40d76e..538d8d23f00 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -410,17 +410,13 @@ func (s *BicepVisitor) VisitResourceDecl(ctx *parser.ResourceDeclContext) interf } func checkAcceptAntlrString(ctx antlr.ParserRuleContext, s *BicepVisitor) string { - resultString := "" - ok := false - if ctx != nil { - resultString, ok = ctx.Accept(s).(string) - if !ok { - resultString = "" + if result, ok := ctx.Accept(s).(string); ok { + return result } } - return resultString + return "" } func checkAcceptExpression(ctx antlr.ParserRuleContext, s *BicepVisitor) interface{} { @@ -581,13 +577,11 @@ func (s *BicepVisitor) VisitLiteralValue(ctx *parser.LiteralValueContext) interf } func acceptExpressionAtIndex(idx int, ctx *parser.InterpStringContext, s *BicepVisitor) interface{} { - var expression interface{} - expression = "" if ctx.Expression(idx) != nil { - expression = ctx.Expression(idx).Accept(s) + return ctx.Expression(idx).Accept(s) } - return expression + return "" } func buildComplexInterp(interpStringValues []interface{}) string { From 85f6f46fa24fcfc74b1229424dae57dc419b13dc Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 13 May 2024 12:18:20 +0100 Subject: [PATCH 120/130] added bicep to --type flag and scan help --- docs/commands.md | 2 +- e2e/fixtures/assets/scan_help | 2 +- internal/constants/constants.go | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/commands.md b/docs/commands.md index 5bb01bc5836..68af1521007 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -72,7 +72,7 @@ Use "kics [command] --help" for more information about a command. | -r, --secrets-regexes-path string | path to secrets regex rules configuration file| | --terraform-vars-path | string path where terraform variables are present| | --timeout int | number of seconds the query has to execute before being canceled (default 60)| -| -t, --type strings | case insensitive list of platform types to scan
(Ansible, AzureResourceManager, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC,GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerLessFW, Terraform)
cannot be provided with type exclusion flags| +| -t, --type strings | case insensitive list of platform types to scan
(Ansible, AzureResourceManager, Bicep, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC,GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerLessFW, Terraform)
cannot be provided with type exclusion flags| | --exclude-type strings | case insensitive list of platform types not to scan
(Ansible, AzureResourceManager, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC, GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerLessFW, Terraform)
cannot be provided with type inclusion flags| diff --git a/e2e/fixtures/assets/scan_help b/e2e/fixtures/assets/scan_help index cfd526eee41..930bec75493 100644 --- a/e2e/fixtures/assets/scan_help +++ b/e2e/fixtures/assets/scan_help @@ -61,7 +61,7 @@ Flags: --terraform-vars-path string path where terraform variables are present --timeout int number of seconds the query has to execute before being canceled (default 60) -t, --type strings case insensitive list of platform types to scan - (Ansible, AzureResourceManager, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC, GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerlessFW, Terraform) + (Ansible, AzureResourceManager, Bicep, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC, GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerlessFW, Terraform) cannot be provided with type exclusion flags Global Flags: diff --git a/internal/constants/constants.go b/internal/constants/constants.go index b72c9f94048..4ecc374505d 100644 --- a/internal/constants/constants.go +++ b/internal/constants/constants.go @@ -51,6 +51,7 @@ var ( "OpenAPI": "openAPI", "Terraform": "terraform", "AzureResourceManager": "azureResourceManager", + "Bicep": "bicep", "GoogleDeploymentManager": "googleDeploymentManager", "GRPC": "grpc", "Buildah": "buildah", From bc6451fd2fcc417d75c21340e78f2b18e41b553a Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 13 May 2024 12:19:45 +0100 Subject: [PATCH 121/130] added documentation for bicep linting and file validation --- docs/future_improvements.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/future_improvements.md b/docs/future_improvements.md index 23de0de8658..cfe91162b9a 100644 --- a/docs/future_improvements.md +++ b/docs/future_improvements.md @@ -8,6 +8,19 @@ Here, you'll find information on upcoming enhancements, planned features, and ar ## Bicep +### Linting and File Validation + +Currently, KICS doesn't perform validation checks on Bicep files before scanning them. +This means that even if a file isn't syntactically or structurally correct, it will still be scanned, potentially leading to inaccurate results without any error notifications. We're actively prioritizing this fix and anticipate implementing it in the forthcoming weeks. + +### Commands on Bicep Files as Comments + +The current version does not support **ignoring sections using special commands in comments** when scanning Bicep files. Unlike other file types, where comments starting with `kics-scan` can control the scan behavior, this feature is not yet available for Bicep. + +We are working on adding this capability in future updates. Until then, please note that Bicep files will be scanned in their entirety, and commands in comments will be ignored. + +More information about commands on comments in files is available on [Running KICS documentation page](https://docs.kics.io/latest/running-kics/#using_commands_on_scanned_files_as_comments) + ### Logic and Cycle Operators Currently, KICS does not analyze logic and cycle operators. This means that expressions within constructs such as for and if statements are ignored during the scanning process. As a result, any security issues or vulnerabilities present within these constructs will not be detected by KICS. @@ -26,13 +39,6 @@ To avoid potential false positives and improve the accuracy of scans when workin We advise reviewing your project's specific security needs to determine if this flag is appropriate. More information about the passwords and secrets query is available in our [Password and Secrets documentation](https://github.com/Checkmarx/kics/blob/master/docs/secrets.md). -### Commands on Bicep Files as Comments - -The current version does not support **ignoring sections using special commands in comments** when scanning Bicep files. Unlike other file types, where comments starting with `kics-scan` can control the scan behavior, this feature is not yet available for Bicep. - -We are working on adding this capability in future updates. Until then, please note that Bicep files will be scanned in their entirety, and commands in comments will be ignored. - -More information about commands on comments in files is available on [Running KICS documentation page](https://docs.kics.io/latest/running-kics/#using_commands_on_scanned_files_as_comments) --- From ebdcceef16a5a4c71a7f5de55086f3b4255d2609 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 13 May 2024 12:31:34 +0100 Subject: [PATCH 122/130] added unit tests for unsuported content on bicep files --- pkg/parser/bicep/parser_test.go | 185 ++++++++++++++++++++++ test/fixtures/bicep_test/unsuported.bicep | 130 +++++++++++++++ 2 files changed, 315 insertions(+) create mode 100644 test/fixtures/bicep_test/unsuported.bicep diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index a154e50101a..1519b676858 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -104,6 +104,191 @@ func TestParseBicepFile(t *testing.T) { want string wantErr bool }{ + { + name: "Parse Bicep file with Unsuported Content", + filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "unsuported.bicep"), + want: `{ + "parameters": { + "diagnosticLogCategoriesToEnable": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 44 + }, + "_kics_type": { + "_kics_line": 44 + } + }, + "allowedValues": [ + [ + "allLogs", + "ConnectedClientList" + ] + ], + "defaultValue": [ + "allLogs" + ], + "metadata": { + "description": "Optional. The name of logs that will be streamed. \"allLogs\" includes all possible logs for the resource." + }, + "type": "array" + }, + "diagnosticMetricsToEnable": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 52 + }, + "_kics_type": { + "_kics_line": 52 + } + }, + "allowedValues": [ + [ + "AllMetrics" + ] + ], + "defaultValue": [ + "AllMetrics" + ], + "metadata": { + "description": "Optional. The name of metrics that will be streamed." + }, + "type": "array" + }, + "diagnosticSettingsName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 32 + }, + "_kics_type": { + "_kics_line": 32 + } + }, + "defaultValue": "'${parameters('name')}-diagnosticSettings'", + "metadata": { + "description": "Optional. The name of the diagnostic setting, if deployed." + }, + "type": "string" + }, + "diagnosticWorkspaceId": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 35 + }, + "_kics_type": { + "_kics_line": 35 + } + }, + "defaultValue": "", + "metadata": { + "description": "Optional. Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub." + }, + "type": "string" + }, + "keyvaultName": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 23 + }, + "_kics_type": { + "_kics_line": 23 + } + }, + "metadata": { + "description": "The name of an existing keyvault, that it will be used to store secrets (connection string)" + }, + "type": "string" + }, + "name": { + "_kics_lines": { + "_kics_defaultValue": { + "_kics_line": 20 + }, + "_kics_type": { + "_kics_line": 20 + } + }, + "maxLength": 63, + "metadata": { + "description": "Required. The name of the Redis cache resource. Start and end with alphanumeric. Consecutive hyphens not allowed" + }, + "minLength": 1, + "type": "string" + } + }, + "resources": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 110 + }, + "_kics_apiVersion": { + "_kics_line": 110 + }, + "_kics_name": { + "_kics_line": 111 + }, + "_kics_type": { + "_kics_line": 110 + } + }, + "apiVersion": "2022-11-01", + "identifier": "keyVault", + "name": "[parameters('keyvaultName')]", + "type": "Microsoft.KeyVault/vaults" + }, + { + "apiVersion": "2021-05-01-preview", + "identifier": "redisCache_diagnosticSettings", + "type": "Microsoft.Insights/diagnosticSettings" + } + ], + "variables": { + "diagnosticsLogs": { + "value": null + }, + "diagnosticsLogsSpecified": { + "value": null + }, + "diagnosticsMetrics": { + "value": null + }, + "dogs": { + "value": [ + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 73 + }, + "_kics_age": { + "_kics_line": 75 + }, + "_kics_name": { + "_kics_line": 74 + } + }, + "age": 3, + "name": "Fido" + }, + { + "_kics_lines": { + "_kics__default": { + "_kics_line": 77 + }, + "_kics_age": { + "_kics_line": 79 + }, + "_kics_name": { + "_kics_line": 78 + } + }, + "age": 7, + "name": "Rex" + } + ] + } + } + }`, + }, { name: "Parse Bicep file with parameters", filename: filepath.Join("..", "..", "..", "test", "fixtures", "bicep_test", "parameters.bicep"), diff --git a/test/fixtures/bicep_test/unsuported.bicep b/test/fixtures/bicep_test/unsuported.bicep new file mode 100644 index 00000000000..8af377c659d --- /dev/null +++ b/test/fixtures/bicep_test/unsuported.bicep @@ -0,0 +1,130 @@ +targetScope = 'resourceGroup' + +type obj = { + level: 'bronze' | 'silver' | 'gold' +} + +type oneOfSeveralObjects = {foo: 'bar'} | {fizz: 'buzz'} | {snap: 'crackle'} +type mixedTypeArray = ('fizz' | 42 | {an: 'object'} | null)[] + +metadata singleExpressionMetaData = 'something' + +metadata objectMetaData = { + author: 'Someone' + description: 'Something' +} + +@description('Required. The name of the Redis cache resource. Start and end with alphanumeric. Consecutive hyphens not allowed') +@maxLength(63) +@minLength(1) +param name string + +@description('The name of an existing keyvault, that it will be used to store secrets (connection string)' ) +param keyvaultName string + +// @description('Optional. Enables system assigned managed identity on the resource.') +// param systemAssignedIdentity bool = false + +// @description('Optional. The ID(s) to assign to the resource.') +// param userAssignedIdentities object = {} + +@description('Optional. The name of the diagnostic setting, if deployed.') +param diagnosticSettingsName string = '${name}-diagnosticSettings' + +@description('Optional. Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.') +param diagnosticWorkspaceId string = '' + +@description('Optional. The name of logs that will be streamed. "allLogs" includes all possible logs for the resource.') +@allowed([ + 'allLogs' + 'ConnectedClientList' +]) +param diagnosticLogCategoriesToEnable array = [ + 'allLogs' +] + +@description('Optional. The name of metrics that will be streamed.') +@allowed([ + 'AllMetrics' +]) +param diagnosticMetricsToEnable array = [ + 'AllMetrics' +] + +var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs'): { + category: category + enabled: true +}] + +var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [ + { + categoryGroup: 'allLogs' + enabled: true + } +] : diagnosticsLogsSpecified + +var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: { + category: metric + timeGrain: null + enabled: true +}] + +var dogs = [ + { + name: 'Fido' + age: 3 + } + { + name: 'Rex' + age: 7 + } +] + +// var identityType = systemAssignedIdentity ? 'SystemAssigned' : !empty(userAssignedIdentities) ? 'UserAssigned' : 'None' + +// var identity = { +// type: identityType +// userAssignedIdentities: !empty(userAssignedIdentities) ? userAssignedIdentities : null +// } + +module singleModuleWithIndexedDependencies 'passthrough.bicep' = { + name: 'hello' + params: { + myInput: concat(moduleCollectionWithCollectionDependencies[index].outputs.myOutput, storageAccounts[index * 3].properties.accessTier) + } + dependsOn: [ + storageAccounts2[index - 10] + ] +} + +module moduleCollectionWithIndexedDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { + name: moduleName + params: { + myInput: '${moduleCollectionWithCollectionDependencies[index].outputs.myOutput} - ${storageAccounts[index * 3].properties.accessTier} - ${moduleName}' + } + dependsOn: [ + storageAccounts2[index - 9] + ] +}] + +resource keyVault 'Microsoft.KeyVault/vaults@2022-11-01' existing = { + name: keyvaultName +} + +resource redisCache_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if ( !empty(diagnosticWorkspaceId) ) { + name: diagnosticSettingsName + properties: { + storageAccountId: null + workspaceId: empty(diagnosticWorkspaceId) ? null : diagnosticWorkspaceId + eventHubAuthorizationRuleId: null + eventHubName: null + metrics: empty(diagnosticWorkspaceId) ? null : diagnosticsMetrics + logs: empty(diagnosticWorkspaceId) ? null : diagnosticsLogs + } + scope: resourceGroup() +} + +@description('The resource name.') +output name string = subscription().displayName + +output oldDogs array = filter(dogs, dog => dog.age >=5) From 4c03d9b99ee24e2f088d2aa6dc56f118e019616d Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 13 May 2024 12:47:12 +0100 Subject: [PATCH 123/130] update LOC count in analyzer_test and add Bicep to supported platforms unit tests --- pkg/analyzer/analyzer_test.go | 2 +- pkg/engine/source/filesystem_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/analyzer/analyzer_test.go b/pkg/analyzer/analyzer_test.go index be86079f697..9b189eb2366 100644 --- a/pkg/analyzer/analyzer_test.go +++ b/pkg/analyzer/analyzer_test.go @@ -430,7 +430,7 @@ func TestAnalyzer_Analyze(t *testing.T) { wantExclude: []string{}, typesFromFlag: []string{""}, excludeTypesFromFlag: []string{""}, - wantLOC: 377, + wantLOC: 507, wantErr: false, gitIgnoreFileName: "", excludeGitIgnore: false, diff --git a/pkg/engine/source/filesystem_test.go b/pkg/engine/source/filesystem_test.go index cd2538292dc..3f99fe8b4de 100644 --- a/pkg/engine/source/filesystem_test.go +++ b/pkg/engine/source/filesystem_test.go @@ -733,6 +733,7 @@ func TestListSupportedPlatforms(t *testing.T) { expected := []string{ "Ansible", "AzureResourceManager", + "Bicep", "Buildah", "CICD", "CloudFormation", From e9d4f5758dc44ee7c4d544086321d93c1555fbe9 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 13 May 2024 13:46:20 +0100 Subject: [PATCH 124/130] fix e2e outputs with Bicep addition --- docs/commands.md | 2 +- docs/dockerhub.md | 4 ++-- e2e/fixtures/E2E_CLI_013 | 1 + e2e/fixtures/assets/scan_help | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/commands.md b/docs/commands.md index 68af1521007..0e99ec9e964 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -73,7 +73,7 @@ Use "kics [command] --help" for more information about a command. | --terraform-vars-path | string path where terraform variables are present| | --timeout int | number of seconds the query has to execute before being canceled (default 60)| | -t, --type strings | case insensitive list of platform types to scan
(Ansible, AzureResourceManager, Bicep, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC,GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerLessFW, Terraform)
cannot be provided with type exclusion flags| -| --exclude-type strings | case insensitive list of platform types not to scan
(Ansible, AzureResourceManager, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC, GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerLessFW, Terraform)
cannot be provided with type inclusion flags| +| --exclude-type strings | case insensitive list of platform types not to scan
(Ansible, AzureResourceManager, Bicep, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC, GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerLessFW, Terraform)
cannot be provided with type inclusion flags| Usage: diff --git a/docs/dockerhub.md b/docs/dockerhub.md index 93b95274791..ff7ade9873f 100644 --- a/docs/dockerhub.md +++ b/docs/dockerhub.md @@ -134,10 +134,10 @@ Flags: -r, --secrets-regexes-path string path to secrets regex rules configuration file --timeout int number of seconds the query has to execute before being canceled (default 60) -t, --type strings case insensitive list of platform types to scan - (Ansible, AzureResourceManager, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC, GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerLessFW, Terraform) + (Ansible, AzureResourceManager, Bicep, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC, GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerLessFW, Terraform) cannot be provided with type exclusion flags --exclude-type strings case insensitive list of platform types not to scan - (Ansible, AzureResourceManager, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC, GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerLessFW, Terraform) + (Ansible, AzureResourceManager, Bicep, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC, GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerLessFW, Terraform) cannot be provided with type inclusion flags ``` diff --git a/e2e/fixtures/E2E_CLI_013 b/e2e/fixtures/E2E_CLI_013 index 827a6f6ae73..8be27088c85 100644 --- a/e2e/fixtures/E2E_CLI_013 +++ b/e2e/fixtures/E2E_CLI_013 @@ -1,5 +1,6 @@ Ansible AzureResourceManager +Bicep Buildah CICD CloudFormation diff --git a/e2e/fixtures/assets/scan_help b/e2e/fixtures/assets/scan_help index 930bec75493..5553976c9ca 100644 --- a/e2e/fixtures/assets/scan_help +++ b/e2e/fixtures/assets/scan_help @@ -27,7 +27,7 @@ Flags: can be provided multiple times or as a comma separated string example: 'info,low' --exclude-type strings case insensitive list of platform types not to scan - (Ansible, AzureResourceManager, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC, GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerlessFW, Terraform) + (Ansible, AzureResourceManager, Bicep, Buildah, CICD, CloudFormation, Crossplane, DockerCompose, Dockerfile, GRPC, GoogleDeploymentManager, Knative, Kubernetes, OpenAPI, Pulumi, ServerlessFW, Terraform) cannot be provided with type inclusion flags --experimental-queries include experimental queries (queries not yet thoroughly reviewed) --fail-on strings which kind of results should return an exit code different from 0 From f52979e2d9d64ce8d3260639c6a56ff3535f1ce5 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 13 May 2024 15:37:22 +0100 Subject: [PATCH 125/130] e2e addition for bicep results and payload --- e2e/fixtures/E2E_CLI_091_PAYLOAD.json | 372 ++++++++++++++++++ e2e/fixtures/E2E_CLI_091_RESULT.json | 200 ++++++++++ .../e2e-cli-091_bicep_scan_output_payload.go | 31 ++ test/fixtures/bicep_test/test/negative1.bicep | 15 + test/fixtures/bicep_test/test/negative2.bicep | 15 + test/fixtures/bicep_test/test/positive1.bicep | 15 + .../fixtures/bicep_test/test/positive10.bicep | 11 + .../fixtures/bicep_test/test/positive11.bicep | 15 + .../fixtures/bicep_test/test/positive12.bicep | 14 + test/fixtures/bicep_test/test/positive2.bicep | 11 + test/fixtures/bicep_test/test/positive3.bicep | 14 + test/fixtures/bicep_test/test/positive4.bicep | 11 + test/fixtures/bicep_test/test/positive5.bicep | 15 + test/fixtures/bicep_test/test/positive6.bicep | 14 + test/fixtures/bicep_test/test/positive7.bicep | 15 + test/fixtures/bicep_test/test/positive8.bicep | 11 + test/fixtures/bicep_test/test/positive9.bicep | 14 + 17 files changed, 793 insertions(+) create mode 100644 e2e/fixtures/E2E_CLI_091_PAYLOAD.json create mode 100644 e2e/fixtures/E2E_CLI_091_RESULT.json create mode 100644 e2e/testcases/e2e-cli-091_bicep_scan_output_payload.go create mode 100644 test/fixtures/bicep_test/test/negative1.bicep create mode 100644 test/fixtures/bicep_test/test/negative2.bicep create mode 100644 test/fixtures/bicep_test/test/positive1.bicep create mode 100644 test/fixtures/bicep_test/test/positive10.bicep create mode 100644 test/fixtures/bicep_test/test/positive11.bicep create mode 100644 test/fixtures/bicep_test/test/positive12.bicep create mode 100644 test/fixtures/bicep_test/test/positive2.bicep create mode 100644 test/fixtures/bicep_test/test/positive3.bicep create mode 100644 test/fixtures/bicep_test/test/positive4.bicep create mode 100644 test/fixtures/bicep_test/test/positive5.bicep create mode 100644 test/fixtures/bicep_test/test/positive6.bicep create mode 100644 test/fixtures/bicep_test/test/positive7.bicep create mode 100644 test/fixtures/bicep_test/test/positive8.bicep create mode 100644 test/fixtures/bicep_test/test/positive9.bicep diff --git a/e2e/fixtures/E2E_CLI_091_PAYLOAD.json b/e2e/fixtures/E2E_CLI_091_PAYLOAD.json new file mode 100644 index 00000000000..23b042c1fd3 --- /dev/null +++ b/e2e/fixtures/E2E_CLI_091_PAYLOAD.json @@ -0,0 +1,372 @@ +{ + "document": [ + { + "file": "path/test/fixtures/bicep_test/test/negative1.bicep", + "id": "74f144d6-1767-4baf-a115-d547c7b4d1f6", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High", + "state": "On" + }, + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ], + "state": "On" + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/negative2.bicep", + "id": "db2dac5a-106a-41f3-922b-fb2bf6ccc52d", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High", + "state": "On" + }, + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ], + "state": "On" + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive1.bicep", + "id": "7f332bce-c819-413e-92ce-29c5e6732f6f", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High", + "state": "Off" + }, + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ], + "state": "On" + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive10.bicep", + "id": "ca45459f-4fbb-4f7a-8fd3-f78ad73a7b47", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High", + "state": "On" + }, + "emails": "sample@email.com", + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive11.bicep", + "id": "81bd370a-d18d-4a42-8504-5a63f74c9e6a", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High", + "state": "On" + }, + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ], + "state": "Off" + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive12.bicep", + "id": "28db2544-6a02-4596-9fcc-42e73d4edefe", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High", + "state": "On" + }, + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ] + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive2.bicep", + "id": "5b10da09-8219-446b-87a8-a1f3ba1904c6", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ], + "state": "On" + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive3.bicep", + "id": "8eb62b6b-8f56-4b73-8a6f-578fe7446dce", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High" + }, + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ], + "state": "On" + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive4.bicep", + "id": "b287ed19-852c-4cd8-ae91-aa18510fa662", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High", + "state": "On" + }, + "emails": "sample@email.com", + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive5.bicep", + "id": "540f8e13-d2c7-4fa0-8510-0776f2ac793f", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High", + "state": "On" + }, + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ], + "state": "Off" + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive6.bicep", + "id": "c6f591fb-970e-43ef-bd63-75e20702dee4", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High", + "state": "On" + }, + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ] + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive7.bicep", + "id": "51817845-7d94-4bf8-99ba-6471d90a8f47", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High", + "state": "Off" + }, + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ], + "state": "On" + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive8.bicep", + "id": "ec84551d-344d-4373-8d60-63c4bcc06c42", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ], + "state": "On" + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + }, + { + "file": "path/test/fixtures/bicep_test/test/positive9.bicep", + "id": "9275e98a-ff6e-48e7-aceb-d4faefe62f18", + "parameters": {}, + "resources": [ + { + "apiVersion": "2020-01-01-preview", + "identifier": "security_contact", + "name": "security contact", + "properties": { + "alertNotifications": { + "minimalSeverity": "High" + }, + "emails": "sample@email.com", + "notificationsByRole": { + "roles": [ + "Owner" + ], + "state": "On" + }, + "phone": "9999999" + }, + "type": "Microsoft.Security/securityContacts" + } + ], + "variables": {} + } + ] +} diff --git a/e2e/fixtures/E2E_CLI_091_RESULT.json b/e2e/fixtures/E2E_CLI_091_RESULT.json new file mode 100644 index 00000000000..81255188947 --- /dev/null +++ b/e2e/fixtures/E2E_CLI_091_RESULT.json @@ -0,0 +1,200 @@ +{ + "kics_version": "development", + "files_scanned": 14, + "lines_scanned": 204, + "files_parsed": 14, + "lines_parsed": 204, + "lines_ignored": 0, + "files_failed_to_scan": 0, + "queries_total": 43, + "queries_failed_to_execute": 0, + "queries_failed_to_compute_similarity_id": 0, + "scan_id": "console", + "severity_counters": { + "CRITICAL": 0, + "HIGH": 0, + "INFO": 12, + "LOW": 0, + "MEDIUM": 0, + "TRACE": 0 + }, + "total_counter": 12, + "total_bom_resources": 0, + "start": "2024-05-13T14:56:28.4200497+01:00", + "end": "2024-05-13T14:56:32.4884749+01:00", + "paths": [ + "/path/test/fixtures/bicep_test/test" + ], + "queries": [ + { + "query_name": "Email Notifications Disabled", + "query_id": "79c2c2c0-eb00-47c0-ac16-f8b0e2c81c92", + "query_url": "https://docs.microsoft.com/en-us/azure/templates/microsoft.security/securitycontacts", + "severity": "INFO", + "platform": "AzureResourceManager", + "cloud_provider": "AZURE", + "category": "Networking and Firewall", + "experimental": false, + "description": "Email notifications about new security alerts, should be set to 'On', and be sent to persons with specific RBAC roles on the subscription", + "description_id": "7f5b9ef4", + "files": [ + { + "file_name": "/path/test/fixtures/bicep_test/test/positive12.bicep", + "similarity_id": "c1c095342af7dbf263e52e6ed344fd07ef39dca36e654aeffecb3c40530728aa", + "line": 10, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "MissingAttribute", + "search_key": "resources.name={{security contact}}.properties.notificationsByRole", + "search_line": 10, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' should have 'notificationsByRole.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' doesn't have 'notificationsByRole.state' property defined" + }, + { + "file_name": "/path/test/fixtures/bicep_test/test/positive2.bicep", + "similarity_id": "cde286e1f04fd3a1ce64f647e9483728511e154bab26b6ed418ac9373fbb42e6", + "line": 3, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "MissingAttribute", + "search_key": "resources.name={{security contact}}.properties", + "search_line": 3, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' should have 'alertNotifications.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' doesn't have 'alertNotifications' property defined" + }, + { + "file_name": "/path/test/fixtures/bicep_test/test/positive7.bicep", + "similarity_id": "1137382a29991fd5de51071734a6b3ba2deb0b5090fd06c0573e35bb79d78b15", + "line": 7, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "IncorrectValue", + "search_key": "resources.name={{security contact}}.properties.alertNotifications.state", + "search_line": 7, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' property value should have 'alertNotifications.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' should have 'alertNotifications.state' property set to 'Off'" + }, + { + "file_name": "/path/test/fixtures/bicep_test/test/positive10.bicep", + "similarity_id": "904900ad2ed3ec646f8f9390b6a223b4541044101f250b4d4e4740eea76a9461", + "line": 3, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "MissingAttribute", + "search_key": "resources.name={{security contact}}.properties", + "search_line": 3, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' should have 'notificationsByRole.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' doesn't have 'notificationsByRole' property defined" + }, + { + "file_name": "/path/test/fixtures/bicep_test/test/positive8.bicep", + "similarity_id": "34afd47f5ee4c855d2733888cc0b2a9df989a61d33340fb873a666ab4cc87eb1", + "line": 3, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "MissingAttribute", + "search_key": "resources.name={{security contact}}.properties", + "search_line": 3, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' should have 'alertNotifications.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' doesn't have 'alertNotifications' property defined" + }, + { + "file_name": "/path/test/fixtures/bicep_test/test/positive5.bicep", + "similarity_id": "3e045654ceb3b05fe41f5e9e64a797725302d50ce01079e8f04255a7c0cdf9a6", + "line": 11, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "IncorrectValue", + "search_key": "resources.name={{security contact}}.properties.notificationsByRole.state", + "search_line": 11, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' property value should have 'notificationsByRole.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' should have 'notificationsByRole.state' property set to 'Off'" + }, + { + "file_name": "/path/test/fixtures/bicep_test/test/positive1.bicep", + "similarity_id": "e29ed60beffa13540f660e8290dd546afe1c3ff9f735b0851f8862010b0cd03c", + "line": 7, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "IncorrectValue", + "search_key": "resources.name={{security contact}}.properties.alertNotifications.state", + "search_line": 7, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' property value should have 'alertNotifications.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' should have 'alertNotifications.state' property set to 'Off'" + }, + { + "file_name": "/path/test/fixtures/bicep_test/test/positive4.bicep", + "similarity_id": "18470b0d2877779414ff2b495c997afe4cd925fb5c055eeeadb8e617772a5c52", + "line": 3, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "MissingAttribute", + "search_key": "resources.name={{security contact}}.properties", + "search_line": 3, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' should have 'notificationsByRole.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' doesn't have 'notificationsByRole' property defined" + }, + { + "file_name": "/path/test/fixtures/bicep_test/test/positive3.bicep", + "similarity_id": "f0bc728e7dd11b3bd9bb68ba9ed364a1918e1988de56cef9aada9bd658c668f0", + "line": 6, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "MissingAttribute", + "search_key": "resources.name={{security contact}}.properties.alertNotifications", + "search_line": 6, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' should have 'alertNotifications.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' doesn't have 'alertNotifications.state' property defined" + }, + { + "file_name": "/path/test/fixtures/bicep_test/test/positive11.bicep", + "similarity_id": "e7f46abecbf3efb96157925b4e3c7b693e8670673f12b8241e6c2f8d0d1ff11a", + "line": 11, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "IncorrectValue", + "search_key": "resources.name={{security contact}}.properties.notificationsByRole.state", + "search_line": 11, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' property value should have 'notificationsByRole.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' should have 'notificationsByRole.state' property set to 'Off'" + }, + { + "file_name": "/path/test/fixtures/bicep_test/test/positive6.bicep", + "similarity_id": "c607324d4aaa4b87c9652f3e2c345d60d17e009d138e6873f457b08f5da58b20", + "line": 10, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "MissingAttribute", + "search_key": "resources.name={{security contact}}.properties.notificationsByRole", + "search_line": 10, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' should have 'notificationsByRole.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' doesn't have 'notificationsByRole.state' property defined" + }, + { + "file_name": "/path/test/fixtures/bicep_test/test/positive9.bicep", + "similarity_id": "abe2b32de833f56224ef281c8833ed5398a80c29fb4f0cbdf00462b2f4cb80eb", + "line": 6, + "resource_type": "Microsoft.Security/securityContacts", + "resource_name": "security contact", + "issue_type": "MissingAttribute", + "search_key": "resources.name={{security contact}}.properties.alertNotifications", + "search_line": 6, + "search_value": "", + "expected_value": "resource with type 'Microsoft.Security/securityContacts' should have 'alertNotifications.state' property set to 'On'", + "actual_value": "resource with type 'Microsoft.Security/securityContacts' doesn't have 'alertNotifications.state' property defined" + } + ] + } + ] +} diff --git a/e2e/testcases/e2e-cli-091_bicep_scan_output_payload.go b/e2e/testcases/e2e-cli-091_bicep_scan_output_payload.go new file mode 100644 index 00000000000..32851e3f59f --- /dev/null +++ b/e2e/testcases/e2e-cli-091_bicep_scan_output_payload.go @@ -0,0 +1,31 @@ +package testcases + +// E2E-CLI-091 - Kics scan command with -o and -d flags on bicep files +// should perform the scan successfully, evaluating the result and payload files +func init() { //nolint + testSample := TestCase{ + Name: "should perform a scan on bicep files and create a result and payload file [E2E-CLI-091]", + Args: args{ + Args: []cmdArgs{ + []string{"scan", "-o", "/path/e2e/output", + "--output-name", "E2E_CLI_091_RESULT", + "-p", "\"/path/test/fixtures/bicep_test/test\"", + "-d", "\"/path/e2e/output/E2E_CLI_091_PAYLOAD.json\"", + "--disable-secrets", + }, + }, + ExpectedResult: []ResultsValidation{ + { + ResultsFile: "E2E_CLI_091_RESULT", + ResultsFormats: []string{"json"}, + }, + }, + ExpectedPayload: []string{ + "E2E_CLI_091_PAYLOAD.json", + }, + }, + WantStatus: []int{20}, + } + + Tests = append(Tests, testSample) +} diff --git a/test/fixtures/bicep_test/test/negative1.bicep b/test/fixtures/bicep_test/test/negative1.bicep new file mode 100644 index 00000000000..26f3a5742be --- /dev/null +++ b/test/fixtures/bicep_test/test/negative1.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/test/fixtures/bicep_test/test/negative2.bicep b/test/fixtures/bicep_test/test/negative2.bicep new file mode 100644 index 00000000000..26f3a5742be --- /dev/null +++ b/test/fixtures/bicep_test/test/negative2.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/test/fixtures/bicep_test/test/positive1.bicep b/test/fixtures/bicep_test/test/positive1.bicep new file mode 100644 index 00000000000..fce90975370 --- /dev/null +++ b/test/fixtures/bicep_test/test/positive1.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'Off' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/test/fixtures/bicep_test/test/positive10.bicep b/test/fixtures/bicep_test/test/positive10.bicep new file mode 100644 index 00000000000..edfc2f0fe0c --- /dev/null +++ b/test/fixtures/bicep_test/test/positive10.bicep @@ -0,0 +1,11 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + } +} diff --git a/test/fixtures/bicep_test/test/positive11.bicep b/test/fixtures/bicep_test/test/positive11.bicep new file mode 100644 index 00000000000..d761b527a04 --- /dev/null +++ b/test/fixtures/bicep_test/test/positive11.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'Off' + roles: ['Owner'] + } + } +} diff --git a/test/fixtures/bicep_test/test/positive12.bicep b/test/fixtures/bicep_test/test/positive12.bicep new file mode 100644 index 00000000000..316159f73c0 --- /dev/null +++ b/test/fixtures/bicep_test/test/positive12.bicep @@ -0,0 +1,14 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + roles: ['Owner'] + } + } +} diff --git a/test/fixtures/bicep_test/test/positive2.bicep b/test/fixtures/bicep_test/test/positive2.bicep new file mode 100644 index 00000000000..047c95bb6d7 --- /dev/null +++ b/test/fixtures/bicep_test/test/positive2.bicep @@ -0,0 +1,11 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/test/fixtures/bicep_test/test/positive3.bicep b/test/fixtures/bicep_test/test/positive3.bicep new file mode 100644 index 00000000000..0de0191abec --- /dev/null +++ b/test/fixtures/bicep_test/test/positive3.bicep @@ -0,0 +1,14 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/test/fixtures/bicep_test/test/positive4.bicep b/test/fixtures/bicep_test/test/positive4.bicep new file mode 100644 index 00000000000..edfc2f0fe0c --- /dev/null +++ b/test/fixtures/bicep_test/test/positive4.bicep @@ -0,0 +1,11 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + } +} diff --git a/test/fixtures/bicep_test/test/positive5.bicep b/test/fixtures/bicep_test/test/positive5.bicep new file mode 100644 index 00000000000..d761b527a04 --- /dev/null +++ b/test/fixtures/bicep_test/test/positive5.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'Off' + roles: ['Owner'] + } + } +} diff --git a/test/fixtures/bicep_test/test/positive6.bicep b/test/fixtures/bicep_test/test/positive6.bicep new file mode 100644 index 00000000000..316159f73c0 --- /dev/null +++ b/test/fixtures/bicep_test/test/positive6.bicep @@ -0,0 +1,14 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'On' + minimalSeverity: 'High' + } + notificationsByRole: { + roles: ['Owner'] + } + } +} diff --git a/test/fixtures/bicep_test/test/positive7.bicep b/test/fixtures/bicep_test/test/positive7.bicep new file mode 100644 index 00000000000..fce90975370 --- /dev/null +++ b/test/fixtures/bicep_test/test/positive7.bicep @@ -0,0 +1,15 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + state: 'Off' + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/test/fixtures/bicep_test/test/positive8.bicep b/test/fixtures/bicep_test/test/positive8.bicep new file mode 100644 index 00000000000..047c95bb6d7 --- /dev/null +++ b/test/fixtures/bicep_test/test/positive8.bicep @@ -0,0 +1,11 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} diff --git a/test/fixtures/bicep_test/test/positive9.bicep b/test/fixtures/bicep_test/test/positive9.bicep new file mode 100644 index 00000000000..0de0191abec --- /dev/null +++ b/test/fixtures/bicep_test/test/positive9.bicep @@ -0,0 +1,14 @@ +resource security_contact 'Microsoft.Security/securityContacts@2020-01-01-preview' = { + name: 'security contact' + properties: { + emails: 'sample@email.com' + phone: '9999999' + alertNotifications: { + minimalSeverity: 'High' + } + notificationsByRole: { + state: 'On' + roles: ['Owner'] + } + } +} From dfaf29d25a131db1d8ddc2f4319427b60f56c5f7 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 13 May 2024 15:53:10 +0100 Subject: [PATCH 126/130] update analyze test for bicep --- pkg/analyzer/analyzer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/analyzer/analyzer_test.go b/pkg/analyzer/analyzer_test.go index 9b189eb2366..9885ef7fb05 100644 --- a/pkg/analyzer/analyzer_test.go +++ b/pkg/analyzer/analyzer_test.go @@ -430,7 +430,7 @@ func TestAnalyzer_Analyze(t *testing.T) { wantExclude: []string{}, typesFromFlag: []string{""}, excludeTypesFromFlag: []string{""}, - wantLOC: 507, + wantLOC: 697, wantErr: false, gitIgnoreFileName: "", excludeGitIgnore: false, From 81abbcea8a108d7c42c3743d7ce0cdb9975b8a50 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 13 May 2024 16:14:53 +0100 Subject: [PATCH 127/130] fix path -d flag --- e2e/testcases/e2e-cli-091_bicep_scan_output_payload.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/testcases/e2e-cli-091_bicep_scan_output_payload.go b/e2e/testcases/e2e-cli-091_bicep_scan_output_payload.go index 32851e3f59f..ff1e341ee77 100644 --- a/e2e/testcases/e2e-cli-091_bicep_scan_output_payload.go +++ b/e2e/testcases/e2e-cli-091_bicep_scan_output_payload.go @@ -10,7 +10,7 @@ func init() { //nolint []string{"scan", "-o", "/path/e2e/output", "--output-name", "E2E_CLI_091_RESULT", "-p", "\"/path/test/fixtures/bicep_test/test\"", - "-d", "\"/path/e2e/output/E2E_CLI_091_PAYLOAD.json\"", + "-d", "/path/e2e/output/E2E_CLI_091_PAYLOAD.json", "--disable-secrets", }, }, From 43acf7a6aa05507c1d647325c82be35c7f6d19d6 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Mon, 13 May 2024 16:39:18 +0100 Subject: [PATCH 128/130] fix file and id on E2E payload --- e2e/fixtures/E2E_CLI_091_PAYLOAD.json | 56 +++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/e2e/fixtures/E2E_CLI_091_PAYLOAD.json b/e2e/fixtures/E2E_CLI_091_PAYLOAD.json index 23b042c1fd3..2cc4ea05b0d 100644 --- a/e2e/fixtures/E2E_CLI_091_PAYLOAD.json +++ b/e2e/fixtures/E2E_CLI_091_PAYLOAD.json @@ -1,8 +1,8 @@ { "document": [ { - "file": "path/test/fixtures/bicep_test/test/negative1.bicep", - "id": "74f144d6-1767-4baf-a115-d547c7b4d1f6", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -29,8 +29,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/negative2.bicep", - "id": "db2dac5a-106a-41f3-922b-fb2bf6ccc52d", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -57,8 +57,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive1.bicep", - "id": "7f332bce-c819-413e-92ce-29c5e6732f6f", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -85,8 +85,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive10.bicep", - "id": "ca45459f-4fbb-4f7a-8fd3-f78ad73a7b47", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -107,8 +107,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive11.bicep", - "id": "81bd370a-d18d-4a42-8504-5a63f74c9e6a", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -135,8 +135,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive12.bicep", - "id": "28db2544-6a02-4596-9fcc-42e73d4edefe", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -162,8 +162,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive2.bicep", - "id": "5b10da09-8219-446b-87a8-a1f3ba1904c6", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -186,8 +186,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive3.bicep", - "id": "8eb62b6b-8f56-4b73-8a6f-578fe7446dce", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -213,8 +213,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive4.bicep", - "id": "b287ed19-852c-4cd8-ae91-aa18510fa662", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -235,8 +235,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive5.bicep", - "id": "540f8e13-d2c7-4fa0-8510-0776f2ac793f", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -263,8 +263,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive6.bicep", - "id": "c6f591fb-970e-43ef-bd63-75e20702dee4", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -290,8 +290,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive7.bicep", - "id": "51817845-7d94-4bf8-99ba-6471d90a8f47", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -318,8 +318,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive8.bicep", - "id": "ec84551d-344d-4373-8d60-63c4bcc06c42", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { @@ -342,8 +342,8 @@ "variables": {} }, { - "file": "path/test/fixtures/bicep_test/test/positive9.bicep", - "id": "9275e98a-ff6e-48e7-aceb-d4faefe62f18", + "file": "file", + "id": "0", "parameters": {}, "resources": [ { From 549484644d76e90ca38a4dcc106816cf2c99778d Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Tue, 14 May 2024 13:34:41 +0100 Subject: [PATCH 129/130] update parser resolve with max resolver depth flag value --- pkg/parser/bicep/parser.go | 2 +- pkg/parser/bicep/parser_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/parser/bicep/parser.go b/pkg/parser/bicep/parser.go index 538d8d23f00..858c480c725 100644 --- a/pkg/parser/bicep/parser.go +++ b/pkg/parser/bicep/parser.go @@ -866,7 +866,7 @@ func (p *Parser) StringifyContent(content []byte) (string, error) { } // Resolve resolves bicep files variables -func (p *Parser) Resolve(fileContent []byte, _ string, _ bool) ([]byte, error) { +func (p *Parser) Resolve(fileContent []byte, _ string, _ bool, _ int) ([]byte, error) { return fileContent, nil } diff --git a/pkg/parser/bicep/parser_test.go b/pkg/parser/bicep/parser_test.go index 1519b676858..30f47275af4 100644 --- a/pkg/parser/bicep/parser_test.go +++ b/pkg/parser/bicep/parser_test.go @@ -28,7 +28,7 @@ func TestParser_SupportedExtensions(t *testing.T) { func Test_Resolve(t *testing.T) { parser := &Parser{} param := `param vmName string = 'simple-vm'` - resolved, err := parser.Resolve([]byte(param), "test.bicep", true) + resolved, err := parser.Resolve([]byte(param), "test.bicep", true, 15) require.NoError(t, err) require.Equal(t, []byte(param), resolved) } From 03b966d36f9b1c430cc1e600734990963cfbf2b7 Mon Sep 17 00:00:00 2001 From: JulioSCX Date: Wed, 15 May 2024 11:15:40 +0100 Subject: [PATCH 130/130] solved conflicts in unrestricted ssh access query --- .../test/positive_expected_result.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive_expected_result.json b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive_expected_result.json index 5fc594a3a8f..f4b05c4f8ac 100644 --- a/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive_expected_result.json +++ b/assets/queries/azureResourceManager/network_security_group_with_unrestricted_access_to_ssh/test/positive_expected_result.json @@ -35,6 +35,12 @@ "line": 22, "fileName": "positive6.json" }, + { + "queryName": "Network Security Group With Unrestricted Access To SSH", + "severity": "MEDIUM", + "line": 22, + "fileName": "positive7.json" + }, { "queryName": "Network Security Group With Unrestricted Access To SSH", "severity": "MEDIUM",