File tree Expand file tree Collapse file tree 1 file changed +9
-22
lines changed Expand file tree Collapse file tree 1 file changed +9
-22
lines changed Original file line number Diff line number Diff line change 1- import { insertBefore } from '../util/language-util.js' ;
2-
31/** @type {import('../types.d.ts').LanguageProto<'css'> } */
42export default {
53 id : 'css' ,
@@ -8,8 +6,7 @@ export default {
86 const string =
97 / (?: " (?: \\ (?: \r \n | [ \s \S ] ) | [ ^ " \\ \r \n ] ) * " | ' (?: \\ (?: \r \n | [ \s \S ] ) | [ ^ ' \\ \r \n ] ) * ' ) / ;
108
11- /** @type {Grammar } */
12- const css = {
9+ return {
1310 'comment' : / \/ \* [ \s \S ] * ?\* \/ / ,
1411 'atrule' : {
1512 pattern : RegExp (
@@ -20,7 +17,7 @@ export default {
2017 ')*?' +
2118 / (?: ; | (? = \s * \{ ) ) / . source
2219 ) ,
23- inside : /** @type { Grammar } */ ( {
20+ inside : {
2421 'rule' : / ^ @ [ \w - ] + / ,
2522 'selector-function-argument' : {
2623 pattern :
@@ -33,8 +30,8 @@ export default {
3330 pattern : / ( ^ | [ ^ \w - ] ) (?: a n d | n o t | o n l y | o r ) (? ! [ \w - ] ) / ,
3431 lookbehind : true ,
3532 } ,
36- $rest : /** @type { Grammar['$rest'] } */ ( ' css') ,
37- } ) ,
33+ $rest : ' css',
34+ } ,
3835 } ,
3936 'url' : {
4037 // https://drafts.csswg.org/css-values-3/#urls
@@ -85,21 +82,11 @@ export default {
8582 lookbehind : true ,
8683 } ,
8784 'punctuation' : / [ ( ) { } ; : , ] / ,
85+ $insertBefore : {
86+ 'function' : /** @type {import('../types.d.ts').GrammarTokens } */ (
87+ getOptionalLanguage ( 'css-extras' )
88+ ) ,
89+ } ,
8890 } ;
89-
90- const extras = getOptionalLanguage ( 'css-extras' ) ;
91- if ( extras ) {
92- insertBefore (
93- css ,
94- 'function' ,
95- /** @type {import('../types.d.ts').GrammarTokens } */ ( extras )
96- ) ;
97- }
98-
99- return css ;
10091 } ,
10192} ;
102-
103- /**
104- * @typedef {import('../types.d.ts').Grammar } Grammar
105- */
You can’t perform that action at this time.
0 commit comments