Commit Graph

1821 Commits

Author SHA1 Message Date
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
c389b44bf8 Compile statements with variables 2017-09-19 22:10:57 -07:00
greg
db52f9b716 Package compilation context into one struct 2017-09-19 22:10:57 -07:00
greg
d3a743442b = should have high precedence 2017-09-19 22:10:57 -07:00
greg
e46d840d96 Move more code to llvm_wrap
And silence a few compiler warnings
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
fca307d3ab Package more functions in LLVMWrapper 2017-09-19 22:10:57 -07:00
greg
a65544356c Fix bug in delete routine 2017-09-19 22:10:57 -07:00
greg
10d51cc29c Compile binexps 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
c032da712f Successfully compiling a main function 2017-09-19 22:10:57 -07:00
greg
cfb93d9dea Compilation that returns an output code works 2017-09-19 22:10:57 -07:00
greg
08798fb690 Move all LLVM functions into LLVMWrap
so I can kill the global unsafe
2017-09-19 22:10:57 -07:00
greg
e0eef5e58f More moving functions around 2017-09-19 22:10:57 -07:00
greg
2107e6344e More function wrapping 2017-09-19 22:10:57 -07:00
greg
2ad65a1c5d Some in-progress work 2017-09-19 22:10:57 -07:00
greg
a01b6c874e Small-step function arg evaluation 2017-09-19 22:10:57 -07:00
greg
907af38f44 Evaluate printing 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
96c51a9b88 Move some more unsafe code into block 2017-09-19 22:10:57 -07:00
greg
8528c912bd Added side effect framework 2017-09-19 22:10:57 -07:00
greg
47f4c25020 Doing some wrapping 2017-09-19 22:10:56 -07:00
greg
6ed67cd325 Add test .schala file 2017-09-19 22:10:56 -07:00
greg
c18c1a639a compilation does something usefl
Following along with:
http://blog.ulysse.io/2016/07/03/llvm-getting-started.html
2017-09-19 22:10:56 -07:00
greg
d3f6bbabaa Starting to add actual LLVM generating code 2017-09-19 22:10:56 -07:00
greg
5d0648b9c0 Ignore Cargo.lock 2017-09-19 22:10:56 -07:00
greg
ba7a2e658f Don't track Cargo.lock 2017-09-19 22:10:56 -07:00
greg
ee12e10ac6 Fix slice syntax 2017-09-19 22:10:56 -07:00
greg
6a0b50f278 Kill hashmap import for now 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
272fa92052 More fleshing out 2017-09-19 22:10:56 -07:00
greg
0c717c721e Import Function type 2017-09-19 22:10:56 -07:00
greg
64d560a1fc Still more work 2017-09-19 22:10:56 -07:00
greg
8a92d5ffa8 Partial LLVM work 2017-09-19 22:10:56 -07:00
greg
5ed0ed727b Starting to add LLVM code 2017-09-19 22:10:56 -07:00
greg
5428810d2c Add llvm dependencies 2017-09-19 22:10:56 -07:00
greg
b48c007bca Get rid of old evaluator file
No longer need it
2017-09-19 22:10:56 -07:00
greg
5aa4c404a5 Added conditionals to grammar 2017-09-19 22:10:56 -07:00
greg
0e3aaa8b08 Add conditional expression support 2017-09-19 22:10:56 -07:00
greg
f33cfdadfe Fix variable lookup order
Evaluator uses frames as a stack, so to find the most-recent variable
binding we have to iterate through it the reverse way. This fixes a bug
manifested by:

fn a(x)
 x + 20
end

fn b(x)
 a(x) + 20
end
2017-09-19 22:10:56 -07:00
greg
231de69084 Added infrastructure for reading files 2017-09-19 22:10:56 -07:00
greg
f014c1a9d9 Kill compiler warnings 2017-09-19 22:10:56 -07:00
greg
c36bc3377e Fix lookup_binding in function call case 2017-09-19 22:10:56 -07:00
greg
5eba222679 Variable binding in fucntion call work 2017-09-19 22:10:56 -07:00
greg
dcf89aa429 Move lookup_function back onto Evaluator
THe problem was that we were borrowing the output of the inner HashMap,
if we clone it we don't borrow anything
2017-09-19 22:10:56 -07:00