[prev in list] [next in list] [prev in thread] [next in thread]
List: 9fans
Subject: Re: [9fans] Porting GO LANG
From: erik quanstrom <quanstro () quanstro ! net>
Date: 2009-11-21 16:08:15
Message-ID: df6a1e4d63d8b4856583d174a868590f () ladd ! quanstro ! net
[Download RAW message or body]
it really isn't worth fighting.
/n/dump/2009/1120/sys/src/cmd/yacc.c:1918,1933 - yacc.c:1918,1940
/* i is the number of lines skipped */
i = 0;
- if(Bgetrune(finput) != '*')
- error("illegal comment");
c = Bgetrune(finput);
- while(c != Beof) {
- while(c == '*')
- if((c=Bgetrune(finput)) == '/')
- return i;
- if(c == '\n')
- i++;
+ if(c == '/'){
+ while((c = Bgetrune(finput)) != Beof)
+ if(c == '\n')
+ return 1;
+ }else{
+ if(c != '*')
+ error("illegal comment");
c = Bgetrune(finput);
+ while(c != Beof) {
+ while(c == '*')
+ if((c=Bgetrune(finput)) == '/')
+ return i;
+ if(c == '\n')
+ i++;
+ c = Bgetrune(finput);
+ }
}
error("EOF inside comment");
return 0;
and for 8a
/n/dump/2009/1120/sys/src/cmd/cc/lexbody:418,425 - /sys/src/cmd/cc/lexbody:418,424
for(;;) {
c = GETC();
if(c == '\n') {
- lineno++;
- goto l0;
+ goto l1; /* return ; for ?a's benefit. */
}
if(c == EOF) {
yyerror("eof in comment");
- erik
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic