Commit Graph

36 Commits

Author SHA1 Message Date
Bruce Hill
b5fb8933af Removed dependency on 'immutable' library. This lets LuaJIT do more
aggressive optimizations and generally helps performance. Some safety is
lost, but I think the performance gains, reduced complexity, and reduced
dependencies are worth it.
2018-06-12 15:14:07 -07:00
Bruce Hill
0c9973ff03 Tidying up exceptions and error reporting. Also simplified the grammar a
tiny bit.
2018-06-12 13:56:35 -07:00
Bruce Hill
563e415e07 Switched from Node(Tuple(values...), source) to Node(source, values...),
thanks to support from immutable-tables for mixed tables.
2018-06-04 17:57:07 -07:00
Bruce Hill
b53516c47c Simplified and correctified lib/object (though the codegen still need
streamlining), added a .stub member to Action trees, and switched
Source's repr to be @filename[start:stop] instead of
"filename[start:stop]"
2018-05-30 17:21:19 -07:00
Bruce Hill
624fcdcc7e Moved as_lua_id() onto 'string' 2018-05-30 13:46:54 -07:00
Bruce Hill
e17822d1e5 Cleaned up some asserts for performance. 2018-05-29 11:14:07 -07:00
Bruce Hill
0c7c06beab Moving back to capturing tables in LPEG and everything is a Source, not
string.
2018-05-26 15:59:03 -07:00
Bruce Hill
8cb2788e0d Re-added sources. 2018-05-26 15:04:38 -07:00
Bruce Hill
64294f5cd6 Removed the Word tree type and replaced it with raw strings, since
they're only used as part of Actions
2018-05-24 21:17:15 -07:00
Bruce Hill
d9b795ee45 Adding some src map building code. 2018-05-24 20:27:26 -07:00
Bruce Hill
ad94ed3653 Moved all the tree->lua and tree->nomsu code back into single functions
in nomsu.moon, and cleaned up how Vars are treated, since they are not
atomic.
2018-05-16 19:08:59 -07:00
Bruce Hill
6f6c4377b2 Initial working version. 2018-05-16 18:13:02 -07:00
Bruce Hill
af9dc07025 Converted DictEntry to be an actual tree, instead of a pseudo-tree, made 'parse % as %'
generate lua code with already-substituted tree literals instead of reparsing and
substituting at parse time, and made some general optimizations.
2018-05-16 15:45:59 -07:00
Bruce Hill
28cd9ae0b7 More API cleanup, and fixed a bug with optimized lua files generating
spurious circular import errors.
2018-05-15 15:22:03 -07:00
Bruce Hill
ae979c3718 Minor cleanups changes. 2018-05-15 14:53:42 -07:00
Bruce Hill
95ee15982b Switched to use inline nomsu generation for Nomsu tree lua
compilation and removed some dead code around Nomsu.debug
2018-05-11 13:54:24 -07:00
Bruce Hill
4126589afe Cleanup: removed "File" type trees (now just Block), overhauled
how_do_i.nom, added "result of %" macro, which allowed comprehensions to
be way more concisely defined. Moved len() operator into the nomsu
environment.
2018-05-10 22:47:18 -07:00
Bruce Hill
1a755ddee8 Added tentative support for luajit (depends on pure-lua LPEG
implementation).
2018-05-09 13:35:04 -07:00
Bruce Hill
a5bbce315d Minor tweaks/cleanups. 2018-05-03 22:34:00 -07:00
Bruce Hill
2abaf67b66 Fix for compile lib putting the files in the wrong place. 2018-05-03 21:55:58 -07:00
Bruce Hill
36ead4d82b Cleanup of unnecessary parens in generated lua code for math operations. 2018-05-03 16:38:06 -07:00
Bruce Hill
e64a91b8ba Better error reporting and codegen. 2018-05-03 16:31:02 -07:00
Bruce Hill
35a5539185 Fix for math expression parsing 2018-04-30 14:50:43 -07:00
Bruce Hill
bf24824660 Improving idiomatic nomsu codegen 2018-04-28 20:45:27 -07:00
Bruce Hill
df9a82a971 Overhaul of command-line API. It's a bit cleaner now. 2018-04-28 17:08:44 -07:00
Bruce Hill
23022dc88c Re-added (..), which is necessary for long expressions as first arg to
an action.
2018-04-28 15:21:28 -07:00
Bruce Hill
7f99c70d56 Fixed renaming lua_obj->code_obj 2018-04-26 14:00:15 -07:00
Bruce Hill
4e821308af Overhauling parsing of Blocks (can no longer contain only one statement) 2018-04-25 17:44:24 -07:00
Bruce Hill
5d59d510cd Removing end-of-line ":" and "(..)" for blocks (they just use
indentation now).
2018-04-25 16:31:09 -07:00
Bruce Hill
50a092e4b5 Got nomsu codegen working again. 2018-04-25 16:04:55 -07:00
Bruce Hill
cb28f52b41 Updated block-style text interpolation to have less redundancy. 2018-04-25 15:37:47 -07:00
Bruce Hill
ec5d730fa0 Switched repr() to only return ""-style strings, and not [[]]-style,
which helps with indenting generated lua code correctly. Also made a few
ergonomic fixes/changes for line breaking.
2018-04-24 20:39:18 -07:00
Bruce Hill
dec5ee8262 Lots of optimizations. 2018-04-20 16:23:59 -07:00
Bruce Hill
14bda2fb2d Cleanups and optimizations. 2018-04-20 14:33:57 -07:00
Bruce Hill
928e78f252 Updated. 2018-04-19 19:23:19 -07:00
Bruce Hill
54fc7fc440 Moving tree_to_lua into each of the Nomsu tree types, which are now in
their own file.
2018-04-17 14:19:07 -07:00