FST · Rational transduction
Strip # comments
Copy text, dropping everything from a # to the end of its line: a is any ordinary character and n a newline, which ends a comment and is kept. A shell, Python or a configuration-file reader does this before anything else. Two states, and the comment state prints nothing.
The author’s examples, run
# → rejecta → reject · a## → reject#a → reject### → rejectnnaan#na#aaaa### → reject · nnaanna