summaryrefslogtreecommitdiff
path: root/consts.py
diff options
context:
space:
mode:
authorAndrew <saintruler@gmail.com>2021-07-12 11:12:14 +0400
committerAndrew <saintruler@gmail.com>2021-07-12 11:12:14 +0400
commita175d139e74f52a83adb647925c3842f8ab026fb (patch)
treeff859d00b59950c76d0271537d6838afb4ff8a89 /consts.py
parentabb8ad61e3605a5e17e05b2f300d2b7277bd424a (diff)
Divided code in modules.
Diffstat (limited to 'consts.py')
-rw-r--r--consts.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/consts.py b/consts.py
new file mode 100644
index 0000000..5bf3fdd
--- /dev/null
+++ b/consts.py
@@ -0,0 +1,18 @@
+STATE_OPERATOR, STATE_NAME, *_ = range(100)
+(
+ LEFT_PARENTHESIS, RIGHT_PARENTHESIS, NUMBER, OPERATOR, SEMICOLON, COMMA, SYMBOL, *_
+) = range(100)
+
+UNARY = "unary"
+FUNCALL = "funcall"
+PRECEDENCE = {
+ "+": 10,
+ "-": 10,
+ "*": 20,
+ "^": 30,
+ UNARY: 40,
+}
+
+OPERATOR_CHARS = "*+-/%&~^|#$.:<=>@"
+NUMBER_CHARS = "0123456789"
+SYMBOL_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!?"