Skip to content

Commit f69eb17

Browse files
committed
allow periods in unquoted property names
fixes NativeScript#16
1 parent dc0d5fb commit f69eb17

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

lib/parser/pbxproj.js

Lines changed: 4 additions & 4 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ CommentedArrayEntry
170170
* Identifiers and Values
171171
*/
172172
Identifier
173-
= id:[A-Za-z0-9_]+ { return id.join('') }
173+
= id:[A-Za-z0-9_.]+ { return id.join('') }
174174
/ QuotedString
175175

176176
Value

test/parser/dotsInNames.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var PEG = require('pegjs'),
2+
fs = require('fs'),
3+
pbx = fs.readFileSync('test/parser/projects/dots-in-names.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 parse com.apple.BackgroundModes'] = function (test) {
10+
var targets = project.attributes.TargetAttributes['1D6058900D05DD3D006BFB54'],
11+
backgroundModes = targets.SystemCapabilities['com.apple.BackgroundModes'];
12+
13+
test.deepEqual(backgroundModes, {enabled: 1});
14+
test.done()
15+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// !$*UTF8*$!
2+
{
3+
isa = PBXProject;
4+
attributes = {
5+
LastUpgradeCheck = 500;
6+
TargetAttributes = {
7+
1D6058900D05DD3D006BFB54 = {
8+
DevelopmentTeam = 9KM9BSKFZ3;
9+
SystemCapabilities = {
10+
com.apple.BackgroundModes = {
11+
enabled = 1;
12+
};
13+
};
14+
};
15+
};
16+
};
17+
}

0 commit comments

Comments
 (0)