remove uneeded circuit syms

This commit is contained in:
gluax 2022-03-28 06:53:22 -07:00
parent 414e288735
commit 7ad500b344
13 changed files with 12 additions and 46 deletions

View File

@ -244,7 +244,7 @@ impl Token {
if input.next_if_eq(&'&').is_some() { if input.next_if_eq(&'&').is_some() {
return Ok((2, Token::And)); return Ok((2, Token::And));
} }
return Ok((1, Token::Ampersand)); return Err(ParserError::lexer_empty_input_tendril().into());
} }
Some('(') => { Some('(') => {
input.next(); input.next();
@ -436,7 +436,6 @@ impl Token {
"let" => Token::Let, "let" => Token::Let,
"mut" => Token::Mut, "mut" => Token::Mut,
"return" => Token::Return, "return" => Token::Return,
"static" => Token::Static,
"true" => Token::True, "true" => Token::True,
"type" => Token::Type, "type" => Token::Type,
"u8" => Token::U8, "u8" => Token::U8,

View File

@ -145,9 +145,7 @@ mod tests {
input input
let let
mut mut
&
return return
static
string string
test test
true true
@ -156,8 +154,6 @@ mod tests {
u32 u32
u16 u16
u8 u8
self
Self
console console
! !
!= !=
@ -209,7 +205,7 @@ mod tests {
assert_eq!( assert_eq!(
output, output,
r#"'a' '😭' "test" "test{}test" "test{}" "{}test" "test{" "test}" "test{test" "test}test" "te{{}}" aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 test_ident 12345 address as bool circuit const else false field for function group i128 i64 i32 i16 i8 if import in input let mut & return static string test true u128 u64 u32 u16 u8 self Self console ! != && ( ) * ** **= *= + += , - -= -> _ . .. ... / /= : :: ; < <= = == > >= @ [ ] { { } } || ? // test r#"'a' '😭' "test" "test{}test" "test{}" "{}test" "test{" "test}" "test{test" "test}test" "te{{}}" aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 test_ident 12345 address as bool circuit const else false field for function group i128 i64 i32 i16 i8 if import in input let mut return string test true u128 u64 u32 u16 u8 console ! != && ( ) * ** **= *= + += , - -= -> _ . .. ... / /= : :: ; < <= = == > >= @ [ ] { { } } || ? // test
/* test */ // "# /* test */ // "#
); );
}); });

View File

@ -135,11 +135,7 @@ pub enum Token {
In, In,
Let, Let,
Mut, Mut,
/// Represents `&`.
/// Used for `Reference` and `BitAnd`.
Ampersand,
Return, Return,
Static,
Type, Type,
// Meta Tokens // Meta Tokens
@ -171,9 +167,7 @@ pub const KEYWORD_TOKENS: &[Token] = &[
Token::Input, Token::Input,
Token::Let, Token::Let,
Token::Mut, Token::Mut,
Token::Ampersand,
Token::Return, Token::Return,
Token::Static,
Token::True, Token::True,
Token::Type, Token::Type,
Token::U8, Token::U8,
@ -216,9 +210,7 @@ impl Token {
Token::Input => sym::input, Token::Input => sym::input,
Token::Let => sym::Let, Token::Let => sym::Let,
Token::Mut => sym::Mut, Token::Mut => sym::Mut,
Token::Ampersand => sym::Ampersand,
Token::Return => sym::Return, Token::Return => sym::Return,
Token::Static => sym::Static,
Token::True => sym::True, Token::True => sym::True,
Token::Type => sym::Type, Token::Type => sym::Type,
Token::U8 => sym::u8, Token::U8 => sym::u8,
@ -321,9 +313,7 @@ impl fmt::Display for Token {
In => write!(f, "in"), In => write!(f, "in"),
Let => write!(f, "let"), Let => write!(f, "let"),
Mut => write!(f, "mut"), Mut => write!(f, "mut"),
Ampersand => write!(f, "&"), // Used for `Reference` and `BitAnd`
Return => write!(f, "return"), Return => write!(f, "return"),
Static => write!(f, "static"),
Type => write!(f, "type"), Type => write!(f, "type"),
Eof => write!(f, ""), Eof => write!(f, ""),
} }

View File

@ -101,7 +101,6 @@ macro_rules! symbols {
symbols! { symbols! {
address, address,
AlwaysConst, AlwaysConst,
Ampersand: "&",
array, array,
As: "as", As: "as",
assert, assert,
@ -138,7 +137,6 @@ symbols! {
Return: "return", Return: "return",
Star: "*", Star: "*",
std, std,
Static: "static",
Struct: "struct", Struct: "struct",
test, test,
True: "true", True: "true",

View File

@ -62,8 +62,6 @@ outputs:
- "Error [EPAR0370030]: Could not lex the following content: `~`." - "Error [EPAR0370030]: Could not lex the following content: `~`."
- "Error [EPAR0370030]: Could not lex the following content: `~`." - "Error [EPAR0370030]: Could not lex the following content: `~`."
- "Error [EPAR0370030]: Could not lex the following content: `~`." - "Error [EPAR0370030]: Could not lex the following content: `~`."
- "Error [EPAR0370030]: Could not lex the following content: `~`."
- "Error [EPAR0370030]: Could not lex the following content: `~`."
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'import'\n --> test:1:1\n |\n 1 | import\n | ^^^^^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'import'\n --> test:1:1\n |\n 1 | import\n | ^^^^^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'as'\n --> test:1:1\n |\n 1 | as\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'as'\n --> test:1:1\n |\n 1 | as\n | ^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'console'\n --> test:1:1\n |\n 1 | console\n | ^^^^^^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'console'\n --> test:1:1\n |\n 1 | console\n | ^^^^^^^"
@ -75,7 +73,6 @@ outputs:
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'in'\n --> test:1:1\n |\n 1 | in\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'in'\n --> test:1:1\n |\n 1 | in\n | ^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'let'\n --> test:1:1\n |\n 1 | let\n | ^^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'let'\n --> test:1:1\n |\n 1 | let\n | ^^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'mut'\n --> test:1:1\n |\n 1 | mut\n | ^^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'mut'\n --> test:1:1\n |\n 1 | mut\n | ^^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '&'\n --> test:1:1\n |\n 1 | &\n | ^" - "Error [EPAR0370023]: Expected more characters to lex but found none."
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'return'\n --> test:1:1\n |\n 1 | return\n | ^^^^^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'return'\n --> test:1:1\n |\n 1 | return\n | ^^^^^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'static'\n --> test:1:1\n |\n 1 | static\n | ^^^^^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'type'\n --> test:1:1\n |\n 1 | type\n | ^^^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'type'\n --> test:1:1\n |\n 1 | type\n | ^^^^"

View File

@ -41,7 +41,7 @@ outputs:
- "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | u32 x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | u32 x = 10u8;\n | ^"
- "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | u64 x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | u64 x = 10u8;\n | ^"
- "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | u128 x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | u128 x = 10u8;\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '&'\n --> test:1:1\n |\n 1 | & x = 10u8;\n | ^" - "Error [EPAR0370023]: Expected more characters to lex but found none."
- "Error [EPAR0370005]: expected ; -- got '='\n --> test:1:10\n |\n 1 | return x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got '='\n --> test:1:10\n |\n 1 | return x = 10u8;\n | ^"
- "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | self x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | self x = 10u8;\n | ^"
- "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | Self x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | Self x = 10u8;\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Parse namespace: Parse
expectation: Fail expectation: Fail
outputs: outputs:
- "Error [EPAR0370005]: expected 'import', 'function', 'test', '@' -- got 'circuit'\n --> test:3:1\n |\n 3 | circuit ;\n | ^^^^^^^" - "Error [EPAR0370023]: Expected more characters to lex but found none."

View File

@ -48,7 +48,7 @@ outputs:
- "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_u32\n | ^" - "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_u32\n | ^"
- "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_u64\n | ^" - "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_u64\n | ^"
- "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_u128\n | ^" - "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_u128\n | ^"
- "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_&\n | ^" - "Error [EPAR0370023]: Expected more characters to lex but found none."
- "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_return\n | ^" - "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_return\n | ^"
- "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_self\n | ^" - "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_self\n | ^"
- "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_Self\n | ^" - "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_Self\n | ^"

View File

@ -47,7 +47,7 @@ outputs:
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 u32 {}\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 u32 {}\n | ^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 u64 {}\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 u64 {}\n | ^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 u128 {}\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 u128 {}\n | ^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 & {}\n | ^^" - "Error [EPAR0370023]: Expected more characters to lex but found none."
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 return {}\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 return {}\n | ^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 self {}\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 self {}\n | ^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 Self {}\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 Self {}\n | ^^"

View File

@ -47,10 +47,10 @@ outputs:
- "Error [EPAR0370009]: unexpected string: expected 'ident', got 'u32'\n --> test:1:4\n |\n 1 | x::u32\n | ^^^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'u32'\n --> test:1:4\n |\n 1 | x::u32\n | ^^^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got 'u64'\n --> test:1:4\n |\n 1 | x::u64\n | ^^^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'u64'\n --> test:1:4\n |\n 1 | x::u64\n | ^^^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got 'u128'\n --> test:1:4\n |\n 1 | x::u128\n | ^^^^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'u128'\n --> test:1:4\n |\n 1 | x::u128\n | ^^^^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got '&'\n --> test:1:4\n |\n 1 | x::&\n | ^" - "Error [EPAR0370023]: Expected more characters to lex but found none."
- "Error [EPAR0370009]: unexpected string: expected 'ident', got 'return'\n --> test:1:4\n |\n 1 | x::return\n | ^^^^^^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'return'\n --> test:1:4\n |\n 1 | x::return\n | ^^^^^^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got 'self'\n --> test:1:4\n |\n 1 | x::self\n | ^^^^" - "Error [EPAR0370003]: unexpected EOF\n --> test:1:4\n |\n 1 | x::self\n | ^^^^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got 'Self'\n --> test:1:4\n |\n 1 | x::Self\n | ^^^^" - "Error [EPAR0370003]: unexpected EOF\n --> test:1:4\n |\n 1 | x::Self\n | ^^^^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got 'true'\n --> test:1:4\n |\n 1 | x::true\n | ^^^^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'true'\n --> test:1:4\n |\n 1 | x::true\n | ^^^^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got 'false'\n --> test:1:4\n |\n 1 | x::false\n | ^^^^^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'false'\n --> test:1:4\n |\n 1 | x::false\n | ^^^^^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:4\n |\n 1 | x::0\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:4\n |\n 1 | x::0\n | ^"

View File

@ -33,7 +33,7 @@ outputs:
- "Error [EPAR0370005]: expected ; -- got 'u32'\n --> test:1:11\n |\n 1 | let x = a u32 b;\n | ^^^" - "Error [EPAR0370005]: expected ; -- got 'u32'\n --> test:1:11\n |\n 1 | let x = a u32 b;\n | ^^^"
- "Error [EPAR0370005]: expected ; -- got 'u64'\n --> test:1:11\n |\n 1 | let x = a u64 b;\n | ^^^" - "Error [EPAR0370005]: expected ; -- got 'u64'\n --> test:1:11\n |\n 1 | let x = a u64 b;\n | ^^^"
- "Error [EPAR0370005]: expected ; -- got 'u128'\n --> test:1:11\n |\n 1 | let x = a u128 b;\n | ^^^^" - "Error [EPAR0370005]: expected ; -- got 'u128'\n --> test:1:11\n |\n 1 | let x = a u128 b;\n | ^^^^"
- "Error [EPAR0370005]: expected ; -- got '&'\n --> test:1:11\n |\n 1 | let x = a & b;\n | ^" - "Error [EPAR0370023]: Expected more characters to lex but found none."
- "Error [EPAR0370005]: expected ; -- got 'return'\n --> test:1:11\n |\n 1 | let x = a return b;\n | ^^^^^^" - "Error [EPAR0370005]: expected ; -- got 'return'\n --> test:1:11\n |\n 1 | let x = a return b;\n | ^^^^^^"
- "Error [EPAR0370005]: expected ; -- got 'self'\n --> test:1:11\n |\n 1 | let x = a self b;\n | ^^^^" - "Error [EPAR0370005]: expected ; -- got 'self'\n --> test:1:11\n |\n 1 | let x = a self b;\n | ^^^^"
- "Error [EPAR0370005]: expected ; -- got 'Self'\n --> test:1:11\n |\n 1 | let x = a Self b;\n | ^^^^" - "Error [EPAR0370005]: expected ; -- got 'Self'\n --> test:1:11\n |\n 1 | let x = a Self b;\n | ^^^^"
@ -56,4 +56,4 @@ outputs:
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x>==b;\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x>==b;\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x<==b;\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x<==b;\n | ^"
- "Error [EPAR0370005]: expected ; -- got '..'\n --> test:1:2\n |\n 1 | x..=b;\n | ^^" - "Error [EPAR0370005]: expected ; -- got '..'\n --> test:1:2\n |\n 1 | x..=b;\n | ^^"
- "Error [EPAR0370005]: expected ; -- got '&'\n --> test:1:2\n |\n 1 | x&=b;\n | ^" - "Error [EPAR0370023]: Expected more characters to lex but found none."

View File

@ -121,12 +121,8 @@ address ~
char ~ char ~
Self ~
input ~ input ~
self ~
import import
as as
@ -153,6 +149,4 @@ mut
return return
static
type type

View File

@ -1,8 +0,0 @@
/*
namespace: Parse
expectation: Pass
*/
function x(const self) {
return ();
}