Comments (4)
Hi,
I'm happy to hear that the crate is useful to you!
I have no problem adding an API to export the functionality.
It could be as simple as having a public fn build_name_map() -> ModuleNameMap
in the A2lFile struct.
One concern I have - the ModuleNameMap stores references to each item (rather than indexes). This means the borrow checker will prevent you from mutating any of these items. Basically, as long as the namemap exists, the a2l data is read-only.
Would that be a problem for you?
from a2lfile.
At the moment, my usecase is just read only. So this would be fine.
A further improvement might be to just store all those data with an indexmap so that we can keep the order of original a2l file, while being able to efficiently search by id.
https://docs.rs/indexmap/latest/indexmap/
from a2lfile.
I exported the the ModuleNameMap struct and also added it to the API of the Module struct.
Now you can do
let namemmap = a2lfile.project.module[0].build_namemap();
from a2lfile.
from a2lfile.
Related Issues (10)
- Issue parsing A2L-files with double quotes within long names HOT 1
- merge_mod_par issue HOT 3
- a2l merge group or function issue HOT 4
- DISPLAY_IDENTIFIER that starts with a number causes a tokenization exception HOT 4
- Extract Record Layout field from Characteristics variables HOT 3
- RECORD_LAYOUT fields are not sorted correctly HOT 2
- Please add a CHAGELOG and use SemVer HOT 5
- Readme exampe not working: latest Version 1.5 uses A2LErrors instead of String
- REF_UNIT should be "keyword", not "block" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from a2lfile.