-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compiler bug affecting Elm Parser module declarations
This commit fixes a bug in the Elm compiler that resulted in invalid emission for a subset of module-level declarations with zero arguments. For example, this defect surfaced when compiling declarations applying `Parser.Advanced.oneOf` as the root expression or when using `Parser.int`
- Loading branch information
Showing
22 changed files
with
99 additions
and
31 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
34 changes: 17 additions & 17 deletions
34
...-and-train/elm-interactive-scenarios-core/partial-application/context-app/src/ModuleA.elm
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
module ModuleA exposing (..) | ||
|
||
|
||
partially_applied_a = | ||
function_with_three_parameters 11 | ||
|
||
|
||
function_with_three_parameters param0 param1 param2 = | ||
[ param0, param1, param0, param2, param1 ] | ||
|
||
|
||
same_module_partially_applied_b = | ||
partially_applied_a named_literal | ||
|
||
|
||
named_literal = | ||
71 | ||
module ModuleA exposing (..) | ||
|
||
|
||
partially_applied_a = | ||
function_with_three_parameters 11 | ||
|
||
|
||
function_with_three_parameters param0 param1 param2 = | ||
[ param0, param1, param0, param2, param1 ] | ||
|
||
|
||
same_module_partially_applied_b = | ||
partially_applied_a named_literal | ||
|
||
|
||
named_literal = | ||
71 |
22 changes: 11 additions & 11 deletions
22
...-and-train/elm-interactive-scenarios-core/partial-application/context-app/src/ModuleB.elm
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
module ModuleB exposing (partially_applied_b) | ||
|
||
import ModuleA exposing (..) | ||
|
||
|
||
partially_applied_b = | ||
ModuleA.partially_applied_a named_literal | ||
|
||
|
||
named_literal = | ||
13 | ||
module ModuleB exposing (partially_applied_b) | ||
|
||
import ModuleA exposing (..) | ||
|
||
|
||
partially_applied_b = | ||
ModuleA.partially_applied_a named_literal | ||
|
||
|
||
named_literal = | ||
13 |
1 change: 1 addition & 0 deletions
1
...-train/elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/context-app/.gitignore
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 @@ | ||
/elm-stuff/ |
25 changes: 25 additions & 0 deletions
25
...nd-train/elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/context-app/elm.json
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,25 @@ | ||
{ | ||
"type": "application", | ||
"source-directories": [ | ||
"src" | ||
], | ||
"elm-version": "0.19.1", | ||
"dependencies": { | ||
"direct": { | ||
"elm/browser": "1.0.2", | ||
"elm/core": "1.0.5", | ||
"elm/html": "1.0.0", | ||
"elm/parser": "1.1.0" | ||
}, | ||
"indirect": { | ||
"elm/json": "1.1.3", | ||
"elm/time": "1.0.0", | ||
"elm/url": "1.0.0", | ||
"elm/virtual-dom": "1.0.3" | ||
} | ||
}, | ||
"test-dependencies": { | ||
"direct": {}, | ||
"indirect": {} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...teractive-scenarios-kernel/elm-kernel-parser-advanced/context-app/src/CompositeParser.elm
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,25 @@ | ||
module CompositeParser exposing (..) | ||
|
||
import Parser.Advanced exposing ((|.), (|=)) | ||
|
||
|
||
negateToken : Parser.Advanced.Token () | ||
negateToken = | ||
Parser.Advanced.Token "-" () | ||
|
||
|
||
oneOf_only_int : Parser.Advanced.Parser () () Int | ||
oneOf_only_int = | ||
Parser.Advanced.oneOf | ||
[ Parser.Advanced.int () () | ||
] | ||
|
||
|
||
signedInt : Parser.Advanced.Parser () () Int | ||
signedInt = | ||
Parser.Advanced.oneOf | ||
[ Parser.Advanced.succeed negate | ||
|. Parser.Advanced.symbol negateToken | ||
|= Parser.Advanced.int () () | ||
, Parser.Advanced.int () () | ||
] |
2 changes: 1 addition & 1 deletion
2
...rain/elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/110/submission.txt
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 |
---|---|---|
@@ -1 +1 @@ | ||
Parser.Advanced.run (Parser.succeed "test") "unrelated" | ||
Parser.Advanced.run (Parser.Advanced.succeed "test") "unrelated" |
1 change: 1 addition & 0 deletions
1
.../elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/331/expected-value.txt
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 @@ | ||
Ok [] |
3 changes: 3 additions & 0 deletions
3
...rain/elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/331/submission.txt
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,3 @@ | ||
Parser.Advanced.run | ||
(Parser.Advanced.symbol CompositeParser.negateToken) | ||
"-" |
1 change: 1 addition & 0 deletions
1
.../elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/341/expected-value.txt
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 @@ | ||
Ok 1 |
1 change: 1 addition & 0 deletions
1
...rain/elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/341/submission.txt
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 @@ | ||
Parser.Advanced.run (Parser.Advanced.oneOf [ Parser.Advanced.int () () ]) "1" |
1 change: 1 addition & 0 deletions
1
...rain/elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/342/submission.txt
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 @@ | ||
testOneOf = Parser.Advanced.oneOf [ Parser.Advanced.int () () ] |
1 change: 1 addition & 0 deletions
1
.../elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/343/expected-value.txt
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 @@ | ||
Ok 13 |
1 change: 1 addition & 0 deletions
1
...rain/elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/343/submission.txt
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 @@ | ||
Parser.Advanced.run testOneOf "13" |
1 change: 1 addition & 0 deletions
1
.../elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/344/expected-value.txt
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 @@ | ||
Ok 17 |
1 change: 1 addition & 0 deletions
1
...rain/elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/344/submission.txt
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 @@ | ||
Parser.Advanced.run CompositeParser.oneOf_only_int "17" |
1 change: 1 addition & 0 deletions
1
...and-train/elm-interactive-scenarios-kernel/elm-kernel-parser/steps/310/expected-value.txt
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 @@ | ||
Ok 0 |
1 change: 1 addition & 0 deletions
1
...est-and-train/elm-interactive-scenarios-kernel/elm-kernel-parser/steps/310/submission.txt
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 @@ | ||
Parser.run Parser.int "0" |
1 change: 1 addition & 0 deletions
1
...and-train/elm-interactive-scenarios-kernel/elm-kernel-parser/steps/311/expected-value.txt
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 @@ | ||
Ok 1 |
1 change: 1 addition & 0 deletions
1
...est-and-train/elm-interactive-scenarios-kernel/elm-kernel-parser/steps/311/submission.txt
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 @@ | ||
Parser.run Parser.int "1" |
1 change: 1 addition & 0 deletions
1
...and-train/elm-interactive-scenarios-kernel/elm-kernel-parser/steps/315/expected-value.txt
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 @@ | ||
Ok 731 |
1 change: 1 addition & 0 deletions
1
...est-and-train/elm-interactive-scenarios-kernel/elm-kernel-parser/steps/315/submission.txt
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 @@ | ||
Parser.run Parser.int "731" |