Enable building of qlalr with QT_NO_CAST_FROM/TO_ASCII

Change-Id: I1b26c4b3ca84e0bb8001ca24ef46bd24926a0f82
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
Lars Knoll 2016-09-23 09:58:59 +02:00
parent eeb03fbf26
commit 8f71182d15
4 changed files with 7 additions and 4 deletions

View File

@ -187,7 +187,7 @@ Grammar::Grammar ():
tk_end = intern ("$end");
terminals.insert (tk_end);
spells.insert (tk_end, "end of file");
spells.insert (tk_end, QLatin1String("end of file"));
/*tk_error= terminals.insert (intern ("error"))*/;
}

View File

@ -337,6 +337,7 @@ public:
Grammar ();
Name intern (const QString &id);
Name intern (const char *id) { return intern(QString::fromUtf8(id)); }
inline bool isTerminal (Name name) const
{ return terminals.find (name) != terminals.end (); }

View File

@ -65,7 +65,7 @@ int main (int argc, char *argv[])
bool no_lines = false;
bool debug_info = true;
bool qt_copyright = false;
QString file_name = 0;
QString file_name;
const QStringList args = app.arguments().mid(1);
for (const QString &arg : args) {

View File

@ -178,7 +178,8 @@ int Recognizer::nextToken()
text.clear ();
if (! _M_no_lines)
text += QLatin1String ("\n#line ") + QString::number (_M_action_line) + " \"" + _M_input_file + "\"\n";
text += QLatin1String("\n#line ") + QString::number (_M_action_line)
+ QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n");
inp (); // skip ':'
forever
@ -215,7 +216,8 @@ int Recognizer::nextToken()
text.clear ();
if (! _M_no_lines)
text += QLatin1String ("\n#line ") + QString::number (_M_action_line) + " \"" + _M_input_file + "\"\n";
text += QLatin1String ("\n#line ") + QString::number (_M_action_line) +
QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n");
inp (); // skip ':'