kevinpt / opbasm

Open PicoBlaze Assembler
http://kevinpt.github.io/opbasm/
MIT License
60 stars 13 forks source link

Single quotes inside comments causing trouble #21

Closed nrother closed 6 years ago

nrother commented 7 years ago

The following code will not assemble correctly:

proc a() {
    load s0, 0 ;I'm the zero reg
}

The problem is caused by the single quote (') in the comment, removing it solves the problem.

I know that the single quote is a quoting character in m4, but this is a really annoying problem, especially since this sometimes does not cause an error but instead just eats up some random instructions, cause some really strange bugs ("It works when I remove the comment...") Maybe one can fix this with some m4 magic?

kevinpt commented 6 years ago

I have fixed this in 1.3.8 by converting backticks and single quotes inside comments into the Unicode equivalent before m4 is run.