Commit Graph

94 Commits

Author SHA1 Message Date
Bruce Hill
90c72074db Renamed replaced_vars() to be more descriptive. 2018-01-12 16:45:49 -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
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
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
Bruce Hill
bfe66a70e6 Renamed "% mod %" to "wrap % around %" 2018-01-11 02:18:09 -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
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
b1c6354464 Added substring operator %x|start - stop| 2018-01-07 16:51:29 -08:00
Bruce Hill
2df539a762 More cleanup of vars.XX -> \%XX 2018-01-05 15:45:46 -08:00
Bruce Hill
139bd76efc Cleaning up vars.XX use and removing typecheck. 2018-01-05 15:42:06 -08:00
Bruce Hill
cd4196d365 Tidying. 2018-01-03 01:04:21 -08:00
Bruce Hill
cfee75b21b Reworked {} a bit and added dicts to the core language. Did some more
testing on string interpolations too.
2018-01-03 00:52:01 -08:00
Bruce Hill
4789892824 Got everything mostly working. 2017-12-30 14:31:07 -08:00
Bruce Hill
3c303018bb Tweaks. 2017-12-15 15:30:05 -08:00
Bruce Hill
1111210047 Updating some more stuff. 2017-12-14 13:57:53 -08:00
Bruce Hill
536a3ba649 Got it working. 2017-12-13 16:29:15 -08:00
Bruce Hill
0c1c406ce0 More updates with more functional macros and source code storage. 2017-12-11 17:53:23 -08:00
Bruce Hill
96441251c4 Pretty much everything is working?? 2017-12-09 15:34:52 -08:00
Bruce Hill
5903820699 Incremental progress towards working. 2017-12-04 17:54:52 -08:00
Bruce Hill
b3b8c4d731 Some stuff changed to allow escaped args and some other ports from the
two_defs branch.
2017-12-04 17:35:47 -08:00
Bruce Hill
3ae1f696aa Fixed remove rule rule. 2017-11-01 20:00:52 -07:00
Bruce Hill
87b2cce8e5 Added remove rule rule. 2017-11-01 19:59:44 -07:00
Bruce Hill
fb3936269f Removed broken code. 2017-11-01 16:49:52 -07:00
Bruce Hill
f1a2c936de Fixed some codegen stuff, optimized "say" for the common case of string
literals.
2017-11-01 16:49:11 -07:00
Bruce Hill
cbd876673a Added gsub. 2017-11-01 15:58:19 -07:00
Bruce Hill
8c7915e466 Added try/except. 2017-11-01 15:52:28 -07:00
Bruce Hill
6ba79a8ff1 Added support for serializing rules. 2017-10-31 16:19:08 -07:00
Bruce Hill
60a85bbd8b Removed some unnecessary semicolons on keywords. 2017-10-23 16:28:45 -07:00
Bruce Hill
9f61e7f90d Misc. cleanups. 2017-10-19 18:56:42 -07:00
Bruce Hill
ca5896b7bd Finally fixed the bullshit way that string literals were converted to lua. 2017-10-19 18:16:15 -07:00
Bruce Hill
c7994cf720 Added some constants to utils. 2017-10-19 17:28:41 -07:00
Bruce Hill
b98059261c Abbreviated "lua code" to "lua>" and "lua expr" to "=lua" and "lua
block" to "lua do>"
2017-10-19 17:00:10 -07:00
Bruce Hill
443f8c73bb Added default dict. 2017-10-19 16:34:38 -07:00
Bruce Hill
9dee9dbbd8 Made symbols group with each other, instead of *every* one being alone. 2017-10-13 19:43:55 -07:00
Bruce Hill
bccfe9d8e1 Changed tokenizing to treat symbols as their own things. 2017-10-13 19:41:58 -07:00
Bruce Hill
e476bfea52 Improved code generation for "when" statements using elseif, and
improved code generation for loops by omitting goto labels when not used.
2017-10-13 18:09:04 -07:00
Bruce Hill
d13bcde2b9 Renamed repr_if_not_string to "stringify" and added nomsu:stringify for
convenience.
2017-10-13 16:16:07 -07:00