mirror of
https://github.com/fluencelabs/interface-types
synced 2024-12-04 15:20:20 +00:00
fix : parsing in record fields
This commit is contained in:
parent
5569b9ab62
commit
552d4b7141
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -161,7 +161,7 @@ checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-interface-types-fl"
|
||||
version = "0.17.16"
|
||||
version = "0.17.17"
|
||||
dependencies = [
|
||||
"log",
|
||||
"nom",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-interface-types-fl"
|
||||
version = "0.17.16"
|
||||
version = "0.17.17"
|
||||
description = "WebAssembly Interface Types library for Wasmer"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
|
@ -184,9 +184,21 @@ impl Parse<'_> for RecordType {
|
||||
})?
|
||||
.to_string();
|
||||
|
||||
if !name.ends_with(':') {
|
||||
parser.step(|cursor| {
|
||||
if let Some((":", rest)) = cursor.reserved() {
|
||||
return Ok(("", rest));
|
||||
}
|
||||
Err(cursor.error("expected : between an argument and a type"))
|
||||
})?;
|
||||
}
|
||||
|
||||
let ty = parser.parse()?;
|
||||
|
||||
fields.push(RecordFieldType { name, ty });
|
||||
fields.push(RecordFieldType {
|
||||
name: name.trim_end_matches(":").to_string(),
|
||||
ty,
|
||||
});
|
||||
}
|
||||
Ok(())
|
||||
})?;
|
||||
|
Loading…
Reference in New Issue
Block a user