From 6d52ac69e940a6be6c15c5c6f84a183bf56899c8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Jan 2016 15:41:53 +0200 Subject: 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. --- cli/lexer.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cli/lexer.cxx') 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); -- cgit v1.1