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

Valid way to exclude specific consrutctions(for ex. loops) #46

Open
alexander-petuhov opened this issue Mar 1, 2018 · 1 comment
Open

Comments

@alexander-petuhov
Copy link

Hello. We are thinking about excluding some specific constructions from parsing - for example loops. I saw there are limitation abilities in "Safe parser" documentation section https://github.com/lunet-io/scriban/blob/master/doc/runtime.md#safe-runtime which can help to limit them, but is there valid way to forbid some of them at all? Thanks.

@xoofx
Copy link
Member

xoofx commented Mar 1, 2018

Unfortunately, there is nothing builtin. You can always iterate on the AST and remove the loops (but there is no a visitor pattern currently provided, so you have to manually go through the statements). If you feel to have this at parse time, feel free to send a PR, modifying the ParserOptions and the Parser to discard loop after parsing them (and log an error).

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

No branches or pull requests

2 participants