Pre-intern "0", "1", ..., "9", and use where appropriate.

This commit is contained in:
Nicholas Nethercote
2019-05-22 19:25:39 +10:00
parent 58c68d00fd
commit 9c7d28d4fd
8 changed files with 48 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
use crate::ast::{self, Ident};
use crate::parse::ParseSess;
use crate::parse::token::{self, Token};
use crate::symbol::Symbol;
use crate::symbol::{sym, Symbol};
use crate::parse::unescape;
use crate::parse::unescape_error_reporting::{emit_unescape_error, push_escaped_char};
@@ -754,7 +754,7 @@ impl<'a> StringReader<'a> {
}
_ => {
// just a 0
return (token::Integer, self.name_from(start_bpos));
return (token::Integer, sym::integer(0));
}
}
} else if c.is_digit(10) {