File tree Expand file tree Collapse file tree
org.omg.sysml.jupyter.jupyterlab/src/main
org.omg.sysml.jupyter.kernel/src/main/resources/kernel
tool-support/syntax-highlighting/jupyter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,21 @@ export function defineSysMLv2Mode(): void {
7777 if ( stream . match ( '/*' , false ) ) stream . next ( ) ;
7878 return false ;
7979 } ,
80+ "#" : function ( stream : CodeMirror . StringStream ) {
81+ do {
82+ if ( stream . match ( "'" , true ) ) {
83+ let b_escaped = false ;
84+ let s_next ;
85+ while ( s_next = stream . next ( ) ) {
86+ if ( s_next === "'" && ! b_escaped ) break ;
87+ b_escaped = ! b_escaped && s_next === '\\' ;
88+ }
89+ } else {
90+ stream . eatWhile ( / \w / ) ;
91+ }
92+ } while ( stream . match ( '::' , true ) )
93+ return 'keyword' ;
94+ } ,
8095 } ,
8196 } ) ;
8297 } ) ;
Original file line number Diff line number Diff line change @@ -89,7 +89,22 @@ var enableMode = function (CodeMirror) {
8989 stream . next ( ) ;
9090 }
9191 return false ;
92- }
92+ } ,
93+ "#" : function ( stream : CodeMirror . StringStream ) {
94+ do {
95+ if ( stream . match ( "'" , true ) ) {
96+ let b_escaped = false ;
97+ let s_next ;
98+ while ( s_next = stream . next ( ) ) {
99+ if ( s_next === "'" && ! b_escaped ) break ;
100+ b_escaped = ! b_escaped && s_next === '\\' ;
101+ }
102+ } else {
103+ stream . eatWhile ( / \w / ) ;
104+ }
105+ } while ( stream . match ( '::' , true ) )
106+ return 'keyword' ;
107+ } ,
93108 }
94109 } ) ;
95110 } ) ;
Original file line number Diff line number Diff line change @@ -89,7 +89,22 @@ var enableMode = function (CodeMirror) {
8989 stream . next ( ) ;
9090 }
9191 return false ;
92- }
92+ } ,
93+ "#" : function ( stream : CodeMirror . StringStream ) {
94+ do {
95+ if ( stream . match ( "'" , true ) ) {
96+ let b_escaped = false ;
97+ let s_next ;
98+ while ( s_next = stream . next ( ) ) {
99+ if ( s_next === "'" && ! b_escaped ) break ;
100+ b_escaped = ! b_escaped && s_next === '\\' ;
101+ }
102+ } else {
103+ stream . eatWhile ( / \w / ) ;
104+ }
105+ } while ( stream . match ( '::' , true ) )
106+ return 'keyword' ;
107+ } ,
93108 }
94109 } ) ;
95110 } ) ;
Original file line number Diff line number Diff line change @@ -75,7 +75,22 @@ var enableMode = function (CodeMirror) {
7575 stream . next ( ) ;
7676 }
7777 return false ;
78- }
78+ } ,
79+ "#" : function ( stream : CodeMirror . StringStream ) {
80+ do {
81+ if ( stream . match ( "'" , true ) ) {
82+ let b_escaped = false ;
83+ let s_next ;
84+ while ( s_next = stream . next ( ) ) {
85+ if ( s_next === "'" && ! b_escaped ) break ;
86+ b_escaped = ! b_escaped && s_next === '\\' ;
87+ }
88+ } else {
89+ stream . eatWhile ( / \w / ) ;
90+ }
91+ } while ( stream . match ( '::' , true ) )
92+ return 'keyword' ;
93+ } ,
7994 }
8095 } ) ;
8196 } ) ;
Original file line number Diff line number Diff line change @@ -77,6 +77,21 @@ export function defineSysMLv2Mode(): void {
7777 if ( stream . match ( '/*' , false ) ) stream . next ( ) ;
7878 return false ;
7979 } ,
80+ "#" : function ( stream : CodeMirror . StringStream ) {
81+ do {
82+ if ( stream . match ( "'" , true ) ) {
83+ let b_escaped = false ;
84+ let s_next ;
85+ while ( s_next = stream . next ( ) ) {
86+ if ( s_next === "'" && ! b_escaped ) break ;
87+ b_escaped = ! b_escaped && s_next === '\\' ;
88+ }
89+ } else {
90+ stream . eatWhile ( / \w / ) ;
91+ }
92+ } while ( stream . match ( '::' , true ) )
93+ return 'keyword' ;
94+ } ,
8095 } ,
8196 } ) ;
8297 } ) ;
Original file line number Diff line number Diff line change @@ -63,6 +63,21 @@ export function defineSysMLv2Mode(): void {
6363 if ( stream . match ( '/*' , false ) ) stream . next ( ) ;
6464 return false ;
6565 } ,
66+ "#" : function ( stream : CodeMirror . StringStream ) {
67+ do {
68+ if ( stream . match ( "'" , true ) ) {
69+ let b_escaped = false ;
70+ let s_next ;
71+ while ( s_next = stream . next ( ) ) {
72+ if ( s_next === "'" && ! b_escaped ) break ;
73+ b_escaped = ! b_escaped && s_next === '\\' ;
74+ }
75+ } else {
76+ stream . eatWhile ( / \w / ) ;
77+ }
78+ } while ( stream . match ( '::' , true ) )
79+ return 'keyword' ;
80+ } ,
6681 } ,
6782 } ) ;
6883 } ) ;
You can’t perform that action at this time.
0 commit comments