aboutsummaryrefslogtreecommitdiff
path: root/nomsu.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-10-02 20:17:52 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-10-02 20:17:52 -0700
commit9251b462dae2ee808a57c17518697916e3db4c6f (patch)
tree4e3e09c2258479472188518d019486ad8fe6b581 /nomsu.lua
parente3200dece1ba596c84fe69640db683e0973e926b (diff)
Fixed one compiler bug with comments immediately after indenting
Diffstat (limited to 'nomsu.lua')
-rw-r--r--nomsu.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/nomsu.lua b/nomsu.lua
index 36eeeba..61d4195 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -128,12 +128,12 @@ local nomsu = [=[ file <- ({ {| shebang?
list_line <- (inline_list_item comma)* ((inline_list_item %ws? ",") / (functioncall / expression))
inline_list_item <- inline_functioncall / inline_expression
- block_comment <- "#.." [^%nl]* indent [^%nl]* (%nl ((%ws? (!. / &%nl)) / (!%dedented [^%nl]*)))*
+ block_comment <- "#.." [^%nl]* (%nl (%ws? &%nl))* %nl %indented [^%nl]+ (%nl ((%ws? (!. / &%nl)) / (!%dedented [^%nl]+)))*
line_comment <- "#" [^%nl]*
eol <- %ws? line_comment? (!. / &%nl)
ignored_line <- (%nodented (block_comment / line_comment)) / (%ws? (!. / &%nl))
- indent <- eol (%nl ignored_line)* %nl %indented
+ indent <- eol (%nl ignored_line)* %nl %indented ((block_comment/line_comment) (%nl ignored_line)* nodent)?
nodent <- eol (%nl ignored_line)* %nl %nodented
dedent <- eol (%nl ignored_line)* (((!.) &%dedented) / (&(%nl %dedented)))
tok_gap <- %ws / %prev_edge / &("[" / "\" / [.,:;{("#%'])