From 04d35a5780168f7819db977164440dc2e0b145c2 Mon Sep 17 00:00:00 2001 From: ARCJ137442 <61109168+ARCJ137442@users.noreply.github.com> Date: Thu, 13 Jun 2024 23:46:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20:arrow=5Fup:=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=B8=8A=E6=B8=B8Narsese=E3=80=81NAVM=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=88=B0=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ✅兼容最新版本的Narsese.rs、NAVM.rs --- Cargo.lock | 14 +++++++------- Cargo.toml | 2 +- src/cin_implements/cxin_js/translators.rs | 2 +- src/cin_implements/ona/dialect.rs | 9 +++++---- src/cin_implements/opennars/dialect.rs | 9 +++++---- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5538f8f..78e212b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,7 +74,7 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "babel_nar" -version = "0.24.3" +version = "0.24.4" dependencies = [ "anyhow", "clap", @@ -702,15 +702,15 @@ dependencies = [ [[package]] name = "nar_dev_utils" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2fad06f5a0f39772634d0f72d7d114bc31f33b089012692330e914e5f02bea" +checksum = "1bc436754166820e0cdf0dfd147ec5f8faefc6459e65e8b91c4bf5da684e8f85" [[package]] name = "narsese" -version = "0.19.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8530d24772e0382c84683812e7a7c1c58a417dfec31cacc16358635316a76e1" +checksum = "0896f2994e2eedc0f53113a235ce4a498cdc2b8e3a79e4c7ce5f594c243b9858" dependencies = [ "lazy_static", "nar_dev_utils", @@ -718,9 +718,9 @@ dependencies = [ [[package]] name = "navm" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e59cfcc3b868e199646293d7bcdf42e576641d298d5481438f65e3d83ae491" +checksum = "3b47eddfbb9de49498e6e50bac6240ec406034b8f121de1fc31a15aa09cc68d5" dependencies = [ "anyhow", "nar_dev_utils", diff --git a/Cargo.toml b/Cargo.toml index ebead8d..626f622 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "babel_nar" -version = "0.24.3" +version = "0.24.4" edition = "2021" description = """ Implementation and application supports of the NAVM model diff --git a/src/cin_implements/cxin_js/translators.rs b/src/cin_implements/cxin_js/translators.rs index 68a7ea4..355a6cf 100644 --- a/src/cin_implements/cxin_js/translators.rs +++ b/src/cin_implements/cxin_js/translators.rs @@ -18,7 +18,7 @@ use crate::runtimes::TranslateError; use anyhow::Result; use narsese::{ - conversion::string::impl_lexical::{format_instances::FORMAT_ASCII, structs::ParseResult}, + conversion::string::impl_lexical::{format_instances::FORMAT_ASCII, ParseResult}, lexical::Narsese, }; use navm::{ diff --git a/src/cin_implements/ona/dialect.rs b/src/cin_implements/ona/dialect.rs index 74c560d..af641a2 100644 --- a/src/cin_implements/ona/dialect.rs +++ b/src/cin_implements/ona/dialect.rs @@ -6,14 +6,15 @@ use crate::runtimes::TranslateError; use anyhow::{Ok, Result}; use narsese::{ - conversion::string::{ - impl_enum::format_instances::FORMAT_ASCII, impl_lexical::structs::MidParseResult, - }, - lexical::{Budget, Narsese, Term, Truth}, + api::NarseseOptions, + conversion::string::impl_enum::format_instances::FORMAT_ASCII, + lexical::{Budget, Narsese, Punctuation, Stamp, Term, Truth}, }; use pest::{iterators::Pair, Parser}; use pest_derive::Parser; +type MidParseResult = NarseseOptions; + #[derive(Parser)] // ! ↓ 必须从项目根目录开始 #[grammar = "src/cin_implements/ona/dialect_ona.pest"] pub struct DialectParser; diff --git a/src/cin_implements/opennars/dialect.rs b/src/cin_implements/opennars/dialect.rs index f1d6bab..fbe7b62 100644 --- a/src/cin_implements/opennars/dialect.rs +++ b/src/cin_implements/opennars/dialect.rs @@ -5,14 +5,15 @@ use crate::runtimes::TranslateError; use anyhow::{Ok, Result}; use narsese::{ - conversion::string::{ - impl_enum::format_instances::FORMAT_ASCII, impl_lexical::structs::MidParseResult, - }, - lexical::{Budget, Narsese, Term, Truth}, + api::NarseseOptions, + conversion::string::impl_enum::format_instances::FORMAT_ASCII, + lexical::{Budget, Narsese, Punctuation, Stamp, Term, Truth}, }; use pest::{iterators::Pair, Parser}; use pest_derive::Parser; +pub(super) type MidParseResult = NarseseOptions; + #[derive(Parser)] // ! ↓ 必须从项目根目录开始 #[grammar = "src/cin_implements/opennars/dialect_opennars.pest"] pub struct DialectParser;