Skip to content

add new port to a module #754

Answered by MikePopoloski
mecobalamin asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MikePopoloski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants