aboutsummaryrefslogtreecommitdiff
path: root/nomsu.peg
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-04-11 20:05:12 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-04-11 20:05:18 -0700
commitb9827b1745e3b633666483ed0a8df35714a7fc4f (patch)
treefcec8f6fef4cfa11e32e6483087d0bdc8f0591ab /nomsu.peg
parentab8ccf4e274d7a4fbb5d95e0fc20b71bafbc98dc (diff)
Work in progress...
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]* }