Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
pull_request:

jobs:
test:
name: Build and test (ubuntu-latest)
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.92.0

- name: Rust cache
uses: Swatinem/rust-cache@v2

- name: Build
run: cargo build --workspace --all-features --exclude gui

- name: Test
run: cargo test --workspace --all-features --exclude gui
2 changes: 1 addition & 1 deletion express/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
fast-float = "0.2"
memchr = "2.4.0"
nom = "6.0"
nom = "7"

[dev-dependencies]
clap = "2.33"
18 changes: 9 additions & 9 deletions express/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,15 +655,15 @@ impl<'a> TypeDecl<'a> {
}
}
impl<'a> UnderlyingType<'a> {
fn to_type(&'a self, type_map: &mut TypeMap<'a>) -> Type {
fn to_type(&'a self, type_map: &mut TypeMap<'a>) -> Type<'a> {
match self {
UnderlyingType::Concrete(c) => c.to_type(type_map),
UnderlyingType::Constructed(c) => c.to_type(),
}
}
}
impl<'a> ConcreteTypes<'a> {
fn to_type(&self, type_map: &mut TypeMap<'a>) -> Type {
fn to_type(&self, type_map: &mut TypeMap<'a>) -> Type<'_> {
match self {
ConcreteTypes::Aggregation(a) => a.to_type(type_map),
ConcreteTypes::Simple(s) => s.to_type(),
Expand Down Expand Up @@ -718,7 +718,7 @@ impl<'a> SimpleExpression<'a> {
}
}
impl<'a> AggregationTypes<'a> {
fn to_type(&self, type_map: &mut TypeMap<'a>) -> Type {
fn to_type(&self, type_map: &mut TypeMap<'a>) -> Type<'_> {
let (optional, instantiable) = match self {
AggregationTypes::Array(a) => (a.optional, &a.instantiable_type),
AggregationTypes::Bag(a) => (false, &a.1),
Expand All @@ -737,15 +737,15 @@ impl<'a> AggregationTypes<'a> {
}
}
impl<'a> ConstructedTypes<'a> {
fn to_type(&'a self) -> Type {
fn to_type(&'a self) -> Type<'a> {
match self {
ConstructedTypes::Enumeration(e) => e.to_type(),
ConstructedTypes::Select(s) => s.to_type(),
}
}
}
impl<'a> EnumerationType<'a> {
fn to_type(&self) -> Type {
fn to_type(&self) -> Type<'_> {
assert!(!self.extensible, "Extensible enumerations are not supported");
match self.items_or_extension.as_ref().unwrap() {
EnumerationItemsOrExtension::Items(e) => e.to_type(),
Expand All @@ -754,7 +754,7 @@ impl<'a> EnumerationType<'a> {
}
}
impl<'a> EnumerationItems<'a> {
fn to_type(&self) -> Type {
fn to_type(&self) -> Type<'_> {
let mut out = Vec::new();
for e in &self.0 {
out.push(e.0);
Expand All @@ -763,7 +763,7 @@ impl<'a> EnumerationItems<'a> {
}
}
impl<'a> SelectType<'a> {
fn to_type(&'a self) -> Type {
fn to_type(&'a self) -> Type<'a> {
assert!(!self.extensible, "Cannot handle extensible lists");
assert!(!self.generic_entity, "Cannot handle generic entity lists");
match &self.list_or_extension {
Expand All @@ -773,7 +773,7 @@ impl<'a> SelectType<'a> {
}
}
impl<'a> SelectList<'a> {
fn to_type(&'a self) -> Type {
fn to_type(&'a self) -> Type<'a> {
let mut out = Vec::new();
for e in &self.0 {
out.push(e.name());
Expand Down Expand Up @@ -950,7 +950,7 @@ impl <'a> SimpleTypes<'a> {
SimpleTypes::String(_) => "&'a str",
}
}
fn to_type(&self) -> Type {
fn to_type(&self) -> Type<'_> {
Type::RedeclaredPrimitive(self.to_attr_type_str())
}
}
Expand Down
Loading