aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@axiomatics.org>2017-01-16 02:01:05 -0800
committerGabriel Dos Reis <gdr@axiomatics.org>2017-01-16 02:01:05 -0800
commit550b22dd50ec1a394d33f63dbf493dff46e3ccb7 (patch)
tree06aa62ad5c93699573639a9337ed3dbd6ab550af /src
parente82d62219c661a2594286e0f867354864514bd87 (diff)
downloadopen-axiom-550b22dd50ec1a394d33f63dbf493dff46e3ccb7.tar.gz
Decorate each input line with its kind.
Diffstat (limited to 'src')
-rw-r--r--src/include/open-axiom/InputFragment1
-rw-r--r--src/include/open-axiom/token8
2 files changed, 8 insertions, 1 deletions
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 <open-axiom/dialect>
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