mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
moon.p function and clean up todo
This commit is contained in:
parent
02a5dbcdd1
commit
48d491aa84
@ -6,6 +6,9 @@ local lua = {
|
|||||||
debug = debug
|
debug = debug
|
||||||
}
|
}
|
||||||
dump = util.dump
|
dump = util.dump
|
||||||
|
p = function(...)
|
||||||
|
return print(dump(...))
|
||||||
|
end
|
||||||
debug = {
|
debug = {
|
||||||
upvalue = function(fn, k, v)
|
upvalue = function(fn, k, v)
|
||||||
local upvalues = { }
|
local upvalues = { }
|
||||||
|
@ -10,6 +10,9 @@ export *
|
|||||||
|
|
||||||
dump = util.dump
|
dump = util.dump
|
||||||
|
|
||||||
|
p = (...) ->
|
||||||
|
print dump ...
|
||||||
|
|
||||||
debug = {
|
debug = {
|
||||||
upvalue: (fn, k, v) ->
|
upvalue: (fn, k, v) ->
|
||||||
upvalues = {}
|
upvalues = {}
|
||||||
|
19
todo
19
todo
@ -1,13 +1,13 @@
|
|||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
|
-- seems like running in moon messes up require order
|
||||||
|
|
||||||
- don't reuse _, put a local on it, so we don't keep around trash
|
- don't reuse _, put a local on it, so we don't keep around trash
|
||||||
|
|
||||||
-- swithc X with Func
|
-- swithc X with Func
|
||||||
|
|
||||||
- or= and=
|
- or= and=
|
||||||
|
|
||||||
- move stuff out of format that should be in types
|
|
||||||
|
|
||||||
- a do block for making a quick anon func and calling it
|
- a do block for making a quick anon func and calling it
|
||||||
|
|
||||||
- error with stray comma at end of line
|
- error with stray comma at end of line
|
||||||
@ -15,9 +15,6 @@
|
|||||||
|
|
||||||
- dump node in mark, see why values are being parsed multiple times
|
- dump node in mark, see why values are being parsed multiple times
|
||||||
|
|
||||||
if hello else world
|
|
||||||
-> if hello then hello else world
|
|
||||||
|
|
||||||
- varargs that get put in a nested generated function aren't valid anymore:
|
- varargs that get put in a nested generated function aren't valid anymore:
|
||||||
|
|
||||||
- class expressions, x = class extends Hello do new: => print "hello"
|
- class expressions, x = class extends Hello do new: => print "hello"
|
||||||
@ -31,18 +28,13 @@ if hello else world
|
|||||||
* elseif with value that inserts lines
|
* elseif with value that inserts lines
|
||||||
- need to decompose elif into if inside else
|
- need to decompose elif into if inside else
|
||||||
|
|
||||||
* export could also be used like so:
|
* export later?
|
||||||
|
|
||||||
export a = -> "hello"
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
x = 232
|
x = 232
|
||||||
export x
|
export x
|
||||||
|
|
||||||
|
|
||||||
* allow return anywhere in block
|
* allow return anywhere in block
|
||||||
* upercase constants and capital letter variables should automatically be exported (in the global scope?)
|
|
||||||
|
|
||||||
* any/every keywords for comprehensions? (what about iterators)
|
* any/every keywords for comprehensions? (what about iterators)
|
||||||
|
|
||||||
@ -51,10 +43,5 @@ not working right:
|
|||||||
double_args = (...) ->
|
double_args = (...) ->
|
||||||
[x * 2 for x in *{...}]
|
[x * 2 for x in *{...}]
|
||||||
|
|
||||||
|
|
||||||
still some issues with whitespace at end of line
|
|
||||||
|
|
||||||
* let array items in table be defined without {} when indented
|
* let array items in table be defined without {} when indented
|
||||||
* key,value table comprehensions with { }
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user