aboutsummaryrefslogtreecommitdiff
path: root/nomsu.7.peg
diff options
context:
space:
mode:
Diffstat (limited to 'nomsu.7.peg')
-rw-r--r--nomsu.7.peg14
1 files changed, 9 insertions, 5 deletions
diff --git a/nomsu.7.peg b/nomsu.7.peg
index 15f7433..650623c 100644
--- a/nomsu.7.peg
+++ b/nomsu.7.peg
@@ -193,6 +193,7 @@ variable (Var) <- "$" ({ident_char+} / "(" ws* (inline_action / variable) ws* ")
inline_list (List) <-
+ !indented_list
"[" ws* !eol
(inline_list_item (ws* ',' ws* inline_list_item)* (ws* ',')?)? ws*
("]" / eof / (","? (missing_bracket_error / unexpected_code)))
@@ -200,8 +201,9 @@ inline_list_item <- inline_action / inline_expression
indented_list (List) <-
({|
- "[" eol nl_indent
- list_line (nl_nodent list_line)*
+ "[" (
+ (ws* indented_block)
+ / (eol nl_indent list_line (nl_nodent list_line)*))
{:curr_indent: %nil :}
|} -> unpack)
(nl_nodent "]" / eof / missing_bracket_error / unexpected_code)
@@ -211,15 +213,17 @@ list_line <-
inline_dict (Dict) <-
+ !indented_dict
"{" ws* !eol
((inline_action / inline_expression) (ws* ',' ws* (inline_action / inline_expression))*)? ws*
("}" / eof / (","? (missing_brace_error / unexpected_code)))
indented_dict (Dict) <-
({|
- "{" eol nl_indent
- dict_line (nl_nodent dict_line)*
- (%nl (ws* %nl)* nodent (comment / eol / unexpected_code))*
+ "{" (
+ (ws* indented_block)
+ / (eol nl_indent dict_line (nl_nodent dict_line)*
+ (%nl (ws* %nl)* nodent (comment / eol / unexpected_code))*))
{:curr_indent: %nil :}
|} -> unpack)
(nl_nodent "}" / eof / missing_brace_error / unexpected_code)