Skip to content

Commit

Permalink
Use str_number_variable to define paths (#116)
Browse files Browse the repository at this point in the history
For simplicity, Kin also accepts variables in path entries.
However, I don't feel this is such a big change and, at worst, this
would simply show false negatives on synthetic config files where
variables are used (maybe they are even valid, I didn't test it).
  • Loading branch information
Serchinastico authored Aug 23, 2024
1 parent fcd3132 commit f3b6d56
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kin/grammar/PBXProj.g4
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ name
;

path
: PATH '=' any_string ';'
: PATH '=' str_number_variable ';'
;

source_tree
Expand Down
2 changes: 1 addition & 1 deletion kin/grammar/PBXProj.interp

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions kin/grammar/PBXProjParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def serializedATN():
1350,5,68,0,0,1350,1351,5,3,0,0,1351,1352,3,224,112,0,1352,1353,
5,4,0,0,1353,211,1,0,0,0,1354,1355,5,69,0,0,1355,1356,5,3,0,0,1356,
1357,3,382,191,0,1357,1358,5,4,0,0,1358,213,1,0,0,0,1359,1360,5,
70,0,0,1360,1361,5,3,0,0,1361,1362,3,382,191,0,1362,1363,5,4,0,0,
70,0,0,1360,1361,5,3,0,0,1361,1362,3,384,192,0,1362,1363,5,4,0,0,
1363,215,1,0,0,0,1364,1365,5,71,0,0,1365,1366,5,3,0,0,1366,1367,
3,382,191,0,1367,1368,5,4,0,0,1368,217,1,0,0,0,1369,1370,5,72,0,
0,1370,1371,5,3,0,0,1371,1372,5,13,0,0,1372,1373,5,4,0,0,1373,219,
Expand Down Expand Up @@ -8678,8 +8678,8 @@ def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
def PATH(self):
return self.getToken(PBXProjParser.PATH, 0)

def any_string(self):
return self.getTypedRuleContext(PBXProjParser.Any_stringContext,0)
def str_number_variable(self):
return self.getTypedRuleContext(PBXProjParser.Str_number_variableContext,0)


def getRuleIndex(self):
Expand Down Expand Up @@ -8707,7 +8707,7 @@ def path(self):
self.state = 1360
self.match(PBXProjParser.T__2)
self.state = 1361
self.any_string()
self.str_number_variable()
self.state = 1362
self.match(PBXProjParser.T__3)
except RecognitionException as re:
Expand Down
15 changes: 15 additions & 0 deletions tests/ok/019.pbxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
archiveVersion = 1;
classes = {};
objectVersion = 46;
objects = {
FE870E28DC2371E7ACA886F03F460581 = {isa = PBXFileReference; explicitFileType = text.xcconfig; name = "Something.xcconfig"; path = 0840; sourceTree = "<group>"; wrapsLines = 1; };
78452DDA02BFEF5D6BA29AEFB4B1266A = {isa = PBXGroup; children = (FE870E28DC2371E7ACA886F03F460581,); name = Configurations; sourceTree = "<group>"; };
49FBBF861C10C2A200A1A4BB = {isa = PBXProject; buildConfigurationList = 49FBBF891C10C2A200A1A4BB; compatibilityVersion = "Xcode 3.2"; hasScannedForEncodings = 0; mainGroup = 49FBBF851C10C2A200A1A4BB; productRefGroup = 49FBBF8F1C10C2A200A1A4BB; projectDirPath = ""; projectRoot = ""; targets = (49FBBF8D1C10C2A200A1A4BB, 4973659B1C19BC6E00837617,); };
49FBBF951C10C2A200A1A4BB = {isa = PBXVariantGroup; children = (49FBBF961C10C2A200A1A4BB,); name = Main.storyboard; sourceTree = "<group>"; };
49FBBF9A1C10C2A200A1A4BB = {isa = PBXVariantGroup; children = (49FBBF9B1C10C2A200A1A4BB,); name = LaunchScreen.storyboard; sourceTree = "<group>"; };
497365A41C19BC6E00837617 = {isa = XCBuildConfiguration; baseConfigurationReference = 274E42B0193BA6FEFA8FD71C; buildSettings = { FRAMEWORK_SEARCH_PATHS = ("$(inherited)", "$(PROJECT_DIR)/build/Debug-iphoneos",); }; name = Debug; };
49FBBFB61C10C2A200A1A4BB = {isa = XCConfigurationList; buildConfigurations = (49FBBFB71C10C2A200A1A4BB, 49FBBFB81C10C2A200A1A4BB,); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; };
};
rootObject = 49FBBF861C10C2A200A1A4BB;
}

0 comments on commit f3b6d56

Please sign in to comment.