Files
react-native/packages
Nick GerlemanandFacebook GitHub Bot bc6105016c Add standards based lexer/tokenizer for CSS values (#42626)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42626

Right now this is done by some combination of string splitting, JS side regexing, etc. This will not scale for math expressions, and gets more and more annoying when we try to add more.

In preparation for adding more units, this adds a tokenizer/lexer for a subset of CSS grammar, based on the spec. This is not hooked up to anything yet, and doesn't add a parser.

The algorithm uses a subset of the comprehensive instructions provided at https://www.w3.org/TR/css-syntax-3/#tokenizer-algorithms as a reference, with some major simplifications.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D53030661

fbshipit-source-id: c48bc572c5e02daee0b05e91830f2441528193d1
2024-01-29 17:47:30 -08:00
..