-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make unit specifier non optional #3
Comments
Like in #2 we have a bit of a conflict between search and HDL use cases. The existing implementation actually parses As an aside, when I have been playing around with HDL implementations I found the way it is currently kind of useful as you can have help function or sub-classes that do this for you: i.e. |
how can you tell it's not an inductor from 10u? That could mean 10uH, or the recovery time of a diode 10us. for passives we can match based on the unit. I think that it is natural to write the most important thing first, secondary information comes afterwards. So the first unit determines the component. With each component we can also have a secondary unit that comes after, and arbitrary units as key value pairs.
for active devices we need a different approach. |
Lol, yeah, knew I was forgetting something. 😆
These kinds of assumptions go out the window if we are thinking about search applications. People will write all sorts of things in any old order and we want to extract as much information as possible out of the input. There is a limit to what we can accept of course but not being too strict on the order of things seems like a really nice feature of the original implementation. I think for the initial Antlr port, we should stick to the original and allow people to leave off the That table is really useful though and I can see how allowing any order makes it harder to expand to different components. We might need to split off a "strict" grammar that allows many more components if we have issues expanding. |
What are your thoughts on units?
Is it ok to require the F in 10uF?
The text was updated successfully, but these errors were encountered: