@ -67,7 +67,12 @@ impl Iterator for Lexer<'_> {
'/' = > self . token_ok ( token ::Kind ::Slash ) ,
'/' = > self . token_ok ( token ::Kind ::Slash ) ,
'%' = > self . token_ok ( token ::Kind ::Percent ) ,
'%' = > self . token_ok ( token ::Kind ::Percent ) ,
'#' = > self . read_comment ( ) ,
'#' = > {
self . read_comment ( ) ;
// we don't need comments for now and they would
// only confuse the parser so let's just Not
self . next ( ) ?
}
'"' = > self . read_string_literal ( ) ,
'"' = > self . read_string_literal ( ) ,
'0' = > self . read_prefix_int_literal ( ) ,
'0' = > self . read_prefix_int_literal ( ) ,
_c @ '1' ..= '9' = > self . read_int_literal ( 10 ) ,
_c @ '1' ..= '9' = > self . read_int_literal ( 10 ) ,
@ -158,6 +163,7 @@ impl<'a> Lexer<'a> {
self . cursor . chop ( ) ;
self . cursor . chop ( ) ;
let mut raw = String ::new ( ) ;
let mut raw = String ::new ( ) ;
for c in & mut self . cursor {
for c in & mut self . cursor {
// TODO: string escape sequences are a thing
if c = = '"' {
if c = = '"' {
self . cursor . chop ( ) ;
self . cursor . chop ( ) ;
return self . token_raw_ok ( token ::Kind ::StringLiteral , raw ) ;
return self . token_raw_ok ( token ::Kind ::StringLiteral , raw ) ;