Skip to content

Guida format #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/some-package/src/Main.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Main exposing (add1)

{-| This library is a test library for testing the Elm compiler.
{-| This a test package for testing the Elm compiler.


# Example
Expand Down
30 changes: 10 additions & 20 deletions src/Browser/Format.elm
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module Browser.Format exposing (run)

import Elm.Syntax.File
import ElmSyntaxParserLenient
import ElmSyntaxPrint
import Common.Format
import Compiler.Elm.Package as Pkg
import Compiler.Parse.Module as M
import Compiler.Parse.SyntaxVersion as SV



Expand All @@ -11,20 +12,9 @@ import ElmSyntaxPrint

run : String -> Result String String
run inputText =
case ElmSyntaxParserLenient.run ElmSyntaxParserLenient.module_ inputText of
Just modu ->
Ok (render modu)

Nothing ->
-- FIXME missings errs
Err "Something went wrong..."



-- RENDER


render : Elm.Syntax.File.File -> String
render modul =
ElmSyntaxPrint.module_ modul
|> ElmSyntaxPrint.toString
Common.Format.format SV.Guida (M.Package Pkg.core) inputText
|> Result.mapError
(\_ ->
-- FIXME missings errs
"Something went wrong..."
)
Loading
Loading