diff options
author | Li Jin <dragon-fly@qq.com> | 2022-05-13 10:08:54 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-05-13 10:08:54 +0800 |
commit | b5153486a948dcb0a35cf8847ced394b2ff8edec (patch) | |
tree | 9079868d2855ff3f7abbf02d07645173d6eb5810 | |
parent | de8f67340f58f8b2ca3fbea77af39e0a5b022abe (diff) | |
download | yuescript-b5153486a948dcb0a35cf8847ced394b2ff8edec.tar.gz yuescript-b5153486a948dcb0a35cf8847ced394b2ff8edec.tar.bz2 yuescript-b5153486a948dcb0a35cf8847ced394b2ff8edec.zip |
add update syntax support for //. fix issue #96.
-rw-r--r-- | spec/inputs/syntax.yue | 1 | ||||
-rw-r--r-- | spec/outputs/syntax.lua | 1 | ||||
-rwxr-xr-x | src/yuescript/yue_compiler.cpp | 2 | ||||
-rwxr-xr-x | src/yuescript/yue_parser.cpp | 1 |
4 files changed, 4 insertions, 1 deletions
diff --git a/spec/inputs/syntax.yue b/spec/inputs/syntax.yue index 84c6578..f212bec 100644 --- a/spec/inputs/syntax.yue +++ b/spec/inputs/syntax.yue | |||
@@ -173,6 +173,7 @@ x += 10 + 3 | |||
173 | j -= "hello" | 173 | j -= "hello" |
174 | y *= 2 | 174 | y *= 2 |
175 | y /= 100 | 175 | y /= 100 |
176 | y //= 100 | ||
176 | m %= 2 | 177 | m %= 2 |
177 | hello ..= "world" | 178 | hello ..= "world" |
178 | 179 | ||
diff --git a/spec/outputs/syntax.lua b/spec/outputs/syntax.lua index 701361e..24b78c6 100644 --- a/spec/outputs/syntax.lua +++ b/spec/outputs/syntax.lua | |||
@@ -176,6 +176,7 @@ x = x + (10 + 3) | |||
176 | local j = j - "hello" | 176 | local j = j - "hello" |
177 | y = y * 2 | 177 | y = y * 2 |
178 | y = y / 100 | 178 | y = y / 100 |
179 | y = y // 100 | ||
179 | local m = m % 2 | 180 | local m = m % 2 |
180 | local hello = hello .. "world" | 181 | local hello = hello .. "world" |
181 | self.__class.something = self.__class.something + 10 | 182 | self.__class.something = self.__class.something + 10 |
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 7d7bf25..bc046af 100755 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
@@ -60,7 +60,7 @@ using namespace parserlib; | |||
60 | 60 | ||
61 | typedef std::list<std::string> str_list; | 61 | typedef std::list<std::string> str_list; |
62 | 62 | ||
63 | const std::string_view version = "0.10.17"sv; | 63 | const std::string_view version = "0.10.18"sv; |
64 | const std::string_view extension = "yue"sv; | 64 | const std::string_view extension = "yue"sv; |
65 | 65 | ||
66 | class YueCompilerImpl { | 66 | class YueCompilerImpl { |
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp index 1f1b57c..ef414d4 100755 --- a/src/yuescript/yue_parser.cpp +++ b/src/yuescript/yue_parser.cpp | |||
@@ -322,6 +322,7 @@ YueParser::YueParser() { | |||
322 | expr("+") | | 322 | expr("+") | |
323 | expr("-") | | 323 | expr("-") | |
324 | expr("*") | | 324 | expr("*") | |
325 | expr("//") | | ||
325 | expr("/") | | 326 | expr("/") | |
326 | expr("%") | | 327 | expr("%") | |
327 | expr("or") | | 328 | expr("or") | |