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

Fix color tokens #268

Merged
merged 1 commit into from
Sep 9, 2021
Merged

Fix color tokens #268

merged 1 commit into from
Sep 9, 2021

Conversation

pokey
Copy link
Member

@pokey pokey commented Sep 8, 2021

Closes #266

@AndreasArvidsson
Copy link
Member

Did you really need to change the numbers regex?

@pokey
Copy link
Member Author

pokey commented Sep 9, 2021

Did you really need to change the numbers regex?

Yep!

  1) tokenizer
       #11aaaa:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected

  [
    '#',
+   '11',
+   'aaaa'
-   '11aaaa'
  ]
      + expected - actual

       [
         "#"
      -  "11"
      -  "aaaa"
      +  "11aaaa"
       ]

Notice that in this PR the number regex is now before the token regex. So if number were able to match a digit string, it would break up any tokens that started with digits, as you can see above. And digit strings are now matched by the token regex anyway so it works

@AndreasArvidsson AndreasArvidsson merged commit 5ce3c2f into main Sep 9, 2021
@AndreasArvidsson AndreasArvidsson deleted the fix-color-tokens branch September 9, 2021 08:50
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.

Treat hex colors as single tokens
2 participants