From 20cd0dd77a34c3a7feaef3338b5fddcb134d5cb1 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Thu, 11 Feb 2021 15:35:14 -0700 Subject: [PATCH] use IndexMap over HashMap in prolog_parser --- crates/prolog_parser/Cargo.toml | 1 + crates/prolog_parser/src/ast.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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 { -- 2.54.0