Commit Graph

147 Commits

Author SHA1 Message Date
Bruce Hill
e8d5d2a240 Added check for circular imports. 2018-02-05 15:35:06 -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
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
2dbf2d8810 Cleanup of REPL and detection of command-line running. 2018-01-30 16:40:23 -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
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
fb22ba11ac Fixed improperly handling locals of a block. 2018-01-25 18:07:51 -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
ef5eb18cbb Updated TODO. 2018-01-24 00:43:30 -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
ac8089dd58 Fixed typo. 2018-01-23 15:25:31 -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
d888b1134a Added more info to error message. 2018-01-19 15:12:00 -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
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
90c72074db Renamed replaced_vars() to be more descriptive. 2018-01-12 16:45:49 -08:00
Bruce Hill
28badba29a Deleted some dead code. 2018-01-12 16:34:46 -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
06bf76f818 Truncated debug output for readability. 2018-01-11 18:48:43 -08:00
Bruce Hill
425f4ed7a7 Added todo. 2018-01-11 15:34:54 -08:00
Bruce Hill
ba87104202 Fixed require->use, updated TODO. 2018-01-11 14:07:14 -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
Bruce Hill
1c6b660d6b Updated TODO 2018-01-11 02:10:23 -08:00
Bruce Hill
8c1da9a6c3 Purged references to "macro" and replaced with "compile action" or
"compile-time action".
2018-01-11 02:07:37 -08:00
Bruce Hill
199161a438 Renamed def->define_action and defmacro->define_macro 2018-01-11 01:57:52 -08:00
Bruce Hill
82cc997ddf Renamed rule % = % to action % % 2018-01-11 01:19:03 -08:00
Bruce Hill
6f4b67632a Renamed String -> Text 2018-01-11 01:09:26 -08:00
Bruce Hill
c0333ca315 Overhaul of error reporting and removing nomsu:call(stub, line_no, ...) in favor of nomsu.defs[stub].fn(...) 2018-01-11 01:04:17 -08:00
Bruce Hill
53a9d4eae8 Pretty much mostly working. 2018-01-10 20:45:03 -08:00
Bruce Hill
09b64e0341 Performance optimizations and correctness fix for [=[...]=]-style
strings. Also, require % now properly inserts lua code.
2018-01-10 16:22:45 -08:00
Bruce Hill
ea05cc155e Switched back to using precompiled lua files instead of lua> "..",
because it's noticeably faster.
2018-01-10 13:52:41 -08:00
Bruce Hill
787c7c5a6c Propagating filename 2018-01-09 16:30:29 -08:00
Bruce Hill
421abe1a6f Cleaned up metaprogramming to go "compile to" -> "rule =" -> "parse as".
This speeds things up a bit, and is more intuitive.
2018-01-09 14:59:06 -08:00
Bruce Hill
f97ab858ed Modernized the codebase a bit to include "immediately:" for immediately
running code before further parsing takes place. That means that in the
default case, whole files can be run at once, which makes all but the
weirdest edge cases make a lot more sense and operate smoothly.
2018-01-08 18:53:57 -08:00
Bruce Hill
568a44ef19 Reworking some stuff so that functions only allow expressions to be
return values with either an explicit "return" statement or if they're
the only line in the function, and the line is an expression.
2018-01-07 18:45:27 -08:00
Bruce Hill
c92e5fbc81 Some overhaul of binary operators so that arbitrary math patterns work
fine.
2018-01-07 18:03:37 -08:00
Bruce Hill
87b93f4aba Added nomsu:assert() 2018-01-05 15:23:18 -08:00