mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-08-15 16:50:22 +03:00
Merge pull request #28198 from ProvableHQ/fix/parser-error-data
Fix expected list in parser error.
This commit is contained in:
commit
edb3c8ea16
@ -137,7 +137,7 @@ impl<N: Network> ParserContext<'_, N> {
|
||||
Token::At | Token::Async | Token::Function | Token::Transition | Token::Inline => {
|
||||
let (id, function) = self.parse_function()?;
|
||||
|
||||
// Partition into transitions and functions so that don't have to sort later.
|
||||
// Partition into transitions and functions so that we don't have to sort later.
|
||||
if function.variant.is_transition() {
|
||||
transitions.push((id, function));
|
||||
} else {
|
||||
@ -147,13 +147,16 @@ impl<N: Network> ParserContext<'_, N> {
|
||||
Token::RightCurly => break,
|
||||
_ => {
|
||||
return Err(Self::unexpected_item(&self.token, &[
|
||||
Token::Const,
|
||||
Token::Struct,
|
||||
Token::Record,
|
||||
Token::Mapping,
|
||||
Token::At,
|
||||
Token::Async,
|
||||
Token::Function,
|
||||
Token::Transition,
|
||||
Token::Inline,
|
||||
Token::RightCurly,
|
||||
])
|
||||
.into());
|
||||
}
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EPAR0370005]: expected 'struct', 'record', 'mapping', '@', 'function', 'transition', 'inline' -- found 'finalize'\n --> test:6:7\n |\n 6 | } finalize {\n | ^^^^^^^^"
|
||||
- "Error [EPAR0370005]: expected 'const', 'struct', 'record', 'mapping', '@', 'async', 'function', 'transition', 'inline', '}' -- found 'finalize'\n --> test:6:7\n |\n 6 | } finalize {\n | ^^^^^^^^"
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EPAR0370005]: expected 'struct', 'record', 'mapping', '@', 'function', 'transition', 'inline' -- found '1'\n --> test:4:5\n |\n 4 | 1 main() {}}\n | ^"
|
||||
- "Error [EPAR0370005]: expected 'const', 'struct', 'record', 'mapping', '@', 'async', 'function', 'transition', 'inline', '}' -- found '1'\n --> test:4:5\n |\n 4 | 1 main() {}}\n | ^"
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EPAR0370005]: expected 'struct', 'record', 'mapping', '@', 'function', 'transition', 'inline' -- found 'test'\n --> test:4:5\n |\n 4 | test main() {}}\n | ^^^^"
|
||||
- "Error [EPAR0370005]: expected 'const', 'struct', 'record', 'mapping', '@', 'async', 'function', 'transition', 'inline', '}' -- found 'test'\n --> test:4:5\n |\n 4 | test main() {}}\n | ^^^^"
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EPAR0370005]: expected 'struct', 'record', 'mapping', '@', 'function', 'transition', 'inline' -- found 'circuit'\n --> test:5:5\n |\n 5 | circuit Foo {\n | ^^^^^^^"
|
||||
- "Error [EPAR0370005]: expected 'const', 'struct', 'record', 'mapping', '@', 'async', 'function', 'transition', 'inline', '}' -- found 'circuit'\n --> test:5:5\n |\n 5 | circuit Foo {\n | ^^^^^^^"
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EPAR0370005]: expected 'struct', 'record', 'mapping', '@', 'function', 'transition', 'inline' -- found 'mappin'\n --> test:4:5\n |\n 4 | mappin balances: address => u128;\n | ^^^^^^"
|
||||
- "Error [EPAR0370005]: expected 'const', 'struct', 'record', 'mapping', '@', 'async', 'function', 'transition', 'inline', '}' -- found 'mappin'\n --> test:4:5\n |\n 4 | mappin balances: address => u128;\n | ^^^^^^"
|
||||
|
Loading…
Reference in New Issue
Block a user