9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] unexpectedly low pH in acid
@ 2011-09-04  4:44 erik quanstrom
  0 siblings, 0 replies; only message in thread
From: erik quanstrom @ 2011-09-04  4:44 UTC (permalink / raw)
  To: 9fans

in my last email, i wanted to put a comment after the dump(...) statement,
but it turns out that didn't work as expected.  the problem is simple enough:
acid // comments in acid mistakely consume the newline, leading to incorrect
line numbers, &c.

the fix for this is straightforward: after recognizing a // comment, continue
with newline processing:

- erik


/n/dump/2011/0903/sys/src/cmd/acid/lex.c:329,334 - lex.c:329,342
  	case '\t':
  		goto loop;

+ 	case '/':
+ 		c = lexc();
+ 		if(c != '/'){
+ 			unlexc(c);
+ 			return '/';
+ 		}
+ 		eatnl();
+
  	case '\n':
  		line++;
  		if(interactive == 0)
/n/dump/2011/0903/sys/src/cmd/acid/lex.c:390,404 - lex.c:398,403
  			return Tinc;
  		unlexc(c);
  		return '+';
-
- 	case '/':
- 		c = lexc();
- 		if(c == '/') {
- 			eatnl();
- 			goto loop;
- 		}
- 		unlexc(c);
- 		return '/';

  	case '\'':
  		c = lexc();



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-04  4:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-04  4:44 [9fans] unexpectedly low pH in acid erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).