Lex interpolations
This commit is contained in:
parent
fd423ce300
commit
77d5c8ea2e
11
src/lexer.rs
11
src/lexer.rs
@ -57,7 +57,7 @@ impl<'a> Iterator for Lexer<'a> {
|
|||||||
self.buf.next();
|
self.buf.next();
|
||||||
TokenKind::Whitespace(Whitespace::CarriageReturn)
|
TokenKind::Whitespace(Whitespace::CarriageReturn)
|
||||||
}
|
}
|
||||||
'#' => symbol!(self, Hash),
|
'#' => self.lex_hash(),
|
||||||
'{' => symbol!(self, OpenBrace),
|
'{' => symbol!(self, OpenBrace),
|
||||||
'*' => symbol!(self, Mul),
|
'*' => symbol!(self, Mul),
|
||||||
'}' => symbol!(self, CloseBrace),
|
'}' => symbol!(self, CloseBrace),
|
||||||
@ -204,7 +204,14 @@ impl<'a> Lexer<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn lex_hash(&mut self) -> TokenKind {
|
fn lex_hash(&mut self) -> TokenKind {
|
||||||
todo!()
|
self.buf.next();
|
||||||
|
self.pos.next_char();
|
||||||
|
if self.buf.peek() == Some(&'{') {
|
||||||
|
self.buf.next();
|
||||||
|
self.pos.next_char();
|
||||||
|
return TokenKind::Interpolation;
|
||||||
|
}
|
||||||
|
TokenKind::Symbol(Symbol::Hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lex_attr(&mut self) -> TokenKind {
|
fn lex_attr(&mut self) -> TokenKind {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user