greg
1f50fcc620
Improvments to interpreter directives parsing
2017-09-19 22:10:59 -07:00
greg
d7181afa91
Few more linefeed-related changes
2017-09-19 22:10:59 -07:00
greg
4eb7683f47
Move linefeed reader to struct
2017-09-19 22:10:59 -07:00
greg
b04a8f0092
Add back interpreter directives
2017-09-19 22:10:59 -07:00
greg
c50be58cd2
Moved from simplerepl to lineread crate
2017-09-19 22:10:59 -07:00
greg
7ddb421ced
Exit cleanly on opt parse fail
2017-09-19 22:10:59 -07:00
greg
9b74527618
Control printing eval steps with flags
2017-09-19 22:10:59 -07:00
greg
f158b6c712
Converted to multiple-evaluator logic
...
Now I have (basically) full single-step evaluation and it works fine
2017-09-19 22:10:58 -07:00
greg
9b62efc830
Fix conditional parsing
...
Needed to account for semicolons/newlines. Maybe need to generalize
delimiter-separated list of things
2017-09-19 22:10:58 -07:00
greg
e84550f3ec
Kill two compilation warnings
2017-09-19 22:10:57 -07:00
greg
3063de1242
Run rustfmt on the rest of them
2017-09-19 22:10:57 -07:00
greg
d4d61ce5ad
Use process::exit in main
2017-09-19 22:10:57 -07:00
greg
743311d18a
Convert Tokenize to Result
2017-09-19 22:10:57 -07:00
greg
fe8418edbe
Kill some extraneous spaces
2017-09-19 22:10:57 -07:00
greg
1d8102b9fa
Make compilation controllable
2017-09-19 22:10:57 -07:00
greg
aac3ca40fe
Add getopts
2017-09-19 22:10:57 -07:00
greg
3d406f1dd2
Move llmv wrapper into separate file
2017-09-19 22:10:57 -07:00
greg
95b773de7f
Compilation sequence
...
-move all steps of the llvm IR compilation process into the binary
2017-09-19 22:10:57 -07:00
greg
923566c4e9
Get rid of println's for token/ast debugging
...
Instead just explicitly stick them into the returned string.
This is necessary 'cause I'm gonna convert simplerepl to use ncurses
soon, so I can't have any side effects
2017-09-19 22:10:57 -07:00
greg
ee12e10ac6
Fix slice syntax
2017-09-19 22:10:56 -07:00
greg
6c44d295db
Framework for compilation
2017-09-19 22:10:56 -07:00
greg
cd69ebaa9d
Split main() into subfunctions
2017-09-19 22:10:56 -07:00
greg
3fe9ec95d5
Fix repl error message
2017-09-19 22:10:56 -07:00
greg
8b5d1ecd15
Kill compilation for now
...
Don't wanna deal with this right this second
2017-09-19 22:10:56 -07:00
greg
8a92d5ffa8
Partial LLVM work
2017-09-19 22:10:56 -07:00
greg
231de69084
Added infrastructure for reading files
2017-09-19 22:10:56 -07:00
greg
a8cafa8c64
Move Evaluator state into interpreter state
2017-09-19 22:10:55 -07:00
greg
16e8d969be
Add basic evaluation
2017-09-19 22:10:55 -07:00
greg
fdaf4c302c
Fix all compiler warnings
2017-09-19 22:10:55 -07:00
greg
087402ece6
Add more tests
...
Need to use box patterns
2017-09-19 22:10:55 -07:00
greg
09b67dc3f7
Change error message
2017-09-19 22:10:54 -07:00
greg
a613fa73e5
Basic parsing framework
2017-09-19 22:10:54 -07:00
greg
8662a3ba0e
Make tokenize error-able
2017-09-19 22:10:54 -07:00
greg
5ca98c7d77
Print tokeniziation
2017-09-19 22:10:54 -07:00
greg
09d524c74a
Changing how parsing works again
...
Someone wrote a port of the LLVM kaleidoscope tutorial to rust, namely
https://github.com/jauhien/iron-kaleidoscope
I'm just gonna follow this along
2017-09-19 22:10:54 -07:00
greg
1c23329656
Add boilerplate for evaluation
...
Just wires everything up, doesn't actually evaluate yet
2017-09-19 22:10:54 -07:00
greg
509ab80b9c
I can now parse one thing
2017-09-19 22:10:54 -07:00
greg
247638c4db
Get parsing REPL working
2017-09-19 22:10:54 -07:00
greg
16dfbb27d5
Use state features from simplerepl
2017-09-19 22:10:53 -07:00
greg
3af7e6a409
Refactoring Schala
...
Gonna work on Schala in earnest now! Using the simplerepl crate instead
of a build-in REPL, temporarily dropping parsing and evaluation code.
2017-09-19 22:10:53 -07:00
greg
123f388711
Rename language to "Schala"
2017-09-19 22:10:53 -07:00
greg
caa331ecdc
Read from file as well as repl
2017-09-19 22:10:53 -07:00
greg
eb5ce2ef9e
Don't print newline for empty REPL result
2017-09-19 22:10:53 -07:00
greg
72b26755a7
Make ParseResult just a normal Result type
...
No reason for it to be different
2017-09-19 22:10:53 -07:00
greg
c27c900e7f
Add operators % and **
...
semantics for these are hard with floats handle later
2017-09-19 22:10:53 -07:00
greg
582a7fd6dc
Make parse and tokens optional
2017-09-19 22:10:53 -07:00
greg
79619025ea
Add directive to print precedence chart
2017-09-19 22:10:53 -07:00
greg
56b338a6a8
Move to global precedence table
2017-09-19 22:10:53 -07:00
greg
8e3a571d67
.env dirctive to display environment
2017-09-19 22:10:53 -07:00
greg
f88f115567
Environment persistent across repl loop
2017-09-19 22:10:53 -07:00