kspalaiologos / asmbf

The only true brainfuck-targetting assembler.
https://esolangs.org/wiki/Asm2bf
MIT License
109 stars 6 forks source link

Flag to bfstrip/bfmake to preserve unknown characters #124

Closed ColonelThirtyTwo closed 3 years ago

ColonelThirtyTwo commented 3 years ago

I'm working with a brainfuck-superset language that adds a few characters that I would like to use. bfstrip though appears to filter those characters out. Can there be a flag to bfstrip (and bfmake) to preserve those characters?

Example below. raw instructions are the extension symbols.

col@col-laptop-asus ~> cat test.asm

mov r1, 1
nav r1
raw .}
mov r1, 2
nav r1
raw .)
mov r1, 20
nav r1
raw .'
raw .@
col@col-laptop-asus ~> bfmake ./test.asm
col@col-laptop-asus ~> cat ./test.b
+>+[<[>-]>[>]<<[>>+<<-]>>[-<<+>>>>>[-]+[-]++[-]++++++++++++++++++++<<<]<<[>>+<<-]>>[-<<+>>]<]⏎
col@col-laptop-asus ~> bfmake -s ./test.asm
col@col-laptop-asus ~> cat ./test.b
+>+[<[>-]>[>]<<[>>+<<-]>>[-<<+>>>>>[-]+}[-]++)[-]++++++++++++++++++++'@<<<]<<[>>+<<-]>>[-<<+>>]<]⏎
col@col-laptop-asus ~>

(Specifically, the "extended brainfuck" is the script for the ChemiCompiler from the game Space Station 13 - it adds a few symbols to interact with the game world)

kspalaiologos commented 3 years ago

Use bfmake -s; for more check bfmake -h. I may add a flag in the future which only removes redundant operations, preserving comments and such.

ColonelThirtyTwo commented 3 years ago

Yeah, I'm aware of the -s flag, but that also means foregoing the optimizations that bfstrip does, hence this ticket.

kspalaiologos commented 3 years ago

resolved in recent commits - use bfmake -q to build your project.