use IndexMap over HashMap in prolog_parser

This commit is contained in:
Mark Thom
2021-02-11 15:35:14 -07:00
parent 2db1fac1eb
commit 20cd0dd77a
2 changed files with 3 additions and 2 deletions

View 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" }

View 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 {