Skip to content

Commit

Permalink
Fix CSS lexer
Browse files Browse the repository at this point in the history
Fix function that include parenthesis shows a wrong error
  • Loading branch information
nocd5 authored and alecthomas committed Dec 23, 2020
1 parent 6e272cf commit 5b9087a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lexers/c/css.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ var CSS = internal.Register(MustNewLexer(
Include("basics"),
{`\}`, Punctuation, Pop(2)},
},
"atparenthesis": {
Include("common-values"),
{`/\*(?:.|\n)*?\*/`, Comment, nil},
Include("numeric-values"),
{`[*+/-]`, Operator, nil},
{`[,]`, Punctuation, nil},
{`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil},
{`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil},
{`[a-zA-Z_-]\w*`, Name, nil},
{`\(`, Punctuation, Push("atparenthesis")},
{`\)`, Punctuation, Pop(1)},
},
"content": {
{`\s+`, Text, nil},
{`\}`, Punctuation, Pop(1)},
Expand Down Expand Up @@ -73,6 +85,7 @@ var CSS = internal.Register(MustNewLexer(
{`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil},
{`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil},
{`[a-zA-Z_-]\w*`, Name, nil},
{`\(`, Punctuation, Push("atparenthesis")},
{`\)`, Punctuation, Pop(1)},
},
"common-values": {
Expand Down

0 comments on commit 5b9087a

Please sign in to comment.