Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: martine/ninja
base: fdec96f54e
...
head fork: martine/ninja
compare: abd33d5e3b
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 2 contributors
Commits on Mar 14, 2012
Nicolas Despres nicolasdespres Depfile parser accept tilde. 6a09b96
Commits on Mar 18, 2012
Evan Martin Merge pull request #251 from polrop/depfile-parser-accept-tilde
Depfile parser accept tilde.
abd33d5
16 src/depfile_parser.cc
View
@@ -64,7 +64,7 @@ bool DepfileParser::Parse(string* content, string* err) {
0, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 0, 0, 0, 0, 0,
+ 128, 128, 128, 0, 0, 0, 128, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -84,7 +84,7 @@ bool DepfileParser::Parse(string* content, string* err) {
};
yych = *in;
- if (yych <= '[') {
+ if (yych <= '\\') {
if (yych <= ':') {
if (yych <= 0x00) goto yy6;
if (yych <= '*') goto yy8;
@@ -92,20 +92,18 @@ bool DepfileParser::Parse(string* content, string* err) {
} else {
if (yych <= '@') goto yy8;
if (yych <= 'Z') goto yy4;
- goto yy8;
+ if (yych <= '[') goto yy8;
}
} else {
- if (yych <= '_') {
- if (yych <= '\\') goto yy2;
- if (yych <= '^') goto yy8;
- goto yy4;
+ if (yych <= '`') {
+ if (yych == '_') goto yy4;
+ goto yy8;
} else {
- if (yych <= '`') goto yy8;
if (yych <= 'z') goto yy4;
+ if (yych == '~') goto yy4;
goto yy8;
}
}
-yy2:
++in;
if ((yych = *in) <= '$') {
if (yych <= '\n') {
2  src/depfile_parser.in.cc
View
@@ -68,7 +68,7 @@ bool DepfileParser::Parse(string* content, string* err) {
*out++ = yych;
continue;
}
- [a-zA-Z0-9+,/_:.-]+ {
+ [a-zA-Z0-9+,/_:.~-]+ {
// Got a span of plain text.
int len = in - start;
// Need to shift it over if we're overwriting backslashes.
13 src/depfile_parser_test.cc
View
@@ -119,3 +119,16 @@ TEST_F(DepfileParserTest, RejectMultipleDifferentOutputs) {
string err;
EXPECT_FALSE(Parse("foo bar: x y z", &err));
}
+
+TEST_F(DepfileParserTest, Tilde) {
+ string err;
+ EXPECT_TRUE(Parse(
+"foo~.o: foo~.c",
+ &err));
+ ASSERT_EQ("", err);
+ EXPECT_EQ("foo~.o",
+ parser_.out_.AsString());
+ ASSERT_EQ(1u, parser_.ins_.size());
+ EXPECT_EQ("foo~.c",
+ parser_.ins_[0].AsString());
+}

No commit comments for this range

Something went wrong with that request. Please try again.