Skip to content

Commit

Permalink
Changed TOMLParser to Parser and moved it to internals. Wrote a wrapp…
Browse files Browse the repository at this point in the history
…er for it to only expose the parts that should be public and called it TOMLParser and put it in the library root. Changed all files that used to reference TOMLParser. Added some new fields to Cargo.toml.
  • Loading branch information
joelself committed Mar 15, 2016
1 parent 09a8648 commit bcadebe
Show file tree
Hide file tree
Showing 14 changed files with 382 additions and 322 deletions.
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
[package]
name = "tomllib"
version = "0.1.0"
authors = ["Joel Self <joel@dislocal.com>"]
authors = ["Joel Self <self@jself.com>"]
description = "A format-preserving TOML file parser and manipulator"
license = "MIT"
repository = "https://github.com/joelself/tomllib"
readme = "README.md"
#documentation = "http://rust.unhandledexpression.com/tomllib/"
keywords = ["toml", "parser", "encode", "decode", "nom"]

[dependencies.nom]
version = "^1.2.0"
Expand Down
4 changes: 2 additions & 2 deletions src/bin/tomlkit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extern crate tomllib;
#[macro_use] extern crate log;
extern crate env_logger;
use std::rc::Rc;
use tomllib::parser::TOMLParser;
use tomllib::TOMLParser;
use tomllib::types::{StrType, Value, TimeOffsetAmount, TimeOffset,
DateTime, Date, Time};

Expand Down Expand Up @@ -148,7 +148,7 @@ enabled = true
// ),
// ])
// ));
parser.print_keys_and_values_debug();
//parser.print_keys_and_values_debug();


println!("before: {}", parser.get_value("title").unwrap());
Expand Down
4 changes: 2 additions & 2 deletions src/internals/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ macro_rules! to_val(
&TOMLValue::Float(ref v) => Value::Float(v.clone()),
&TOMLValue::Boolean(v) => Value::Boolean(v),
&TOMLValue::DateTime(ref v) => Value::DateTime(v.clone()),
&TOMLValue::Array(ref arr) => TOMLParser::sanitize_array(arr.clone()),
&TOMLValue::Array(ref arr) => Parser::sanitize_array(arr.clone()),
&TOMLValue::String(ref s, t) => Value::String(s.clone(), t.clone()),
&TOMLValue::InlineTable(ref it) => TOMLParser::sanitize_inline_table(it.clone()),
&TOMLValue::InlineTable(ref it) => Parser::sanitize_inline_table(it.clone()),
&TOMLValue::Table => panic!("Cannot convert a Table to a Value"),
}
);
Expand Down
5 changes: 3 additions & 2 deletions src/internals/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#[macro_use]
mod macros;
pub mod ast;
mod ast;
mod toml;
mod util;
mod objects;
pub mod primitives;
pub mod parser;
mod primitives;
130 changes: 65 additions & 65 deletions src/internals/objects.rs

Large diffs are not rendered by default.

0 comments on commit bcadebe

Please sign in to comment.