-
-
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 defective branch was taken when compiling declarations applying `Parser.Advanced.oneOf` as the root expression.
- Loading branch information
Showing
18 changed files
with
73 additions
and
3 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
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": {} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...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,15 @@ | ||
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 () () | ||
] |
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
.../elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/345/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 19 |
1 change: 1 addition & 0 deletions
1
...rain/elm-interactive-scenarios-kernel/elm-kernel-parser-advanced/steps/345/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_with_param_for_problem ()) "19" |
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" |