Bruce Hill
c9ff0ff04b
Fixed up some edge cases with parsing and comments.
2018-07-14 14:53:03 -07:00
Bruce Hill
d535dc5794
Fixed up comment generation to old standards
2018-07-14 14:41:32 -07:00
Bruce Hill
84c0058e69
Switching to use 'unpack' for indentation grouping.
2018-07-13 09:56:38 -07:00
Bruce Hill
af62e3e8bf
All tests passing.
2018-07-12 21:24:13 -07:00
Bruce Hill
f908bb49b3
Initial version of new pegfile. works (ish)
2018-07-12 16:14:44 -07:00
Bruce Hill
ba2b83d566
Fixed nomsu codegen for indented text and improved text parsing. Also
...
moved some more tests inline.
2018-07-11 14:14:16 -07:00
Bruce Hill
3fd5687370
Fixed up line numbers for generated code.
2018-07-10 17:10:59 -07:00
Bruce Hill
de34592dbe
Adding some compatibility stuff.
2018-07-09 19:22:46 -07:00
Bruce Hill
0923b0192c
Improvements to nomsu codegen (comments are now retained) and some
...
improvements to handling of stdin and fixes for error reporting.
2018-06-28 14:13:01 -07:00
Bruce Hill
dbf3de3d8e
Added versioning system.
2018-06-23 00:57:39 -07:00
Bruce Hill
16d127abb5
Initial working version.
2018-06-18 15:44:35 -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
b5fb8933af
Removed dependency on 'immutable' library. This lets LuaJIT do more
...
aggressive optimizations and generally helps performance. Some safety is
lost, but I think the performance gains, reduced complexity, and reduced
dependencies are worth it.
2018-06-12 15:14:07 -07:00
Bruce Hill
0c9973ff03
Tidying up exceptions and error reporting. Also simplified the grammar a
...
tiny bit.
2018-06-12 13:56:35 -07:00
Bruce Hill
aeceba800b
Deleted shebang rule. Comments handle it just fine.
2018-05-30 13:11:05 -07:00
Bruce Hill
f9229c5e91
Better parse error reporting.
2018-05-30 13:07:15 -07:00
Bruce Hill
e5d9879a79
Cleaned up patterns a little.
2018-05-30 12:07:08 -07:00
Bruce Hill
b6be516e3f
Fix for luajit, though I'm not sure why it worked for lua either.
2018-05-28 23:24:43 -07:00
Bruce Hill
66fa60100e
Trivially added support for foo(1,2)
as sugar for foo 1 2
2018-05-27 18:36:15 -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
6ce32bdd25
Cleaned up lpeg matching stuff to use lpeg.Carg(1) instead of
...
lpeg.userdata, and switched indent/dedent/nodent to use a number to
track indentation instead of a stack.
2018-05-26 19:25:17 -07:00
Bruce Hill
0c7c06beab
Moving back to capturing tables in LPEG and everything is a Source, not
...
string.
2018-05-26 15:59:03 -07:00
Bruce Hill
0b4a81191a
Minor tidying.
2018-05-26 13:09:25 -07:00
Bruce Hill
64294f5cd6
Removed the Word tree type and replaced it with raw strings, since
...
they're only used as part of Actions
2018-05-24 21:17:15 -07:00
Bruce Hill
2e345e271f
Misc changes, fixed up Object lib and tests.
2018-05-24 14:57:35 -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
01aa199f7a
Adding support for coroutines, and cleaning up comment syntax.
2018-05-15 16:36:38 -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
Bruce Hill
e64a91b8ba
Better error reporting and codegen.
2018-05-03 16:31:02 -07:00
Bruce Hill
23022dc88c
Re-added (..), which is necessary for long expressions as first arg to
...
an action.
2018-04-28 15:21:28 -07:00
Bruce Hill
b54829de36
Better text interpolation/handling of "\". Also added syntax support for
...
(statement; statement)
2018-04-27 16:45:35 -07:00
Bruce Hill
4e821308af
Overhauling parsing of Blocks (can no longer contain only one statement)
2018-04-25 17:44:24 -07:00
Bruce Hill
5d59d510cd
Removing end-of-line ":" and "(..)" for blocks (they just use
...
indentation now).
2018-04-25 16:31:09 -07:00
Bruce Hill
cb28f52b41
Updated block-style text interpolation to have less redundancy.
2018-04-25 15:37:47 -07:00
Bruce Hill
bff93d386c
Refactor to improve indentation and move as_nomsu() into tree methods.
2018-04-24 20:17:08 -07:00
Bruce Hill
b589c23741
Disabled comment transpilation for now.
2018-04-17 14:47:42 -07:00
Bruce Hill
54fc7fc440
Moving tree_to_lua into each of the Nomsu tree types, which are now in
...
their own file.
2018-04-17 14:19:07 -07:00
Bruce Hill
b9827b1745
Work in progress...
2018-04-11 20:05:18 -07:00
Bruce Hill
fd621a1062
Cleaned up LHS of "." operator to avoid adding unnecessary parens so
...
Lua's parser doesn't get confused by (x).y = 1.
2018-04-08 15:41:55 -07:00
Bruce Hill
227b944bad
Initial working version.
2018-04-06 16:45:57 -07:00
Bruce Hill
a9c4b78074
Initial branch of switching to using immutable types.
2018-02-13 15:18:00 -08:00
Bruce Hill
545618ddc9
Added back in support for ":" indented blocks
2018-01-30 16:41:03 -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
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
15dc0309c3
Removed dead code.
2018-01-23 15:25:52 -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
d82c4f85d8
Added support for translating comments instead of dropping them.
2018-01-15 15:50:32 -08:00
Bruce Hill
48b27d4b1a
Fixed an error in the peg for dicts.
2018-01-11 18:48:12 -08:00