Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

remainingTokens is not accessible after parsing #77

Open
vogel opened this issue Dec 18, 2018 · 0 comments
Open

remainingTokens is not accessible after parsing #77

vogel opened this issue Dec 18, 2018 · 0 comments

Comments

@vogel
Copy link

vogel commented Dec 18, 2018

I was trying to extract remainingTokens from InternalParseResult from failed parse, but I was not able to. It seems that remainingTokens are a pair of iterators that are no longer valid after Parser::parse() method was finished.

I think it means that return value of Parser::parser() has wrong return type, as it gives access to variables that cannot be accessed. It could be fixed by either changing the return type, make variables valid at that point, or add a new TokenStream/std::vectorstd::string member to Parser class that will contain remainingTokens after parse() is finished.

I've ended up with implementing my own class from Parser that does the last thing.

Please let me know what do you think about it (nb.: in some previous version of clara those values were easily accessible by unusedTokens() method).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant