From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- build/rust/nom/Cargo.toml | 15 +++++++++++++++ build/rust/nom/lib.rs | 26 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 build/rust/nom/Cargo.toml create mode 100644 build/rust/nom/lib.rs (limited to 'build/rust/nom') diff --git a/build/rust/nom/Cargo.toml b/build/rust/nom/Cargo.toml new file mode 100644 index 0000000000..7a69aa23c1 --- /dev/null +++ b/build/rust/nom/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "nom" +version = "6.99.99" +edition = "2018" +license = "MPL-2.0" + +[lib] +path = "lib.rs" + +[dependencies.nom] +version = "7" +default-features = false + +[features] +std = ["nom/std"] diff --git a/build/rust/nom/lib.rs b/build/rust/nom/lib.rs new file mode 100644 index 0000000000..2e85191113 --- /dev/null +++ b/build/rust/nom/lib.rs @@ -0,0 +1,26 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Strict minimum to make glsl happy. +pub use nom::{branch, bytes, character, combinator, error, sequence, Err, IResult, ParseTo}; + +pub mod multi { + use nom::multi::fold_many0 as nom_fold_many0; + pub use nom::multi::{many0, many1, separated_list0}; + + pub fn fold_many0( + f: F, + init: R, + g: G, + ) -> impl FnMut(I) -> nom::IResult + where + I: Clone + nom::InputLength, + F: nom::Parser, + G: FnMut(R, O) -> R, + E: nom::error::ParseError, + R: Clone, + { + nom_fold_many0(f, move || init.clone(), g) + } +} -- cgit v1.2.3