Skip to content

Commit bed10ad

Browse files
authored
Merge pull request github#5113 from github/alexet/fix-var-decls-spec
Update the language specification to allow empty var_decls
2 parents 8a2e063 + 7583904 commit bed10ad

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/codeql/ql-language-reference/ql-language-specification.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ A *variable declaration list* provides a sequence of variables and a type for ea
374374

375375
::
376376

377-
var_decls ::= var_decl ("," var_decl)*
377+
var_decls ::= (var_decl ("," var_decl)*)?
378378
var_decl ::= type simpleId
379379

380380
A valid variable declaration list must not include two declarations with the same variable name. Moreover, if the declaration has a typing environment that applies, it must not use a variable name that is already present in that typing environment.
@@ -820,7 +820,7 @@ The head of the predicate gives a name, an optional *result type*, and a sequenc
820820

821821
::
822822

823-
head ::= ("predicate" | type) predicateName "(" (var_decls)? ")"
823+
head ::= ("predicate" | type) predicateName "(" var_decls ")"
824824

825825
The body of a predicate is of one of three forms:
826826

@@ -1209,7 +1209,7 @@ An aggregation can be written in one of two forms:
12091209

12101210
::
12111211

1212-
aggregation ::= aggid ("[" expr "]")? "(" (var_decls)? ("|" (formula)? ("|" as_exprs ("order" "by" aggorderbys)?)?)? ")"
1212+
aggregation ::= aggid ("[" expr "]")? "(" var_decls ("|" (formula)? ("|" as_exprs ("order" "by" aggorderbys)?)?)? ")"
12131213
| aggid ("[" expr "]")? "(" as_exprs ("order" "by" aggorderbys)? ")"
12141214
| "unique" "(" var_decls "|" (formula)? ("|" as_exprs)? ")"
12151215

@@ -2046,7 +2046,7 @@ The complete grammar for QL is as follows:
20462046
| "language" "[" "monotonicAggregates" "]"
20472047
| "bindingset" "[" (variable ( "," variable)*)? "]"
20482048

2049-
head ::= ("predicate" | type) predicateName "(" (var_decls)? ")"
2049+
head ::= ("predicate" | type) predicateName "(" var_decls ")"
20502050

20512051
optbody ::= ";"
20522052
| "{" formula "}"
@@ -2070,7 +2070,7 @@ The complete grammar for QL is as follows:
20702070
| qldoc? annotations "class" classname "=" type ";"
20712071
| qldoc? annotations "module" modulename "=" moduleId ";"
20722072
2073-
var_decls ::= var_decl ("," var_decl)*
2073+
var_decls ::= (var_decl ("," var_decl)*)?
20742074

20752075
var_decl ::= type simpleId
20762076

@@ -2157,7 +2157,7 @@ The complete grammar for QL is as follows:
21572157

21582158
postfix_cast ::= primary "." "(" type ")"
21592159

2160-
aggregation ::= aggid ("[" expr "]")? "(" (var_decls)? ("|" (formula)? ("|" as_exprs ("order" "by" aggorderbys)?)?)? ")"
2160+
aggregation ::= aggid ("[" expr "]")? "(" var_decls ("|" (formula)? ("|" as_exprs ("order" "by" aggorderbys)?)?)? ")"
21612161
| aggid ("[" expr "]")? "(" as_exprs ("order" "by" aggorderbys)? ")"
21622162
| "unique" "(" var_decls "|" (formula)? ("|" as_exprs)? ")"
21632163

0 commit comments

Comments
 (0)