Commit Graph

286 Commits

Author SHA1 Message Date
Bruce Hill
53c735be55 Removed "\.." syntax, and just added support for the literal ".." as
long as it's not followed by an indented region.
2018-01-26 14:53:30 -08:00
Bruce Hill
0c0fb98389 Added some training wheels for functions. 2018-01-25 18:08:04 -08:00
Bruce Hill
fb22ba11ac Fixed improperly handling locals of a block. 2018-01-25 18:07:51 -08:00
Bruce Hill
6668918b2e Deleted stale code. 2018-01-25 17:45:51 -08:00
Bruce Hill
90b2888d46 Fixed up how_do_i with updated syntax. 2018-01-25 17:44:09 -08:00
Bruce Hill
c79bea4401 Overhaul of compiling API (eliminated some of the expr/statements
helpers and forced the use of {expr=..., locals=...}-type syntax. This
helped fix up all of the cases like loops where locals were being
mishandled and led to some cleaner code.
2018-01-25 17:36:05 -08:00
Bruce Hill
f769351556 Updated and improve syntax for some stuff. Also added string indexing
like in python, including slices.
2018-01-24 13:13:26 -08:00
Bruce Hill
d173e9ae88 Fixed id for nil/NaN and cleaned up collection metatable stuff. 2018-01-24 12:38:09 -08:00
Bruce Hill
566b7d09c8 Updated training wheels with new syntax and print(). 2018-01-24 03:00:31 -08:00
Bruce Hill
42d950f7b4 Fix for some old syntax. 2018-01-24 02:55:49 -08:00
Bruce Hill
a33cb2598f Cleaned up code duplication in 'compile % to %' and 'compile % to code
%' and improved generated lua output for the common case (a text value).
2018-01-24 01:38:55 -08:00
Bruce Hill
3e1e32e953 Fixed unintentional printing of "-n" 2018-01-24 01:38:02 -08:00
Bruce Hill
ef5eb18cbb Updated TODO. 2018-01-24 00:43:30 -08:00
Bruce Hill
30639f52e1 Added "export" for explicitly non-local variables. 2018-01-23 19:42:14 -08:00
Bruce Hill
49f0e95571 Prevented redeclaration of function arguments as locals. 2018-01-23 19:29:11 -08:00
Bruce Hill
6d11354b3f Added implicit local declarations and new syntax of %var <- %value. 2018-01-23 19:22:45 -08:00
Bruce Hill
15dc0309c3 Removed dead code. 2018-01-23 15:25:52 -08:00
Bruce Hill
ac8089dd58 Fixed typo. 2018-01-23 15:25:31 -08:00
Bruce Hill
376dd65278 Updated and fixed up how_do_i 2018-01-19 18:13:13 -08:00
Bruce Hill
4764842fe6 Updated class.nom for new syntax. 2018-01-19 17:32:01 -08:00
Bruce Hill
c1ac0635fd Refactored syntax a bit so that ":" isn't necessary for a block, and can
be used for inline expressions instead. Also, dict literals now use ":" instead
of "=".
2018-01-19 17:30:39 -08:00
Bruce Hill
ca07d84b4c Added scratch folder to .gitignore 2018-01-19 17:28:47 -08:00
Bruce Hill
d888b1134a Added more info to error message. 2018-01-19 15:12:00 -08:00
Bruce Hill
7759b778f6 Cleaned up code output to be just a series of declarations, instead of a
table literal and a loop.
2018-01-18 16:45:24 -08:00
Bruce Hill
6021f04490 Fix for lua parsing of long strings/table literals. 2018-01-18 16:44:32 -08:00
Bruce Hill
f91d06d9fa Initial commit of object oriented classes. 2018-01-18 01:49:27 -08:00
Bruce Hill
12cc294c7a Fixed some minor bugs that made generated nomsu uglier. 2018-01-17 16:45:29 -08:00
Bruce Hill
8bbebb8735 Completely fixed/reworked tree_to_nomsu, and it's okay right now. 2018-01-17 16:37:27 -08:00
64865aa596 Added compile step for lib/core.nom 2018-01-16 01:45:43 -08:00
4c059a7f9b Removed unnecessary semicolons that broke luajit. 2018-01-16 01:44:50 -08:00
Bruce Hill
d82c4f85d8 Added support for translating comments instead of dropping them. 2018-01-15 15:50:32 -08:00
Bruce Hill
5a526675db Better usage of ACTION_METADATA and deprecating nomsu.defs. 2018-01-12 19:28:19 -08:00
Bruce Hill
268a636157 Optimized loops to use local vars in loop definitions when possible. 2018-01-12 17:08:05 -08:00
Bruce Hill
b5ae7dac51 Added indent action 2018-01-12 17:07:35 -08:00
Bruce Hill
90c72074db Renamed replaced_vars() to be more descriptive. 2018-01-12 16:45:49 -08:00
Bruce Hill
b4a0267f71 Making change for auto-adding recompiled nomsu.lua to commits. 2018-01-12 16:41:30 -08:00
Bruce Hill
28badba29a Deleted some dead code. 2018-01-12 16:34:46 -08:00
Bruce Hill
4b6d35aa9f Rebuild. 2018-01-12 16:33:42 -08:00
Bruce Hill
6b09187899 Switched to use load() with environment table instead of passing in
nomsu to everything. This has some nice code cleanliness benefits.
2018-01-12 16:33:11 -08:00
Bruce Hill
e09f05a50c Reshuffled all the library code into files that make more sense and
cleaned up some of the library code.
2018-01-11 18:51:21 -08:00
Bruce Hill
06bf76f818 Truncated debug output for readability. 2018-01-11 18:48:43 -08:00
Bruce Hill
48b27d4b1a Fixed an error in the peg for dicts. 2018-01-11 18:48:12 -08:00
Bruce Hill
425f4ed7a7 Added todo. 2018-01-11 15:34:54 -08:00
Bruce Hill
7251f75087 Added "local %" macro as a stopgap for locals. 2018-01-11 15:32:54 -08:00
Bruce Hill
1e0dc6e477 Moved text utilities into their own file. 2018-01-11 15:27:15 -08:00
Bruce Hill
60aa3f5fcf Fixed ipairs->pairs to make dict iteration work. 2018-01-11 15:26:51 -08:00
Bruce Hill
ba87104202 Fixed require->use, updated TODO. 2018-01-11 14:07:14 -08:00
Bruce Hill
3fbc89273d Removed some dead code and streamlined the API a bit. Also added
training wheels for ease of transitions.
2018-01-11 04:38:46 -08:00
Bruce Hill
756c1f718e Renamed "require %" to "use %" 2018-01-11 03:35:35 -08:00
Bruce Hill
9d8c701441 Added "%'s id" to use UUIDs and changed "% = %" to "set % = %" and some
other misc.
2018-01-11 03:32:12 -08:00