greg
178434171e
Cleaning up some types
2017-09-19 22:11:00 -07:00
greg
fd4610e175
Make newtype for LLVM code strings
2017-09-19 22:11:00 -07:00
greg
1a4bf24ab1
Move schala-specific stuff into its own module
2017-09-19 22:11:00 -07:00
greg
9d6bdf22da
More conversions to trait version
2017-09-19 22:11:00 -07:00
greg
8326a12c9c
(Largely) trait-ify Schala
...
The idea is to provide a trait `ProgrammingLanguage` that actually does
all the work, and then main.rs will just be the infra for storing its
own state
2017-09-19 22:11:00 -07:00
greg
1ac440c8df
Implement trait parse
2017-09-19 22:11:00 -07:00
greg
f5022a771c
Starting work to trait-ify language
2017-09-19 22:11:00 -07:00
greg
3e231b4715
Use native rust to write source file
2017-09-19 22:11:00 -07:00
greg
1702163478
Add flag for llvm
2017-09-19 22:11:00 -07:00
greg
bdd6f75cf6
Show/hide LLVM IR in REPL
2017-09-19 22:11:00 -07:00
greg
0ace370fc2
Tightened up REPL loop
2017-09-19 22:10:59 -07:00
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