Commit graph

67 commits

Author SHA1 Message Date
74a4af9c33 Fix bug where only first type of argument checked 2022-02-23 02:45:11 +09:00
a0791f97ad Add comment 2022-02-22 17:05:21 +09:00
26c6f3d7bf multiple arguments for function 2022-02-22 17:01:39 +09:00
8c029cd0d8 Value.to_string: "symbol" -> "#" 2022-02-21 02:19:54 +09:00
de0d7bc009 Add print/println primitive 2022-02-21 02:19:54 +09:00
1784f83887 Use newtype pattern in Env 2022-02-21 02:19:54 +09:00
019e3d7bd1 Split global and local environment 2022-02-21 02:19:54 +09:00
8c40e99241 Change get/set precedence/associativity to external function 2022-02-21 02:19:44 +09:00
34eeff4a01 Seperate apply from eval 2022-02-19 23:17:10 +09:00
71bc70d3bc Refactor operator system
This commit:
- removes unused functions
- refactors operator overloading & auto-coercion system
- changes type signitures of operators
- incorperates unary operators into Eval.Operator.operator table
- changes external function implementation
2022-02-19 21:46:48 +09:00
dbcba252bf Add comments 2022-02-19 20:39:50 +09:00
b6e00cd862 Fix recursive function 2022-02-18 16:49:20 +09:00
96d0c882b3 Add fatal error on Parser 2022-02-17 02:51:56 +09:00
e3d683c28f Add column info to Parser 2022-02-15 00:28:39 +09:00
847375027a Change a comment slightly 2022-02-15 00:09:52 +09:00
27457eb6e2 Fix operator precedence 2022-02-15 00:08:40 +09:00
bacfd64bae Pass column info on lex 2022-02-15 00:08:24 +09:00
8434ac98a0 (Re)add recursion support 2022-02-13 21:10:25 +09:00
23892acf6d Refactor env to list 2022-02-12 03:18:00 +09:00
1790a72b68 Add column info to Lex 2022-02-12 03:17:26 +09:00
fcf2c0388d Add --debug flag 2022-02-11 15:05:21 +09:00
138d12e899 Refactor function evaluation; now can partially apply 2022-02-11 02:54:21 +09:00
b2251d26d5 Seperate eval and eval_top 2022-02-10 01:37:01 +09:00
d5ac54365d Add closure 2022-02-09 17:27:19 +09:00
cd3487dd81 Fix apply bug with keyword 2022-02-08 22:03:16 +09:00
edeff67edb Add relation operators 2022-02-08 22:02:00 +09:00
a752932913 Add Bool and If 2022-02-08 16:05:33 +09:00
1f91d214ee Implement Ocaml-style return 2022-02-08 01:22:49 +09:00
7cddc45e8b Removed some exceptions 2022-02-08 01:00:36 +09:00
36fd3de4e7 Merge Eval and Env 2022-02-08 00:46:43 +09:00
700356022b Add symbol type 2022-02-08 00:26:03 +09:00
95684a31df Change names 2022-02-08 00:15:09 +09:00
05797676ce Move Value module into Env 2022-02-07 23:12:11 +09:00
995d95df41 Seperate Ast and value (which should be in Eval) 2022-02-07 01:09:57 +09:00
8093af06a7 Remove meaningless test.ml 2022-02-01 21:42:12 +09:00
1dbc3f5264 Add function and external value 2022-02-01 21:38:00 +09:00
765ac6f004 Add Env module 2022-02-01 02:20:48 +09:00
d30b1de271 Fix a bug that parser treated var as 0-ary function 2022-02-01 02:20:48 +09:00
d6f31ccde0 Seperate Value.t and Token.t 2022-02-01 02:06:18 +09:00
c33fd366ee Add basic function evaluation 2022-01-29 20:01:48 +09:00
b699ed6b2f refactor lex 2022-01-28 01:52:57 +09:00
282fbfa738 Merge Binop and Unary to Operator 2022-01-28 00:56:24 +09:00
bb2ee45c33 Rewrite binop 2022-01-25 15:28:38 +09:00
755052f531 Add unary negation 2022-01-23 01:20:34 +09:00
f77c1db22a Revert Lex.tokenize to be non-laxy 2022-01-22 03:04:16 +09:00
c2308d7939 Replace Token.(Values) with Token.Value of Ast.Value.t and add String type 2022-01-22 03:03:23 +09:00
2be0b7f794 Add let 2022-01-21 00:17:01 +09:00
5aaa261198 Add associativity control 2022-01-20 23:36:53 +09:00
e859d01683 Move parsers out of Parser.parse 2022-01-20 01:35:48 +09:00
7b9ccd1328 Add var table 2022-01-20 01:35:18 +09:00