From a6a65ba26a9d320611abcbfba49fa724edfb4dad Mon Sep 17 00:00:00 2001 From: Li Jin Date: Fri, 2 Dec 2022 10:15:09 +0800 Subject: add more num lit specs. --- src/yuescript/yue_compiler.cpp | 2 +- src/yuescript/yue_parser.cpp | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src') 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 { typedef std::list str_list; -const std::string_view version = "0.15.17"sv; +const std::string_view version = "0.15.18"sv; const std::string_view extension = "yue"sv; class 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,16 +57,16 @@ YueParser::YueParser() { num_char_hex = range('0', '9') | range('a', 'f') | range('A', 'F'); num_lit = num_char_hex >> *(num_char_hex | expr('_') >> and_(num_char_hex)); Num = ( - "0x." >> +num_lit >> -num_expo_hex - ) | ( - "0x" >> +num_lit >> ( - '.' >> +num_lit >> -num_expo_hex | - num_expo_hex | - lj_num | - true_() + "0x" >> ( + +num_lit >> ( + '.' >> +num_lit >> -num_expo_hex | + num_expo_hex | + lj_num | + true_() + ) | ( + '.' >> +num_lit >> -num_expo_hex + ) ) - ) | ( - '.' >> +num_char >> -num_expo ) | ( +num_char >> ( '.' >> +num_char >> -num_expo | @@ -74,6 +74,8 @@ YueParser::YueParser() { lj_num | true_() ) + ) | ( + '.' >> +num_char >> -num_expo ); Cut = false_(); -- cgit v1.2.3-55-g6feb