aboutsummaryrefslogtreecommitdiff
path: root/lib/operators.nom
diff options
context:
space:
mode:
Diffstat (limited to 'lib/operators.nom')
-rw-r--r--lib/operators.nom4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/operators.nom b/lib/operators.nom
index 9250214..cdf41fe 100644
--- a/lib/operators.nom
+++ b/lib/operators.nom
@@ -31,6 +31,10 @@ compile [..]
# Indexing:
compile [%obj'%key, %obj's %key, %obj -> %key] to: "(\(%obj as lua))[\(%key as lua)]"
+# Substring
+compile [%str |%start|] to: "\(%str as lua):sub(\(%start as lua), \(%start as lua))"
+compile [%str |%start - %stop|] to: "\(%str as lua):sub(\(%start as lua), \(%stop as lua))"
+
# Variable assignment operator, and += type versions
compile [%var = %val] to code:
lua> ".."