From 8157bea401a02a6a4bb8af232a31d0096334fdf9 Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Sat, 22 Aug 2020 17:03:19 +0800 Subject: [PATCH] feat: make compile works --- Cargo.toml | 3 +++ scie-grammar/src/inter/mod.rs | 12 +++++++----- src/main.rs | 12 +++++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3301be1..5817ccd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,9 @@ edition = "2018" [dependencies] +[dependencies.scie-grammar] +path = "scie-grammar" + [workspace] members = [ "scie-grammar" diff --git a/scie-grammar/src/inter/mod.rs b/scie-grammar/src/inter/mod.rs index 2fc73e0..0d863af 100644 --- a/scie-grammar/src/inter/mod.rs +++ b/scie-grammar/src/inter/mod.rs @@ -1,5 +1,7 @@ use std::collections::HashMap; + +#[derive(Debug, Clone)] pub struct ILocation { pub filename: String, pub line: String, @@ -21,7 +23,7 @@ pub struct IRawRepositoryMap { } pub struct IRawRepository { - pub map: IRawRepositoryMap, + pub map: Box, pub location: ILocatable, } @@ -37,15 +39,15 @@ pub struct IRawRule { pub include: Option, pub content_name: Option, pub match_s: Option, - pub captures: Option, + pub captures: Option>, pub begin: Option, - pub beginCaptures: Option, + pub beginCaptures: Option>, pub end: Option, - pub endCaptures: Option, + pub endCaptures: Option>, pub while_s: Option, - pub whileCaptures: Option, + pub whileCaptures: Option>, pub pattern: Option>, pub repository: Option, diff --git a/src/main.rs b/src/main.rs index f328e4d..51b8e7c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1 +1,11 @@ -fn main() {} +use scie_grammar::inter::{IRawCaptures, ILocatable, ILocation}; +use std::collections::HashMap; + +fn main() { + let location = ILocation { + filename: "".to_string(), + line: "".to_string(), + chart: "".to_string() + }; + println!("{:?}", location) +} -- GitLab