bs-nice icon indicating copy to clipboard operation
bs-nice copied to clipboard

write splitSelector in pure reason

Open threepointone opened this issue 7 years ago • 3 comments

currently inlines with [%bs.raw]

https://github.com/threepointone/bs-nice/blob/98611e1aba32a7be3049715900fca2ef64ca256f/src/nice.re#L901

threepointone avatar Dec 23 '17 18:12 threepointone

Could you give me an example input ? I can't figure out what is it doing

thangngoc89 avatar Dec 23 '17 20:12 thangngoc89

given a string '.a, span:hover, &:matches(h1, h2)', it splits it into an array of selectors, [".a", "span:hover", "&:matches(h1, h2)"]

threepointone avatar Dec 24 '17 00:12 threepointone

Where does selectorTokenizer come from? I can't find it in the source. But I guess it's a regex that looks something like this: /[(),]|"(?:\\.|[^"\n])*"|'(?:\\.|[^'\n])*'|\/\*[\s\S]*?\*\//g?

ulrikstrid avatar Jan 12 '18 08:01 ulrikstrid