Skip to content

Commit

Permalink
Initial unicode character support for identifiers
Browse files Browse the repository at this point in the history
Summary:

Test Plan:
Added a test

Reviewers:

Subscribers:

Tasks:

Tags:
  • Loading branch information
kaikalur committed Jan 9, 2023
1 parent 19f8399 commit b091c7e
Show file tree
Hide file tree
Showing 6 changed files with 25,332 additions and 3 deletions.
2 changes: 1 addition & 1 deletion parser/cpp/prepare-javacc-grammar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pwd
GRAMMAR_DIR='../grammar'
GEN_DIR='target/generated-sources/javacc'
mkdir -p $GEN_DIR
cat ./javacc-options.txt $GRAMMAR_DIR/nonreservedwords.txt $GRAMMAR_DIR/reservedwords.txt $GRAMMAR_DIR/sql-spec.txt $GRAMMAR_DIR/presto-extensions.txt $GRAMMAR_DIR/lexical-elements.txt > $GEN_DIR/parser_tmp.jjt
cat ./javacc-options.txt $GRAMMAR_DIR/kw.txt $GRAMMAR_DIR/sql-spec.txt $GRAMMAR_DIR/presto-extensions.txt $GRAMMAR_DIR/nonreservedwords.txt $GRAMMAR_DIR/unicode-identifiers.txt $GRAMMAR_DIR/lexical-elements.txt > $GEN_DIR/parser_tmp.jjt
2 changes: 1 addition & 1 deletion parser/grammar/lexical-elements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ regular_identifier()

| <#identifier_part: <identifier_start> | <identifier_extend> >

| <#identifier_start: ["a"-"z"] // temp
| <#identifier_start: (<UnicodeIdentifierStart>)
/*!! See the Syntax Rules.*/
>

Expand Down
4 changes: 3 additions & 1 deletion parser/grammar/prepare-javacc-grammar.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Concatenate all the fragments into a .jj file.
gendir='../target/generated-sources/javacc'
mkdir -p $gendir
cat javacc-options-java.txt nonreservedwords.txt reservedwords.txt sql-spec.txt presto-extensions.txt lexical-elements.txt > $gendir/parser_tmp.jjt
awk -f ./compact_char_sets.awk < unicode-identifiers.txt > $gendir/compact-unicode-identifiers.txt
#cp unicode-identifiers.txt $gendir/comcpat-unicode-identifiers.txt
cat javacc-options-java.txt kw.txt sql-spec.txt presto-extensions.txt nonreservedwords.txt $gendir/comcpat-unicode-identifiers.txt lexical-elements.txt > $gendir/parser_tmp.jjt
Loading

0 comments on commit b091c7e

Please sign in to comment.