mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-24 07:48:04 +03:00
Add "Future", "Await", "Async", remove "Finalize", "then" tokens
This commit is contained in:
parent
acdb2b5c9b
commit
863a54391c
@ -384,6 +384,7 @@ impl Token {
|
||||
"assert" => Token::Assert,
|
||||
"assert_eq" => Token::AssertEq,
|
||||
"assert_neq" => Token::AssertNeq,
|
||||
"async" => Token::Async,
|
||||
"block" => Token::Block,
|
||||
"bool" => Token::Bool,
|
||||
"console" => Token::Console,
|
||||
@ -392,7 +393,7 @@ impl Token {
|
||||
"else" => Token::Else,
|
||||
"false" => Token::False,
|
||||
"field" => Token::Field,
|
||||
"finalize" => Token::Finalize,
|
||||
"future" => Token::Future,
|
||||
"for" => Token::For,
|
||||
"function" => Token::Function,
|
||||
"group" => Token::Group,
|
||||
@ -418,7 +419,6 @@ impl Token {
|
||||
"self" => Token::SelfLower,
|
||||
"string" => Token::String,
|
||||
"struct" => Token::Struct,
|
||||
"then" => Token::Then,
|
||||
"transition" => Token::Transition,
|
||||
"true" => Token::True,
|
||||
"u8" => Token::U8,
|
||||
|
@ -93,9 +93,9 @@ mod tests {
|
||||
else
|
||||
false
|
||||
field
|
||||
finalize
|
||||
for
|
||||
function
|
||||
future
|
||||
group
|
||||
i128
|
||||
i64
|
||||
@ -118,7 +118,6 @@ mod tests {
|
||||
string
|
||||
struct
|
||||
test
|
||||
then
|
||||
transition
|
||||
true
|
||||
u128
|
||||
@ -170,7 +169,7 @@ mod tests {
|
||||
|
||||
assert_eq!(
|
||||
output,
|
||||
r#""test" "test{}test" "test{}" "{}test" "test{" "test}" "test{test" "test}test" "te{{}}" test_ident 12345 address as assert assert_eq assert_neq async bool const else false field finalize for function group i128 i64 i32 i16 i8 if in inline input let mut private program public return scalar self signature string struct test then transition true u128 u64 u32 u16 u8 console ! != && ( ) * ** + , - -> => _ . .. / : ; < <= = == > >= [ ] { { } } || ? @ // test
|
||||
r#""test" "test{}test" "test{}" "{}test" "test{" "test}" "test{test" "test}test" "te{{}}" test_ident 12345 address as assert assert_eq assert_neq async bool const else false field for function future group i128 i64 i32 i16 i8 if in inline input let mut private program public return scalar self signature string struct test transition true u128 u64 u32 u16 u8 console ! != && ( ) * ** + , - -> => _ . .. / : ; < <= = == > >= [ ] { { } } || ? @ // test
|
||||
/* test */ // "#
|
||||
);
|
||||
});
|
||||
|
@ -113,13 +113,14 @@ pub enum Token {
|
||||
Assert,
|
||||
AssertEq,
|
||||
AssertNeq,
|
||||
Async,
|
||||
Console,
|
||||
Const,
|
||||
Constant,
|
||||
Else,
|
||||
Finalize,
|
||||
For,
|
||||
Function,
|
||||
Future,
|
||||
If,
|
||||
Import,
|
||||
In,
|
||||
@ -134,7 +135,6 @@ pub enum Token {
|
||||
Return,
|
||||
SelfLower,
|
||||
Struct,
|
||||
Then,
|
||||
Transition,
|
||||
|
||||
// Meta Tokens
|
||||
@ -155,6 +155,7 @@ pub const KEYWORD_TOKENS: &[Token] = &[
|
||||
Token::Assert,
|
||||
Token::AssertEq,
|
||||
Token::AssertNeq,
|
||||
Token::Async,
|
||||
Token::Bool,
|
||||
Token::Console,
|
||||
Token::Const,
|
||||
@ -162,9 +163,9 @@ pub const KEYWORD_TOKENS: &[Token] = &[
|
||||
Token::Else,
|
||||
Token::False,
|
||||
Token::Field,
|
||||
Token::Finalize,
|
||||
Token::For,
|
||||
Token::Function,
|
||||
Token::Future,
|
||||
Token::Group,
|
||||
Token::I8,
|
||||
Token::I16,
|
||||
@ -187,7 +188,6 @@ pub const KEYWORD_TOKENS: &[Token] = &[
|
||||
Token::Scalar,
|
||||
Token::String,
|
||||
Token::Struct,
|
||||
Token::Then,
|
||||
Token::Transition,
|
||||
Token::True,
|
||||
Token::U8,
|
||||
@ -220,7 +220,6 @@ impl Token {
|
||||
Token::Else => sym::Else,
|
||||
Token::False => sym::False,
|
||||
Token::Field => sym::field,
|
||||
Token::Finalize => sym::finalize,
|
||||
Token::For => sym::For,
|
||||
Token::Function => sym::function,
|
||||
Token::Group => sym::group,
|
||||
@ -246,7 +245,6 @@ impl Token {
|
||||
Token::SelfLower => sym::SelfLower,
|
||||
Token::String => sym::string,
|
||||
Token::Struct => sym::Struct,
|
||||
Token::Then => sym::then,
|
||||
Token::Transition => sym::transition,
|
||||
Token::True => sym::True,
|
||||
Token::U8 => sym::u8,
|
||||
@ -349,13 +347,14 @@ impl fmt::Display for Token {
|
||||
Assert => write!(f, "assert"),
|
||||
AssertEq => write!(f, "assert_eq"),
|
||||
AssertNeq => write!(f, "assert_neq"),
|
||||
Async => write!(f, "async"),
|
||||
Console => write!(f, "console"),
|
||||
Const => write!(f, "const"),
|
||||
Constant => write!(f, "constant"),
|
||||
Else => write!(f, "else"),
|
||||
Finalize => write!(f, "finalize"),
|
||||
For => write!(f, "for"),
|
||||
Function => write!(f, "function"),
|
||||
Future => write!(f, "future"),
|
||||
If => write!(f, "if"),
|
||||
Import => write!(f, "import"),
|
||||
In => write!(f, "in"),
|
||||
@ -368,7 +367,6 @@ impl fmt::Display for Token {
|
||||
Return => write!(f, "return"),
|
||||
SelfLower => write!(f, "self"),
|
||||
Struct => write!(f, "struct"),
|
||||
Then => write!(f, "then"),
|
||||
Transition => write!(f, "transition"),
|
||||
Block => write!(f, "block"),
|
||||
Leo => write!(f, "leo"),
|
||||
|
@ -202,6 +202,7 @@ symbols! {
|
||||
to_x_coordinate,
|
||||
to_y_coordinate,
|
||||
verify,
|
||||
Await: "await",
|
||||
|
||||
// types
|
||||
address,
|
||||
@ -213,6 +214,7 @@ symbols! {
|
||||
i32,
|
||||
i64,
|
||||
i128,
|
||||
Future: "future",
|
||||
record,
|
||||
scalar,
|
||||
signature,
|
||||
|
Loading…
Reference in New Issue
Block a user