From b8c88e34a3f5f1aa53a304594977e28346d7712e Mon Sep 17 00:00:00 2001 From: Karl Krissian Date: Fri, 7 Oct 2022 15:23:30 +0200 Subject: [PATCH] Allow double quote includes --- source/context.cpp | 4 ++-- source/type.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/context.cpp b/source/context.cpp index 901750a0..57a5168e 100644 --- a/source/context.cpp +++ b/source/context.cpp @@ -50,11 +50,11 @@ string file_name_prefix_for_binder(BinderOP &b) string include = binder::relevant_include(decl); - string exceptions = "_/<>."; + string exceptions = "_/<>.\""; include.erase(std::remove_if(include.begin(), include.end(), [&](unsigned char c) { return not(std::isalnum(c) or std::find(exceptions.begin(), exceptions.end(), c) != exceptions.end()); }), include.end()); - if( include.size() <= 2 ) { + if( include.size() <= 0 ) { include = ""; // outs() << "Warning: file_name_prefix_for_binder could not determent file name for decl: " + string(*b) + ", result is too short!\n"; } // throw std::runtime_error( "file_name_for_decl failed!!! include name for decl: " + string(*b) + " is too short!"); diff --git a/source/type.cpp b/source/type.cpp index ab52d34e..ded37b6b 100644 --- a/source/type.cpp +++ b/source/type.cpp @@ -100,7 +100,7 @@ string relevant_include(NamedDecl const *decl) for( ; *data and *data != terminator; ++data ) include_string.push_back(*data); if( *data == terminator ) include_string.push_back(*data); } - if( include_string.size() and include_string[0] == '"' ) include_string.resize(0); // avoid adding include in quotes because compiler will not be able to find them + // if( include_string.size() and include_string[0] == '"' ) include_string.resize(0); // avoid adding include in quotes because compiler will not be able to find them } return include_string;