-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change default file paths for files in tests
- Loading branch information
Showing
4 changed files
with
78 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module Review.FileParser exposing (parse) | ||
|
||
import Elm.Parser as Parser | ||
import Elm.Processing | ||
import Elm.Syntax.File exposing (File) | ||
import Review.Dependencies | ||
|
||
|
||
{-| Parse source code into a AST. | ||
-} | ||
parse : String -> Result () File | ||
parse source = | ||
source | ||
|> Parser.parse | ||
|> Result.mapError (always ()) | ||
|> Result.map (Elm.Processing.process elmProcessContext) | ||
|
||
|
||
elmProcessContext : Elm.Processing.ProcessContext | ||
elmProcessContext = | ||
Elm.Processing.init | ||
|> Elm.Processing.addDependency Review.Dependencies.elmCore | ||
|> Elm.Processing.addDependency Review.Dependencies.elmUrl | ||
|> Elm.Processing.addDependency Review.Dependencies.elmParser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters