summaryrefslogtreecommitdiff
path: root/cli/lexer.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-01-26 15:41:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-01-26 15:41:53 +0200
commit6d52ac69e940a6be6c15c5c6f84a183bf56899c8 (patch)
tree057fc64f259d171d400b2ce3afc6450ff2b200aa /cli/lexer.cxx
parent8e07c5e7dec299df8a0fbdb2d2c6ae5fbf4d9db4 (diff)
Implement support for sourcing .cli files
The idea is that the file is "read in" as if its content was copy-n-pasted. For example: "\h|Installation|" source "INSTALL.cli" // Also used to generate plain text INSTALL. Unlike include, source can appear anywhere in the file.
Diffstat (limited to 'cli/lexer.cxx')
-rw-r--r--cli/lexer.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/lexer.cxx b/cli/lexer.cxx
index bf16ce5..02be745 100644
--- a/cli/lexer.cxx
+++ b/cli/lexer.cxx
@@ -22,6 +22,7 @@ lexer (istream& is, string const& id)
buf_ (0, 0, 0),
unget_ (false)
{
+ keyword_map_["source"] = token::k_source;
keyword_map_["include"] = token::k_include;
keyword_map_["namespace"] = token::k_namespace;
keyword_map_["class"] = token::k_class;
@@ -340,7 +341,7 @@ identifier (xchar c)
if (i != keyword_map_.end ())
{
- if (i->second == token::k_include)
+ if (i->second == token::k_include || i->second == token::k_source)
include_ = true;
return token (i->second, ln, cl);