alunny / node-xcode

tools and utilities for working with xcode/ios projects
Apache License 2.0
226 stars 105 forks source link

Syntax Error: Parser fails using Capabilities #16

Closed jonathannaguin closed 10 years ago

jonathannaguin commented 10 years ago

If the project has enable some Capabilities from Xcode 5.0, for example, Background Modes with the mode Location Updates, the parser pbxproj.js fails with this output:

{ name: 'SyntaxError',
  message: 'Expected "/*", "=" or [A-Za-z0-9_] but "." found.',
  line: 418,
  column: 11 }

The problematic line is:

409. /* Begin PBXProject section */
410.        29B97313FDCFA39411CA2CEA /* Project object */ = {
411.            isa = PBXProject;
412.            attributes = {
413.                LastUpgradeCheck = 500;
414.                TargetAttributes = {
415.                    1D6058900D05DD3D006BFB54 = {
416.                        DevelopmentTeam = 9KM9BSKFZ3;
417.                        SystemCapabilities = {
418.                            com.apple.BackgroundModes = { 
419.                                enabled = 1;
420.                            };
421.                        };
422.                    };
423.                };
424.            };
alunny commented 10 years ago

Looks like the parser doesn't expect . in the unquoted rules - that should be an easy fix. I'll take a quick stab at it tonight.

alunny commented 10 years ago

I'll probably wait until #15 is fixed to do a release to npm. Thanks for reporting the issue.