Commit Graph

65 Commits

Author SHA1 Message Date
652c29bdef Major overhaul, splitting nomsu_compiler into nomsu_environment,
nomsu_compiler, and nomsu_decompiler. Also added comprehensions.
2018-11-08 15:24:15 -08:00
307dea1881 Changed stub convention to (foo 1 baz 2) -> foo_1_baz instead of
foo_1_baz_2, removed "smext", made some cleanup changes.
2018-11-02 14:39:23 -07:00
d0c3c57f7b Simplified AST to just use a single moonscript class called "SyntaxTree"
instead of a different metatable for each type of syntax tree.
2018-10-31 15:54:51 -07:00
ea3197aaff Fully working version of (action [foo]: baz) -> ((foo) means: baz)
refactor and misc other changes.
2018-10-30 23:42:36 -07:00
23abab4f80 Some cleanups and fixes, made the parser more permissive of prematurely
terminated files.
2018-10-29 13:00:30 -07:00
63d8b1cd3f Fully working, I think? (with a lot of shims) 2018-09-28 22:15:19 -07:00
Bruce Hill
c1cba45968 Added support for compile actions returning trees, and compiling blocks
into values.
2018-09-17 15:30:24 -07:00
Bruce Hill
e22c35681f Auto-upgraded everything. 2018-09-14 19:17:16 -07:00
Bruce Hill
7c6047254e Upgraded to 3.8 (text method changes) and fixed some bugs in
tree_to_nomsu.
2018-09-10 16:26:27 -07:00
Bruce Hill
a35d010dfe Removed the mandatory "_" prefix for Nomsu variables, renamed "list" and
"dict" to "List" and "Dict", or in Nomsu's environment, "_List" and
"_Dict", removed uuid.lua and replaced it with core/id.nom for handling
IDs.
2018-09-06 12:48:16 -07:00
Bruce Hill
18126da9c5 Auto-upgraded to 3.7 2018-08-30 14:16:18 -07:00
Bruce Hill
4f30e02acb Handling more compatibility stuff, including Lua 5.4, and a backup for
if openssl module is not found, and moving containers (List/Dict) into
their own file, as well as bit operators (and support for __bxor, etc.
metamethods in Lua 5.2/LuaJIT)
2018-08-29 19:39:15 -07:00
Bruce Hill
dcb5e8add2 Fully updated to 3.6, deprecated old LuaCode global functions like "to 1
write 2" and replaced them with method calls like "1::append 2"
2018-08-29 15:10:27 -07:00
Bruce Hill
5ee9bcb7fb Upgraded version to 3.5.5.6, corresponding to Object Oriented changes. 2018-08-28 15:34:45 -07:00
Bruce Hill
e44acbf338 Lots of overhaul, supporting a new Object Oriented approach (e.g.
%obj::action 1 2) and syntax.
2018-08-28 15:08:07 -07:00
Bruce Hill
c6a7b0be9e Added compatibility for 2.5.5.5 (file hash changes). 2018-07-30 19:39:32 -07:00
Bruce Hill
ab4ebdf175 Changed autoformatting rules to ensure tests get clumped together with
the thing below them.
2018-07-30 15:06:03 -07:00
Bruce Hill
7c488dd266 Fixed bitwise operators to work on Lua 5.2 and LuaJIT, and added tests.
This is the first case where precompiled code is now platform-dependent.
2018-07-30 14:26:55 -07:00
Bruce Hill
ed996ad1b6 Switching compile action to parse action for 3-way comparison. 2018-07-26 12:38:17 -07:00
Bruce Hill
a69555bc03 Updated version numbers. 2018-07-25 13:49:17 -07:00
Bruce Hill
470a6fe7f9 Fixed blocks starting with extra newline when they start with a comment. 2018-07-23 14:41:30 -07:00
Bruce Hill
04d7edefa3 Adding more inline tests. 2018-07-22 16:13:33 -07:00
Bruce Hill
addac10a47 Re-autoformatted everything. The main changes are: no longer adding a
newline after 1-line indented code inside blocks, and forcing files to
have a trailing newline. The trailing newline thing created a lot of
spurious changes.
2018-07-22 15:01:05 -07:00
Bruce Hill
ae4670bd8e Improvements working towards better inline tests. Improved handling of
file spoofing and adding -e command line flag for executing a string.
2018-07-21 14:44:26 -07:00
Bruce Hill
6728587dfc Auto-formatted and auto-upgraded everything! 2018-07-20 20:27:27 -07:00
Bruce Hill
bf67a61013 Updating to version 2.4.4.3, with new syntax for multi-statement 'if'
and switch statements.
2018-07-18 17:56:15 -07:00
Bruce Hill
d5cfaa37be Upgrading to version 2.3 (main change: "=" instead of "<-" for
assignment)
2018-07-18 01:28:17 -07:00
Bruce Hill
ba639f2bd0 Upgraded core code to latest Nomsu verison. 2018-07-17 23:08:24 -07:00
Bruce Hill
be06fc096a Major changes to how versioning and parsing work. This should be a
better path going forward to handling upgrades. Old syntax files will
stick around for compatibility purposes. Old syntax can be parsed into
valid syntax trees via the old syntax (.peg) files, and then old syntax
trees should be valid and can be upgraded via the normal code path. This
change has lots of improvements to Nomsu codegen too.
2018-07-15 19:43:28 -07:00
Bruce Hill
fa72d7eeb1 Fixing up error reporting and ripping out LDT-specific code (now a
debugger can
be provided by a command line flag)
2018-07-10 15:00:35 -07:00
Bruce Hill
65dc1f2196 Cleaning up metaprogramming a bit and fixing/adding test for recursion
control flow.
2018-06-26 15:53:00 -07:00
Bruce Hill
86a3219e7f Cleanup of some metaprogramming stuff, as well as adding support for
"package.nomsupath" to search for files in different locations, and
prioritizing use of "luafilesystem" over system calls.
2018-06-21 19:13:47 -07:00
Bruce Hill
d73cbf0aa5 Cleanups. 2018-06-20 15:22:06 -07:00
Bruce Hill
f83cc3ad8a More streamlining and cleanup. 2018-06-18 18:11:09 -07:00
Bruce Hill
16d127abb5 Initial working version. 2018-06-18 15:44:35 -07:00
Bruce Hill
b12744d831 Some cleanup and fixes. Simplifying a lot of code, and extending the
flexibility of scoping. Redesigned Object system too.
2018-06-14 23:25:34 -07:00
Bruce Hill
49f1eb3d08 Reshuffling some files. 2018-06-14 22:17:37 -07:00
Bruce Hill
82cfd3e54b More streamlining and cleanup. Especially for core/metaprogramming.nom 2018-06-14 21:59:43 -07:00
Bruce Hill
3c510e4ee5 Lots of optimizations and simplifications, especially towards getting
better performance on luajit.
2018-06-12 18:04:41 -07:00
Bruce Hill
810ae220bc Added list/dict metatables to make comparison and string representations
simpler. Also deleted Counters.
2018-06-06 13:25:34 -07:00
Bruce Hill
83183122f1 Optimizations and cleanup. Build script now fails on first error and
uses the precompiled versions it has just compiled.
2018-06-04 20:44:58 -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
2e15c0fd50 Some tweaks/cleanup on the nomsu code as well as adding variable
mangling to 'parse % as %' to make almost hygienic macros.
2018-05-27 18:29:23 -07:00
Bruce Hill
8cb2788e0d Re-added sources. 2018-05-26 15:04:38 -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
0a95a264e5 Cleaning up comments. 2018-05-15 18:56:00 -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