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

compiler: invalid handling of variables imported from template files and used in macros #962

Open
zapateo opened this issue Dec 13, 2024 · 0 comments
Labels
critical-bug A critical bug, that is a bug that takes precedence over other bugs (for example cannot be bypassed) disassembler Related to disassembler needsInvestigation Need to investigate RuntimeError A bug in Scriggo caused an error/panic at runtime templates Related to the template

Comments

@zapateo
Copy link
Member

zapateo commented Dec 13, 2024

The issue #852 was fixed and tests were added, but these tests do not seem to be extensive enough, and therefore panics occur in the runtime (and possibly in the disassembler).

To reproduce such panics:

"https://github.com/open2b/scriggo/issues/852 - Additional tests #1": {
	sources: fstest.Files{
		"index.html":    `{% import pkg "imported.html" %}a{% macro M %}b{{ pkg.V }}c{% end macro %}d{{ M() }}`,
		"imported.html": `{% var V int %}`,
	},
	expectedOut: "TODO",
},

"https://github.com/open2b/scriggo/issues/852 - Additional tests #2": {
	sources: fstest.Files{
		"index.html":    `{% import pkg "imported.html" %}a{% macro M %}b{{ pkg.V }}c{% end macro %}d{{ M() }}`,
		"imported.html": `{% var V int = 42 %}`,
	},
	expectedOut: "TODO",
},
@zapateo zapateo added needsInvestigation Need to investigate RuntimeError A bug in Scriggo caused an error/panic at runtime templates Related to the template labels Dec 13, 2024
@zapateo zapateo added critical-bug A critical bug, that is a bug that takes precedence over other bugs (for example cannot be bypassed) disassembler Related to disassembler labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical-bug A critical bug, that is a bug that takes precedence over other bugs (for example cannot be bypassed) disassembler Related to disassembler needsInvestigation Need to investigate RuntimeError A bug in Scriggo caused an error/panic at runtime templates Related to the template
Projects
None yet
Development

No branches or pull requests

1 participant