summaryrefslogtreecommitdiff
path: root/src/grammar.lalrpop
diff options
context:
space:
mode:
authorNanoTech2016-12-10 17:41:27 -0600
committerNanoTech2017-03-10 23:48:29 -0600
commitd4d1f3461d3db269bcd4ffe0dddd3c919f924faf (patch)
tree2fe4642acbb54b6fb693c5c0e649feb435591dad /src/grammar.lalrpop
parent187341b63043d02347eb13089b9b5ea4c437d625 (diff)
Use BTreeMaps to keep records and unions sorted
Diffstat (limited to 'src/grammar.lalrpop')
-rw-r--r--src/grammar.lalrpop8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/grammar.lalrpop b/src/grammar.lalrpop
index 0a103d1..35716fc 100644
--- a/src/grammar.lalrpop
+++ b/src/grammar.lalrpop
@@ -5,7 +5,7 @@ use core::BuiltinType::*;
use grammar_util::*;
use lexer::*;
-use std::collections::HashMap;
+use std::collections::BTreeMap;
use std::iter;
use std::iter::FromIterator;
@@ -146,12 +146,12 @@ Elems: Vec<ParsedExpr<'input>> = {
};
RecordLit: BoxExpr<'input> = {
- "{" "=" "}" => bx(RecordLit(HashMap::new())),
- "{" <FieldValues> "}" => bx(RecordLit(HashMap::from_iter(<>))),
+ "{" "=" "}" => bx(RecordLit(BTreeMap::new())),
+ "{" <FieldValues> "}" => bx(RecordLit(BTreeMap::from_iter(<>))),
};
Record: BoxExpr<'input> = {
- "{" <FieldTypes> "}" => bx(Record(HashMap::from_iter(<>))),
+ "{" <FieldTypes> "}" => bx(Record(BTreeMap::from_iter(<>))),
};
FieldValues = SepBy1<",", Field<"=">>;