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

feat: Add support for template literals #15

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

yokljo
Copy link
Contributor

@yokljo yokljo commented Jul 31, 2024

I added support for template literals. Here's the working test case:

it('should support template literals', () => {
  const code = `
    let a = \`world\`;
    let b = 1234;
    const result = \`hello \${a}\${a}, \\u{55} \${b * 2}! \${'test'}\`;
  `;

  const jinter = new Jinter();
  jinter.evaluate(code)

  expect(jinter.scope.get('result')).toBe('hello worldworld, U 2468! test');
});

@LuanRT LuanRT changed the title Added support for template literals feat: Add support for template literals Jul 31, 2024
@LuanRT
Copy link
Owner

LuanRT commented Jul 31, 2024

Thanks!

@LuanRT LuanRT merged commit 6daec99 into LuanRT:main Jul 31, 2024
1 of 2 checks passed
@LuanRT LuanRT mentioned this pull request Jul 31, 2024
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

Successfully merging this pull request may close these issues.

2 participants