summaryrefslogtreecommitdiff
path: root/odb/pragma.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/pragma.cxx')
-rw-r--r--odb/pragma.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/odb/pragma.cxx b/odb/pragma.cxx
index 3a1bc0f..9970376 100644
--- a/odb/pragma.cxx
+++ b/odb/pragma.cxx
@@ -3,18 +3,11 @@
// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
// license : GNU GPL v3; see accompanying LICENSE file
+#include <odb/cxx-lexer.hxx>
#include <odb/pragma.hxx>
using namespace std;
-// Token spelling. See cpplib.h for details.
-//
-#define OP(e, s) s ,
-#define TK(e, s) #e ,
-static char const* token_spelling[N_TTYPES] = { TTYPE_TABLE };
-#undef OP
-#undef TK
-
// Lists of pragmas.
//
loc_pragmas loc_pragmas_;
@@ -256,11 +249,17 @@ handle_pragma (cpp_reader* reader,
}
size_t pb (0);
+ bool punc (false);
for (tt = pragma_lex (&t);
tt != CPP_EOF && (tt != CPP_CLOSE_PAREN || pb != 0);
tt = pragma_lex (&t))
{
+ if (punc && tt > CPP_LAST_PUNCTUATOR)
+ val += ' ';
+
+ punc = false;
+
if (tt == CPP_OPEN_PAREN)
pb++;
else if (tt == CPP_CLOSE_PAREN)
@@ -288,16 +287,17 @@ handle_pragma (cpp_reader* reader,
case CPP_NAME:
{
val += IDENTIFIER_POINTER (t);
+ punc = true;
break;
}
default:
{
if (tt <= CPP_LAST_PUNCTUATOR)
- val += token_spelling[tt];
+ val += cxx_lexer::token_spelling[tt];
else
{
error ("unexpected token %qs in db pragma %qs",
- token_spelling[tt],
+ cxx_lexer::token_spelling[tt],
pc);
return;
}