Skip to content

Fix color tokens#268

Merged
AndreasArvidsson merged 1 commit intomainfrom
fix-color-tokens
Sep 9, 2021
Merged

Fix color tokens#268
AndreasArvidsson merged 1 commit intomainfrom
fix-color-tokens

Conversation

@pokey
Copy link
Copy Markdown
Member

@pokey pokey commented Sep 8, 2021

Closes #266

@AndreasArvidsson
Copy link
Copy Markdown
Member

Did you really need to change the numbers regex?

@pokey
Copy link
Copy Markdown
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