aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-03-09 10:49:36 +0000
committers-ol <s-ol@users.noreply.github.com>2020-03-09 10:51:45 +0000
commit08159094121698efe5822e9a79ed9c4a7633a9df (patch)
tree3f1c6fcdef475cc1dc47e2f541660ecd324da2fb
parentadd internals docs (diff)
downloadalive-08159094121698efe5822e9a79ed9c4a7633a9df.tar.gz
alive-08159094121698efe5822e9a79ed9c4a7633a9df.zip
bugfixes
-rw-r--r--core/cell.moon2
-rw-r--r--core/invoke.moon2
-rw-r--r--core/result.moon4
-rw-r--r--lib/midi/core.moon10
-rw-r--r--lib/midi/launchctl.moon25
-rw-r--r--lib/util.moon4
-rw-r--r--spec/core/parsing_spec.moon5
7 files changed, 27 insertions, 25 deletions
diff --git a/core/cell.moon b/core/cell.moon
index f023b25..3567a6d 100644
--- a/core/cell.moon
+++ b/core/cell.moon
@@ -123,7 +123,7 @@ class Cell
buf ..= '...'
else
for i, child in ipairs @children
- buf ..= child\stringify depth - 1
+ buf ..= child\stringify if depth == -1 then -1 else depth - 1
buf ..= if depth > 0 then ' ' else @white[i]
if depth > 0
diff --git a/core/invoke.moon b/core/invoke.moon
index 69ce881..a401c9a 100644
--- a/core/invoke.moon
+++ b/core/invoke.moon
@@ -19,7 +19,7 @@ class op_invoke extends Action
true
eval: (scope, tail) =>
- children = L\push -> [L\push expr\eval, scope for expr in *tail]
+ children = [L\push expr\eval, scope for expr in *tail]
@op\setup [result for result in *children], scope
any_dirty = false
diff --git a/core/result.moon b/core/result.moon
index e92bc5c..5ad5734 100644
--- a/core/result.moon
+++ b/core/result.moon
@@ -5,8 +5,6 @@
-- between `Op`s.
--
-- @classmod Result
-import base from require 'core.cycle'
-
class Result
--- members
-- @section members
@@ -36,7 +34,7 @@ class Result
-- should be called once per frame on the root, right before tick.
tick_io: =>
for stream, input in pairs @side_inputs
- if input.__class == base.IOInput
+ if input.__class.__name == "IOInput"
io = input!
io\tick!
diff --git a/lib/midi/core.moon b/lib/midi/core.moon
index 627aa2e..d5259ad 100644
--- a/lib/midi/core.moon
+++ b/lib/midi/core.moon
@@ -1,4 +1,4 @@
-import IO, Op, Registry, ValueInput, match from require 'core.base'
+import IO, Op, Registry, Input, match from require 'core.base'
import RtMidiIn, RtMidiOut, RtMidi from require 'luartmidi'
import band, bor, lshift, rshift from require 'bit32'
@@ -68,7 +68,7 @@ class input extends PortOp
setup: (inputs) =>
{ name } = match 'str', inputs
- super name: ValueInput name
+ super name: Input.value name
tick: => super @inputs.name
@@ -77,7 +77,7 @@ class output extends PortOp
setup: (inputs) =>
{ name } = match 'str', inputs
- super name: ValueInput name
+ super name: Input.value name
tick: => super nil, @inputs.name
@@ -87,8 +87,8 @@ class inout extends PortOp
setup: (inputs) =>
{ inp, out } = match 'str str', inputs
super
- inp: ValueInput inp
- out: ValueInput out
+ inp: Input.value inp
+ out: Input.value out
tick: => super @inputs.inp, @inputs.out
diff --git a/lib/midi/launchctl.moon b/lib/midi/launchctl.moon
index 495743b..6408528 100644
--- a/lib/midi/launchctl.moon
+++ b/lib/midi/launchctl.moon
@@ -1,5 +1,4 @@
-import Value, Op, ValueInput, EventInput, IOInput, match
- from require 'core.base'
+import Value, Op, Input, match from require 'core.base'
import apply_range from require 'lib.midi.core'
import bor, lshift from require 'bit32'
@@ -29,12 +28,12 @@ range can be one of:
chan, steps, range } = match 'midi/port num num num num? any?', inputs
super
- port: IOInput port
- i: ValueInput i
- start: ValueInput start
- chan: ValueInput chan
- steps: ValueInput steps or Value.num 8
- range: ValueInput range or Value.str 'uni'
+ port: Input.io port
+ i: Input.value i
+ start: Input.value start
+ chan: Input.value chan
+ steps: Input.value steps or Value.num 8
+ range: Input.value range or Value.str 'uni'
if not @out\unwrap!
@out\set apply_range @inputs.range, 0
@@ -75,11 +74,11 @@ steps defaults to 8."
{ port, i, start, chan, steps } = match 'midi/port num num num num?', inputs
super
- port: IOInput port
- i: ValueInput i
- start: ValueInput start
- chan: ValueInput chan
- steps: ValueInput steps or Value.num 8
+ port: Input.io port
+ i: Input.value i
+ start: Input.value start
+ chan: Input.value chan
+ steps: Input.value steps or Value.num 8
light = (set, active) ->
set = if set then 'S' else ' '
diff --git a/lib/util.moon b/lib/util.moon
index 2a43dd2..3ed903b 100644
--- a/lib/util.moon
+++ b/lib/util.moon
@@ -21,7 +21,7 @@ when i is a num, it is (floor)ed and the matching argument (starting from 0) is
i_type = i\type!
assert i_type == 'bool' or i_type == 'num', "#{@}: i has to be bool or num"
typ = all_same [v\type! for v in *values]
- @out = Value typ
+ @out = Value typ if not @out or typ != @out.type
super
i: Input.value i
@@ -74,7 +74,7 @@ class edge extends Op
setup: (inputs) =>
{ value } = match 'bool', inputs
- super value: Input.value
+ super value: Input.value value
tick: =>
now = @inputs.value!
diff --git a/spec/core/parsing_spec.moon b/spec/core/parsing_spec.moon
index 7f4bb06..9958e22 100644
--- a/spec/core/parsing_spec.moon
+++ b/spec/core/parsing_spec.moon
@@ -145,3 +145,8 @@ describe 'resynthesis', ->
) '
matched = assert.is.truthy verify_parse program, str
assert.is.equal str, matched\stringify!
+
+ test 'nested tags', ->
+ str = '([2]a ([3]b))'
+ matched = assert.is.truthy verify_parse program, str
+ assert.is.equal str, matched\stringify!