mirror of
https://github.com/github/codeql.git
synced 2025-12-28 06:36:33 +01:00
Merge pull request #5113 from github/alexet/fix-var-decls-spec
Update the language specification to allow empty var_decls
This commit is contained in:
@@ -374,7 +374,7 @@ A *variable declaration list* provides a sequence of variables and a type for ea
|
||||
|
||||
::
|
||||
|
||||
var_decls ::= var_decl ("," var_decl)*
|
||||
var_decls ::= (var_decl ("," var_decl)*)?
|
||||
var_decl ::= type simpleId
|
||||
|
||||
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
|
||||
|
||||
::
|
||||
|
||||
head ::= ("predicate" | type) predicateName "(" (var_decls)? ")"
|
||||
head ::= ("predicate" | type) predicateName "(" var_decls ")"
|
||||
|
||||
The body of a predicate is of one of three forms:
|
||||
|
||||
@@ -1209,7 +1209,7 @@ An aggregation can be written in one of two forms:
|
||||
|
||||
::
|
||||
|
||||
aggregation ::= aggid ("[" expr "]")? "(" (var_decls)? ("|" (formula)? ("|" as_exprs ("order" "by" aggorderbys)?)?)? ")"
|
||||
aggregation ::= aggid ("[" expr "]")? "(" var_decls ("|" (formula)? ("|" as_exprs ("order" "by" aggorderbys)?)?)? ")"
|
||||
| aggid ("[" expr "]")? "(" as_exprs ("order" "by" aggorderbys)? ")"
|
||||
| "unique" "(" var_decls "|" (formula)? ("|" as_exprs)? ")"
|
||||
|
||||
@@ -2046,7 +2046,7 @@ The complete grammar for QL is as follows:
|
||||
| "language" "[" "monotonicAggregates" "]"
|
||||
| "bindingset" "[" (variable ( "," variable)*)? "]"
|
||||
|
||||
head ::= ("predicate" | type) predicateName "(" (var_decls)? ")"
|
||||
head ::= ("predicate" | type) predicateName "(" var_decls ")"
|
||||
|
||||
optbody ::= ";"
|
||||
| "{" formula "}"
|
||||
@@ -2070,7 +2070,7 @@ The complete grammar for QL is as follows:
|
||||
| qldoc? annotations "class" classname "=" type ";"
|
||||
| qldoc? annotations "module" modulename "=" moduleId ";"
|
||||
|
||||
var_decls ::= var_decl ("," var_decl)*
|
||||
var_decls ::= (var_decl ("," var_decl)*)?
|
||||
|
||||
var_decl ::= type simpleId
|
||||
|
||||
@@ -2157,7 +2157,7 @@ The complete grammar for QL is as follows:
|
||||
|
||||
postfix_cast ::= primary "." "(" type ")"
|
||||
|
||||
aggregation ::= aggid ("[" expr "]")? "(" (var_decls)? ("|" (formula)? ("|" as_exprs ("order" "by" aggorderbys)?)?)? ")"
|
||||
aggregation ::= aggid ("[" expr "]")? "(" var_decls ("|" (formula)? ("|" as_exprs ("order" "by" aggorderbys)?)?)? ")"
|
||||
| aggid ("[" expr "]")? "(" as_exprs ("order" "by" aggorderbys)? ")"
|
||||
| "unique" "(" var_decls "|" (formula)? ("|" as_exprs)? ")"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user