Eric Blake <ebb9 <at> byu.net> writes: > > However, the issue is not just multiline comments, but also multiline > strings, so I think creating a new TOKEN_COMMENT is not strictly > necessary, since the fix for one should be applied to the other.
For comparison, here is how Solaris m4 behaves: => #line 1 "-" changecom(/*,*/) => hello => hello /* multi => /* multi line */ => line */ `multi => multi line' => line define(foo,``multi line'') => => #line 9 foo => multi => line => #line 10 define(bar, `/*multi line*/') => => #line 12 dnl dnl hi => hi => #line 15 bar => /*multi => line*/ => #line 16 Their algorithm is a bit off (it prints the line directive _before_ collecting an input line, so anything that follows omitted lines is off; for example, #line 12 should have been #line 14, and then #line 15 was unnecessary). But that output never broke up a multi-line token. On the other hand: => #line 1 "-" define(foo,a b) => => #line 3 one foo two => one a => #line 3 => b two define(bar,``a b'') => => #line 6 one bar two => one a => #line 6 => b two hi => hi The second #line 3 is expected; the output of foo is three tokens (a, newline, b). But the second #line 6 broke up a multiline token (the single string 'a\nb'). Which means Solaris m4 has the same bug, that it can insert line directives inside a multiline comment and mess up a preprocessor's notion of the current line for the subsequent line. -- Eric Blake _______________________________________________ Bug-m4 mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-m4
