From 27f89faaee6f318edcf4a19b95f01b523d84fe09 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 14 Sep 2017 04:31:46 -0700 Subject: Tweaked apostrophe rules to make %x's %y work. --- nomsu.moon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nomsu.moon') diff --git a/nomsu.moon b/nomsu.moon index a27354a..90c847e 100755 --- a/nomsu.moon +++ b/nomsu.moon @@ -194,7 +194,7 @@ class NomsuCompiler ((%indent %new_line block ((%dedent (%new_line "..")?) / errors)) / (one_liner (%ws? (%new_line? ".."))?)) }) -> Thunk - word <- ({ !number {%wordchar+} }) -> Word + word <- ({ !number {%wordchar (!"'" %wordchar)*} }) -> Word expression <- ({ (longstring / string / number / variable / list / thunk / subexpression) }) -> Expression string <- ({ (!longstring) '"' {(("\" [^%nl]) / [^"%nl])*} '"' }) -> String @@ -210,7 +210,7 @@ class NomsuCompiler |}}) -> Longstring string_interpolation <- "\" %ws? (functioncall / expression) %ws? "\" number <- ({ {'-'? [0-9]+ ("." [0-9]+)?} }) -> Number - variable <- ({ ("%" {%wordchar+}) }) -> Var + variable <- ({ ("%" {%wordchar (!"'" %wordchar)*}) }) -> Var subexpression <- ("(" %ws? (functioncall / expression) %ws? ")") -- cgit v1.2.3