aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-05-13 10:08:54 +0800
committerLi Jin <dragon-fly@qq.com>2022-05-13 10:08:54 +0800
commitb5153486a948dcb0a35cf8847ced394b2ff8edec (patch)
tree9079868d2855ff3f7abbf02d07645173d6eb5810
parentde8f67340f58f8b2ca3fbea77af39e0a5b022abe (diff)
downloadyuescript-b5153486a948dcb0a35cf8847ced394b2ff8edec.tar.gz
yuescript-b5153486a948dcb0a35cf8847ced394b2ff8edec.tar.bz2
yuescript-b5153486a948dcb0a35cf8847ced394b2ff8edec.zip
add update syntax support for //. fix issue #96.
-rw-r--r--spec/inputs/syntax.yue1
-rw-r--r--spec/outputs/syntax.lua1
-rwxr-xr-xsrc/yuescript/yue_compiler.cpp2
-rwxr-xr-xsrc/yuescript/yue_parser.cpp1
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
173j -= "hello" 173j -= "hello"
174y *= 2 174y *= 2
175y /= 100 175y /= 100
176y //= 100
176m %= 2 177m %= 2
177hello ..= "world" 178hello ..= "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)
176local j = j - "hello" 176local j = j - "hello"
177y = y * 2 177y = y * 2
178y = y / 100 178y = y / 100
179y = y // 100
179local m = m % 2 180local m = m % 2
180local hello = hello .. "world" 181local hello = hello .. "world"
181self.__class.something = self.__class.something + 10 182self.__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
61typedef std::list<std::string> str_list; 61typedef std::list<std::string> str_list;
62 62
63const std::string_view version = "0.10.17"sv; 63const std::string_view version = "0.10.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 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") |