luaparser 0.1.1

Read Lua 5.1 code and produce an abstract syntax tree
Documentation
use crate::nodes::{
    Expression,
    Prefix,
};

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct FieldExpression {
    pub prefix: Prefix,
    pub field: String,
}

impl From<(Prefix, String)> for FieldExpression {
    fn from((prefix, field): (Prefix, String)) -> Self {
        Self {
            prefix,
            field,
        }
    }
}

impl Into<Expression> for FieldExpression {
    fn into(self) -> Expression {
        Expression::Field(Box::new(self))
    }
}