aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-12-02 10:15:09 +0800
committerLi Jin <dragon-fly@qq.com>2022-12-02 10:15:09 +0800
commita6a65ba26a9d320611abcbfba49fa724edfb4dad (patch)
tree8e51410485a1f7a6108d87eb608aeae1a632add6 /src
parent44069ba29baf423d73e0d2752f0abc7df46fbbb6 (diff)
downloadyuescript-a6a65ba26a9d320611abcbfba49fa724edfb4dad.tar.gz
yuescript-a6a65ba26a9d320611abcbfba49fa724edfb4dad.tar.bz2
yuescript-a6a65ba26a9d320611abcbfba49fa724edfb4dad.zip
add more num lit specs.
Diffstat (limited to 'src')
-rw-r--r--src/yuescript/yue_compiler.cpp2
-rw-r--r--src/yuescript/yue_parser.cpp20
2 files changed, 12 insertions, 10 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp
index 3e58305..0d674f8 100644
--- a/src/yuescript/yue_compiler.cpp
+++ b/src/yuescript/yue_compiler.cpp
@@ -60,7 +60,7 @@ namespace yue {
60 60
61typedef std::list<std::string> str_list; 61typedef std::list<std::string> str_list;
62 62
63const std::string_view version = "0.15.17"sv; 63const std::string_view version = "0.15.18"sv;
64const std::string_view extension = "yue"sv; 64const std::string_view extension = "yue"sv;
65 65
66class YueCompilerImpl { 66class YueCompilerImpl {
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp
index 63c9162..acdc343 100644
--- a/src/yuescript/yue_parser.cpp
+++ b/src/yuescript/yue_parser.cpp
@@ -57,23 +57,25 @@ YueParser::YueParser() {
57 num_char_hex = range('0', '9') | range('a', 'f') | range('A', 'F'); 57 num_char_hex = range('0', '9') | range('a', 'f') | range('A', 'F');
58 num_lit = num_char_hex >> *(num_char_hex | expr('_') >> and_(num_char_hex)); 58 num_lit = num_char_hex >> *(num_char_hex | expr('_') >> and_(num_char_hex));
59 Num = ( 59 Num = (
60 "0x." >> +num_lit >> -num_expo_hex 60 "0x" >> (
61 ) | ( 61 +num_lit >> (
62 "0x" >> +num_lit >> ( 62 '.' >> +num_lit >> -num_expo_hex |
63 '.' >> +num_lit >> -num_expo_hex | 63 num_expo_hex |
64 num_expo_hex | 64 lj_num |
65 lj_num | 65 true_()
66 true_() 66 ) | (
67 '.' >> +num_lit >> -num_expo_hex
68 )
67 ) 69 )
68 ) | ( 70 ) | (
69 '.' >> +num_char >> -num_expo
70 ) | (
71 +num_char >> ( 71 +num_char >> (
72 '.' >> +num_char >> -num_expo | 72 '.' >> +num_char >> -num_expo |
73 num_expo | 73 num_expo |
74 lj_num | 74 lj_num |
75 true_() 75 true_()
76 ) 76 )
77 ) | (
78 '.' >> +num_char >> -num_expo
77 ); 79 );
78 80
79 Cut = false_(); 81 Cut = false_();