Skip to content

Commit

Permalink
All files used a mishmash of spaces and tabs to indent. Enforced 2 sp…
Browse files Browse the repository at this point in the history
…ace indentation in all source files. Removed all trailing spaces. Wrapped using statements at 120 characters instead of . Added a space between a comment and the text of the comment in a few places. This doesn't affect functionality in any way so there won't be a new release for this change.
  • Loading branch information
joelself committed Mar 31, 2016
1 parent 9c27188 commit 36d1ecf
Show file tree
Hide file tree
Showing 11 changed files with 817 additions and 821 deletions.
710 changes: 354 additions & 356 deletions src/internals/ast/structs.rs

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/internals/macros.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

macro_rules! to_val(
($tval:expr) => (
match $tval {
Expand Down
2 changes: 1 addition & 1 deletion src/internals/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ mod toml;
mod util;
mod objects;
pub mod parser;
mod primitives;
mod primitives;
21 changes: 10 additions & 11 deletions src/internals/objects.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use internals::ast::structs::{TableType, WSKeySep, Table, CommentNewLines,
CommentOrNewLines, ArrayValue, Array, TOMLValue, InlineTable, WSSep,
TableKeyVal, ArrayType, HashValue, format_tt_keys};
use internals::ast::structs::{TableType, WSKeySep, Table, CommentNewLines, CommentOrNewLines, ArrayValue, Array,
TOMLValue, InlineTable, WSSep, TableKeyVal, ArrayType, HashValue, format_tt_keys};
use internals::parser::Parser;
use internals::primitives::Key;
use types::{ParseError, Children};
Expand All @@ -26,7 +25,7 @@ fn map_val_to_array_type(val: &TOMLValue) -> ArrayType {
}

impl<'a> Parser<'a> {

pub fn insert(vector: &RefCell<Vec<String>>, insert: String) -> bool {
for s in vector.borrow().iter() {
if s == &insert {
Expand All @@ -36,7 +35,7 @@ impl<'a> Parser<'a> {
vector.borrow_mut().push(insert);
return true;
}

fn contains(vector: &RefCell<Vec<String>>, find: &str) -> bool {
for s in vector.borrow().iter() {
if s == find {
Expand Down Expand Up @@ -212,7 +211,7 @@ impl<'a> Parser<'a> {
key: call_m!(self.key) ,
||{
WSKeySep::new_str(WSSep::new_str(ws1, ws2), key)
}
}
)
);
// Standard Table
Expand Down Expand Up @@ -340,7 +339,7 @@ impl<'a> Parser<'a> {
)
);

//Array Table
// Array Table
method!(array_table<Parser<'a>, &'a str, Rc<TableType> >, mut self,
chain!(
tag_s!("[[") ~
Expand Down Expand Up @@ -481,7 +480,7 @@ impl<'a> Parser<'a> {

method!(comment_or_nls<Parser<'a>, &'a str, Vec<CommentOrNewLines> >, mut self,
many1!(call_m!(self.comment_or_nl)));

method!(array_value<Parser<'a>, &'a str, ArrayValue>, mut self,
chain!(
val: call_m!(self.val) ~
Expand Down Expand Up @@ -539,7 +538,7 @@ impl<'a> Parser<'a> {

pub fn array(mut self: Parser<'a>, input: &'a str) -> (Parser<'a>, IResult<&'a str, Rc<RefCell<Array>>>) {
// Initialize last array type to None, we need a stack because arrays can be nested
//debug!("*** array called on input:\t\t\t{}", input);
// debug!("*** array called on input:\t\t\t{}", input);
self.last_array_type.borrow_mut().push(ArrayType::None);
self.keychain.borrow_mut().push(Key::Index(Cell::new(0)));
let (tmp, res) = self.array_internal(input);
Expand Down Expand Up @@ -602,8 +601,8 @@ mod test {
use nom::IResult::Done;
use types::{DateTime, Date, Time, TimeOffset, TimeOffsetAmount, StrType};
use internals::parser::Parser;
use internals::ast::structs::{Array, ArrayValue, WSSep, TableKeyVal, InlineTable, WSKeySep,
KeyVal, CommentNewLines, Comment, CommentOrNewLines, Table, TableType, TOMLValue};
use internals::ast::structs::{Array, ArrayValue, WSSep, TableKeyVal, InlineTable, WSKeySep, KeyVal, CommentNewLines,
Comment, CommentOrNewLines, Table, TableType, TOMLValue};
use internals::primitives::Key;

#[test]
Expand Down
Loading

0 comments on commit 36d1ecf

Please sign in to comment.