Skip to content

Conversation

@Rawk
Copy link
Contributor

@Rawk Rawk commented Nov 22, 2025

feat(parser): Split up combined reserved words

For example, split "SEQUENCE OF" into it's two reserved character sequences "SEQUENCE" and "OF". This is to better follow the reserved words, and also allows arbitrary white space between words.

fix(parser) CHOICE options no longer requires constraints

Parse tests outcome:

Success rate of 74%->75%.
Parsed 664->675 ASN1 modules without running into unrecoverable errors.
Failed to parse 228->217 modules with the following errors: ..

Copy link
Member

@6d7a 6d7a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one question concerning the removed match arms.

constraints,
distinguished_values: None,
}),
(None, BIT_STRING) => ASN1Type::BitString(BitString {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove these arms?

Rawk added 7 commits November 28, 2025 13:03
Update test snapshots for `parses_modules` after pull request librasn#161 Parse
ANY [DEFINED BY identifier].
Update test snapshots for `parses_modules` after pull request librasn#168 feat:
Support T61String.
Update test snapshots for `parses_modules` after pull request librasn#169 feat:
Generate bindings for UniversalString.
Update test snapshots for `parses_modules` after pull request librasn#170 Fix
syntax errors in RFC 3281.
For example, split "SEQUENCE OF" into it's two reserved character
sequences "SEQUENCE" and "OF".

This is to better follow the reserved words, and also allows white space between words.

Two more test modules are now parsing.
Fixes parsing of some more modules.
@Rawk Rawk force-pushed the reserved-char-seq branch from f12c6e1 to 8278b85 Compare November 28, 2025 14:38
@Rawk
Copy link
Contributor Author

Rawk commented Nov 28, 2025

I added the snapshot testing changes. This probably needs to be merged after #171 Update snapshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants