Dylan Baker
7bbcd1de4f
Fix bug where lambda required an application
5 years ago
Dylan Baker
da6ce44556
Add length function; preserve Number node line numbers
5 years ago
Dylan Baker
d66c23ab39
Prettier
5 years ago
Dylan Baker
80c7326df2
Implement missing closing “/) errors
5 years ago
Dylan Baker
bd4aa9d124
Fix error handling and bug where let bindings stay in scope
5 years ago
Dylan Baker
c93190c567
Implement let bindings
5 years ago
Dylan Baker
2f5f91b2fe
Alphabetize methods
5 years ago
Dylan Baker
9662adf8aa
Implement definitions
5 years ago
Dylan Baker
369853af3e
Replace compiler with evaluator
This class exposes two functions. `evalNode` take an AST node and evaluates it down to simplest terms. `eval` takes an array of AST nodes and calls evalNode on each of them. I don’t think we’re quite ready to be producing HTML yet so let’s not get ahead of ourselves.
5 years ago
Dylan Baker
76c6eac9b5
Implement conditionals
Currently I'm relying on JavaScript's semantics
around truthiness. I think I'm going to retain
that ease of use (i.e. `(if list #t #f)` should
return true if the list has more than 0 elements,
etc) but I want to specify that behavior myself.
5 years ago
Dylan Baker
c833db2f94
LOL I forgot how Lisp works
5 years ago
Dylan Baker
3e5a873054
Prettier :/
5 years ago
Dylan Baker
b83126524d
Make all functions lambdas for now
5 years ago
Dylan Baker
bffecce670
Add lambdas
5 years ago
Dylan Baker
90d84dbb6f
Prettier
5 years ago
Dylan Baker
4b3ce29206
Remove resolver and compiler, add define to parser
5 years ago
Dylan Baker
3b6525e29f
Prettier
5 years ago
Dylan Baker
f77ad26a69
Allow empty strings
5 years ago
Dylan Baker
581c99f794
Rewrite AST and compiler to be more normal
5 years ago
Dylan Baker
64e2ab8eb0
Implement some very basic error handling
It's a little hacky and not very clean but it's
working for now.
5 years ago
Dylan Baker
802884b135
Runn prettier
5 years ago
Dylan Baker
ebae8a3536
Rework main parser logic
The way that we were doing it before was going to
make it very difficult to implement any sort of
error handling or extension to the language.
5 years ago
Dylan Baker
d82d4ed612
Don't wrap eaches in an empty function call node
Because I was assuming that every expression
started with a literal, calls to `each` were
getting wrapped by a functionCall node with no
functionName, which was subsequently ignored by
the compiler. This removes all of that uselessness
5 years ago
Dylan Baker
ebc21f694d
Redo map as each, still playing with the syntax
5 years ago
Dylan Baker
db64e79472
Implement mapping
5 years ago
Dylan Baker
d46f25c589
Run prettier
5 years ago
Dylan Baker
564b4808e9
Allow using variables as attribute values
5 years ago
Dylan Baker
709986560e
First try at the compiler
No variables or conditionals or anything yet, just
the basic ability to turn s-expressions into HTML.
5 years ago
Dylan Baker
f7d7e9f46f
Fix up some stuff and add a test for parser
6 years ago
Dylan Baker
a6b691807d
Handle nested expressions
6 years ago
Dylan Baker
bdf7527409
WIP Parser
6 years ago