Skip to content

Commit 3ae912f

Browse files
committed
Add non-reserved keywords for some GPML keywords
1 parent b9340a7 commit 3ae912f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

partiql-parser/src/parse/partiql.lalrpop

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,8 @@ FunctionCall: CallSite = {
13121312
#[inline]
13131313
FunctionName: ast::SymbolPrimitive = {
13141314
<SymbolPrimitive>,
1315+
<lo:@L> <ident:FnNonReservedKeyword> <hi:@R> =>
1316+
ast::SymbolPrimitive { value: ident.to_owned(), case: ast::CaseSensitivity::CaseInsensitive }
13151317
}
13161318

13171319
#[inline]
@@ -1437,6 +1439,10 @@ VarRef: ast::AstNode<ast::VarRef> = {
14371439
name: ast::SymbolPrimitive { value: ident.to_owned(), case: ast::CaseSensitivity::CaseSensitive },
14381440
qualifier: ast::ScopeQualifier::Unqualified
14391441
},lo..hi),
1442+
<lo:@L> <ident:VarNonReservedKeyword> <hi:@R> => state.node(ast::VarRef {
1443+
name: ast::SymbolPrimitive { value: ident.to_owned(), case: ast::CaseSensitivity::CaseInsensitive },
1444+
qualifier: ast::ScopeQualifier::Unqualified
1445+
},lo..hi),
14401446
}
14411447

14421448
ExcludePath: ast::AstNode<ast::ExcludePath> = {
@@ -1668,6 +1674,25 @@ ByIdent: ast::SymbolPrimitive = {
16681674
// //
16691675
// ------------------------------------------------------------------------------ //
16701676

1677+
#[inline]
1678+
VarNonReservedKeyword: &'static str = {
1679+
<NonReservedKeyword>
1680+
}
1681+
1682+
#[inline]
1683+
FnNonReservedKeyword: &'static str = {
1684+
<NonReservedKeyword>
1685+
}
1686+
1687+
#[inline]
1688+
NonReservedKeyword: &'static str = {
1689+
"ACYCLIC" => "ACYCLIC",
1690+
"ANY" => "ANY",
1691+
"SIMPLE" => "SIMPLE",
1692+
"SHORTEST" => "SHORTEST",
1693+
"TRAIL" => "TRAIL",
1694+
}
1695+
16711696
// The lexer is external; See [`lexer.rs`] for its definition.
16721697
//
16731698
// See also http://lalrpop.github.io/lalrpop/lexer_tutorial/002_writing_custom_lexer.html

0 commit comments

Comments
 (0)