add new port to a module #754
-
I want to pull out some of the wires internal to a module as outputs. using slang i think i can select the wires by traversing the entire list. however when i am trying to add a port, i am stuck because i am unable to create a new token
the Info field is private and i donot have other arguments that i can pass. also, any suggestions on how to add the assign between the two ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You need to use the Token constructor, tokens are immutable once constructed which is why you can't modify the info field. Incidentally, slang could probably benefit from some ergonomic helper methods for constructing new synthetic tokens / syntax nodes (you should be able to construct full syntax trees with the code that exists but it probably won't be pretty looking), so if you come up with some while working on this please do consider contributing them to the library. |
Beta Was this translation helpful? Give feedback.
You need to use the Token constructor, tokens are immutable once constructed which is why you can't modify the info field.
Incidentally, slang could probably benefit from some ergonomic helper methods for constructing new synthetic tokens / syntax nodes (you should be able to construct full syntax trees with the code that exists but it probably won't be pretty looking), so if you come up with some while working on this please do consider contributing them to the library.