Nathanaël Courant
23bd655873
Add comment about the interpreter needing a few more features than the current version of miniml
2020-12-07 21:26:42 +01:00
Nathanaël Courant
e469c51a3a
Fix typos in README after review
2020-12-07 21:23:57 +01:00
Nathanaël Courant
b84dff4c94
Add READMEs
2020-12-07 18:07:44 +01:00
Nathanaël Courant
cf4506e656
Change bytecode magic number to match the one in the ocaml version we use
2020-12-07 17:16:08 +01:00
Gabriel Scherer
35ffa040ee
allow (Cons _) patterns even if Cons has arity >1
2020-12-07 16:24:37 +01:00
Gabriel Scherer
5c3a9b264f
first-class status for wildcard patterns
2020-12-07 16:24:37 +01:00
Gabriel Scherer
9a5f6a091c
change the grammar of patterns to accept patterns under constructors... but require variable for compilation
2020-12-07 16:24:37 +01:00
Gabriel Scherer
b5bb3c8932
Merge pull request #14 from Ekdohibs/functors
...
Compilation of functors
2020-12-07 13:31:38 +01:00
Nathanaël Courant
5cb0ed73f3
Add tests for argument of functor
2020-12-07 13:29:28 +01:00
Nathanaël Courant
637eb2c355
miniml: add functors
2020-12-07 12:33:33 +01:00
Gabriel Scherer
2fe9599bc1
environments: weird code factorization
2020-12-07 11:36:43 +01:00
Gabriel Scherer
46ca612508
bindings visibility: bindings-exported-only, bindings-make-local
2020-12-07 11:36:43 +01:00
Gabriel Scherer
9dbc6ac08a
bindings-filter-map
2020-12-07 11:36:43 +01:00
Gabriel Scherer
2680aa4ff3
bindings in env: introduce bindings-replace to elide explicit 'Export markers
2020-12-07 11:36:43 +01:00
Gabriel Scherer
1bde4c5d88
environments contain "bindings", export bindings-get
...
This is a new abstraction/concept in the codebase: the vhashes that
contain visibility information and a definition are called
"environment bindings".
For now there is only an accessor, bindings-get.
2020-12-07 11:36:43 +01:00
Gabriel Scherer
ed364b7ee4
clarify the purpose of (cons #t ...) in primitive declarations
2020-12-07 11:25:08 +01:00
Gabriel Scherer
45e1f17227
clarify the visibility of environment items
...
Before doing this change, I had no clue what those (cons # ...) would mean,
2020-12-07 11:25:08 +01:00
Gabriel Scherer
7a14982cc2
[minor] pattern-matching in vhash-{map,filter-map}
2020-12-07 11:25:08 +01:00
Gabriel Scherer
0b197cb705
Merge pull request #15 from Ekdohibs/ocamllex
...
Ocamllex
2020-12-05 16:51:37 +01:00
Julien Lepiller
de8c561c40
Ignore generated interpreter files
2020-12-05 15:33:44 +01:00
Julien Lepiller
eb98434c9f
lexer: lex_string: Use buffer directly.
2020-12-05 14:58:08 +01:00
Julien Lepiller
c195c3b83e
lexer: try_skip_space_and_comments: Make tail-recursive.
2020-12-05 14:58:04 +01:00
Julien Lepiller
7ff2fb4f6c
lexer: Use Char.code '0' instead of magic constant
2020-12-05 14:57:44 +01:00
Julien Lepiller
55d5bce3ae
interp: Add missing end
2020-12-05 13:38:40 +01:00
Gabriel Scherer
da11c946dc
fix IRebind compilation
2020-12-05 07:21:11 +01:00
Nathanaël Courant
bc1487b12c
Add definition for infix :: constructor
2020-12-04 15:15:50 +01:00
Nathanaël Courant
603090e8c3
Use the new infix operators instead of fixed names
2020-12-04 15:15:50 +01:00
Nathanaël Courant
2e0d235ce3
Fix the other conflict
2020-12-04 15:15:50 +01:00
Nathanaël Courant
654f8a7989
Fix lident_ext
2020-12-04 15:15:50 +01:00
Nathanaël Courant
cbfa7ff6a0
Fix conflict with infix operators
2020-12-04 15:15:50 +01:00
Nathanaël Courant
95da29da2f
Record construction must use longident_field... but more conflicts
2020-12-04 15:15:50 +01:00
Nathanaël Courant
a037d4071d
Initial try for infix operators
2020-12-04 15:15:50 +01:00
Nathanaël Courant
e783d2c8c0
Fix shape of let ... = function at toplevel
2020-12-03 22:27:21 +01:00
Julien Lepiller
a6990cc1fb
Add ocamllex bootstrap lexer
2020-12-03 20:00:53 +01:00
Nathanaël Courant
ff6db2bb00
Fix interpreter genfile
2020-12-02 15:15:49 +01:00
Gabriel Scherer
1357bf2c78
compile.scm: lower Lambda
2020-12-02 10:09:23 +01:00
Gabriel Scherer
738c69092a
compile.scm: lower Let
2020-12-02 10:09:23 +01:00
Gabriel Scherer
1fe521ea06
compile.scm: lower Match and Try into Switch and Catch
2020-12-02 10:09:23 +01:00
Gabriel Scherer
99173f7233
compile.scm: helper functions for variable and constructor desugaring
2020-12-02 10:09:23 +01:00
Gabriel Scherer
363f2047b7
compile.scm: lower EApply
2020-12-02 10:09:23 +01:00
Gabriel Scherer
88623f4f02
compile.scm: lower Getfield, Setfield
2020-12-02 10:09:23 +01:00
Gabriel Scherer
518ec3aa6d
compile.scm: lower ERecordwith
2020-12-02 10:09:23 +01:00
Gabriel Scherer
2875adb603
compile.scm: lower ERecord
2020-12-02 10:09:23 +01:00
Gabriel Scherer
a32b5a4f4b
compile.scm: lower constructors
2020-12-02 10:09:23 +01:00
Gabriel Scherer
a86494145b
compile.scm: lower constants
2020-12-02 10:09:23 +01:00
Gabriel Scherer
1202e82461
compile.scm: introduce a (currently-empty) distinction between 'lowering' and code production
2020-12-02 10:09:23 +01:00
Gabriel Scherer
9b27099bab
factorize vhash-replace calls on the environment
2020-12-01 12:51:00 +01:00
Gabriel Scherer
61f8c29e12
compile.scm: minor refactor
2020-12-01 12:49:32 +01:00
Gabriel Scherer
8604066454
compile.scm: match in compile-def
2020-12-01 12:10:30 +01:00
Gabriel Scherer
3b640bb5bc
compile.scm: match in compile-type
2020-12-01 12:10:30 +01:00