consistent keyword order and names

This commit is contained in:
gluax 2021-03-23 12:11:42 -04:00
parent bac54b21de
commit 1adc8cee14
3 changed files with 1120 additions and 1119 deletions

File diff suppressed because it is too large Load Diff

View File

@ -323,6 +323,7 @@ impl Token {
"as" => Token::As,
"bool" => Token::Bool,
"circuit" => Token::Circuit,
"console" => Token::Console,
"const" => Token::Const,
"else" => Token::Else,
"false" => Token::False,
@ -330,11 +331,11 @@ impl Token {
"for" => Token::For,
"function" => Token::Function,
"group" => Token::Group,
"i128" => Token::I128,
"i64" => Token::I64,
"i32" => Token::I32,
"i16" => Token::I16,
"i8" => Token::I8,
"i16" => Token::I16,
"i32" => Token::I32,
"i64" => Token::I64,
"i128" => Token::I128,
"if" => Token::If,
"import" => Token::Import,
"in" => Token::In,
@ -342,17 +343,16 @@ impl Token {
"let" => Token::Let,
"mut" => Token::Mut,
"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::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),
}),
);

View File

@ -36,12 +36,13 @@ impl fmt::Display for FormattedStringPart {
/// Represents all valid Leo syntax tokens.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Token {
CommentLine(String),
CommentBlock(String),
FormattedString(Vec<FormattedStringPart>),
AddressLit(String),
Ident(String),
Int(String),
CommentLine(String),
CommentBlock(String),
Not,
NotEq,
And,
@ -98,7 +99,7 @@ pub enum Token {
Mut,
Return,
Static,
Str,
String,
True,
U128,
U64,
@ -137,6 +138,7 @@ pub const KEYWORD_TOKENS: &[Token] = &[
Token::As,
Token::Bool,
Token::Circuit,
Token::Console,
Token::Const,
Token::Else,
Token::False,
@ -144,11 +146,11 @@ pub const KEYWORD_TOKENS: &[Token] = &[
Token::For,
Token::Function,
Token::Group,
Token::I128,
Token::I64,
Token::I32,
Token::I16,
Token::I8,
Token::I16,
Token::I32,
Token::I64,
Token::I128,
Token::If,
Token::Import,
Token::In,
@ -156,17 +158,16 @@ pub const KEYWORD_TOKENS: &[Token] = &[
Token::Let,
Token::Mut,
Token::Return,
Token::Static,
Token::Str,
Token::True,
Token::U128,
Token::U64,
Token::U32,
Token::U16,
Token::U8,
Token::BigSelf,
Token::LittleSelf,
Token::Console,
Token::Static,
Token::String,
Token::True,
Token::U8,
Token::U16,
Token::U32,
Token::U64,
Token::U128,
];
impl Token {
@ -251,7 +252,7 @@ impl fmt::Display for Token {
Mut => write!(f, "mut"),
Return => write!(f, "return"),
Static => write!(f, "static"),
Str => write!(f, "string"),
String => write!(f, "string"),
True => write!(f, "true"),
U128 => write!(f, "u128"),
U64 => write!(f, "u64"),