From 0a087cd28bbee5fcdffbb9d49b0ba9f413ad7f92 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 24 Jan 2020 16:23:57 +0100 Subject: =?UTF-8?q?Reorganize=20modules=20=F0=9F=A7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/syntax/expr.rs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/syntax/expr.rs') diff --git a/src/syntax/expr.rs b/src/syntax/expr.rs index fe24c655..b4c0dfaa 100644 --- a/src/syntax/expr.rs +++ b/src/syntax/expr.rs @@ -1,4 +1,10 @@ -use super::*; +use std::fmt::{self, Display, Formatter}; + +use crate::error::Errors; +use crate::size::Size; +use super::func::{keys::Key, values::Value}; +use super::span::{Span, Spanned}; +use super::tokens::is_identifier; /// An argument or return value. @@ -91,6 +97,13 @@ pub struct Object { pub pairs: Vec, } +/// A key-value pair in an object. +#[derive(Clone, PartialEq)] +pub struct Pair { + pub key: Spanned, + pub value: Spanned, +} + impl Object { pub fn new() -> Object { Object { pairs: vec![] } @@ -162,13 +175,6 @@ impl Object { } } -/// A key-value pair in an object. -#[derive(Clone, PartialEq)] -pub struct Pair { - pub key: Spanned, - pub value: Spanned, -} - impl Display for Expr { fn fmt(&self, f: &mut Formatter) -> fmt::Result { use Expr::*; -- cgit v1.2.3