Use str += u8 in rustc lexer.
This commit is contained in:
parent
ddd8feea31
commit
9363c1ab7f
1 changed files with 4 additions and 0 deletions
|
@ -30,12 +30,16 @@ fn is_whitespace(char c) -> bool {
|
||||||
fn next_token(stdio_reader rdr) -> token.token {
|
fn next_token(stdio_reader rdr) -> token.token {
|
||||||
auto eof = (-1) as char;
|
auto eof = (-1) as char;
|
||||||
auto c = rdr.getc() as char;
|
auto c = rdr.getc() as char;
|
||||||
|
auto accum = "";
|
||||||
|
|
||||||
while (is_whitespace(c) && c != eof) {
|
while (is_whitespace(c) && c != eof) {
|
||||||
c = rdr.getc() as char;
|
c = rdr.getc() as char;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == eof) { ret token.EOF(); }
|
if (c == eof) { ret token.EOF(); }
|
||||||
|
if (is_alpha(c)) {
|
||||||
|
accum += (c as u8);
|
||||||
|
}
|
||||||
log c;
|
log c;
|
||||||
ret token.EOF();
|
ret token.EOF();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue