mirror of https://github.com/vitalif/lime
Made lime_scan_tokens.l somewhat more elegant to read
parent
6163fdac49
commit
f669d69163
|
@ -14,9 +14,9 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
%{
|
||||
void out(char*t, char*v);
|
||||
void out(char* t, char* v);
|
||||
void lit();
|
||||
void tok(char*t);
|
||||
void tok(char* t);
|
||||
void php();
|
||||
%}
|
||||
|
||||
|
@ -63,9 +63,7 @@ BLOCKCMT "/*"({CC}|{CX})*{CT}
|
|||
{BLOCKCMT} {}
|
||||
"/"{WORD}+ |
|
||||
"/$" out("lambda", yytext+1);
|
||||
"%prec" {
|
||||
tok("prec");
|
||||
}
|
||||
"%prec" tok("prec");
|
||||
"%"{WORD}+ {
|
||||
out("pragma", yytext+1);
|
||||
yy_push_state(pragma);
|
||||
|
@ -115,7 +113,7 @@ void lit() {
|
|||
out(lit, yytext);
|
||||
}
|
||||
|
||||
void tok(char*t) {
|
||||
void tok(char* t) {
|
||||
out(t, yytext);
|
||||
}
|
||||
|
||||
|
@ -123,7 +121,7 @@ void php() {
|
|||
out("php", yytext);
|
||||
}
|
||||
|
||||
void out(char*type, char*value) {
|
||||
void out(char* type, char* value) {
|
||||
printf("%d\001%s\001%s", yylineno, type, value);
|
||||
fputc(0, stdout);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue