8000 Using stream instead of string? · Issue #99 · dabeaz/sly · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Using stream instead of string? #99
Open
@davidmcnabnz

Description

@davidmcnabnz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0