diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-11-08 15:23:22 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-11-08 15:24:15 -0800 |
| commit | 652c29bdef1f0991cc13bef59d6dc78b657ae9a4 (patch) | |
| tree | 8e335399e77b1893657b9fa985db0738034daac3 /nomsu.4.peg | |
| parent | 1f3660f393c1a17988a15b89f18686b28e51a9e7 (diff) | |
Major overhaul, splitting nomsu_compiler into nomsu_environment,
nomsu_compiler, and nomsu_decompiler. Also added comprehensions.
Diffstat (limited to 'nomsu.4.peg')
| -rw-r--r-- | nomsu.4.peg | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/nomsu.4.peg b/nomsu.4.peg index a3677c6..e0a5781 100644 --- a/nomsu.4.peg +++ b/nomsu.4.peg @@ -114,14 +114,15 @@ index_chain (IndexChain): -- Actions need either at least 1 word, or at least 2 tokens inline_action (Action): !section_division - ({:target: inline_arg :} ws* "::" ws*)? + ({:target: (inline_expression / "(" inline_block ")") :} ws* "::" ws*)? ( (inline_arg (ws* (inline_arg / word))+) / (word (ws* (inline_arg / word))*)) (ws* inline_block)? inline_arg: inline_expression / inline_block action (Action): !section_division - ({:target: arg :} ((ws* "\")? eol nl_nodent "..")? ws* "::" ((ws* "\")? eol nl_nodent "..")? ws*)? + ({:target: (expression / "(" inline_block ")" / indented_block) :} + ((ws* "\")? eol nl_nodent "..")? ws* "::" ((ws* "\")? eol nl_nodent "..")? ws*)? ( (arg (((ws* "\")? eol nl_nodent "..")? ws* (arg / word))+) / (word (((ws* "\")? eol nl_nodent "..")? ws* (arg / word))*)) arg: expression / inline_block / indented_block @@ -190,8 +191,8 @@ indented_list (List): (","? unexpected_code)? list_line: (inline_list_item ws* "," ws*)+ eol - / (inline_list_item ws* "," ws*)* (action / expression) eol -inline_list_item: inline_action / inline_expression + / (inline_list_item ws* "," ws*)* (action / expression / inline_block / indented_block) eol +inline_list_item: inline_action / inline_expression / inline_block inline_dict (Dict): !('{..}') @@ -206,10 +207,14 @@ indented_dict (Dict): dict_line: (inline_dict_entry ws* "," ws*)+ eol / (inline_dict_entry ws* "," ws*)* dict_entry eol -dict_entry(DictEntry): +_dict_entry(DictEntry): dict_key (ws* ":" ws* (action / expression))? -inline_dict_entry(DictEntry): +dict_entry: + _dict_entry / inline_block / indented_block +_inline_dict_entry(DictEntry): dict_key (ws* ":" ws* (inline_action / inline_expression)?)? +inline_dict_entry: + _inline_dict_entry / inline_block dict_key: text_word / inline_expression |
