mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-26 11:06:00 +03:00
Fix the grammar benchmark
This commit is contained in:
parent
bd2bd1f40f
commit
55002db847
@ -22,8 +22,8 @@ name = "leo_grammar"
|
||||
path = "src/main.rs"
|
||||
|
||||
[[bench]]
|
||||
name = "ast"
|
||||
path = "benches/ast.rs"
|
||||
name = "grammar"
|
||||
path = "benches/grammar.rs"
|
||||
harness = false
|
||||
|
||||
[dependencies.from-pest]
|
||||
|
@ -2,7 +2,7 @@ circuit PedersenHash {
|
||||
parameters: [group; 256],
|
||||
|
||||
// Instantiates a Pedersen hash circuit
|
||||
static function new(parameters: [group; 256]) -> Self {
|
||||
function new(self, parameters: [group; 256]) -> Self {
|
||||
return Self { parameters: parameters }
|
||||
}
|
||||
|
||||
|
@ -44,8 +44,8 @@ use pest::{
|
||||
#[grammar = "leo.pest"]
|
||||
pub struct LanguageParser;
|
||||
|
||||
pub fn parse(input: &str) -> Result<Pairs<Rule>, Error<Rule>> {
|
||||
LanguageParser::parse(Rule::file, input)
|
||||
pub fn parse(program_string: &str) -> Result<Pairs<Rule>, Error<Rule>> {
|
||||
LanguageParser::parse(Rule::file, program_string)
|
||||
}
|
||||
|
||||
pub(crate) fn span_into_string(span: Span) -> String {
|
||||
|
@ -53,7 +53,8 @@ pub(crate) use span::*;
|
||||
use from_pest::FromPest;
|
||||
use std::{fs, path::Path};
|
||||
|
||||
/// The pest abstract syntax tree (ast) for a Leo program.
|
||||
///
|
||||
/// The grammar of a Leo program, encoded as an abstract syntax tree (AST).
|
||||
///
|
||||
/// The [`Grammar`] type represents a Leo program as a series of recursive data types.
|
||||
/// These data types form a tree that begins from a [`File`] type root.
|
||||
|
0
wasm/.resources/main.leo
Normal file
0
wasm/.resources/main.leo
Normal file
0
wasm/src/grammar.rs
Normal file
0
wasm/src/grammar.rs
Normal file
Loading…
Reference in New Issue
Block a user