diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-04-13 18:40:35 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-04-14 08:46:54 +0000 |
| commit | 1a8debe87762072b3a63b769aa515ebf63b4c70d (patch) | |
| tree | 33b42866307d11d2c0878b23e0ec0bb8925d3fcc /core/init.moon | |
| parent | spec base.match __tostring (diff) | |
| download | alive-1a8debe87762072b3a63b769aa515ebf63b4c70d.tar.gz alive-1a8debe87762072b3a63b769aa515ebf63b4c70d.zip | |
move into proper Lua module (`alv`)
Diffstat (limited to 'core/init.moon')
| -rw-r--r-- | core/init.moon | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/core/init.moon b/core/init.moon deleted file mode 100644 index 6e23fa7..0000000 --- a/core/init.moon +++ /dev/null @@ -1,55 +0,0 @@ ----- --- `alive` public API. --- --- @module init -L or= setmetatable {}, __index: => -> - -import ValueStream, EventStream, IOStream from require 'core.stream' -import Result from require 'core.result' -import Scope from require 'core.scope' -import Error from require 'core.error' -import Registry, SimpleRegistry from require 'core.registry' -import Tag from require 'core.tag' - -import Cell from require 'core.cell' -import cell, program from require 'core.parsing' - -with require 'core.cycle' - \load! - -globals = Scope.from_table require 'core.builtin' - ---- exports --- @table exports --- @tfield ValueStream ValueStream --- @tfield EventStream EventStream --- @tfield IOStream IOStream --- @tfield Result Result --- @tfield Cell Cell --- @tfield RootCell RootCell --- @tfield Scope Scope --- @tfield Error Error --- @tfield Registry Registry --- @tfield Tag Tag --- @tfield Scope globals global definitons --- @tfield parse function to turn a `string` into a root `Cell` -{ - :ValueStream, :EventStream, :IOStream - :Cell, :RootCell - :Result, :Scope, :Error - - :Registry, :SimpleRegistry, :Tag - - :globals - - parse: (str) -> - assert (program\match str), Error 'syntax', "failed to parse" - - eval: (str, inject) -> - scope = Scope nil, globals - scope\use inject if inject - - ast = assert (program\match str), "failed to parse" - result = ast\eval scope - result\const! -} |
