astro-ghostcms/.pnpm-store/v3/files/29/dd3959e83ed3b33307e4be9a15a...

21 lines
456 B
Plaintext
Raw Normal View History

2024-02-14 14:10:47 +00:00
import { SPACE, IDENT, STRING } from '../tokenTypes'
export default tokenStream => {
let fontFamily
if (tokenStream.matches(STRING)) {
fontFamily = tokenStream.lastValue
} else {
fontFamily = tokenStream.expect(IDENT)
while (tokenStream.hasTokens()) {
tokenStream.expect(SPACE)
const nextIdent = tokenStream.expect(IDENT)
fontFamily += ` ${nextIdent}`
}
}
tokenStream.expectEmpty()
return { fontFamily }
}