Skip to content

Commit

Permalink
Merge pull request #3 from librasn/fix/issue-2
Browse files Browse the repository at this point in the history
Fix/issue 2
  • Loading branch information
6d7a authored Mar 13, 2024
2 parents fa2b958 + be946a7 commit ee6aab0
Show file tree
Hide file tree
Showing 699 changed files with 11,854 additions and 11,512 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Build
uses: actions-rs/cargo@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
[![crates.io](https://img.shields.io/crates/d/rasn-compiler.svg)](https://crates.io/crates/rasn-compiler)
[![Help Wanted](https://img.shields.io/github/issues/librasn/compiler/help%20wanted?color=green)](https://github.com/librasn/compiler/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
[![Lines Of Code](https://tokei.rs/b1/github/librasn/compiler?category=code)](https://github.com/XAMPPRocky/tokei)
[![Documentation](https://docs.rs/rasn-compiler/badge.svg)](https://docs.rs/rasn/)
[![Documentation](https://docs.rs/rasn-compiler/badge.svg)](https://docs.rs/rasn-compiler/)

[Try compiling some ASN.1 online.](https://librasn.github.io/)

The `rasn-compiler` library is a parser combinator that parses ASN.1 specifications and outputs
encoding-rule-agnotic bindings for ASN.1 data elements to be used with the [`rasn`](https://github.com/librasn/rasn) crate.
encoding-rule-agnotic bindings for ASN.1 data elements to be used with the [`rasn`](https://github.com/librasn/rasn) crate.
The compiler heavily relies on the great library [nom](https://docs.rs/nom/latest/nom/) for its basic parsers.
The parser has been designed to generate rasn bindings for ASN.1. It should not be used as a validating tool for ASN.1 modules (yet), since some of the parsers are more lenient than the ASN.1 syntax specification. The compiler aims to become fully compliant with X680 in this regard.

Expand Down Expand Up @@ -95,7 +95,7 @@ Currently, `rasn` supports the following encoding rules:
* `CHOICE` type and value
* `UTCTime` type and value
* `GeneralizedTime` type and value

#### Constraints
* Single value constraints
* Value range constraints
Expand Down
1 change: 0 additions & 1 deletion rasn-compiler-tests/src/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ macro_rules! e2e_pdu {
};
}


#[macro_export]
macro_rules! e2e_module {
($suite:ident, $asn1:literal, $expected:literal) => {
Expand Down
11 changes: 5 additions & 6 deletions rasn-compiler-tests/tests/edge_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ e2e_pdu!(
pub struct Restricted(pub Distinguished); "#
);


e2e_pdu!(
distinguished_value_range_in_choice,
r#"
r#"
TestChoice ::= CHOICE {
restricted Distinguished (second|fourth..sixth|eighth),
...
Expand Down Expand Up @@ -58,12 +57,12 @@ e2e_pdu!(

e2e_pdu!(
enum_and_distinguished_defaults,
r#"
r#"
Test ::= SEQUENCE {
int IntWithDefault DEFAULT first,
enum EnumWithDefault DEFAULT first,
}
IntWithDefault ::= INTEGER {
first(1),
second(2)
Expand All @@ -74,7 +73,7 @@ e2e_pdu!(
second(2)
}
"#,
r#"
r#"
#[derive(AsnType, Debug, Clone, Copy, Decode, Encode, PartialEq, PartialOrd, Eq, Ord, Hash)]
#[rasn(enumerated)]
pub enum EnumWithDefault {
Expand Down Expand Up @@ -103,4 +102,4 @@ e2e_pdu!(
fn test_r_enum_default() -> EnumWithDefault {
EnumWithDefault::first
} "#
);
);
Loading

0 comments on commit ee6aab0

Please sign in to comment.