some opts
This commit is contained in:
@@ -24,7 +24,7 @@ See the [manual](lttb-manual.md) for more details on every supported command and
|
|||||||
|
|
||||||
Here are all currently known implementations of LTTB:
|
Here are all currently known implementations of LTTB:
|
||||||
|
|
||||||
* [Jim Tcl port](./lttb.tcl) (300 SLOC)
|
* [Jim Tcl port](./lttb.tcl) (298 SLOC)
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# Based upon the original Tiny BASIC Design Notes by Dennis Allison
|
# Based upon the original Tiny BASIC Design Notes by Dennis Allison
|
||||||
# Created in 2026 by Luxferre, released into the public domain
|
# Created in 2026 by Luxferre, released into the public domain
|
||||||
|
|
||||||
set lttb_keywords {EN GO IF IN LE PR RE}
|
|
||||||
lassign {{} {} {} 0} progmem callstack vars ip
|
lassign {{} {} {} 0} progmem callstack vars ip
|
||||||
loop i 65 91 {set vars([format {%c} $i]) 0}
|
loop i 65 91 {set vars([format {%c} $i]) 0}
|
||||||
|
|
||||||
@@ -30,15 +29,14 @@ proc lttb_proginput {rawline} {
|
|||||||
|
|
||||||
# Main line interpreter
|
# Main line interpreter
|
||||||
proc lttb_exec {pline} {
|
proc lttb_exec {pline} {
|
||||||
global lttb_keywords
|
|
||||||
set kw [string range [lttb_stripspace $pline] 0 1]
|
set kw [string range [lttb_stripspace $pline] 0 1]
|
||||||
if {[string index $kw 1] eq {=}} {
|
if {[string index $kw 1] eq {=}} {
|
||||||
set kw LE
|
set kw LE
|
||||||
set pline [string cat {LE } $pline]
|
set pline [string cat {LE } $pline]
|
||||||
}
|
}
|
||||||
set bi [string first { } $pline]
|
if {$kw in {EN GO IF IN LE PR RE}} {
|
||||||
set body [string trim [string range $pline $bi end]]
|
set bi [string first { } $pline]
|
||||||
if {$kw in $lttb_keywords} {
|
set body [string trim [string range $pline $bi end]]
|
||||||
if {$kw eq {GO} && [string index $pline 2] eq {S}} {
|
if {$kw eq {GO} && [string index $pline 2] eq {S}} {
|
||||||
lttb_GOS $body
|
lttb_GOS $body
|
||||||
} else {lttb_$kw $body}
|
} else {lttb_$kw $body}
|
||||||
|
|||||||
Reference in New Issue
Block a user