Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 3e5a00f

Browse files
authored
Merge pull request #175 from github/update-php-assignment
Match `FormalParameter` symbol
2 parents bd5acca + 8cd44aa commit 3e5a00f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Data/Language.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ languageForFilePath :: FilePath -> Language
134134
languageForFilePath = languageForType . takeExtension
135135

136136
supportedExts :: [String]
137-
supportedExts = [".go", ".py", ".rb", ".js", ".ts"]
137+
supportedExts = [".go", ".py", ".rb", ".js", ".ts", ".php", ".phpt"]
138138

139139
codeNavLanguages :: [Language]
140-
codeNavLanguages = [Go, Ruby, Python, JavaScript, TypeScript]
140+
codeNavLanguages = [Go, Ruby, Python, JavaScript, PHP, TypeScript]
141141

142142
pathIsMinified :: FilePath -> Bool
143143
pathIsMinified = isExtensionOf ".min.js"

src/Language/PHP/Assignment.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ anonymousFunctionCreationExpression = makeTerm <$> symbol AnonymousFunctionCreat
388388
makeFunction identifier parameters functionUseClause returnType statement = Declaration.Function [functionUseClause, returnType] identifier parameters statement
389389

390390
parameters :: Assignment [Term]
391-
parameters = manyTerm (simpleParameter <|> variadicParameter)
391+
parameters = symbol FormalParameters *> children (manyTerm (simpleParameter <|> variadicParameter))
392392

393393
simpleParameter :: Assignment Term
394394
simpleParameter = makeTerm <$> symbol SimpleParameter <*> children (makeAnnotation <$> (term typeDeclaration <|> emptyTerm) <*> (makeAssignment <$> location <*> term variableName <*> (term defaultArgumentSpecifier <|> emptyTerm)))

0 commit comments

Comments
 (0)