@@ -158,14 +158,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
158158 } else if ( wordRE . test ( ch ) ) {
159159 stream . eatWhile ( wordRE ) ;
160160 var word = stream . current ( )
161- if ( state . lastType != "." ) {
162- if ( keywords . propertyIsEnumerable ( word ) ) {
163- var kw = keywords [ word ]
164- return ret ( kw . type , kw . style , word )
165- }
166- if ( word == "async" && stream . match ( / ^ ( \s | \/ \* .* ?\* \/ ) * [ \[ \( \w ] / , false ) )
167- return ret ( "async" , "keyword" , word )
161+ if ( keywords . propertyIsEnumerable ( word ) ) {
162+ var kw = keywords [ word ]
163+ return ret ( kw . type , kw . style , word )
168164 }
165+ if ( state . lastType != "." && word == "async" && stream . match ( / ^ ( \s | \/ \* .* ?\* \/ ) * [ \[ \( \w ] / , false ) )
166+ return ret ( "async" , "keyword" , word )
169167 return ret ( "variable" , "variable" , word )
170168 }
171169 }
@@ -285,6 +283,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
285283 if ( combinator ( type , content ) ) {
286284 while ( cc . length && cc [ cc . length - 1 ] . lex )
287285 cc . pop ( ) ( ) ;
286+ if ( style ?. slice ( 0 , 2 ) === "p5" ) return style ;
288287 if ( cx . marked ) return cx . marked ;
289288 if ( type == "variable" && inScope ( state , content ) ) return "variable-2" ;
290289 return style ;
0 commit comments