Skip to content

Commit b091c7e

Browse files
committed
Initial unicode character support for identifiers
Summary: Test Plan: Added a test Reviewers: Subscribers: Tasks: Tags:
1 parent 19f8399 commit b091c7e

File tree

6 files changed

+25332
-3
lines changed

6 files changed

+25332
-3
lines changed

parser/cpp/prepare-javacc-grammar.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ pwd
33
GRAMMAR_DIR='../grammar'
44
GEN_DIR='target/generated-sources/javacc'
55
mkdir -p $GEN_DIR
6-
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
6+
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

parser/grammar/lexical-elements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ regular_identifier()
8080

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

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Concatenate all the fragments into a .jj file.
22
gendir='../target/generated-sources/javacc'
33
mkdir -p $gendir
4-
cat javacc-options-java.txt nonreservedwords.txt reservedwords.txt sql-spec.txt presto-extensions.txt lexical-elements.txt > $gendir/parser_tmp.jjt
4+
awk -f ./compact_char_sets.awk < unicode-identifiers.txt > $gendir/compact-unicode-identifiers.txt
5+
#cp unicode-identifiers.txt $gendir/comcpat-unicode-identifiers.txt
6+
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

0 commit comments

Comments
 (0)