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

Template literals support in evaluator #35

Open
Machy8 opened this issue Jun 8, 2024 · 0 comments
Open

Template literals support in evaluator #35

Machy8 opened this issue Jun 8, 2024 · 0 comments

Comments

@Machy8
Copy link
Contributor

Machy8 commented Jun 8, 2024

Tried it.
It is possible.
The problem is, that it needs to be used within a template literal string that is now detected as a simple quote.
There is no precedence order for it.
I could probably use the lowest one aka (1) or custom (0).

Just putting the test code here for the future me or some hero in the pull requst.

1000: [
			['${', '}', ({ index, chunks, compile, getGroupChunks }) => {
				const args = getGroupChunks(chunks, index, '${', '}');
				const argsLength = args.length;
				const compiled = compile([...allPrecedences], args);
				console.log('compiled', compiled);
				return [compiled[0], argsLength + 1, index];
			}],
		],
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

1 participant