mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-19 15:41:36 +03:00
consistent keyword order and names
This commit is contained in:
parent
bac54b21de
commit
1adc8cee14
File diff suppressed because it is too large
Load Diff
@ -323,6 +323,7 @@ impl Token {
|
|||||||
"as" => Token::As,
|
"as" => Token::As,
|
||||||
"bool" => Token::Bool,
|
"bool" => Token::Bool,
|
||||||
"circuit" => Token::Circuit,
|
"circuit" => Token::Circuit,
|
||||||
|
"console" => Token::Console,
|
||||||
"const" => Token::Const,
|
"const" => Token::Const,
|
||||||
"else" => Token::Else,
|
"else" => Token::Else,
|
||||||
"false" => Token::False,
|
"false" => Token::False,
|
||||||
@ -330,11 +331,11 @@ impl Token {
|
|||||||
"for" => Token::For,
|
"for" => Token::For,
|
||||||
"function" => Token::Function,
|
"function" => Token::Function,
|
||||||
"group" => Token::Group,
|
"group" => Token::Group,
|
||||||
"i128" => Token::I128,
|
|
||||||
"i64" => Token::I64,
|
|
||||||
"i32" => Token::I32,
|
|
||||||
"i16" => Token::I16,
|
|
||||||
"i8" => Token::I8,
|
"i8" => Token::I8,
|
||||||
|
"i16" => Token::I16,
|
||||||
|
"i32" => Token::I32,
|
||||||
|
"i64" => Token::I64,
|
||||||
|
"i128" => Token::I128,
|
||||||
"if" => Token::If,
|
"if" => Token::If,
|
||||||
"import" => Token::Import,
|
"import" => Token::Import,
|
||||||
"in" => Token::In,
|
"in" => Token::In,
|
||||||
@ -342,17 +343,16 @@ impl Token {
|
|||||||
"let" => Token::Let,
|
"let" => Token::Let,
|
||||||
"mut" => Token::Mut,
|
"mut" => Token::Mut,
|
||||||
"return" => Token::Return,
|
"return" => Token::Return,
|
||||||
"static" => Token::Static,
|
|
||||||
"string" => Token::Str,
|
|
||||||
"true" => Token::True,
|
|
||||||
"u128" => Token::U128,
|
|
||||||
"u64" => Token::U64,
|
|
||||||
"u32" => Token::U32,
|
|
||||||
"u16" => Token::U16,
|
|
||||||
"u8" => Token::U8,
|
|
||||||
"Self" => Token::BigSelf,
|
"Self" => Token::BigSelf,
|
||||||
"self" => Token::LittleSelf,
|
"self" => Token::LittleSelf,
|
||||||
"console" => Token::Console,
|
"static" => Token::Static,
|
||||||
|
"string" => Token::String,
|
||||||
|
"true" => Token::True,
|
||||||
|
"u8" => Token::U8,
|
||||||
|
"u16" => Token::U16,
|
||||||
|
"u32" => Token::U32,
|
||||||
|
"u64" => Token::U64,
|
||||||
|
"u128" => Token::U128,
|
||||||
_ => Token::Ident(ident),
|
_ => Token::Ident(ident),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
@ -36,12 +36,13 @@ impl fmt::Display for FormattedStringPart {
|
|||||||
/// Represents all valid Leo syntax tokens.
|
/// Represents all valid Leo syntax tokens.
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub enum Token {
|
pub enum Token {
|
||||||
|
CommentLine(String),
|
||||||
|
CommentBlock(String),
|
||||||
|
|
||||||
FormattedString(Vec<FormattedStringPart>),
|
FormattedString(Vec<FormattedStringPart>),
|
||||||
AddressLit(String),
|
AddressLit(String),
|
||||||
Ident(String),
|
Ident(String),
|
||||||
Int(String),
|
Int(String),
|
||||||
CommentLine(String),
|
|
||||||
CommentBlock(String),
|
|
||||||
Not,
|
Not,
|
||||||
NotEq,
|
NotEq,
|
||||||
And,
|
And,
|
||||||
@ -98,7 +99,7 @@ pub enum Token {
|
|||||||
Mut,
|
Mut,
|
||||||
Return,
|
Return,
|
||||||
Static,
|
Static,
|
||||||
Str,
|
String,
|
||||||
True,
|
True,
|
||||||
U128,
|
U128,
|
||||||
U64,
|
U64,
|
||||||
@ -137,6 +138,7 @@ pub const KEYWORD_TOKENS: &[Token] = &[
|
|||||||
Token::As,
|
Token::As,
|
||||||
Token::Bool,
|
Token::Bool,
|
||||||
Token::Circuit,
|
Token::Circuit,
|
||||||
|
Token::Console,
|
||||||
Token::Const,
|
Token::Const,
|
||||||
Token::Else,
|
Token::Else,
|
||||||
Token::False,
|
Token::False,
|
||||||
@ -144,11 +146,11 @@ pub const KEYWORD_TOKENS: &[Token] = &[
|
|||||||
Token::For,
|
Token::For,
|
||||||
Token::Function,
|
Token::Function,
|
||||||
Token::Group,
|
Token::Group,
|
||||||
Token::I128,
|
|
||||||
Token::I64,
|
|
||||||
Token::I32,
|
|
||||||
Token::I16,
|
|
||||||
Token::I8,
|
Token::I8,
|
||||||
|
Token::I16,
|
||||||
|
Token::I32,
|
||||||
|
Token::I64,
|
||||||
|
Token::I128,
|
||||||
Token::If,
|
Token::If,
|
||||||
Token::Import,
|
Token::Import,
|
||||||
Token::In,
|
Token::In,
|
||||||
@ -156,17 +158,16 @@ pub const KEYWORD_TOKENS: &[Token] = &[
|
|||||||
Token::Let,
|
Token::Let,
|
||||||
Token::Mut,
|
Token::Mut,
|
||||||
Token::Return,
|
Token::Return,
|
||||||
Token::Static,
|
|
||||||
Token::Str,
|
|
||||||
Token::True,
|
|
||||||
Token::U128,
|
|
||||||
Token::U64,
|
|
||||||
Token::U32,
|
|
||||||
Token::U16,
|
|
||||||
Token::U8,
|
|
||||||
Token::BigSelf,
|
Token::BigSelf,
|
||||||
Token::LittleSelf,
|
Token::LittleSelf,
|
||||||
Token::Console,
|
Token::Static,
|
||||||
|
Token::String,
|
||||||
|
Token::True,
|
||||||
|
Token::U8,
|
||||||
|
Token::U16,
|
||||||
|
Token::U32,
|
||||||
|
Token::U64,
|
||||||
|
Token::U128,
|
||||||
];
|
];
|
||||||
|
|
||||||
impl Token {
|
impl Token {
|
||||||
@ -251,7 +252,7 @@ impl fmt::Display for Token {
|
|||||||
Mut => write!(f, "mut"),
|
Mut => write!(f, "mut"),
|
||||||
Return => write!(f, "return"),
|
Return => write!(f, "return"),
|
||||||
Static => write!(f, "static"),
|
Static => write!(f, "static"),
|
||||||
Str => write!(f, "string"),
|
String => write!(f, "string"),
|
||||||
True => write!(f, "true"),
|
True => write!(f, "true"),
|
||||||
U128 => write!(f, "u128"),
|
U128 => write!(f, "u128"),
|
||||||
U64 => write!(f, "u64"),
|
U64 => write!(f, "u64"),
|
||||||
|
Loading…
Reference in New Issue
Block a user