Commit Graph

358 Commits

Author SHA1 Message Date
Bruce Hill
667e5f3f81 Fixed bug with iteration over range that starts after 1, and added an
append alias that puts the list first.
2018-02-05 15:10:53 -08:00
Bruce Hill
f58dc0fcb7 Reverted "use %" to expr-like behavior with return values preserved. 2018-02-05 15:10:02 -08:00
Bruce Hill
e8f9ef36d6 Updated gitignore. 2018-02-02 15:59:05 -08:00
Bruce Hill
505fec2a61 Restructured the nomsu files to group all the essentials into core/ and
all the optionals into lib/. lib/core.nom and tests/all.nom are no
longer needed now.
2018-02-02 15:49:42 -08:00
Bruce Hill
513c721198 Updated 'use %' to support directories, and cleaned up action_metadata a
tiny bit.
2018-02-02 14:01:06 -08:00
Bruce Hill
75c6755d32 Switched accumulate() to return a table, not a string. 2018-02-01 16:40:26 -08:00
Bruce Hill
f1d4a568a3 Added test for OO. 2018-01-31 15:31:31 -08:00
Bruce Hill
a387fd86a8 Added colons for aesthetics. 2018-01-31 15:31:13 -08:00
Bruce Hill
b1406a3203 Removed "core_defs" 2018-01-30 16:41:51 -08:00
Bruce Hill
545618ddc9 Added back in support for ":" indented blocks 2018-01-30 16:41:03 -08:00
Bruce Hill
2dbf2d8810 Cleanup of REPL and detection of command-line running. 2018-01-30 16:40:23 -08:00
Bruce Hill
78c15a5d5e Removed indented interpolations for inline strings. 2018-01-30 15:13:13 -08:00
Bruce Hill
0563571625 Overhaul of indentations. Now strictly requiring exactly 4 spaces
everywhere, and supporting indented string interpolations.
2018-01-30 15:11:18 -08:00
Bruce Hill
d7abcba34d Fix for bad indentation. 2018-01-30 15:10:29 -08:00
Bruce Hill
99ccd0e0a4 Fixed error->barf 2018-01-29 15:16:08 -08:00
Bruce Hill
27c8024888 Added numeric-for list comprehension 2018-01-29 15:14:50 -08:00
Bruce Hill
f0446a27c9 Updated readme. 2018-01-27 16:40:43 -08:00
Bruce Hill
855fe23439 Tweaked code to not rely on moonscript. 2018-01-27 16:40:29 -08:00
Bruce Hill
90c56d3135 Added a ton of tests for virtually all the functionality. Helped me find
and fix a lot of latent problems.
2018-01-26 20:20:38 -08:00
Bruce Hill
d5aa4e5298 Minor fix for value_to_nomsu 2018-01-26 15:19:05 -08:00
Bruce Hill
95f3f55ff2 Cleaned up unnecessary buffer use. 2018-01-26 15:03:15 -08:00
Bruce Hill
214b3f9186 Removed nomsu:write() and nomsu:writeln() and replaced with just plain
ol' print()
2018-01-26 15:02:32 -08:00
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