about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-06-09 21:14:12 -0400
committerelioat <elioat@tilde.institute>2024-06-09 21:14:12 -0400
commitdf761f249300a4ea7f641bb698b68a144020d11d (patch)
tree948c8c6fdfef5ba35dd3e565dd66436d35beb37b
parentb978a4bb4add25f95dda7b25fffc0233cf780806 (diff)
downloadtour-df761f249300a4ea7f641bb698b68a144020d11d.tar.gz
*
-rw-r--r--lua/chupacabra/chupacabra.lua5
-rw-r--r--lua/chupacabra/refcard.md9
2 files changed, 7 insertions, 7 deletions
diff --git a/lua/chupacabra/chupacabra.lua b/lua/chupacabra/chupacabra.lua
index b8b6995..27cd8b5 100644
--- a/lua/chupacabra/chupacabra.lua
+++ b/lua/chupacabra/chupacabra.lua
@@ -1,6 +1,5 @@
 local chupacabra = {}
 
--- Parse a string into a list of tokens
 function chupacabra.tokenize(s)
     local tokens = {}
     local array = nil
@@ -65,7 +64,7 @@ function chupacabra.evaluate(tokens, context)
             local a = table.remove(stack)
             table.insert(stack, a == b)
         elseif token == "@=" then
-            -- checks if the values of 2 equally lengthed arrays are equal, and returns a bit mask of the differences
+            -- checks if the values of 2 equal length arrays are equal, and returns a bit mask of the differences
             local b = table.remove(stack)
             local a = table.remove(stack)
             if #a ~= #b then
@@ -227,4 +226,4 @@ function chupacabra.run(str, context)
     return chupacabra.evaluate(tokens, context)
 end
 
-return chupacabra
\ No newline at end of file
+return chupacabra
diff --git a/lua/chupacabra/refcard.md b/lua/chupacabra/refcard.md
index 9eaf6e7..af6e24d 100644
--- a/lua/chupacabra/refcard.md
+++ b/lua/chupacabra/refcard.md
@@ -24,14 +24,15 @@ Chupacabra is a stack-based programming language/calculator implemented in lua.
 ## Test cases
 You can create test cases using the `tc` function from lua. The `tc` function takes an input string and an expected output, runs the input string through the Chupacabra interpreter, and checks if the output matches the expected output.
 
-For example, `tc("[1 1 1] [2 3 4] @+", {3, 4, 5})` tests that adding the arrays {1, 1, 1} and {2, 3, 4} results in the array {3, 4, 5}.
+For example, `tc("[1 1 1] [2 3 4] @+", {3, 4, 5})` tests that adding the arrays `[1 1 1`] and `[2 3 4]` results in the array `[3 4 5]`.
 
-There is also a totally shit repl. I'll make that better, soon...maybe.
+~~There is also a totally shit repl. I'll make that better, soon...maybe.~~ I made the repl a little better!
 
 ## repl
-There is a basic repl provided to use when exploring chupacabra. First run, `chmod +x repl` and then every other time you should be able to run just `./repl`.
+There is a repl provided to use when exploring chupacabra. First run, `chmod +x repl` and then every other time you should be able to run `./repl` to start it up.
 
 ## Other stuff
 - Nested arrays? lol, nope.
 - User defined words? Also a nope.
-- Lambdas? Maybe one day.
\ No newline at end of file
+- Lambdas? Maybe one day.
+