From 550b22dd50ec1a394d33f63dbf493dff46e3ccb7 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Mon, 16 Jan 2017 02:01:05 -0800 Subject: Decorate each input line with its kind. --- src/include/open-axiom/InputFragment | 1 + src/include/open-axiom/token | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/include/open-axiom/InputFragment b/src/include/open-axiom/InputFragment index 65f3dfc9..41661c67 100644 --- a/src/include/open-axiom/InputFragment +++ b/src/include/open-axiom/InputFragment @@ -44,6 +44,7 @@ namespace OpenAxiom { struct Line : std::string { LineNumber number { }; ColumnIndex indent { }; + LineKind kind { LineKind::Ordinary }; std::string sub_string(ColumnIndex s, ColumnIndex e) const { return substr(s, e - s); diff --git a/src/include/open-axiom/token b/src/include/open-axiom/token index da508a82..9eb0b66b 100644 --- a/src/include/open-axiom/token +++ b/src/include/open-axiom/token @@ -1,5 +1,5 @@ // -*- C++ -*- -// Copyright (C) 2013-2014, Gabriel Dos Reis. +// Copyright (C) 2013-2017, Gabriel Dos Reis. // All rights reserved. // Written by Gabriel Dos Reis. // @@ -41,6 +41,12 @@ #include namespace OpenAxiom { + enum class LineKind : uint8_t { + Ordinary, // Ordinary input line + Meta, // Input to the attention of the reader + Ignorable, // Ignorable commentary line + }; + // Categorization of Boot and Spad tokens. enum class TokenCategory : uint8_t { Unclassified, // token of unknown class -- cgit v1.2.3