diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-03-07 20:58:30 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-03-07 20:58:51 +0000 |
| commit | 6a7a2ddaca798f3cccac394d1fb9f317cbe90de6 (patch) | |
| tree | 4e49e53057b39f75813311ede13f87d238061fe6 /core/parsing.moon | |
| parent | spellcheck (diff) | |
| download | alive-6a7a2ddaca798f3cccac394d1fb9f317cbe90de6.tar.gz alive-6a7a2ddaca798f3cccac394d1fb9f317cbe90de6.zip | |
add ldoc documentation
Diffstat (limited to 'core/parsing.moon')
| -rw-r--r-- | core/parsing.moon | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/core/parsing.moon b/core/parsing.moon index 8a99d89..911f473 100644 --- a/core/parsing.moon +++ b/core/parsing.moon @@ -1,5 +1,9 @@ +---- +-- Lpeg Grammar for parsing `alive` code. +-- +-- @module parsing import Value from require 'core.value' -import Cell, RootCell from require 'core.cell' +import Cell from require 'core.cell' import Tag from require 'core.tag' import R, S, P, V, C, Ct from require 'lpeg' @@ -35,7 +39,7 @@ tag = (P '[') * (digit^1 / Tag\parse) * (P ']') cell = (P '(') * tag^-1 * (V 'explist') * (P ')') / Cell\parse root = P { - (V 'explist') / RootCell\parse + (V 'explist') / Cell\parse_root :expr, :explist, :cell } @@ -46,6 +50,17 @@ cell = P { program = root * -1 +--- exports +-- @table exports +-- @tfield pattern comment +-- @tfield pattern space +-- @tfield pattern atom +-- @tfield pattern expr +-- @tfield pattern explist +-- @tfield pattern explist +-- @tfield pattern cell +-- @tfield pattern root +-- @tfield pattern program the main parsing entrypoint { :comment :space |
