google/closure-stylesheets

Escaped characters in css-identifier throws compiler parsing error

ogermann opened this issue · 0 comments

Parsing CSS-identifiers with escaped characters throw a compiler error:

Compiler parsing error: Parse error in test.css at line 1 column 5:
.red\@small {
    ^

com.google.common.css.compiler.ast.GssParserException: Parse error in test.css at line 1 column 5:
.red\@small {
    ^

	at com.google.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:214)
	at com.google.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:234)
	at com.google.common.css.compiler.ast.AbstractGssParser.parseInternal(AbstractGssParser.java:56)
	at com.google.common.css.compiler.ast.GssParser.parse(GssParser.java:46)
	at com.google.common.css.compiler.ast.GssParser.parse(GssParser.java:42)
	at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.parseAndPrint(DefaultCommandLineCompiler.java:126)
	at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.compile(DefaultCommandLineCompiler.java:110)
	at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.execute(DefaultCommandLineCompiler.java:156)
	at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.executeJob(ClosureCommandLineCompiler.java:374)
	at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.main(ClosureCommandLineCompiler.java:440)
Caused by: com.google.common.css.compiler.ast.ParseException: Encountered " <BAD_TOKEN> "\\ "" at line 1, column 5.
Was expecting one of:
    ":" ...
    "." ...
    "[" ...
    "{" ...
    "," ...
    <S> ...
    <HASH_NAME> ...
    <S> ...

	at com.google.common.css.compiler.ast.GssParserCC.generateParseException(GssParserCC.java:5284)
	at com.google.common.css.compiler.ast.GssParserCC.jj_consume_token(GssParserCC.java:5149)
	at com.google.common.css.compiler.ast.GssParserCC.ruleSet(GssParserCC.java:573)
	at com.google.common.css.compiler.ast.GssParserCC.block(GssParserCC.java:3827)
	at com.google.common.css.compiler.ast.GssParserCC.start(GssParserCC.java:3930)
	at com.google.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:209)
	... 9 more

I know there are some debates if escaped characters in identifiers are good practice or not, so I just wondered if this is just an unsupported feature or prohibited by intent.