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(core): implement -st-extends parser #2299

Closed
wants to merge 4 commits into from

Conversation

barak007
Copy link
Collaborator

@barak007 barak007 commented Jan 30, 2022

Just a starting point for the new -st-extend parsing:

  • basic tree structure parsing
  • union and intersection syntax
  • operator precedence
  • parens elimination
  • good errors
  • basic cases tests
  • error cases tests
  • weird cases tests
  • move code from tests
  • This PR is for early feedback collection

@idoros
Copy link
Collaborator

idoros commented Jan 31, 2022

code seems correct (missing the unchecked test cases that you already specified). I think you should open a new folder src/parsers and move it there.

Copy link
Contributor

@tzachbon tzachbon left a comment

Choose a reason for hiding this comment

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

Looks good at the moment, left a couple of questions.
Btw, make sure to update the lock file.

import { expect } from 'chai';
import { parseCSSValue } from '@tokey/css-value-parser';

type ParsedNodes = ReturnType<typeof parseCSSValue>[number];
Copy link
Contributor

Choose a reason for hiding this comment

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

We should export it from tokey

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes

Comment on lines 8 to 9
public left?: string | stNode,
public right?: string | stNode,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe instead of a string, it should be the tokey ast node? (generic type for the stNode)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes

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

Successfully merging this pull request may close these issues.

None yet

4 participants