\ basic 00.11.27 11:28 pm NAB .( Loading Quartus Very Tiny Basic ) cr needs infix needs file needs string char ; token ';' char " token 'quote' bnf: 'quote' \ Use s" type instead of ." so that the \ same code works whether compiling \ or not: [char] s b, [char] " b, bl b, [char] " parse string>buffer [char] " b, ," type " ;bnf bnf: ," . " | ;bnf bnf: ';' | ',' ," 4 spaces " ;bnf bnf: recurse | | recurse ;bnf : print ( "..." -- ) start-parsing success @ >r evaluate-code r> 0= if s" cr" evaluate then ; immediate : cls ( -- ) page ; inline : rem ( -- ) postpone \ ; immediate create inputbuffer 10 allot : (input) ( addr -- ) inputbuffer 10 accept >r 0. inputbuffer r> false >r begin >number dup 0= >r 2over or r> or 0= while over c@ [char] - = r> or >r 1 /string repeat 2drop drop r> if negate then swap ! ; bnf: ';' ," (input) " | ," (input) " ;bnf : input ( "[<;>]" -- ) start-parsing evaluate-code ; immediate