Commit Graph

734 Commits

Author SHA1 Message Date
greg
fa6c2a6f45 Re-added symbol table infra 2018-07-26 00:52:45 -07:00
greg
92e6830979 Some logic for function call inferring 2018-07-26 00:52:45 -07:00
greg
ef9cd04605 Starting on function application typechecking 2018-07-26 00:52:45 -07:00
greg
1eaf201145 Move some code around 2018-07-26 00:52:45 -07:00
greg
876373c9fd Function calls work 2018-07-26 00:52:45 -07:00
greg
63f5f155ae Temporarily disable type-erroring
and tighten some code
2018-07-26 00:52:45 -07:00
greg
51cf8a4824 Handle variable lookups 2018-07-26 00:52:45 -07:00
greg
e0cc12276c Evaluate binding declarations 2018-07-26 00:52:45 -07:00
greg
d69970a806 Separate Value and NamedStruct syntactic categories 2018-07-26 00:52:45 -07:00
greg
522d9fc951 Fixed | 2018-07-26 00:52:45 -07:00
greg
63c3e0a4db More operator stuff 2018-07-26 00:52:45 -07:00
greg
547def990e Operator changes 2018-07-26 00:52:45 -07:00
greg
6e105bac55 Fixed tests w/ respect to binop
There's a few unnecessary conversions of &str 's to Rc<String> and back
2018-07-26 00:52:45 -07:00
greg
a396c448ec Centralize data for prefix ops too 2018-07-26 00:52:45 -07:00
greg
d3ef980dc5 Added type information to binop definitions
Also started centralizing precedence there too
2018-07-26 00:52:45 -07:00
greg
df86e0c16e Make sigil field private 2018-07-26 00:52:45 -07:00
greg
274bf80b5d Function evaluation work 2018-07-26 00:52:45 -07:00
greg
f0a39ac88a Give State a pointer to its parent
For function call lookups
2018-07-26 00:52:45 -07:00
greg
85e65273fe Finished initial BinOp/PrefixOp 2018-07-26 00:52:45 -07:00
greg
413c5afe67 Starting to munge BinOp types
Incomplete, doesn't yet compile
2018-07-26 00:52:45 -07:00
greg
36174140bc ReplState -> State
Not everythign is a repl
2018-07-26 00:52:45 -07:00
greg
75ecfb4e86 Move bx! macro up to mod.rs
And make use of it in parser
2018-07-26 00:52:45 -07:00
greg
e86d401c90 Move anno-to-type to a method on TypeName 2018-07-26 00:52:45 -07:00
greg
b2319f0971 Fix tests too 2018-07-26 00:52:45 -07:00
greg
d423e88845 Separate tokenizing module
Parsing was getting too long
2018-07-26 00:52:45 -07:00
greg
5cb0e6715d Some work on binops 2018-07-26 00:52:45 -07:00
greg
5bb2c319e8 Some more type-checking work 2018-07-26 00:52:45 -07:00
greg
440783bb64 More work on evaluating applications
for later testing + to kill a compiler warning
2018-07-26 00:52:45 -07:00
greg
9834ee295e Fix traits, silence warnings 2018-07-26 00:52:45 -07:00
greg
9346bb9581 type of a declaration should be Void, not Unit
I think this makes sense

Also kill some compiler warnings
2018-07-26 00:52:45 -07:00
greg
f46f593c44 Types in bindings 2018-07-26 00:52:45 -07:00
greg
ec7d185ed5 Simplified match 2018-07-26 00:52:45 -07:00
greg
3f1cf1d975 Added trait declaration 2018-07-26 00:52:45 -07:00
greg
39ee550b54 More static type work 2018-07-26 00:52:45 -07:00
greg
d5df868f10 Finished basic constant type inference 2018-07-26 00:52:45 -07:00
greg
55629e6d9d More type implementing - WIP
This has a borrowing bug currently
2018-07-26 00:52:45 -07:00
greg
9d99971f49 Fix some integer overflows with binary and hex 2018-07-26 00:52:45 -07:00
greg
76575e9ba3 Starting basic type stuff 2018-07-26 00:52:45 -07:00
greg
a50d8d9e3f Starting over with types 2018-07-26 00:52:45 -07:00
greg
e6a015090c More type things 2018-07-26 00:52:45 -07:00
greg
c18bf9c29f Type singletons test work 2018-07-26 00:52:45 -07:00
greg
cfc507a2df TypeSingletonName broken out 2018-07-26 00:52:45 -07:00
greg
f7e88c7cab Fix struct literals in if expressions
With special case-ing, sigh :( Also will need to do this for match
expressions but I'll cross that bridge when I come to it
2018-07-26 00:52:45 -07:00
greg
4d0bfa2a52 Don't need clone() here 2018-07-26 00:52:45 -07:00
greg
99e5d86764 Kill separate is_digit method
I care about 10 vs 16 distinction
2018-07-26 00:52:45 -07:00
greg
17e8ebe789 Hex parsing done 2018-07-26 00:52:45 -07:00
greg
967e5cc436 Added a bunch of notes 2018-07-26 00:52:45 -07:00
greg
7a6ace5db1 Fix parse level calculation 2018-07-26 00:52:45 -07:00
greg
129af43e69 Proper indentation of parser debug 2018-07-26 00:52:45 -07:00
greg
17dccf65c8 Move some code around 2018-07-26 00:52:45 -07:00
greg
95c6a23bf1 Better hex literals 2018-07-26 00:52:45 -07:00
greg
2bff53846c Starting hex parsing 2018-07-26 00:52:45 -07:00
greg
514d117c7e Simplify some code 2018-07-26 00:52:45 -07:00
greg
9ec983dc20 unified BoolAtom 2018-07-26 00:52:45 -07:00
greg
8f6c80ac8c Print operation 2018-07-26 00:52:45 -07:00
greg
7f546fa879 Refactoring 2018-07-26 00:52:45 -07:00
greg
48a35aa382 Delete some unneeded code 2018-07-26 00:52:45 -07:00
greg
0c64b14be0 Forgot to change name here 2018-07-26 00:52:45 -07:00
greg
5d9fa6679b Name change
builtin -> primitive
2018-07-26 00:52:45 -07:00
greg
ea24ae1bb5 Get rid of some printlns 2018-07-26 00:52:45 -07:00
greg
0d2a0e3536 Implement lambda application 2018-07-26 00:52:45 -07:00
greg
339e3464e3 Plus and multiply 2018-07-26 00:52:45 -07:00
greg
c35b684bdd Builtins - + 2018-07-26 00:52:45 -07:00
greg
d11c518721 Framework for multiple environments 2018-07-26 00:52:45 -07:00
greg
8dde8c7381 Apply wokr 2018-07-26 00:52:45 -07:00
greg
47cad3712c Fixing quote 2018-07-26 00:52:45 -07:00
greg
ffcc0ef379 Starting builtins 2018-07-26 00:52:45 -07:00
greg
6766791627 Lambda abstraction 2018-07-26 00:52:45 -07:00
greg
05de5ebe61 Kill this linker thing 2018-07-26 00:52:45 -07:00
greg
29ebd35165 Kill unused code 2018-07-26 00:52:45 -07:00
greg
622b50a40c Some lambda work 2018-07-26 00:52:45 -07:00
greg
9f916c7c02 Remove a unimplemented 2018-07-26 00:52:45 -07:00
greg
85375bb9df Add fn literal variant 2018-07-26 00:52:45 -07:00
greg
d11500c643 Even more concise 2018-07-26 00:52:45 -07:00
greg
8493233b69 Refactoring 2018-07-26 00:52:45 -07:00
greg
60644ba3d7 Starting lambdas 2018-07-26 00:52:45 -07:00
greg
254f2ae4b8 Make var methods better 2018-07-26 00:52:45 -07:00
greg
e243b99d3b If expressions 2018-07-26 00:52:45 -07:00
greg
3d023a6704 Rukka - Variables 2018-07-26 00:52:45 -07:00
greg
73612d1465 Define half-working 2018-07-26 00:52:45 -07:00
greg
d1a15b64ff Get rid of old import 2018-07-26 00:52:45 -07:00
greg
66e8643382 eq? 2018-07-26 00:52:45 -07:00
greg
ad58fc1ad1 True and False primitives 2018-07-26 00:52:45 -07:00
greg
adc7be30a9 Some primitive implementations 2018-07-26 00:52:45 -07:00
greg
72097fa125 Fix pointer alias problem 2018-07-26 00:52:45 -07:00
greg
ae9d93f6dc Still tryign to make the pointer-munging work 2018-07-26 00:52:45 -07:00
greg
3d421c7039 This has broken sexp parsing 2018-07-26 00:52:45 -07:00
greg
166bc3b3cb Fix print bug 2018-07-26 00:52:45 -07:00
greg
2f263de8ba Convert to more lispish Cons 2018-07-26 00:52:45 -07:00
greg
46ae176498 Special forms list 2018-07-26 00:52:45 -07:00
greg
d84def35e7 Unwraps 2018-07-26 00:52:45 -07:00
greg
07e55ca04e Handle top-level empty list 2018-07-26 00:52:45 -07:00
greg
6dcf5c7945 print list 2018-07-26 00:52:45 -07:00
greg
568ee88f3a Tighten code 2018-07-26 00:52:45 -07:00
greg
8749ed984d Some more code 2018-07-26 00:52:45 -07:00
greg
559eaf54de Type simplification 2018-07-26 00:52:45 -07:00
greg
bf42b58ca5 State for eval 2018-07-26 00:52:45 -07:00
greg
ecdcb7ff3d Numbers 2018-07-26 00:52:45 -07:00
greg
766209e5b2 Fixed string parsing 2018-07-26 00:52:45 -07:00
greg
e9429ed62a Strings partway working 2018-07-26 00:52:45 -07:00