Skip to content

Commit

Permalink
Merge pull request #179 from github/add-php
Browse files Browse the repository at this point in the history
Fix PHP assignment parsing
  • Loading branch information
joshvera authored Jun 25, 2019
2 parents e0ff53e + 3dea3d7 commit b4792db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Data/Language.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"
4 changes: 4 additions & 0 deletions src/Parsing/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module Parsing.Parser
, typescriptParser
, typescriptASTParser
, phpParser
, phpASTParser
, haskellParser
) where

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b4792db

Please sign in to comment.