Skip to content

Commit

Permalink
fix(interpreter): Moving Text closer to use
Browse files Browse the repository at this point in the history
This also involves removing it from the interpreter API

BREAKING CHANGE: `Text` is no longer visible.
  • Loading branch information
epage committed Dec 10, 2018
1 parent 033c9b7 commit 6e9f5be
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 3 additions & 0 deletions liquid-compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mod include;
mod options;
mod parser;
mod tag;
mod text;

pub mod error {
pub use liquid_error::*;
Expand All @@ -25,3 +26,5 @@ pub use include::*;
pub use options::*;
pub use parser::*;
pub use tag::*;

use text::Text;
2 changes: 1 addition & 1 deletion liquid-compiler/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std;

use liquid_interpreter::Expression;
use liquid_interpreter::Renderable;
use liquid_interpreter::Text;
use liquid_interpreter::Variable;
use liquid_interpreter::{FilterCall, FilterChain};
use liquid_value::Scalar;
Expand All @@ -17,6 +16,7 @@ use super::error::{Error, Result};
use super::LiquidOptions;
use super::ParseBlock;
use super::ParseTag;
use super::Text;

use pest::Parser;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
use std::io::Write;

use super::Context;
use super::Renderable;
use liquid_interpreter::Context;
use liquid_interpreter::Renderable;
use error::{Result, ResultLiquidChainExt};

/// A raw template expression.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Text {
pub(crate) struct Text {
text: String,
}

impl Text {
/// Create a raw template expression.
pub fn new<S: Into<String>>(text: S) -> Text {
pub(crate) fn new<S: Into<String>>(text: S) -> Text {
Text { text: text.into() }
}
}
Expand Down
2 changes: 0 additions & 2 deletions liquid-interpreter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ mod registry;
mod renderable;
mod stack;
mod template;
mod text;
mod variable;

pub use self::context::*;
Expand All @@ -41,5 +40,4 @@ pub use self::stack::*;
pub use self::registry::*;
pub use self::renderable::*;
pub use self::template::*;
pub use self::text::*;
pub use self::variable::*;

0 comments on commit 6e9f5be

Please sign in to comment.