From: Mark Thom Date: Thu, 11 Feb 2021 22:35:14 +0000 (-0700) Subject: use IndexMap over HashMap in prolog_parser X-Git-Tag: v0.9.0~150^2~59 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=20cd0dd77a34c3a7feaef3338b5fddcb134d5cb1;p=scryer-prolog.git use IndexMap over HashMap in prolog_parser --- diff --git a/crates/prolog_parser/Cargo.toml b/crates/prolog_parser/Cargo.toml index e022c66c..b9dab9fd 100644 --- a/crates/prolog_parser/Cargo.toml +++ b/crates/prolog_parser/Cargo.toml @@ -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" } diff --git a/crates/prolog_parser/src/ast.rs b/crates/prolog_parser/src/ast.rs index fcde5b5a..3b9a9287 100644 --- a/crates/prolog_parser/src/ast.rs +++ b/crates/prolog_parser/src/ast.rs @@ -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; +pub type OpDir = IndexMap; #[derive(Debug, Clone, Copy)] pub struct MachineFlags {