Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using stream instead of string? #99

Open
davidmcnabnz opened this issue Aug 28, 2022 · 0 comments
Open

Using stream instead of string? #99

davidmcnabnz opened this issue Aug 28, 2022 · 0 comments

Comments

@davidmcnabnz
Copy link

Hi David,

I notice Sly's tokeniser is designed to feed only from an indexable, sliceable string-like object. I need to have it feeding instead from a "stack of streams", to allow nested file inclusions.

One option is to implement a string-like class which, under the hood, sources input from a 'stack' of file-like streams. With this, the parser can then 'push' a new stream to the stack when it sees an include command, and the include stream can 'pop' from the stack when exhausted.

Do you think this is the best way to go, or can you recommend I take a better approach?

Cheers
David

P.S. Sly has sure come a long way since the earlier Ply days. You may remember me from my contribution of a class-based calc parser.

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

No branches or pull requests

1 participant