aboutsummaryrefslogtreecommitdiff
path: root/compiler/test_util_test.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-02-24 23:05:54 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-02-25 00:39:23 +0900
commit0d4795245765669f4c7aa033e988833d5f78c9a3 (patch)
treed6d50edfb57a19b1a4664edc583d9a2f2db12dd4 /compiler/test_util_test.go
parentAdd range expression (diff)
downloadtre-0d4795245765669f4c7aa033e988833d5f78c9a3.tar.gz
tre-0d4795245765669f4c7aa033e988833d5f78c9a3.tar.xz
Refactoring
* Remove token field from symbolNode * Simplify notation of nested nodes * Simplify arguments of newSymbolNode()
Diffstat (limited to 'compiler/test_util_test.go')
-rw-r--r--compiler/test_util_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/test_util_test.go b/compiler/test_util_test.go
new file mode 100644
index 0000000..7e6896d
--- /dev/null
+++ b/compiler/test_util_test.go
@@ -0,0 +1,13 @@
+package compiler
+
+func newSymbolNodeWithPos(v byte, pos symbolPosition) *symbolNode {
+ n := newSymbolNode(v)
+ n.pos = pos
+ return n
+}
+
+func newEndMarkerNodeWithPos(id int, pos symbolPosition) *endMarkerNode {
+ n := newEndMarkerNode(id)
+ n.pos = pos
+ return n
+}