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();

Reply via email to