建银国际遵循规范:
在文件结束或其他文件错误条件的情况下,& 和 ~ 都像 r 一样。
可以使用其内置的跟踪器/调试器进行验证:
$ echo "~~~...@" > test.fg
$ echo "a" > input
$ ccbi --trace test.fg
Instruction: 126 0x7e '~'
Position: (0,0) -- Delta: (1,0) -- Offset: (0,0)
Stack: 0 cell(s): [ - - - - - - - -] ""
Tick: 0 -- IPs: 1 -- Index/ID: 0/0 -- Stacks: 1 -- Mode:
(Tracer) stdin < input
Successfully set stdin to file 'input'.
(Tracer) s
Instruction: 126 0x7e '~'
Position: (1,0) -- Delta: (1,0) -- Offset: (0,0)
Stack: 1 cell(s): [ - - - - - - - 97] "a"
Tick: 1 -- IPs: 1 -- Index/ID: 0/0 -- Stacks: 1 -- Mode:
(Tracer) s
Instruction: 126 0x7e '~'
Position: (2,0) -- Delta: (1,0) -- Offset: (0,0)
Stack: 2 cell(s): [ - - - - - - 97 10] "a^J"
Tick: 2 -- IPs: 1 -- Index/ID: 0/0 -- Stacks: 1 -- Mode:
(Tracer) s
Instruction: 126 0x7e '~'
Position: (1,0) -- Delta: (-1,0) -- Offset: (0,0)
Stack: 2 cell(s): [ - - - - - - 97 10] "a^J"
Tick: 3 -- IPs: 1 -- Index/ID: 0/0 -- Stacks: 1 -- Mode:
(Tracer) s
Instruction: 126 0x7e '~'
Position: (2,0) -- Delta: (1,0) -- Offset: (0,0)
Stack: 2 cell(s): [ - - - - - - 97 10] "a^J"
Tick: 4 -- IPs: 1 -- Index/ID: 0/0 -- Stacks: 1 -- Mode:
(Tracer) s
Instruction: 126 0x7e '~'
Position: (1,0) -- Delta: (-1,0) -- Offset: (0,0)
Stack: 2 cell(s): [ - - - - - - 97 10] "a^J"
Tick: 5 -- IPs: 1 -- Index/ID: 0/0 -- Stacks: 1 -- Mode:
(Tracer) s
Instruction: 126 0x7e '~'
Position: (2,0) -- Delta: (1,0) -- Offset: (0,0)
Stack: 2 cell(s): [ - - - - - - 97 10] "a^J"
Tick: 6 -- IPs: 1 -- Index/ID: 0/0 -- Stacks: 1 -- Mode:
在刻度 3 上,增量已从(1,0)
变为(-1,0)
,即第~
3 列(位置 )上的指令(2,0)
如预期的那样反映在 EOF 上。之后,代码在两条~
指令之间循环。
可以修改您的代码以检查是否符合~
-on-EOF 行为,例如:
~~#v~...a"tcelfer ton did">:#,_@
>..a"detcelfer">:#,_@