You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are multiline comments possible with nex? I've been playing with nex quite a bit and I'm very impressed. However, I'm having trouble figuring out how to handle multiline comments. Can this been done with the nesting feature? I've tried but could not figure it out. Below is one thing I tired but I regex is greedy the nesting grabs the rest of the document.
This question is a little bit old, but I encountered the same problem and I found three possible solutions:
Match /* and then mess with nex internals so that it skips everything until the next */ (or when an counter reaches 0 so that recursion is possible). I didn't tried if this works and I wouln't recommend trying it.
Match against /* and */ and increase or decrease a variable(or just set it to true or false, if you don't wan't recursive comments). And in all other matches add a condition which checks if the match is within a comment, so that it gets skipped.
If you create a special reader, which wraps around another one you can filter all comments before they get lexed. This is the best solution I came up with but I didn't tried it.
Are multiline comments possible with nex? I've been playing with nex quite a bit and I'm very impressed. However, I'm having trouble figuring out how to handle multiline comments. Can this been done with the nesting feature? I've tried but could not figure it out. Below is one thing I tired but I regex is greedy the nesting grabs the rest of the document.
The text was updated successfully, but these errors were encountered: