@@ -46,10 +46,10 @@ operator_offset = { OFFSET ~ integer_literal ~ SEMICOLON }
4646operator_limit = { LIMIT ~ integer_literal ~ SEMICOLON }
4747operator_require = { REQUIRE ~ vars ~ SEMICOLON }
4848operator_distinct = { DISTINCT ~ SEMICOLON }
49- operator_reduce = { REDUCE ~ reduce_assign ~ ( COMMA ~ reduce_assign )* ~ COMMA? ~ (GROUPBY ~ vars )? ~ SEMICOLON }
49+ operator_reduce = { REDUCE ~ reduce_assign ~ ( COMMA ~ reduce_assign )* ~ COMMA? ~ ( GROUPBY ~ vars )? ~ SEMICOLON }
5050
5151var_order = { var ~ ORDER? }
52- reduce_assign = { (reduce_assignment_var ~ ASSIGN ~ reducer) }
52+ reduce_assign = { ( reduce_assignment_var ~ ASSIGN ~ reducer ) }
5353
5454reduce_assignment_var = { var_optional | var }
5555reducer = { COUNT ~ ( PAREN_OPEN ~ var ~ PAREN_CLOSE )?
@@ -99,13 +99,13 @@ plays_constraint = { PLAYS ~ type_ref }
9999
100100// THING STATEMENTS ============================================================
101101statement_thing = { var ~ COMMA? ~ thing_constraint_list
102- | thing_relation_anonymous ~ (COMMA? ~ thing_constraint_list)?
102+ | thing_relation_anonymous ~ ( COMMA? ~ thing_constraint_list )?
103103 }
104104thing_relation_anonymous = { type_ref? ~ relation }
105- thing_constraint_list = {thing_constraint ~ (COMMA ~ thing_constraint)* ~ COMMA?}
105+ thing_constraint_list = {thing_constraint ~ ( COMMA ~ thing_constraint )* ~ COMMA?}
106106
107107thing_constraint = { isa_constraint | iid_constraint | has_constraint | links_constraint }
108- isa_constraint = { ISA_ ~ type_ref ~ (relation | expression | value_literal | expression_struct | comparison)? }
108+ isa_constraint = { ISA_ ~ type_ref ~ ( relation | expression | value_literal | expression_struct | comparison )? }
109109iid_constraint = { IID ~ iid_value }
110110has_constraint = { HAS ~ type_ref_list ~ ( comparison | expression_list | var )
111111 | HAS ~ type_ref ~ ( comparison | expression_value | var )
@@ -377,7 +377,7 @@ reserved = { WITH | MATCH | FETCH | UPDATE | DEFINE | UNDEFINE | REDEFINE | INSE
377377 | FIRST | LAST
378378 }
379379
380- unreserved = { ABS | CEIL | FLOOR | ROUND | LENGTH
380+ unreserved = { ABS | CEIL | FLOOR | ROUND | LEN
381381 | CHECK | FIRST
382382 | COUNT | MAX | MIN | MEAN | MEDIAN | STD | SUM | LIST
383383 | VALUE | SELECT | SORT | LIMIT | OFFSET | GROUP | LIKE | CONTAINS
@@ -517,11 +517,16 @@ POWER = @{ "^" }
517517MODULO = @{ "%" }
518518
519519// Incomplete list of function names usable in expressions. The 'expression_function_name' rule references all function names.
520- builtin_func_name = ${ ABS | CEIL | FLOOR | ROUND | LENGTH | MAX | MIN }
520+ builtin_func_name = ${ ABS
521+ | CEIL | FLOOR | ROUND
522+ | LEN
523+ | MAX | MIN
524+ | LABEL | IID
525+ }
521526ABS = @{ "abs" ~ WB }
522527CEIL = @{ "ceil" ~ WB }
523528FLOOR = @{ "floor" ~ WB }
524- LENGTH = @{ "length " ~ WB }
529+ LEN = @{ "len " ~ WB }
525530ROUND = @{ "round" ~ WB }
526531
527532// GROUP AND AGGREGATE QUERY KEYWORDS
0 commit comments