1
1
mirror of https://github.com/github/semantic.git synced 2025-01-08 00:16:53 +03:00

Merge pull request #179 from github/add-php

Fix PHP assignment parsing
This commit is contained in:
Josh Vera 2019-06-25 15:28:14 -04:00 committed by GitHub
commit b4792db252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -122,7 +122,7 @@ extensionsForLanguage language = case language of
Go -> [".go"]
Haskell -> [".hs"]
JavaScript -> [".js", ".mjs"]
PHP -> [".php"]
PHP -> [".php", ".phpt"]
Python -> [".py"]
Ruby -> [".rb"]
TypeScript -> [".ts"]
@ -138,7 +138,7 @@ supportedExts :: [String]
supportedExts = [".go", ".py", ".rb", ".js", ".mjs", ".ts", ".php", ".phpt"]
codeNavLanguages :: [Language]
codeNavLanguages = [Go, Ruby, Python, JavaScript, PHP, TypeScript]
codeNavLanguages = [Go, Ruby, Python, JavaScript, TypeScript, PHP]
pathIsMinified :: FilePath -> Bool
pathIsMinified = isExtensionOf ".min.js"

View File

@ -24,6 +24,7 @@ module Parsing.Parser
, typescriptParser
, typescriptASTParser
, phpParser
, phpASTParser
, haskellParser
) where
@ -137,6 +138,9 @@ rubyParser = AssignmentParser (ASTParser tree_sitter_ruby) Ruby.assignment
phpParser :: Parser PHP.Term
phpParser = AssignmentParser (ASTParser tree_sitter_php) PHP.assignment
phpASTParser :: Parser (AST [] PHP.Grammar)
phpASTParser = ASTParser tree_sitter_php
pythonParser :: Parser Python.Term
pythonParser = AssignmentParser (ASTParser tree_sitter_python) Python.assignment