4 ms·
In terms of "value for effort", this sounds like a cool idea. I'd guess this approach also struggles with multiple-line input like if/else, loops, functions.
by rgoulter 8y ago
In terms of "value for effort", this sounds like a cool idea.
I'd guess this approach also struggles with multiple-line input like if/else, loops, functions.
I'm reminded of https://github.com/jcartledge/sublime-worksheet https://github.com/jcartledge/sublime-worksheet
which is language-agnostic on the other end of things.
The two ideas might work well together in limited cases.
- xiii1408 8y agoIt's actually pretty easy to detect multi-line inputs as long as they have clear enclosers (like '{}' for a block in C/C++). This is what reple does. This doesn't require a parser--you just have to know what the enclosers are (one of the things that goes in a reple config file) and then count them to see if they're matched or not. For languages without Python-like syntax or with enclosers that can be ambiguous (some dialects of Fortran), this would be pretty difficult.