DavidKinder / Inform6

The latest version of the Inform 6 compiler, used for generating interactive fiction games.
http://inform-fiction.org/
Other
199 stars 32 forks source link

Putting quote in single quotes causes a compilation error #234

Closed auraes closed 1 year ago

auraes commented 1 year ago
[ Main;
   print ''';
];

Inform 6.42 (in development) line 3: Error: Expected ''' but found end of file

line 3: Error: Expected comma but found dict word '; ]; '

line 5: Error: Expected ']' but found

line 5: Error: Expected ';' after ']' but found

Compiled with 4 errors (no output)

erkyrath commented 1 year ago

Right, quotes inside quotes have to be escaped.

If you want a dictionary word with a single quote in it, write it like this: 'can^t' or 'can@{27}t'.

If you want the ASCII value of a single quote, just write 39 or $27.

auraes commented 1 year ago

Thank you. This is a recent regression since it worked with the previous 6.42.

erkyrath commented 1 year ago

Ok, I didn't realize it was a regression. I didn't make that change on purpose.

I'll try to see what caused it.

erkyrath commented 1 year ago

Change f1d8d622abe3d0b46eaa07fc944ca50d9beacb66 , and that was a genuine mistake! I accidentally dropped a quoted_size++.

Thanks for pointing this out. I was just wrong about this case having to be escaped.