follow masque interface

This commit is contained in:
Jan Petykiewicz 2026-04-02 20:35:31 -07:00
commit d3bf15f47a
6 changed files with 54 additions and 54 deletions

View file

@ -2,7 +2,7 @@
name = "klamath_rs_ext" name = "klamath_rs_ext"
version = "0.2.0" version = "0.2.0"
authors = ["jan <jan@mpxd.net>"] authors = ["jan <jan@mpxd.net>"]
edition = "2021" edition = "2024"
[lib] [lib]

View file

@ -15,15 +15,15 @@ pub enum ErrType {
Failed(String), Failed(String),
} }
pub fn fail<O>(input: &[u8], msg: String) -> IResult<O> { pub fn fail<O>(input: &[u8], msg: String) -> IResult<'_, O> {
Err((input, ErrType::Failed(msg))) Err((input, ErrType::Failed(msg)))
} }
pub fn incomplete<O>(input: &[u8], size: Option<usize>) -> IResult<O> { pub fn incomplete<O>(input: &[u8], size: Option<usize>) -> IResult<'_, O> {
Err((input, ErrType::Incomplete(size))) Err((input, ErrType::Incomplete(size)))
} }
pub fn take_bytes<CC: Into<usize>>(input: &[u8], count: CC) -> IResult<&[u8]> { pub fn take_bytes<CC: Into<usize>>(input: &[u8], count: CC) -> IResult<'_, &[u8]> {
let cc = count.into(); let cc = count.into();
if input.len() < cc { if input.len() < cc {
incomplete(input, Some(cc)) incomplete(input, Some(cc))
@ -37,19 +37,19 @@ pub fn take_bytes<CC: Into<usize>>(input: &[u8], count: CC) -> IResult<&[u8]> {
/* /*
* Parse functions * Parse functions
*/ */
pub fn parse_u16(input: &[u8]) -> IResult<u16> { pub fn parse_u16(input: &[u8]) -> IResult<'_, u16> {
let (input, buf) = take_bytes(input, 2_usize)?; let (input, buf) = take_bytes(input, 2_usize)?;
let val = BigEndian::read_u16(buf); let val = BigEndian::read_u16(buf);
Ok((input, val)) Ok((input, val))
} }
pub fn parse_int2(input: &[u8]) -> IResult<i16> { pub fn parse_int2(input: &[u8]) -> IResult<'_, i16> {
let (input, buf) = take_bytes(input, 2_usize)?; let (input, buf) = take_bytes(input, 2_usize)?;
let val = BigEndian::read_i16(buf); let val = BigEndian::read_i16(buf);
Ok((input, val)) Ok((input, val))
} }
pub fn parse_int4(input: &[u8]) -> IResult<i32> { pub fn parse_int4(input: &[u8]) -> IResult<'_, i32> {
let (input, buf) = take_bytes(input, 4_usize)?; let (input, buf) = take_bytes(input, 4_usize)?;
let val = BigEndian::read_i32(buf); let val = BigEndian::read_i32(buf);
Ok((input, val)) Ok((input, val))
@ -67,14 +67,14 @@ pub fn decode_real8(int: u64) -> f64 {
mant * 2_f64.powi(exp2) mant * 2_f64.powi(exp2)
} }
pub fn parse_real8(input: &[u8]) -> IResult<f64> { pub fn parse_real8(input: &[u8]) -> IResult<'_, f64> {
let (input, buf) = take_bytes(input, 8_usize)?; let (input, buf) = take_bytes(input, 8_usize)?;
let data = BigEndian::read_u64(buf); let data = BigEndian::read_u64(buf);
Ok((input, decode_real8(data))) Ok((input, decode_real8(data)))
} }
pub fn parse_datetime(input: &[u8]) -> IResult<[i16; 6]> { pub fn parse_datetime(input: &[u8]) -> IResult<'_, [i16; 6]> {
let mut buf = [0_i16; 6]; let mut buf = [0_i16; 6];
let mut input = input; let mut input = input;
for bb in &mut buf { for bb in &mut buf {
@ -85,7 +85,7 @@ pub fn parse_datetime(input: &[u8]) -> IResult<[i16; 6]> {
} }
pub fn parse_bitarray(input: &[u8]) -> IResult<[bool; 16]> { pub fn parse_bitarray(input: &[u8]) -> IResult<'_, [bool; 16]> {
let mut bits = [false; 16]; let mut bits = [false; 16];
let (input, val) = parse_int2(input)?; let (input, val) = parse_int2(input)?;
for (ii, bit) in bits.iter_mut().enumerate() { for (ii, bit) in bits.iter_mut().enumerate() {
@ -95,7 +95,7 @@ pub fn parse_bitarray(input: &[u8]) -> IResult<[bool; 16]> {
} }
pub fn parse_ascii(input: &[u8], length: u16) -> IResult<Vec<u8>> { pub fn parse_ascii(input: &[u8], length: u16) -> IResult<'_, Vec<u8>> {
let length = length as usize; let length = length as usize;
let (input, data) = take_bytes(input, length)?; let (input, data) = take_bytes(input, length)?;
let last = data[length - 1]; let last = data[length - 1];

View file

@ -946,7 +946,7 @@ pub trait Element {
/// Read from a stream to construct this object. /// Read from a stream to construct this object.
/// Consumes up to (and including) the ENDEL record. /// Consumes up to (and including) the ENDEL record.
/// ///
fn read(input: &[u8]) -> IResult<Self> where Self: Sized; fn read(input: &[u8]) -> IResult<'_, Self> where Self: Sized;
/// ///
/// Write this element to a stream. /// Write this element to a stream.
@ -993,7 +993,7 @@ pub struct Reference {
} }
impl Element for Reference { impl Element for Reference {
fn read(input: &[u8]) -> IResult<Self> { fn read(input: &[u8]) -> IResult<'_, Self> {
let mut invert_y = false; let mut invert_y = false;
let mut mag = 1.0; let mut mag = 1.0;
let mut angle_deg = 0.0; let mut angle_deg = 0.0;
@ -1094,7 +1094,7 @@ pub struct Boundary {
} }
impl Element for Boundary { impl Element for Boundary {
fn read(input: &[u8]) -> IResult<Self> { fn read(input: &[u8]) -> IResult<'_, Self> {
let (input, layer) = LAYER::skip_and_read(input)?; let (input, layer) = LAYER::skip_and_read(input)?;
let (input, dtype) = DATATYPE::read(input)?; let (input, dtype) = DATATYPE::read(input)?;
let (input, xy) = XY::read(input)?; let (input, xy) = XY::read(input)?;
@ -1142,7 +1142,7 @@ pub struct Path {
} }
impl Element for Path { impl Element for Path {
fn read(input: &[u8]) -> IResult<Self> { fn read(input: &[u8]) -> IResult<'_, Self> {
let mut path_type = 0; let mut path_type = 0;
let mut width = 0; let mut width = 0;
let mut bgn_ext = 0; let mut bgn_ext = 0;
@ -1221,7 +1221,7 @@ pub struct GDSBox {
} }
impl Element for GDSBox { impl Element for GDSBox {
fn read(input: &[u8]) -> IResult<Self> { fn read(input: &[u8]) -> IResult<'_, Self> {
let (input, layer) = LAYER::skip_and_read(input)?; let (input, layer) = LAYER::skip_and_read(input)?;
let (input, dtype) = BOXTYPE::read(input)?; let (input, dtype) = BOXTYPE::read(input)?;
let (input, xy) = XY::read(input)?; let (input, xy) = XY::read(input)?;
@ -1260,7 +1260,7 @@ pub struct Node {
} }
impl Element for Node { impl Element for Node {
fn read(input: &[u8]) -> IResult<Self> { fn read(input: &[u8]) -> IResult<'_, Self> {
let (input, layer) = LAYER::skip_and_read(input)?; let (input, layer) = LAYER::skip_and_read(input)?;
let (input, dtype) = NODETYPE::read(input)?; let (input, dtype) = NODETYPE::read(input)?;
let (input, xy) = XY::read(input)?; let (input, xy) = XY::read(input)?;
@ -1317,7 +1317,7 @@ pub struct Text {
} }
impl Element for Text { impl Element for Text {
fn read(input: &[u8]) -> IResult<Self> { fn read(input: &[u8]) -> IResult<'_, Self> {
let mut path_type = 0; let mut path_type = 0;
let mut presentation = [false; 16]; let mut presentation = [false; 16];
let mut invert_y = false; let mut invert_y = false;

View file

@ -20,7 +20,7 @@ use arrow::ffi::{to_ffi, FFI_ArrowArray, FFI_ArrowSchema};
use arrow::array::Array; use arrow::array::Array;
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn read_path( pub unsafe extern "C" fn read_path(
cpath: *const c_char, cpath: *const c_char,
arr: *mut FFI_ArrowArray, arr: *mut FFI_ArrowArray,
@ -40,7 +40,7 @@ pub unsafe extern "C" fn read_path(
let input = fs::read(path).expect("File read failed"); let input = fs::read(path).expect("File read failed");
let (_input, struct_arr) = read_library(&input).expect("Read failed"); let (_input, struct_arr) = read_library(&input).expect("Read failed");
(*arr, *schema) = to_ffi(&struct_arr.to_data()).unwrap(); unsafe { (*arr, *schema) = to_ffi(&struct_arr.to_data()).unwrap(); }
} }
@ -80,40 +80,40 @@ macro_rules! impl_i32be {
} }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn f64_to_i16(arr: *mut f64, size: usize) -> f64 { impl_i16be!(f64, arr, size) } pub unsafe extern "C" fn f64_to_i16(arr: *mut f64, size: usize) -> f64 { impl_i16be!(f64, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn f64_to_i32(arr: *mut f64, size: usize) -> f64 { impl_i32be!(f64, arr, size) } pub unsafe extern "C" fn f64_to_i32(arr: *mut f64, size: usize) -> f64 { impl_i32be!(f64, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn f32_to_i16(arr: *mut f32, size: usize) -> f32 { impl_i16be!(f32, arr, size) } pub unsafe extern "C" fn f32_to_i16(arr: *mut f32, size: usize) -> f32 { impl_i16be!(f32, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn f32_to_i32(arr: *mut f32, size: usize) -> f32 { impl_i32be!(f32, arr, size) } pub unsafe extern "C" fn f32_to_i32(arr: *mut f32, size: usize) -> f32 { impl_i32be!(f32, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn u64_to_i16(arr: *mut u64, size: usize) -> u64 { impl_i16be!(u64, arr, size) } pub unsafe extern "C" fn u64_to_i16(arr: *mut u64, size: usize) -> u64 { impl_i16be!(u64, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn u64_to_i32(arr: *mut u64, size: usize) -> u64 { impl_i32be!(u64, arr, size) } pub unsafe extern "C" fn u64_to_i32(arr: *mut u64, size: usize) -> u64 { impl_i32be!(u64, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn i64_to_i16(arr: *mut i64, size: usize) -> i64 { impl_i16be!(i64, arr, size) } pub unsafe extern "C" fn i64_to_i16(arr: *mut i64, size: usize) -> i64 { impl_i16be!(i64, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn i64_to_i32(arr: *mut i64, size: usize) -> i64 { impl_i32be!(i64, arr, size) } pub unsafe extern "C" fn i64_to_i32(arr: *mut i64, size: usize) -> i64 { impl_i32be!(i64, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn u32_to_i16(arr: *mut u32, size: usize) -> u32 { impl_i16be!(u32, arr, size) } pub unsafe extern "C" fn u32_to_i16(arr: *mut u32, size: usize) -> u32 { impl_i16be!(u32, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn u32_to_i32(arr: *mut u32, size: usize) -> u32 { impl_i32be!(u32, arr, size) } pub unsafe extern "C" fn u32_to_i32(arr: *mut u32, size: usize) -> u32 { impl_i32be!(u32, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn i32_to_i16(arr: *mut i32, size: usize) -> i32 { impl_i16be!(i32, arr, size) } pub unsafe extern "C" fn i32_to_i16(arr: *mut i32, size: usize) -> i32 { impl_i16be!(i32, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn i32_to_i32(arr: *mut i32, size: usize) -> i32 { impl_i32be!(i32, arr, size) } pub unsafe extern "C" fn i32_to_i32(arr: *mut i32, size: usize) -> i32 { impl_i32be!(i32, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn u16_to_i16(arr: *mut u16, size: usize) -> u16 { impl_i16be!(u16, arr, size) } pub unsafe extern "C" fn u16_to_i16(arr: *mut u16, size: usize) -> u16 { impl_i16be!(u16, arr, size) }
#[no_mangle] #[unsafe(no_mangle)]
pub unsafe extern "C" fn i16_to_i16(arr: *mut i16, size: usize) -> i16 { impl_i16be!(i16, arr, size) } pub unsafe extern "C" fn i16_to_i16(arr: *mut i16, size: usize) -> i16 { impl_i16be!(i16, arr, size) }

View file

@ -64,7 +64,7 @@ impl FileHeader {
/// Returns: /// Returns:
/// FileHeader object /// FileHeader object
/// ///
pub fn read(input: &[u8]) -> IResult<Self> { pub fn read(input: &[u8]) -> IResult<'_, Self> {
let (input, _version) = records::HEADER::read(input)?; let (input, _version) = records::HEADER::read(input)?;
let (input, [mod_time, acc_time]) = records::BGNLIB::read(input)?; let (input, [mod_time, acc_time]) = records::BGNLIB::read(input)?;
let (input, name) = records::LIBNAME::skip_and_read(input)?; let (input, name) = records::LIBNAME::skip_and_read(input)?;
@ -98,7 +98,7 @@ impl FileHeader {
} }
pub fn read_library(input: &[u8]) -> IResult<StructArray> { pub fn read_library(input: &[u8]) -> IResult<'_, StructArray> {
let input_size = input.len(); let input_size = input.len();
let property_t = DataType::Struct(Fields::from(vec![ let property_t = DataType::Struct(Fields::from(vec![

View file

@ -24,7 +24,7 @@ pub struct RecordHeader {
} }
impl RecordHeader { impl RecordHeader {
pub fn read(input: &[u8]) -> IResult<RecordHeader> { pub fn read(input: &[u8]) -> IResult<'_, RecordHeader> {
let (input, size) = parse_u16(input)?; let (input, size) = parse_u16(input)?;
let (input, tag) = parse_u16(input)?; let (input, tag) = parse_u16(input)?;
Ok((input, RecordHeader{tag, data_size:size - 4})) Ok((input, RecordHeader{tag, data_size:size - 4}))
@ -50,7 +50,7 @@ pub trait RecordData {
type InData : ?Sized; type InData : ?Sized;
type ByteData : AsRef<[u8]>; type ByteData : AsRef<[u8]>;
fn read(input: &[u8], size: u16) -> IResult<Self::BareData<'_>>; fn read(input: &[u8], size: u16) -> IResult<'_, Self::BareData<'_>>;
fn pack_into(buf: &mut [u8], data: &Self::InData); fn pack_into(buf: &mut [u8], data: &Self::InData);
//fn size(data: &Self::BareData<'_>) -> u16; //fn size(data: &Self::BareData<'_>) -> u16;
fn pack(data: &Self::InData) -> Self::ByteData; fn pack(data: &Self::InData) -> Self::ByteData;
@ -72,7 +72,7 @@ pub trait Record<RData: RecordData> {
} }
} }
fn read_header(input: &[u8]) -> IResult<RecordHeader> { fn read_header(input: &[u8]) -> IResult<'_, RecordHeader> {
RecordHeader::read(input) RecordHeader::read(input)
} }
@ -80,7 +80,7 @@ pub trait Record<RData: RecordData> {
RecordHeader{tag: Self::tag(), data_size}.write(ww) RecordHeader{tag: Self::tag(), data_size}.write(ww)
} }
fn read_data(input: &[u8], size: u16) -> IResult<RData::BareData<'_>> { fn read_data(input: &[u8], size: u16) -> IResult<'_, RData::BareData<'_>> {
RData::read(input, size) RData::read(input, size)
} }
@ -95,7 +95,7 @@ pub trait Record<RData: RecordData> {
/// True if the record was encountered and skipped. /// True if the record was encountered and skipped.
/// False if the end of the library was reached. /// False if the end of the library was reached.
/// ///
fn skip_past(input: &[u8]) -> IResult<bool> { fn skip_past(input: &[u8]) -> IResult<'_, bool> {
let original_input = input; let original_input = input;
let (mut input, mut header) = RecordHeader::read(input)?; let (mut input, mut header) = RecordHeader::read(input)?;
while header.tag != Self::tag() { while header.tag != Self::tag() {
@ -109,7 +109,7 @@ pub trait Record<RData: RecordData> {
Ok((input, true)) Ok((input, true))
} }
fn skip_and_read(input: &[u8]) -> IResult<RData::BareData<'_>> { fn skip_and_read(input: &[u8]) -> IResult<'_, RData::BareData<'_>> {
let (mut input, mut header) = RecordHeader::read(input)?; let (mut input, mut header) = RecordHeader::read(input)?;
while header.tag != Self::tag() { while header.tag != Self::tag() {
(input, _) = take_bytes(input, header.data_size)?; (input, _) = take_bytes(input, header.data_size)?;
@ -119,7 +119,7 @@ pub trait Record<RData: RecordData> {
Ok((input, data)) Ok((input, data))
} }
fn expect_header(input: &[u8]) -> IResult<u16> { fn expect_header(input: &[u8]) -> IResult<'_, u16> {
let (input, header) = RecordHeader::read(input)?; let (input, header) = RecordHeader::read(input)?;
if header.tag != Self::tag() { if header.tag != Self::tag() {
fail(input, format!("Unexpected record! Got tag 0x{:04x}, expected 0x{:04x}", header.tag, Self::tag())) fail(input, format!("Unexpected record! Got tag 0x{:04x}, expected 0x{:04x}", header.tag, Self::tag()))
@ -128,7 +128,7 @@ pub trait Record<RData: RecordData> {
} }
} }
fn read(input: &[u8]) -> IResult<RData::BareData<'_>> { fn read(input: &[u8]) -> IResult<'_, RData::BareData<'_>> {
let (input, size) = Self::expect_header(input)?; let (input, size) = Self::expect_header(input)?;
Self::check_size(size).unwrap(); Self::check_size(size).unwrap();
let (input, data) = Self::read_data(input, size)?; let (input, data) = Self::read_data(input, size)?;
@ -152,7 +152,7 @@ impl RecordData for BitArray {
type InData = [bool; 16]; type InData = [bool; 16];
type ByteData = [u8; 2]; type ByteData = [u8; 2];
fn read(input: &[u8], size: u16) -> IResult<Self::BareData<'_>> { fn read(input: &[u8], size: u16) -> IResult<'_, Self::BareData<'_>> {
assert!(size == 2); assert!(size == 2);
parse_bitarray(input) parse_bitarray(input)
} }
@ -175,7 +175,7 @@ impl RecordData for Int2 {
type InData = i16; type InData = i16;
type ByteData = [u8; 2]; type ByteData = [u8; 2];
fn read(input: &[u8], size: u16) -> IResult<Self::BareData<'_>> { fn read(input: &[u8], size: u16) -> IResult<'_, Self::BareData<'_>> {
assert!(size == 2); assert!(size == 2);
parse_int2(input) parse_int2(input)
} }
@ -197,7 +197,7 @@ impl RecordData for Int4 {
type InData = i32; type InData = i32;
type ByteData = [u8; 4]; type ByteData = [u8; 4];
fn read(input: &[u8], size: u16) -> IResult<Self::BareData<'_>> { fn read(input: &[u8], size: u16) -> IResult<'_, Self::BareData<'_>> {
assert!(size == 4); assert!(size == 4);
parse_int4(input) parse_int4(input)
} }
@ -220,7 +220,7 @@ impl RecordData for Int2Array {
type InData = [i16]; type InData = [i16];
type ByteData = Vec<u8>; type ByteData = Vec<u8>;
fn read(input: &[u8], size: u16) -> IResult<Self::BareData<'_>> { fn read(input: &[u8], size: u16) -> IResult<'_, Self::BareData<'_>> {
assert!(size % 2 == 0, "Record must contain an integer quantity of integers"); assert!(size % 2 == 0, "Record must contain an integer quantity of integers");
//let mut input = input; //let mut input = input;
let (input, bytes) = take_bytes(input, size)?; let (input, bytes) = take_bytes(input, size)?;
@ -261,7 +261,7 @@ impl RecordData for Int4Array {
type InData = [i32]; type InData = [i32];
type ByteData = Vec<u8>; type ByteData = Vec<u8>;
fn read(input: &[u8], size: u16) -> IResult<Self::BareData<'_>> { fn read(input: &[u8], size: u16) -> IResult<'_, Self::BareData<'_>> {
assert!(size % 4 == 0, "Record must contain an integer quantity of integers"); assert!(size % 4 == 0, "Record must contain an integer quantity of integers");
//let mut input = input; //let mut input = input;
let (input, bytes) = take_bytes(input, size)?; let (input, bytes) = take_bytes(input, size)?;
@ -302,7 +302,7 @@ impl RecordData for Real8 {
type InData = f64; type InData = f64;
type ByteData = [u8; 8]; type ByteData = [u8; 8];
fn read(input: &[u8], size: u16) -> IResult<Self::BareData<'_>> { fn read(input: &[u8], size: u16) -> IResult<'_, Self::BareData<'_>> {
assert!(size == 8); assert!(size == 8);
parse_real8(input) parse_real8(input)
} }
@ -324,7 +324,7 @@ impl RecordData for Real8Pair {
type InData = (f64, f64); type InData = (f64, f64);
type ByteData = [u8; 2 * 8]; type ByteData = [u8; 2 * 8];
fn read(input: &[u8], size: u16) -> IResult<Self::BareData<'_>> { fn read(input: &[u8], size: u16) -> IResult<'_, Self::BareData<'_>> {
assert!(size == 2 * 8); assert!(size == 2 * 8);
let (input, data0) = parse_real8(input)?; let (input, data0) = parse_real8(input)?;
let (input, data1) = parse_real8(input)?; let (input, data1) = parse_real8(input)?;
@ -354,7 +354,7 @@ impl RecordData for ASCII {
type InData = [u8]; type InData = [u8];
type ByteData = Vec<u8>; type ByteData = Vec<u8>;
fn read(input: &[u8], size: u16) -> IResult<Self::BareData<'_>> { fn read(input: &[u8], size: u16) -> IResult<'_, Self::BareData<'_>> {
parse_ascii(input, size) parse_ascii(input, size)
} }
@ -376,7 +376,7 @@ impl RecordData for DateTimePair {
type InData = [[i16; 6]; 2]; type InData = [[i16; 6]; 2];
type ByteData = [u8; 2 * 6 * 2]; type ByteData = [u8; 2 * 6 * 2];
fn read(input: &[u8], size: u16) -> IResult<Self::BareData<'_>> { fn read(input: &[u8], size: u16) -> IResult<'_, Self::BareData<'_>> {
assert!(size == 2 * 6 * 2); assert!(size == 2 * 6 * 2);
let (input, data0) = parse_datetime(input)?; let (input, data0) = parse_datetime(input)?;
let (input, data1) = parse_datetime(input)?; let (input, data1) = parse_datetime(input)?;
@ -406,7 +406,7 @@ impl RecordData for Empty {
type InData = (); type InData = ();
type ByteData = [u8; 0]; type ByteData = [u8; 0];
fn read(input: &[u8], size: u16) -> IResult<Self::BareData<'_>> { fn read(input: &[u8], size: u16) -> IResult<'_, Self::BareData<'_>> {
assert!(size == 0); assert!(size == 0);
Ok((input, ())) Ok((input, ()))
} }