HEX
Server: Apache
System: Linux webd004.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: frenchy (106757)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/frenchy/www/french-american.org/current/node_modules/postcss-jsx/template-parser-helper.js
"use strict";
const Literal = require("./literal");
const isLiteral = token => token[0] === "word" && /^\$\{[\s\S]*\}$/.test(token[1]);
function literal (start) {
	if (!isLiteral(start)) {
		return;
	}
	const tokens = [];
	let hasWord;
	let type;
	let token;
	while ((token = this.tokenizer.nextToken())) {
		tokens.push(token);
		type = token[0];
		if (type.length === 1) {
			break;
		} else if (type === "word") {
			hasWord = true;
		}
	}

	while (tokens.length) {
		this.tokenizer.back(tokens.pop());
	}

	if (type === "{" || (type === ":" && !hasWord)) {
		return;
	}

	const node = new Literal({
		text: start[1],
	});

	this.init(node, start[2], start[3]);

	return node;
}

function freeSemicolon (token) {
	this.spaces += token[1];
	const nodes = this.current.nodes;
	const prev = nodes && nodes[nodes.length - 1];
	if (prev && /^(rule|literal)$/.test(prev.type) && !prev.raws.ownSemicolon) {
		prev.raws.ownSemicolon = this.spaces;
		this.spaces = "";
	}
}

module.exports = {
	freeSemicolon: freeSemicolon,
	literal: literal,
};