Skip to content

Commit 48d491a

Browse files
committed
moon.p function and clean up todo
1 parent 02a5dbc commit 48d491a

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

moon/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ local lua = {
66
debug = debug
77
}
88
dump = util.dump
9+
p = function(...)
10+
return print(dump(...))
11+
end
912
debug = {
1013
upvalue = function(fn, k, v)
1114
local upvalues = { }

moon/init.moon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export *
1010

1111
dump = util.dump
1212

13+
p = (...) ->
14+
print dump ...
15+
1316
debug = {
1417
upvalue: (fn, k, v) ->
1518
upvalues = {}

todo

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
# TODO
22

3+
-- seems like running in moon messes up require order
4+
35
- don't reuse _, put a local on it, so we don't keep around trash
46

57
-- swithc X with Func
68

79
- or= and=
810

9-
- move stuff out of format that should be in types
10-
1111
- a do block for making a quick anon func and calling it
1212

1313
- error with stray comma at end of line
1414
- ugly error if attempting to assign to rvalue like #hello
1515

1616
- dump node in mark, see why values are being parsed multiple times
1717

18-
if hello else world
19-
-> if hello then hello else world
20-
2118
- varargs that get put in a nested generated function aren't valid anymore:
2219

2320
- class expressions, x = class extends Hello do new: => print "hello"
@@ -31,18 +28,13 @@ if hello else world
3128
* elseif with value that inserts lines
3229
- need to decompose elif into if inside else
3330

34-
* export could also be used like so:
35-
36-
export a = -> "hello"
37-
38-
or
31+
* export later?
3932

4033
x = 232
4134
export x
4235

4336

4437
* allow return anywhere in block
45-
* upercase constants and capital letter variables should automatically be exported (in the global scope?)
4638

4739
* any/every keywords for comprehensions? (what about iterators)
4840

@@ -51,10 +43,5 @@ not working right:
5143
double_args = (...) ->
5244
[x * 2 for x in *{...}]
5345

54-
55-
still some issues with whitespace at end of line
56-
5746
* let array items in table be defined without {} when indented
58-
* key,value table comprehensions with { }
59-
6047

0 commit comments

Comments
 (0)