aboutsummaryrefslogtreecommitdiff
path: root/nomsu.peg
diff options
context:
space:
mode:
Diffstat (limited to 'nomsu.peg')
-rw-r--r--nomsu.peg6
1 files changed, 4 insertions, 2 deletions
diff --git a/nomsu.peg b/nomsu.peg
index 5ea5ee0..5758b17 100644
--- a/nomsu.peg
+++ b/nomsu.peg
@@ -100,10 +100,12 @@ indented_dict (Dict):
|} -> Tuple)
(dedent / (("" -> "Error while parsing dict") => error))
dict_line:
- (((inline_expression / word) %ws* ":" %ws* (functioncall / expression)) -> DictEntry !comma)
+ ((dict_key %ws* ":" %ws* (functioncall / expression)) -> DictEntry !comma)
/ (inline_dict_item (comma dict_line?)?)
inline_dict_item:
- ((inline_expression / word) %ws* ":" %ws* (inline_functioncall / inline_expression)) -> DictEntry
+ (dict_key %ws* ":" %ws* (inline_functioncall / inline_expression)) -> DictEntry
+dict_key:
+ (({} ({|{%operator / (!number plain_word)}|} -> Tuple) {}) -> Text) / inline_expression
block_comment(Comment): "#.." { [^%nl]* (%nl+ %indent [^%nl]* (%nl+ %nodent [^%nl]*)* %dedent)? }
line_comment(Comment): "#" { [^%nl]* }