178 Commits

Author SHA1 Message Date
Gabriel Scherer
c99c947c18 compile.scm serialization: emit 32bit-format header when possible 2021-09-24 18:23:39 +02:00
Gabriel Scherer
8eb89941db compile.scm serialization: support smaller sizes, in particular 32bit compat 2021-09-24 18:23:04 +02:00
Gabriel Scherer
bd70f69880 compile.scm: make the string-chars lexer tail-recursive
This matters because the ocamlyacc parser presents the parsing
automaton as large string literals full of escaped characters: the
longest of them is a string literal of 43292 escaped characters. On my
machine, recent versions of compile.scm stack overflow when compiling
this file (not sure when the problem started).
2021-09-24 18:22:07 +02:00
Gabriel Scherer
b103dc5241 test that we support higher-order functors 2021-09-08 18:20:54 +02:00
Nathanaël Courant
c68bec0f39 Optimize calls to primitives 2021-02-18 08:00:46 +01:00
Nathanaël Courant
f375799b0d Make interp compatible with ocamlopt 2021-02-17 15:16:14 +01:00
Nathanaël Courant
30a585a943 Stop using genfile.sh 2021-02-15 14:44:55 +01:00
Nathanaël Courant
98e51391b3 Revert files to ocaml versions when possible 2021-02-15 13:48:26 +01:00
Nathanaël Courant
9e3e03d70f Add really inefficient interval patterns 2021-02-15 11:14:52 +01:00
Nathanaël Courant
a18951cf07 Add int32, int64 and nativeint constants 2021-02-15 10:56:33 +01:00
Nathanaël Courant
e4304fc1b5 miniml: Handle 0x, 0o, 0b literals 2021-02-15 09:44:08 +01:00
Nathanaël Courant
f4fc51c0b4 Make ocamllex work with miniml 2021-02-12 15:41:29 +01:00
Nathanaël Courant
64b1b0c402 miniml: output symbol table, handle uminus better, more primitives 2021-02-08 10:37:55 +01:00
Nathanaël Courant
984357931c Change compiling scripts for native code 2021-02-07 11:43:27 +01:00
Nathanaël Courant
b60b8bb356 Add a function executed at end of program (for flushing) 2021-01-11 12:20:11 +01:00
Nathanaël Courant
899bd1b913 Names for primitives 2021-01-11 10:20:58 +01:00
Nathanaël Courant
c80b7ee60f Fix incorrect computation of free variables for 'LLetrecfun 2021-01-08 12:35:23 +01:00
Nathanaël Courant
899e9dfcbf Ignore module types 2021-01-06 12:42:03 +01:00
Nathanaël Courant
e1b82f9d49 Add M.(...) syntax in patterns 2021-01-06 12:25:52 +01:00
Nathanaël Courant
46b9b934a8 Add M.{ ... } syntax in both patterns and expressions 2021-01-06 12:25:52 +01:00
Nathanaël Courant
8bfbae5673 Fixes after review 2021-01-06 12:25:17 +01:00
Nathanaël Courant
cc31acf2c8 Warning for escaping function with labels 2020-12-31 17:35:17 +01:00
Nathanaël Courant
755ac6a4d4 General function application 2020-12-30 16:55:29 +01:00
Nathanaël Courant
4450a27f0f Add for and while loops 2020-12-30 16:20:24 +01:00
Nathanaël Courant
d7f4e971a4 Add 'a ref and related functions to lib.ml 2020-12-30 16:19:22 +01:00
Gabriel Scherer
7caf12247f string patterns
(I believe that the small size increase in all tests is due to the
unconditional registration of "caml_string_equal" as an additional
primitive.)
2020-12-29 20:30:22 +01:00
Gabriel Scherer
363135e795 refactor compile-switch 2020-12-29 20:30:22 +01:00
Gabriel Scherer
8665fbb5fa compile.scm: match .. with exception 2020-12-28 17:15:08 +01:00
Gabriel Scherer
0bf1f90c6a labels with patterns
(I wanted to use this feature in a test file.)
2020-12-28 17:15:08 +01:00
Gabriel Scherer
996c0d94e6 minor bugfix 2020-12-21 17:40:32 +01:00
Gabriel Scherer
66d2988b37 use standard names in compiler tests 2020-12-21 17:33:37 +01:00
Gabriel Scherer
57459d078d test/lib.ml: bind more standard primitives and definitions 2020-12-21 17:33:37 +01:00
Gabriel Scherer
ef40f51bb9 support for when-guards in pattern clauses 2020-12-21 17:03:31 +01:00
Gabriel Scherer
5e52504cf9 pattern-matching: do not generate a default case when groups are complete 2020-12-21 12:44:33 +01:00
Gabriel Scherer
4a9ddd7ec1 parse (and ignore) variance annotations 2020-12-21 09:21:19 +01:00
Gabriel Scherer
af6a929a60 make PLUS a proper token 2020-12-21 09:21:19 +01:00
Gabriel Scherer
766606afd2
Merge pull request #37 from gasche/list-patterns
support list patterns [p1; p2; ...; pn]
2020-12-21 06:57:50 +01:00
Gabriel Scherer
bf1daa2a59 support list patterns [p1; p2; ...; pn] 2020-12-21 06:56:54 +01:00
Gabriel Scherer
68dff20576 inline records 2020-12-21 06:54:49 +01:00
Gabriel Scherer
5e8e1efc50 record field punning 2020-12-21 06:51:22 +01:00
Gabriel Scherer
d8f7ac5d24 record patterns 2020-12-20 22:21:02 +01:00
Gabriel Scherer
fd01798f0e [minor] refactor pattern helpers 2020-12-20 22:21:02 +01:00
Gabriel Scherer
c3866c82ca [minor] remove stale comment 2020-12-20 22:21:02 +01:00
Gabriel Scherer
c93dcaac1d implement support for or-patterns 2020-12-19 10:01:21 +01:00
Gabriel Scherer
c1bdebc6c6 implement support for as-patterns 2020-12-19 10:01:21 +01:00
Gabriel Scherer
149271d65a fix a bug with irrefutable patterns in let 2020-12-19 10:01:21 +01:00
Gabriel Scherer
8b065f45ec change the pattern grammar (follow the expression grammar) to better handle nesting 2020-12-19 10:01:21 +01:00
Gabriel Scherer
fb591b2f57 refactor adjust-[ep]constr-args 2020-12-19 10:01:21 +01:00
Gabriel Scherer
95934067f5 deduplication of pattern actions 2020-12-19 10:01:21 +01:00
Gabriel Scherer
dea17c0c16 patterns.ml: use a large right-hand-side in a duplicated action 2020-12-19 10:01:21 +01:00