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: repeat quantifier #11

Merged
merged 2 commits into from
Dec 6, 2023
Merged

feat: repeat quantifier #11

merged 2 commits into from
Dec 6, 2023

Conversation

okwasniewski
Copy link
Member

Summary

This PR implements repeat() utility. I still need to figure out how to properly type it

Test plan

Passings tests

src/types.ts Outdated Show resolved Hide resolved
@okwasniewski okwasniewski marked this pull request as ready for review December 6, 2023 16:06
@okwasniewski okwasniewski changed the title [WIP] feat: implement repeat feat: implement repeat Dec 6, 2023
@mdjastrzebski mdjastrzebski changed the title feat: implement repeat feat: repeat quantifier Dec 6, 2023
src/compiler.ts Outdated Show resolved Hide resolved
config: Repeat['config']
): string {
if ('count' in config && typeof config?.count === 'number') {
return `${wrapGroup(compiledChildren)}{${config?.count || ''}}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Why || ''? You should be able to access config.count directly inside the if.

src/types.ts Outdated Show resolved Hide resolved
Copy link
Member

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid! I've left some comments regarding polishing the implementation

Copy link
Member

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@okwasniewski okwasniewski merged commit eb111c2 into main Dec 6, 2023
3 checks passed
@okwasniewski okwasniewski deleted the feat/repeat branch December 6, 2023 17:33
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