Skip to content

Commit af20a96

Browse files
committed
fix for #11
1 parent c4be849 commit af20a96

File tree

4 files changed

+49
-13
lines changed

4 files changed

+49
-13
lines changed

lib/parser/pbxproj.js

Lines changed: 31 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/parser/pbxproj.pegjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ DecimalValue
188188
}
189189

190190
IntegerValue
191-
= !Alpha number:Digit+ !Alpha
191+
= !Alpha number:Digit+ !NonTerminator
192192
{ return parseInt(number.join(''), 10) }
193193

194194
StringValue
@@ -210,9 +210,12 @@ LiteralString
210210
= literal:LiteralChar+ { return literal.join('') }
211211

212212
LiteralChar
213-
= !InlineCommentOpen !LineTerminator char:[^;,\n]
213+
= !InlineCommentOpen !LineTerminator char:NonTerminator
214214
{ return char }
215215

216+
NonTerminator
217+
= [^;,\n]
218+
216219
/*
217220
* SingleLineComment - used for the encoding comment
218221
*/

test/parser/file-references.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var PEG = require('pegjs'),
2+
fs = require('fs'),
3+
pbx = fs.readFileSync('test/parser/projects/file-references.pbxproj', 'utf-8'),
4+
grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'),
5+
parser = PEG.buildParser(grammar),
6+
rawProj = parser.parse(pbx),
7+
project = rawProj.project;
8+
9+
exports['should have a PBXFileReference section'] = function (test) {
10+
test.ok(project.objects['PBXFileReference']);
11+
test.done();
12+
}

test/parser/projects/file-references.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
3072F99613A8081B00425683 /* Capture.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Capture.bundle; path = Resources/Capture.bundle; sourceTree = "<group>"; };
3232
307D28A1123043350040C0FA /* PhoneGapBuildSettings.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = PhoneGapBuildSettings.xcconfig; sourceTree = "<group>"; };
3333
308D052E1370CCF300D202BF /* icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-72.png"; sourceTree = "<group>"; };
34-
308D052F1370CCF300D202BF /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; };
34+
308D052F1370CCF300D202BF /* 1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 1.png; sourceTree = "<group>"; };
3535
308D05301370CCF300D202BF /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon@2x.png"; sourceTree = "<group>"; };
3636
308D05341370CCF300D202BF /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
3737
308D05351370CCF300D202BF /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };

0 commit comments

Comments
 (0)