diff --git a/Cargo.lock b/Cargo.lock index 19d7665..c45acfe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,18 +1,60 @@ -[root] +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "binding" +version = "0.1.0" +source = "git+ssh://git@gitlab.com/CyberMages/Core/binding.git#51a8a23a65e5c31355dcd6ab353f30b32489b74a" +dependencies = [ + "scribe 0.5.0 (git+ssh://git@gitlab.com/CyberMages/Core/scribe.git)", + "weave 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/weave.git)", +] + +[[package]] name = "draconic" version = "0.1.0" dependencies = [ - "scribe 0.1.0 (git+https://gitlab.com/CyberMages/scribe.git)", - "spellbook 0.1.0 (git+https://gitlab.com/CyberMages/spellbook.git)", + "scribe 0.5.0 (git+ssh://git@gitlab.com/CyberMages/Core/scribe.git)", + "spellbook 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/spellbook.git)", + "weave 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/weave.git)", +] + +[[package]] +name = "pact" +version = "0.1.0" +source = "git+ssh://git@gitlab.com/CyberMages/Core/pact.git#16878ec911b09926db16bb11d504a30b21c06fb2" +dependencies = [ + "binding 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/binding.git)", + "scribe 0.5.0 (git+ssh://git@gitlab.com/CyberMages/Core/scribe.git)", + "weave 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/weave.git)", ] [[package]] name = "scribe" -version = "0.1.0" -source = "git+https://gitlab.com/CyberMages/scribe.git#c655eca358577795d818bdd07cb71864c0c9b9f2" +version = "0.5.0" +source = "git+ssh://git@gitlab.com/CyberMages/Core/scribe.git#a1ebb45e35cf05692eaa2e13b602d33fde255710" [[package]] name = "spellbook" version = "0.1.0" -source = "git+https://gitlab.com/CyberMages/spellbook.git#0059c4a676ef2243d982ec1ad471a03fc5c79e01" +source = "git+ssh://git@gitlab.com/CyberMages/Core/spellbook.git#6ebdfae92c40c37bc92ba0571ce20ca331fc78bd" +dependencies = [ + "binding 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/binding.git)", + "pact 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/pact.git)", + "scribe 0.5.0 (git+ssh://git@gitlab.com/CyberMages/Core/scribe.git)", + "weave 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/weave.git)", +] +[[package]] +name = "weave" +version = "0.1.0" +source = "git+ssh://git@gitlab.com/CyberMages/Core/weave.git#44fe5ddade94651cfdb7b8d3fad2e6addd309975" +dependencies = [ + "scribe 0.5.0 (git+ssh://git@gitlab.com/CyberMages/Core/scribe.git)", +] + +[metadata] +"checksum binding 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/binding.git)" = "" +"checksum pact 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/pact.git)" = "" +"checksum scribe 0.5.0 (git+ssh://git@gitlab.com/CyberMages/Core/scribe.git)" = "" +"checksum spellbook 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/spellbook.git)" = "" +"checksum weave 0.1.0 (git+ssh://git@gitlab.com/CyberMages/Core/weave.git)" = "" diff --git a/Cargo.toml b/Cargo.toml index 4f8d40c..461daae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,8 @@ license = "" repository = "https://gitlab.com/CyberMages/draconic.git" documentation = "" keywords = ["draconic", "parser", "interpreter", "compiler"] +edition = "2018" + [[bin]] name = "draconicpt" @@ -14,7 +16,10 @@ path = "src/pt_compiler.rs" [dependencies.scribe] -git = "https://gitlab.com/CyberMages/scribe.git" +git = "ssh://git@gitlab.com/CyberMages/Core/scribe.git" + +[dependencies.weave] +git = "ssh://git@gitlab.com/CyberMages/Core/weave.git" [dependencies.spellbook] -git = "https://gitlab.com/CyberMages/spellbook.git" +git = "ssh://git@gitlab.com/CyberMages/Core/spellbook.git" diff --git a/src/compiler.rs b/src/compiler.rs index facec93..d282335 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -2,12 +2,14 @@ use std::fs::File; use std::io::Write; use std::path::Path; -use ::lexer::Lexer; -use ::lexer::Token; -use ::lexer::TokenTypes; -use ::parser::Parser; -use ::reader::Reader; -use ::util::Util; +use scribe::{warn, error}; + +use crate::lexer::Lexer; +use crate::lexer::Token; +use crate::lexer::TokenTypes; +use crate::parser::Parser; +use crate::reader::Reader; +use crate::util::Util; diff --git a/src/lexer/lexer.rs b/src/lexer/lexer.rs index ce897c7..25cc351 100644 --- a/src/lexer/lexer.rs +++ b/src/lexer/lexer.rs @@ -1,6 +1,10 @@ -use ::reader::Reader; -use ::lexer::token::Token; -use ::lexer::token_types::TokenTypes; +use scribe::{warn, error}; + +use weave::attempt; + +use crate::reader::Reader; +use crate::lexer::token::Token; +use crate::lexer::token_types::TokenTypes; @@ -386,7 +390,7 @@ impl Lexer // Begin turning the input into tokens. while reader.is_eob() == false { - test_char = try!(reader.get_char()); + test_char = attempt!(reader.get_char()); if is_whitespace(test_char) { // Just skip/remove any whitespace. diff --git a/src/lexer/token.rs b/src/lexer/token.rs index c288910..4786165 100644 --- a/src/lexer/token.rs +++ b/src/lexer/token.rs @@ -1,7 +1,9 @@ use std::convert::From; use std::str::FromStr; -use ::lexer::token_types::TokenTypes; +use scribe::warn; + +use crate::lexer::token_types::TokenTypes; diff --git a/src/lib.rs b/src/lib.rs index 3b19017..5c68c85 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,10 +1,3 @@ -#[macro_use] -extern crate scribe; - -extern crate spellbook; - - - mod compiler; mod lexer; mod parser; diff --git a/src/parser.rs b/src/parser.rs index 9913a1b..5ec24a3 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,10 +1,12 @@ use std::path::PathBuf; -use ::compiler::read_file; -use ::lexer::Token; -use ::lexer::TokenTypes; -use ::reader::Reader; -use ::util::Util; +use scribe::error; + +use crate::compiler::read_file; +use crate::lexer::Token; +use crate::lexer::TokenTypes; +use crate::reader::Reader; +use crate::util::Util; diff --git a/src/pt_compiler.rs b/src/pt_compiler.rs index 4dcdbba..a92cb9d 100644 --- a/src/pt_compiler.rs +++ b/src/pt_compiler.rs @@ -1,10 +1,3 @@ -#[macro_use] -extern crate scribe; - -extern crate spellbook; - - - mod compiler; mod lexer; mod parser; @@ -15,9 +8,10 @@ mod util; use std::path::PathBuf; -use spellbook::{EMPTY_STRING, ArgParser, ArgOption}; +use spellbook::cantrips::{ArgParser, ArgOption}; +use spellbook::components::EMPTY_STRING; -use ::compiler::Compiler; +use crate::compiler::Compiler; diff --git a/src/reader.rs b/src/reader.rs index 202dc5c..55cfcec 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -2,6 +2,10 @@ use std::fs::File; use std::io::Read; use std::path::Path; +use scribe::{info, error}; + +use weave::attempt; + // TODO: Make this work on only a predetermined size of a buffer. @@ -151,7 +155,7 @@ impl Reader // Get the current character and move the position // in the buffer forward. - character = try!(self.get_char()); + character = attempt!(self.get_char()); self.position += 1; // Return the character that was retrieved. @@ -204,7 +208,7 @@ impl Reader continue_consuming = true; while continue_consuming == true { - current_char = try!(self.consume_char()); + current_char = attempt!(self.consume_char()); buffer.push(current_char); if current_char == '\n'