Skip to content

Commit

Permalink
support function application on multiple lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Warry committed Oct 13, 2016
1 parent c45948f commit fa8bba8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Ast/Helpers.elm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spaces : Parser String
spaces = regex "[ \t]*"

spaces' : Parser String
spaces' = regex "[ \t]+"
spaces' = regex "[ \r\t\n]*[ \t]+"

symbol : String -> Parser String
symbol k =
Expand Down
17 changes: 17 additions & 0 deletions tests/Statement.elm
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ f x =
g : Int -> Int
g x =
f x + 1
h : Int -> Int
h x =
g
x
+
10
"""

multipleDeclarations : Test
Expand All @@ -235,6 +243,15 @@ multipleDeclarations =
(Variable ["f"])
(Variable ["x"]))
(Integer 1))
, FunctionTypeDeclaration "h" (TypeApplication
(TypeConstructor ["Int"] [])
(TypeConstructor ["Int"] []))
, FunctionDeclaration "h" ["x"] (BinOp
(Variable ["+"])
(Application
(Variable ["g"])
(Variable ["x"]))
(Integer 10))
]

moduleFixityInput : String
Expand Down

0 comments on commit fa8bba8

Please sign in to comment.