Skip to content

Commit

Permalink
Fix elm#1535, order of defs matters!
Browse files Browse the repository at this point in the history
In some cases, I skipped reversing things back to their original order.
In this case, the original order was important!

There is already a test for this, but I guess I got excited about the
new parse error messages and forgot about this case.

The NonHomogeneousRecords change now matches the previous version:
elm@239af836ec601ce96e57ddc4
a3d8f3a01497e8cf#diff-5d834b6ba7fbbd59d5a79fcc66792e32
  • Loading branch information
evancz committed Dec 19, 2016
1 parent 0c6152d commit 3594701
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Parse/Expression.hs
Original file line number Diff line number Diff line change
Expand Up @@ -489,19 +489,19 @@ let_ start =


letHelp :: R.Position -> Int -> [Src.RawDef] -> R.Position -> SPos -> ExprParser
letHelp start oldIndent defs end pos =
letHelp start oldIndent revDefs end pos =
oneOf
[ do checkAligned pos
(def, newEnd, newPos) <- definition
letHelp start oldIndent (def:defs) newEnd newPos
letHelp start oldIndent (def:revDefs) newEnd newPos

, do setIndent oldIndent
checkSpace pos
keyword "in"
popContext ()
spaces
(body, newEnd, newPos) <- expression
let letExpr = A.at start end (Src.Let defs body)
let letExpr = A.at start end (Src.Let (reverse revDefs) body)
return ( letExpr, newEnd, newPos )
]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var _elm_lang$core$Main$bindFields = function (thing) {
var x = thing.x;
var y = thing.y;
var x = thing.x;
return thing;
};
var _elm_lang$core$Main$Thing = F2(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var _elm_lang$core$Main$myId = function () {
var id = function (x) {
return x;
};
return id;
}();

0 comments on commit 3594701

Please sign in to comment.