diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-09-22 23:32:28 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-09-22 23:32:28 +0200 |
commit | c09cd7512491cee1e82c1ad8128ce9fd4bc3f79b (patch) | |
tree | a659ed768d849130ab5780a11b7f791a463a1a91 /libbutl/tab-parser.cxx | |
parent | 2a00871f07067f8f9e2de08bb9c8f50e1bf6a650 (diff) |
Initial modularization with both Clang and VC hacks
Note: gave up on VC about half way though.
Diffstat (limited to 'libbutl/tab-parser.cxx')
-rw-r--r-- | libbutl/tab-parser.cxx | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/libbutl/tab-parser.cxx b/libbutl/tab-parser.cxx index bf0a7dd..183e6d7 100644 --- a/libbutl/tab-parser.cxx +++ b/libbutl/tab-parser.cxx @@ -2,12 +2,39 @@ // copyright : Copyright (c) 2014-2017 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file -#include <libbutl/tab-parser.hxx> +#ifndef __cpp_modules +#include <libbutl/tab-parser.mxx> +#endif #include <cassert> + +#ifndef __cpp_lib_modules +#include <string> +#include <vector> +#include <cstdint> +#include <stdexcept> + +#include <istream> #include <sstream> +#endif + +// Other includes. + +#ifdef __cpp_modules +module butl.tab_parser; + +// Only imports additional to interface. +#ifdef __clang__ +#ifdef __cpp_lib_modules +import std.core; +import std.io; +#endif +#endif -#include <libbutl/string-parser.hxx> +import butl.string_parser; +#else +#include <libbutl/string-parser.mxx> +#endif using namespace std; @@ -53,7 +80,7 @@ namespace butl { sp = string_parser::parse_quoted_position (s, false); } - catch (const invalid_string& e) + catch (const string_parser::invalid_string& e) { throw parsing (name_, line_, e.position + 1, e.what ()); } @@ -69,7 +96,7 @@ namespace butl // tab_parsing // - static string + static inline string format (const string& n, uint64_t l, uint64_t c, const string& d) { ostringstream os; |