diff options
Diffstat (limited to 'base.moon')
| -rw-r--r-- | base.moon | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,9 +1,14 @@ +import is_object from require 'moon' + class Const - new: (@value) => + types = { str: true, num: true, op: true, opdef: true } + new: (@type, @value) => + assert types[@type], "invalid Const type: #{@type}" + get: => @value getc: => @value - __tostring: => "<const: #{@value}>" + __tostring: => "<#{@type}: #{@value}>" class Op new: (@node) => |
