Skip to content

Commit aade4b2

Browse files
authored
feature/sections (#22)
* Made cooking soup recursive. * Added anaphoric var fillers. * Number and bind anaphora. * Builtin index -> HashMap * Ugly refactor... - to hide binding type in error - allow cooking underneath binders * Prepare to move metadata pass into desugar stage * Tests for desugar-time target detection. * Moved to TranslationUnits target handling in main Currently abstractStaticBlock is broken though. * Implemented rebody to better handle evaluand * Tidies and options * Soup now cooked in fixity pass. * Tests for fixity distribution
1 parent 5966e8c commit aade4b2

27 files changed

+1360
-809
lines changed

lib/prelude.eu

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ panic: __PANIC
4646
trace: TODO(__TRACE)
4747

4848
` { doc: "`assert(c, s, v)` - if `c` is true then value `v` otherwise error with message `s`."
49-
example: { foo: bar assert(bar >= 0, "negative foo") }
49+
# example: { foo: bar assert(bar >= 0, "negative foo") }
5050
export: :suppress }
5151
assert(c, s, v): if(c, v, panic(s))
5252

@@ -79,7 +79,7 @@ if: __IF
7979
##
8080

8181
` { doc: "`cons(h, t)` - construct new list by prepending item `h` to list `t`."
82-
example: cons(0,[1,2]) //=> [0,1,2]
82+
# example: cons(0,[1,2]) //=> [0,1,2]
8383
export: :suppress }
8484
cons: __CONS
8585

@@ -422,8 +422,8 @@ nil?(l): l = []
422422

423423
` { doc: "`take(n, l)` - return as list the initial segment of integer `n` elements from list `l`."
424424
export: :suppress }
425-
take(n, l): __IF((n zero?), [], cons(l head, take(n dec, l tail)))
426-
425+
take(n, l): __IF(n zero?, [], cons(l head, take(n dec, l tail)))
426+
427427
` { doc: "`drop(n, l)` - return as list the result of dropping the initial segment of integer `n` elements from list `l`."
428428
export: :suppress }
429429
drop(n, l): __IF((n zero?), l, drop(n dec, l tail))

package.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ library:
3535
- optparse-applicative
3636
- megaparsec
3737
- monad-loops
38+
- mtl
3839
- parsec
3940
- parsec-numeric
4041
- path
@@ -49,6 +50,8 @@ library:
4950
- text
5051
- transformers
5152
- unix
53+
- unordered-containers
54+
- vector
5255
- yaml
5356

5457
executables:
@@ -82,6 +85,7 @@ tests:
8285
- megaparsec
8386
- hspec-megaparsec
8487
- pretty
88+
- mtl
8589
- network-uri
8690
- text
8791
- bound

src/Eucalypt/Core/Builtin.hs

+63-62
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)