regression fix

This commit is contained in:
Luxferre
2026-07-10 10:20:23 +03:00
parent 94a809d224
commit 38e8de1faf
3 changed files with 6 additions and 12 deletions
+3 -7
View File
@@ -268,11 +268,7 @@ func (c *Clyx) popCallerToken() any {
}
}
if stream == nil {
if len(c.tokenStreams) == 0 {
stream = &c.tokens
} else {
return nil
}
stream = &c.tokens
}
if len(*stream) == 0 { return nil }
t := (*stream)[0]
@@ -296,11 +292,11 @@ func (c *Clyx) cmdDefw() {
break
}
}
if stream == nil && len(c.tokenStreams) == 0 {
if stream == nil {
stream = &c.tokens
}
var val any
if stream != nil && len(*stream) > 0 {
if len(*stream) > 0 {
t0 := (*stream)[0]
isQForm := false
if s, ok := t0.(string); ok && s == "[" { isQForm = true } else if _, ok := t0.([]any); ok { isQForm = true }
+2 -5
View File
@@ -108,10 +108,7 @@ class Clyx:
t = stream
break
if t is None:
if not self._token_streams:
t = self._tokens
else:
return None
t = self._tokens
if not t: return None
val = t.pop(0)
if val == '[': return self._parse_qform(t)
@@ -123,7 +120,7 @@ class Clyx:
if stream:
t = stream
break
if t is None and not self._token_streams:
if t is None:
t = self._tokens
val = self._pop_caller_token() if (t and (t[0] == '[' or isinstance(t[0], list))) else self._stack.pop()
if isinstance(val, str): val = self._norm_token(val)
+1
View File
@@ -230,6 +230,7 @@ if [
"Testing definition words..." puts cr
"my_const" [ 99 ] defw my_const 99 = if [ " defw (no-inline) PASS" puts cr ] [ " defw (no-inline) FAIL" puts cr ] # Test defw
"test_defw_map" [ [ 1 2 3 ] [ 2 * ] map ] defw test_defw_map [ 2 4 6 ] streq if [ " map inside defw PASS" puts cr ] [ " map inside defw FAIL" puts cr ] # Test map inside defw
:: my_inline [ 100 ]
my_inline 100 = if [ " :: (inline) PASS" puts cr ] [ " :: (inline) FAIL" puts cr ] # Test inline ::
5 then 5 = if [ " then PASS" puts cr ] [ " then FAIL" puts cr ] # Test then