diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-22 14:57:37 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-22 14:57:56 -0700 |
| commit | 4fa9757fa27d79a0cda399dcf3b711f4d0d60457 (patch) | |
| tree | a67d210b87912ac023822b3e69c97c406659e139 /nomsu.2.peg | |
| parent | 0fe94570b5c33e01472f61fcd564809f93e1b08a (diff) | |
Better handling of parsing non-filechunks text.
Diffstat (limited to 'nomsu.2.peg')
| -rw-r--r-- | nomsu.2.peg | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/nomsu.2.peg b/nomsu.2.peg index c1f4f81..1f096af 100644 --- a/nomsu.2.peg +++ b/nomsu.2.peg @@ -1,8 +1,8 @@ -- Nomsu version 2 file: {:curr_indent: ' '* :} - (file_chunks / chunk / (comment? blank_lines? (inline_block / indented_block)))? - blank_lines? + (((action / expression / inline_block / indented_block) eol !.) + / file_chunks / blank_lines / '') %ws* (!! .+ -> "Parse error" !!)? shebang: "#!" (!"nomsu" [^%nl])* "nomsu" %ws+ "-V" %ws* {:version: [0-9.]+ :} [^%nl]* @@ -10,16 +10,12 @@ shebang: "#!" (!"nomsu" [^%nl])* "nomsu" %ws+ "-V" %ws* {:version: [0-9.]+ :} [^ file_chunks (FileChunks): {:curr_indent: ' '* :} shebang? comment? blank_lines? - chunk (nl_nodent section_division nl_nodent chunk)+ + (top_block (nl_nodent section_division top_block)*) blank_lines? -chunk: - top_block / (comment? blank_lines? statement) - top_block (Block): {:curr_indent: ' '* :} - shebang? comment? blank_lines? - statement (nl_nodent statement)+ + comment? blank_lines? statement (nl_nodent statement)* nodent: =curr_indent !(" ") indent: =curr_indent " " |
