summaryrefslogtreecommitdiff
path: root/src/syntax
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2021-06-08 11:05:09 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-09 22:44:40 +0200
commit29cfef0a6dfef5820bda339d327638e285aaf4d3 (patch)
tree7a2e16b4c97d4259da1eb63deaa716b620feb4df /src/syntax
parent73fa2eda2c23bd3baeb9e22b99eb0bfb183fc638 (diff)
Add a grid layouter
Diffstat (limited to 'src/syntax')
-rw-r--r--src/syntax/expr.rs3
-rw-r--r--src/syntax/token.rs3
-rw-r--r--src/syntax/visit.rs1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/syntax/expr.rs b/src/syntax/expr.rs
index 4dac9c59..17e4a196 100644
--- a/src/syntax/expr.rs
+++ b/src/syntax/expr.rs
@@ -9,6 +9,8 @@ use crate::geom::{AngularUnit, LengthUnit};
pub enum Expr {
/// The none literal: `none`.
None(Span),
+ /// The `auto` constant.
+ Auto(Span),
/// A boolean literal: `true`, `false`.
Bool(Span, bool),
/// An integer literal: `120`.
@@ -69,6 +71,7 @@ impl Expr {
pub fn span(&self) -> Span {
match *self {
Self::None(span) => span,
+ Self::Auto(span) => span,
Self::Bool(span, _) => span,
Self::Int(span, _) => span,
Self::Float(span, _) => span,
diff --git a/src/syntax/token.rs b/src/syntax/token.rs
index 56ab3dd6..26c01fbb 100644
--- a/src/syntax/token.rs
+++ b/src/syntax/token.rs
@@ -100,6 +100,8 @@ pub enum Token<'s> {
Include,
/// The `using` keyword.
Using,
+ /// The `auto` keyword.
+ Auto,
/// One or more whitespace characters.
///
/// The contained `usize` denotes the number of newlines that were contained
@@ -248,6 +250,7 @@ impl<'s> Token<'s> {
Self::Import => "keyword `import`",
Self::Include => "keyword `include`",
Self::Using => "keyword `using`",
+ Self::Auto => "keyword `auto`",
Self::Space(_) => "space",
Self::Text(_) => "text",
Self::UnicodeEscape(_) => "unicode escape sequence",
diff --git a/src/syntax/visit.rs b/src/syntax/visit.rs
index ba7555f2..97e8d4ed 100644
--- a/src/syntax/visit.rs
+++ b/src/syntax/visit.rs
@@ -74,6 +74,7 @@ visit! {
fn visit_expr(v, node: &Expr) {
match node {
Expr::None(_) => {}
+ Expr::Auto(_) => {}
Expr::Bool(_, _) => {}
Expr::Int(_, _) => {}
Expr::Float(_, _) => {}