mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-27 12:17:35 +03:00
Merge pull request #46 from AleoHQ/refactor/syntax-errors
Refactors SyntaxError to leo-ast
This commit is contained in:
commit
c2b5c0acee
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -503,9 +503,11 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"from-pest",
|
"from-pest",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
"log",
|
||||||
"pest",
|
"pest",
|
||||||
"pest-ast",
|
"pest-ast",
|
||||||
"pest_derive",
|
"pest_derive",
|
||||||
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "leo-ast"
|
name = "leo-ast"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["howardwu <howardwu@berkeley.edu>"]
|
authors = ["The Aleo Team <hello@aleo.org>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
from-pest = { version = "0.3.1" }
|
from-pest = { version = "0.3.1" }
|
||||||
lazy_static = { version = "1.3.0" }
|
lazy_static = { version = "1.3.0" }
|
||||||
|
log = { version = "0.4" }
|
||||||
pest = { version = "2.0" }
|
pest = { version = "2.0" }
|
||||||
pest-ast = { version = "0.3.3" }
|
pest-ast = { version = "0.3.3" }
|
||||||
pest_derive = { version = "2.0" }
|
pest_derive = { version = "2.0" }
|
||||||
|
thiserror = { version = "1.0" }
|
||||||
|
2
ast/src/errors/mod.rs
Normal file
2
ast/src/errors/mod.rs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
pub mod syntax;
|
||||||
|
pub use syntax::*;
|
@ -1,4 +1,4 @@
|
|||||||
use leo_ast::ast::Rule;
|
use crate::ast::Rule;
|
||||||
|
|
||||||
use pest::error::Error;
|
use pest::error::Error;
|
||||||
|
|
@ -2,10 +2,11 @@
|
|||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate pest_derive;
|
extern crate pest_derive;
|
||||||
|
#[macro_use]
|
||||||
extern crate from_pest;
|
extern crate thiserror;
|
||||||
extern crate pest;
|
|
||||||
extern crate pest_ast;
|
|
||||||
|
|
||||||
pub mod ast;
|
pub mod ast;
|
||||||
pub use ast::*;
|
pub use ast::*;
|
||||||
|
|
||||||
|
pub mod errors;
|
||||||
|
pub use errors::*;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use crate::errors::{FunctionError, ImportError, IntegerError, SyntaxError};
|
use crate::errors::{FunctionError, ImportError, IntegerError, };
|
||||||
use leo_ast::ast::Rule;
|
use leo_ast::{ast::Rule, SyntaxError};
|
||||||
|
|
||||||
use pest::error::Error;
|
use pest::error::Error;
|
||||||
use std::{io, path::PathBuf};
|
use std::{io, path::PathBuf};
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
pub mod ast;
|
|
||||||
pub use self::ast::*;
|
|
||||||
|
|
||||||
pub mod compiler;
|
pub mod compiler;
|
||||||
pub use self::compiler::*;
|
pub use self::compiler::*;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user