if yy_isspace(c) {
if c == '\n' && curio.nlsemi != 0 {
ungetc(c)
- DBG("lex: implicit semi\n")
+ if Debug['x'] != 0 {
+ fmt.Printf("lex: implicit semi\n")
+ }
return ';'
}
yylval.val.U.Xval = new(Mpint)
Mpmovecfix(yylval.val.U.Xval, v)
yylval.val.Ctype = CTRUNE
- DBG("lex: codepoint literal\n")
+ if Debug['x'] != 0 {
+ fmt.Printf("lex: codepoint literal\n")
+ }
litbuf = "string literal"
return LLITERAL
case '{':
if loophack == 1 {
- DBG("%L lex: LBODY\n", lexlineno)
+ if Debug['x'] != 0 {
+ fmt.Printf("%v lex: LBODY\n", Ctxt.Line(int(lexlineno)))
+ }
loophack = 0
return LBODY
}
lx:
if c > 0xff {
- DBG("%L lex: TOKEN %s\n", lexlineno, lexname(c))
+ if Debug['x'] != 0 {
+ fmt.Printf("%v lex: TOKEN %s\n", Ctxt.Line(int(lexlineno)), lexname(c))
+ }
} else {
- DBG("%L lex: TOKEN '%c'\n", lexlineno, c)
+ if Debug['x'] != 0 {
+ fmt.Printf("%v lex: TOKEN '%c'\n", Ctxt.Line(int(lexlineno)), c)
+ }
}
if isfrog(c) {
Yyerror("illegal character 0x%x", uint(c))
asop:
yylval.i = c // rathole to hold which asop
- DBG("lex: TOKEN ASOP %c\n", c)
+ if Debug['x'] != 0 {
+ fmt.Printf("lex: TOKEN ASOP %c\n", c)
+ }
return LASOP
/*
loophack = 1 // see comment about loophack above
}
- DBG("lex: %S %s\n", s, lexname(int(s.Lexical)))
+ if Debug['x'] != 0 {
+ fmt.Printf("lex: %s %s\n", Sconv(s, 0), lexname(int(s.Lexical)))
+ }
yylval.sym = s
return int32(s.Lexical)
}
yylval.val.Ctype = CTINT
- DBG("lex: integer literal\n")
+ if Debug['x'] != 0 {
+ fmt.Printf("lex: integer literal\n")
+ }
litbuf = "literal "
litbuf += lexbuf.String()
return LLITERAL
}
yylval.val.Ctype = CTCPLX
- DBG("lex: imaginary literal\n")
+ if Debug['x'] != 0 {
+ fmt.Printf("lex: imaginary literal\n")
+ }
litbuf = "literal "
litbuf += lexbuf.String()
return LLITERAL
}
yylval.val.Ctype = CTFLT
- DBG("lex: floating literal\n")
+ if Debug['x'] != 0 {
+ fmt.Printf("lex: floating literal\n")
+ }
litbuf = "literal "
litbuf += lexbuf.String()
return LLITERAL
strlit:
yylval.val.U.Sval = &Strlit{S: cp.String()}
yylval.val.Ctype = CTSTR
- DBG("lex: string literal\n")
+ if Debug['x'] != 0 {
+ fmt.Printf("lex: string literal\n")
+ }
litbuf = "string literal"
return LLITERAL
}