Dylan Baker
5d73f82733
Compile to HTML
6 vuotta sitten
Dylan Baker
a0ac2606ec
Rename head/tail to first/rest
Trying to avoid conflict with the <head> tag
6 vuotta sitten
Dylan Baker
7bbcd1de4f
Fix bug where lambda required an application
6 vuotta sitten
Dylan Baker
cf57876795
Implement compiler
Just strings and numbers for now
6 vuotta sitten
Dylan Baker
7d8caf316f
Prettier
6 vuotta sitten
Dylan Baker
f1466bf07a
Add cons, head, and tail; remove type checking
I think there’s a better way to do type checking so I’m going to hold off on it for now and get basic functionality working for now and come back later.
6 vuotta sitten
Dylan Baker
da6ce44556
Add length function; preserve Number node line numbers
6 vuotta sitten
Dylan Baker
acc88c3df9
Create list function
6 vuotta sitten
Dylan Baker
65eade66fd
Remove unused import
6 vuotta sitten
Dylan Baker
8821f2368e
Make sure all arguments get evaluated
6 vuotta sitten
Dylan Baker
d66c23ab39
Prettier
6 vuotta sitten
Dylan Baker
80c7326df2
Implement missing closing “/) errors
6 vuotta sitten
Dylan Baker
bd4aa9d124
Fix error handling and bug where let bindings stay in scope
6 vuotta sitten
Dylan Baker
c93190c567
Implement let bindings
6 vuotta sitten
Dylan Baker
fc7978ce6b
Evaluate conditionals
6 vuotta sitten
Dylan Baker
b9e4a1f908
Move AST nodes into one file
6 vuotta sitten
Dylan Baker
9662adf8aa
Implement definitions
6 vuotta sitten
Dylan Baker
63d4d4b735
Evaluate lambda functions
6 vuotta sitten
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.
6 vuotta sitten
Dylan Baker
4d957c60a0
Core functions should return Oslo types, not JS types
6 vuotta sitten
Dylan Baker
f4f4f18106
Add comparison functions to core env
6 vuotta sitten
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.
6 vuotta sitten
Dylan Baker
3e5a873054
Prettier :/
6 vuotta sitten
Dylan Baker
b83126524d
Make all functions lambdas for now
6 vuotta sitten
Dylan Baker
06ab1b52d4
Compile function applications (named and lambda)
6 vuotta sitten
Dylan Baker
7a9b1a6727
Create simple compiler class
Just numbers and strings for now
6 vuotta sitten
Dylan Baker
bffecce670
Add lambdas
6 vuotta sitten
Dylan Baker
90d84dbb6f
Prettier
6 vuotta sitten
Dylan Baker
4b3ce29206
Remove resolver and compiler, add define to parser
6 vuotta sitten
Dylan Baker
91730231df
Saving state
6 vuotta sitten
Dylan Baker
497af0aa34
Implement test helper functions
6 vuotta sitten
Dylan Baker
f77ad26a69
Allow empty strings
6 vuotta sitten
Dylan Baker
581c99f794
Rewrite AST and compiler to be more normal
6 vuotta sitten
Dylan Baker
c7c40f7df7
Implement number and boolean types
6 vuotta sitten
Dylan Baker
64e2ab8eb0
Implement some very basic error handling
It's a little hacky and not very clean but it's
working for now.
6 vuotta sitten
Dylan Baker
31f584d688
Allow for self-closing tags
6 vuotta sitten
Dylan Baker
ebc21f694d
Redo map as each, still playing with the syntax
6 vuotta sitten
Dylan Baker
db64e79472
Implement mapping
6 vuotta sitten
Dylan Baker
d46f25c589
Run prettier
6 vuotta sitten
Dylan Baker
d60e736fec
Allow using special characters in literals
6 vuotta sitten
Dylan Baker
564b4808e9
Allow using variables as attribute values
6 vuotta sitten
Dylan Baker
ef0845237f
Allow whitespace while between quotes
What was happening was that spaces were allowed in
all literals to account for quoted strings, but
this meant that two identifiers in a row would get
parsed as a single literal. This commit sets a
flag to allow whitespace in literals when a quote
is encountered and then unsets that flag at the
next quote.
6 vuotta sitten
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.
6 vuotta sitten
Dylan Baker
f7d7e9f46f
Fix up some stuff and add a test for parser
7 vuotta sitten
Dylan Baker
0bd9afe74b
Fix broken lexer test
7 vuotta sitten
Dylan Baker
fdee6a6367
Use classes after all
7 vuotta sitten
Dylan Baker
190d19a7a1
Initial commit
7 vuotta sitten