Merge pull request #46 from AleoHQ/refactor/syntax-errors

Refactors SyntaxError to leo-ast
This commit is contained in:
Howard Wu 2020-06-07 19:19:08 -07:00 committed by GitHub
commit c2b5c0acee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 11 deletions

2
Cargo.lock generated
View File

@ -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]]

View File

@ -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
View File

@ -0,0 +1,2 @@
pub mod syntax;
pub use syntax::*;

View File

@ -1,4 +1,4 @@
use leo_ast::ast::Rule; use crate::ast::Rule;
use pest::error::Error; use pest::error::Error;

View File

@ -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::*;

View File

@ -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};

View File

@ -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::*;