File tree 1 file changed +12
-12
lines changed
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ import * as regex from '../lib/regex.js';
10
10
/** @type LanguageFn */
11
11
export default function ( hljs ) {
12
12
const IDENT_RE = / [ a - z A - Z _ $ ] [ a - z A - Z 0 - 9 _ $ ] * / ;
13
+ const PKG_NAME_RE = regex . concat (
14
+ IDENT_RE ,
15
+ regex . optional ( regex . concat ( "(\." , IDENT_RE , ")*" ) )
16
+ ) ;
13
17
const IDENT_FUNC_RETURN_TYPE_RE = / ( [ * ] | [ a - z A - Z _ $ ] [ a - z A - Z 0 - 9 _ $ ] * ) / ;
14
18
15
19
const AS3_REST_ARG_MODE = {
@@ -37,20 +41,16 @@ export default function(hljs) {
37
41
hljs . C_BLOCK_COMMENT_MODE ,
38
42
hljs . C_NUMBER_MODE ,
39
43
{
40
- className : 'class' ,
41
- beginKeywords : ' package' ,
42
- end : / \{ / ,
43
- contains : [ hljs . TITLE_MODE ]
44
+ beforeMatch : / \b ( p a c k a g e ) \s + / ,
45
+ keywords : " package" ,
46
+ match : PKG_NAME_RE ,
47
+ className : "title.class"
44
48
} ,
45
49
{
46
- className : 'class' ,
47
- beginKeywords : 'class interface' ,
48
- end : / \{ / ,
49
- excludeEnd : true ,
50
- contains : [
51
- { beginKeywords : 'extends implements' } ,
52
- hljs . TITLE_MODE
53
- ]
50
+ beforeMatch : / \b ( c l a s s | i n t e r f a c e | e x t e n d s | i m p l e m e n t s ) \s + / ,
51
+ keywords : "class interface extends implements" ,
52
+ match : IDENT_RE ,
53
+ className : "title.class"
54
54
} ,
55
55
{
56
56
className : 'meta' ,
You can’t perform that action at this time.
0 commit comments