Dylan Baker
f64680858b
Fix closure environment binding
пре 6 година
Dylan Baker
eb9b1b9c5e
Allow calling anonymous functions directly
пре 6 година
Dylan Baker
2088c2ed1a
Allow calling the result of a function call
пре 6 година
Dylan Baker
d3ea85d84d
For loop/environment fixes
There was a problem where the body of a for loop was treated like a
function and got an entirely new environment. This meant that you could
not, for instance, modify a variable in a loop and keep the changed
value after the loop finished executing.
Also, for consistency, switch to storing only fully evaluated values in
the environment.
пре 6 година
Dylan Baker
76bc66d472
Prettier
пре 6 година
Dylan Baker
30e3ba32d9
Add assignments, make declarations throw if var already exists
пре 6 година
Dylan Baker
25152d67de
Allow top-level function expressions
пре 6 година
Dylan Baker
9d9548404f
Implement comments
пре 6 година
Dylan Baker
381f363d0d
Pull whitespace skipping out into a shared method
пре 6 година
Dylan Baker
858d7a095b
Use \A instead of ^
^ matches the beginning of every line. Given the string
function() {
}
using /^\{/ will match the final } because it's at the beginning of the
line
пре 6 година
Dylan Baker
37b3c966bf
Execute class definitions
пре 6 година
Dylan Baker
ebfc3e529c
Function expressions/higher order functions
пре 6 година
Dylan Baker
956369475a
Escape quotes, newlines, tabs
пре 6 година
Dylan Baker
749c1d5350
Fix for loops
пре 6 година
Dylan Baker
56e876a3b2
For loops
пре 6 година
Dylan Baker
9b28b56a3a
Prettier
пре 6 година
Dylan Baker
0d7aa28346
Allow grouping expressions with parentheses
пре 6 година
Dylan Baker
da7881db9f
Test scoping
пре 6 година
Dylan Baker
a9c444a42f
Raise instead of throw
пре 6 година
Dylan Baker
59efebdd72
Add unary operations
пре 6 година
Dylan Baker
673f904132
Add hashes
пре 6 година
Dylan Baker
7553f1eee9
Interpreter
пре 6 година
Dylan Baker
0db77c281e
Initial commit
пре 6 година