mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-23 18:21:38 +03:00
remove uneeded circuit syms
This commit is contained in:
parent
414e288735
commit
7ad500b344
@ -244,7 +244,7 @@ impl Token {
|
||||
if input.next_if_eq(&'&').is_some() {
|
||||
return Ok((2, Token::And));
|
||||
}
|
||||
return Ok((1, Token::Ampersand));
|
||||
return Err(ParserError::lexer_empty_input_tendril().into());
|
||||
}
|
||||
Some('(') => {
|
||||
input.next();
|
||||
@ -436,7 +436,6 @@ impl Token {
|
||||
"let" => Token::Let,
|
||||
"mut" => Token::Mut,
|
||||
"return" => Token::Return,
|
||||
"static" => Token::Static,
|
||||
"true" => Token::True,
|
||||
"type" => Token::Type,
|
||||
"u8" => Token::U8,
|
||||
|
@ -145,9 +145,7 @@ mod tests {
|
||||
input
|
||||
let
|
||||
mut
|
||||
&
|
||||
return
|
||||
static
|
||||
string
|
||||
test
|
||||
true
|
||||
@ -156,8 +154,6 @@ mod tests {
|
||||
u32
|
||||
u16
|
||||
u8
|
||||
self
|
||||
Self
|
||||
console
|
||||
!
|
||||
!=
|
||||
@ -209,7 +205,7 @@ mod tests {
|
||||
|
||||
assert_eq!(
|
||||
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 */ // "#
|
||||
);
|
||||
});
|
||||
|
@ -135,11 +135,7 @@ pub enum Token {
|
||||
In,
|
||||
Let,
|
||||
Mut,
|
||||
/// Represents `&`.
|
||||
/// Used for `Reference` and `BitAnd`.
|
||||
Ampersand,
|
||||
Return,
|
||||
Static,
|
||||
Type,
|
||||
|
||||
// Meta Tokens
|
||||
@ -171,9 +167,7 @@ pub const KEYWORD_TOKENS: &[Token] = &[
|
||||
Token::Input,
|
||||
Token::Let,
|
||||
Token::Mut,
|
||||
Token::Ampersand,
|
||||
Token::Return,
|
||||
Token::Static,
|
||||
Token::True,
|
||||
Token::Type,
|
||||
Token::U8,
|
||||
@ -216,9 +210,7 @@ impl Token {
|
||||
Token::Input => sym::input,
|
||||
Token::Let => sym::Let,
|
||||
Token::Mut => sym::Mut,
|
||||
Token::Ampersand => sym::Ampersand,
|
||||
Token::Return => sym::Return,
|
||||
Token::Static => sym::Static,
|
||||
Token::True => sym::True,
|
||||
Token::Type => sym::Type,
|
||||
Token::U8 => sym::u8,
|
||||
@ -321,9 +313,7 @@ impl fmt::Display for Token {
|
||||
In => write!(f, "in"),
|
||||
Let => write!(f, "let"),
|
||||
Mut => write!(f, "mut"),
|
||||
Ampersand => write!(f, "&"), // Used for `Reference` and `BitAnd`
|
||||
Return => write!(f, "return"),
|
||||
Static => write!(f, "static"),
|
||||
Type => write!(f, "type"),
|
||||
Eof => write!(f, ""),
|
||||
}
|
||||
|
@ -101,7 +101,6 @@ macro_rules! symbols {
|
||||
symbols! {
|
||||
address,
|
||||
AlwaysConst,
|
||||
Ampersand: "&",
|
||||
array,
|
||||
As: "as",
|
||||
assert,
|
||||
@ -138,7 +137,6 @@ symbols! {
|
||||
Return: "return",
|
||||
Star: "*",
|
||||
std,
|
||||
Static: "static",
|
||||
Struct: "struct",
|
||||
test,
|
||||
True: "true",
|
||||
|
@ -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 [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 '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 '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 '&'\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 '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 | ^^^^"
|
||||
|
@ -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 | u64 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 '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 | ^"
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
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."
|
||||
|
@ -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_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_&\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_self\n | ^"
|
||||
- "Error [EPAR0370005]: expected ; -- got '_'\n --> test:1:4\n |\n 1 | x.0_Self\n | ^"
|
||||
|
@ -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 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 & {}\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 self {}\n | ^^"
|
||||
- "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 Self {}\n | ^^"
|
||||
|
@ -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 '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 '&'\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 'self'\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 [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 '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 | ^"
|
||||
|
@ -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 '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 '&'\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 '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 [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."
|
||||
|
@ -121,12 +121,8 @@ address ~
|
||||
|
||||
char ~
|
||||
|
||||
Self ~
|
||||
|
||||
input ~
|
||||
|
||||
self ~
|
||||
|
||||
import
|
||||
|
||||
as
|
||||
@ -153,6 +149,4 @@ mut
|
||||
|
||||
return
|
||||
|
||||
static
|
||||
|
||||
type
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
function x(const self) {
|
||||
return ();
|
||||
}
|
Loading…
Reference in New Issue
Block a user