aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Yakimowich-Payne <jyapayne@gmail.com>2020-04-20 17:55:05 -0600
committerJoey Yakimowich-Payne <jyapayne@gmail.com>2020-04-26 09:11:56 -0600
commita84adfe1d8db39e91f4e0e0af4cd81f02cee2fd6 (patch)
treea44fe6009956dd8dcf5d25854dfdc65ad00dcaf8
parent1576127a6e1b5f429d3fb91cf924fc41e43346cf (diff)
downloadnimterop-a84adfe1d8db39e91f4e0e0af4cd81f02cee2fd6.tar.gz
nimterop-a84adfe1d8db39e91f4e0e0af4cd81f02cee2fd6.zip
Add comments describing capabilities
-rw-r--r--nimterop/exprparser.nim23
1 files changed, 22 insertions, 1 deletions
diff --git a/nimterop/exprparser.nim b/nimterop/exprparser.nim
index 610c0cb..1fc72ab 100644
--- a/nimterop/exprparser.nim
+++ b/nimterop/exprparser.nim
@@ -8,6 +8,27 @@ import "."/treesitter/[api, c, cpp]
import "."/[globals, getters, utils]
+# This version of exprparser should be able to handle:
+#
+# All integers + integer like expressions (hex, octal, suffixes)
+# All floating point expressions (except for C++'s hex floating point stuff)
+# Strings and character literals, including C's escape characters (not sure if this is the same as C++'s escape characters or not)
+# Math operators (+, -, /, *)
+# Some Unary operators (-, !, ~). ++, --, and & are yet to be implemented
+# Any identifiers
+# C type descriptors (int, char, etc)
+# Boolean values (true, false)
+# Shift expressions (containing anything in this list)
+# Cast expressions (containing anything in this list)
+# Math expressions (containing anything in this list)
+# Sizeof expressions (containing anything in this list)
+# Cast expressions (containing anything in this list)
+# Parentheses expressions (containing anything in this list)
+# Expressions containing other expressions
+#
+# In addition to the above, it should also handle most type coercions, except
+# for where Nim can't (such as uint + -int)
+
type
ExprParser* = ref object
state*: NimState
@@ -413,7 +434,7 @@ proc processBitwiseExpression(exprParser: ExprParser, node: TSNode, typeofNode:
let unarySym = node.tsNodeChild(0).val.strip()
techo "BIN SYM: ", unarySym
- # TODO: Support more symbols here
+ # TODO: Support more symbols here. ++, --, &
case unarySym
of "~":
nimSym = "not"