Commit Graph

15 Commits

Author SHA1 Message Date
7393e12555 Allow multiple arguments to IO.print(). 2014-04-09 07:48:35 -07:00
2da8025cd4 Fiber.create -> new Fiber 2014-04-04 18:24:55 -07:00
f5a9f39568 Check argument type in new Fn. 2014-04-04 18:13:13 -07:00
4a8cf3a7bf Move newline handling down into parser.
This lets us make it a grammar feature and not a lexer trick.
Newlines are explicitly ignored in some parts of the grammar. This
lets, for example, things like "|" ignore the newline when used as
an operator, but not when used as a parameter delimiter in a block
argument.
2014-04-04 07:51:18 -07:00
da4cadf16b Unify body handling.
Blocks, functions, and methods now have the same code for handling
their bodies.

This means that single-line methods work like single-line functions:
they return the result of their expression.
2014-04-03 07:48:19 -07:00
d146018559 Convert all fns to block arg syntax. 2014-04-02 19:41:53 -07:00
a550d6cea4 Change how new operators are compiled.
Instead of an instruction that always instantiates an instance,
the "new" is compiled to a method call on the class, followed by a
method call on the (presumably) new instance.

The former lets built-in types like Fn do special stuff instead of
allocating an instance. In particular, it means:

  new Fn { ... }

can just return the block argument.
2014-04-02 17:42:30 -07:00
e535d7a9e7 Conditional operator. 2014-02-15 11:36:01 -08:00
7726ee5131 Handle extra and missing arguments to fn.call. 2014-02-04 09:34:05 -08:00
b979272305 Clean up text handling a bit:
- Rename IO.write -> IO.print.
- Make IO.write not print a newline.
- Support \u Unicode escapes in strings.
2014-01-05 12:27:12 -08:00
c8fe27d6c4 Allow empty blocks. 2013-12-29 10:46:21 -08:00
6c3aa85228 Make IO a static class instead of a singleton. 2013-12-21 19:25:09 -08:00
7fe60499db Get rid of my name from TODOs. Anyone can do them. 2013-12-14 15:28:18 -08:00
325bb281a5 Allow 16 arguments, and handle going over that correctly. 2013-11-29 15:08:27 -08:00
56449cdbef Reorganize tests. 2013-11-26 22:52:00 -08:00