qlalr: Use forward slashes in #include directives

Makes sure we don't use backslashes on Windows systems, which could lead
to the following warnings being emitted:

In file included from main.cpp:43:0:
repparser.h:2:10: warning: unknown escape sequence: '\.'
  #line 57 "..\..\src\repparser\parser.g"

caused by lines like
  #line 57 "..\..\src\\repparser\parser.g"

Change-Id: I6cfe0e39a2a58eb39f9d385ece30374bcfa09e05
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
bb10
Kevin Funk 2017-03-08 16:01:52 +01:00
parent 5cc0de2e08
commit 137e6632c8
2 changed files with 8 additions and 4 deletions

View File

@ -192,6 +192,8 @@ protected:
#include "recognizer.h"
#include <QtCore/qdir.h>
#include <cstdlib>
#include <cstring>
#include <cctype>
@ -343,7 +345,7 @@ int Recognizer::nextToken()
text.clear ();
if (! _M_no_lines)
text += QLatin1String("\n#line ") + QString::number(_M_action_line) +
QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n");
QLatin1String(" \"") + QDir::fromNativeSeparators(_M_input_file) + QLatin1String("\"\n");
inp (); // skip ':'
forever
@ -381,7 +383,7 @@ int Recognizer::nextToken()
text.clear ();
if (! _M_no_lines)
text += QLatin1String("\n#line ") + QString::number(_M_action_line) +
QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n");
QLatin1String(" \"") + QDir::fromNativeSeparators(_M_input_file) + QLatin1String("\"\n");
inp (); // skip ':'

View File

@ -28,6 +28,8 @@
#include "recognizer.h"
#include <QtCore/qdir.h>
#include <cstdlib>
#include <cstring>
#include <cctype>
@ -179,7 +181,7 @@ int Recognizer::nextToken()
text.clear ();
if (! _M_no_lines)
text += QLatin1String("\n#line ") + QString::number(_M_action_line) +
QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n");
QLatin1String(" \"") + QDir::fromNativeSeparators(_M_input_file) + QLatin1String("\"\n");
inp (); // skip ':'
forever
@ -217,7 +219,7 @@ int Recognizer::nextToken()
text.clear ();
if (! _M_no_lines)
text += QLatin1String("\n#line ") + QString::number(_M_action_line) +
QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n");
QLatin1String(" \"") + QDir::fromNativeSeparators(_M_input_file) + QLatin1String("\"\n");
inp (); // skip ':'