added float and as
This commit is contained in:
+9
-1
@@ -72,7 +72,7 @@ const SYNTAX: [Node; 14] = [
|
||||
},
|
||||
Node {
|
||||
token_type: TokenType::Keyword,
|
||||
token_regex: Lazy::new(|| Regex::new(r"^(mut|try|catch|return|fn|let|use|cb|struct|impl|for|in)\b").unwrap())
|
||||
token_regex: Lazy::new(|| Regex::new(r"^(mut|try|catch|return|fn|let|use|cb|struct|impl|for|in|as)\b").unwrap())
|
||||
},
|
||||
Node {
|
||||
token_type: TokenType::Identifier,
|
||||
@@ -386,6 +386,14 @@ pub fn lex(mut code: &str, use_whitespace: bool, state: LexerState) -> Result<Ve
|
||||
column: state.column
|
||||
});
|
||||
}
|
||||
"float" => {
|
||||
tokens.push(Token {
|
||||
token_type: s.token_type,
|
||||
value: "f32".to_string(),
|
||||
line: state.line,
|
||||
column: state.column
|
||||
});
|
||||
}
|
||||
_ => {
|
||||
tokens.push(Token {
|
||||
token_type: s.token_type,
|
||||
|
||||
Reference in New Issue
Block a user