diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2017-09-13 16:22:04 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2017-09-13 16:22:04 -0700 |
| commit | 6b5fbd436bb5caf99b152dfa418317dfc1fca272 (patch) | |
| tree | 82cfe4357060f8021ead30e40024cc05dc48b6c2 /nomsu.moon | |
| parent | d27561b16a30223751998e0e02ba9e3d7289436f (diff) | |
Renamed Compiler -> NomsuCompiler
Diffstat (limited to 'nomsu.moon')
| -rwxr-xr-x | nomsu.moon | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -5,6 +5,8 @@ utils = require 'utils' -- TODO: -- string interpolation +-- improve indentation of generated lua code +-- provide way to run precompiled nomsu -> lua code -- comprehensions? -- dicts? -- better scoping? @@ -85,7 +87,7 @@ make_parser = (lingo, extra_definitions)-> }) return re.compile lingo, defs -class Compiler +class NomsuCompiler new:(parent)=> @defs = setmetatable({}, {__index:parent and parent.defs}) @callstack = {} @@ -535,7 +537,7 @@ class Compiler -- Run on the command line via "./nomsu.moon input_file.nom" to execute -- and "./nomsu.moon input_file.nom output_file.lua" to compile (use "-" to compile to stdout) if arg and arg[1] - c = Compiler() + c = NomsuCompiler() input = io.open(arg[1])\read("*a") -- Kinda hacky, if run via "./nomsu.moon file.nom -", then silence print and io.write -- during execution and re-enable them to print out the generated source code @@ -560,10 +562,9 @@ if arg and arg[1] output\write [[ end - local utils = require('utils') - local Compiler = require('nomsu') - local c = Compiler() + local NomsuCompiler = require('nomsu') + local c = NomsuCompiler() load()(c, {}) ]] -return Compiler +return NomsuCompiler |
