]> Repositorios git - scryer-prolog.git/commitdiff
use IndexMap over HashMap in prolog_parser
authorMark Thom <[email protected]>
Thu, 11 Feb 2021 22:35:14 +0000 (15:35 -0700)
committerMark Thom <[email protected]>
Thu, 11 Feb 2021 22:35:14 +0000 (15:35 -0700)
crates/prolog_parser/Cargo.toml
crates/prolog_parser/src/ast.rs

index e022c66c363dc87eb1f9a19b9229a180de538d84..b9dab9fd7f267d7fae7e5535b344a79263b46e9b 100644 (file)
@@ -8,6 +8,7 @@ description = " An operator precedence parser for the Rebis development version
 license = "BSD-3-Clause"
 
 [dependencies]
+indexmap = "1.0.2"
 lexical = "2.1.0"
 ordered-float = "0.5.0"
 rug = { optional = true, version = "1.4.0" }
index fcde5b5ab7fe03ccb6d8cca47ecdc34181a9fa5b..3b9a928713f1332b05508f4dd6fea0cc3dbaa0ac 100644 (file)
@@ -6,7 +6,6 @@ use crate::put_back_n::*;
 
 use std::cell::Cell;
 use std::cmp::Ordering;
-use std::collections::HashMap;
 use std::fmt;
 use std::hash::{Hash, Hasher};
 use std::io::{Bytes, Error as IOError, Read};
@@ -14,6 +13,7 @@ use std::ops::Deref;
 use std::rc::Rc;
 use std::vec::Vec;
 
+use indexmap::IndexMap;
 use unicode_reader::CodePoints;
 
 pub type Atom = String;
@@ -278,7 +278,7 @@ impl OpDirValue {
 }
 
 // name and fixity -> operator type and precedence.
-pub type OpDir = HashMap<OpDirKey, OpDirValue>;
+pub type OpDir = IndexMap<OpDirKey, OpDirValue>;
 
 #[derive(Debug, Clone, Copy)]
 pub struct MachineFlags {