1- import { rest } from '../shared/symbols' ;
21import type { Grammar , GrammarToken , LanguageProto } from '../types' ;
32
43export default {
@@ -22,7 +21,7 @@ export default {
2221 pattern : / ' (?: [ ^ ' \\ ] | \\ .) * ' / ,
2322 inside : {
2423 'punctuation' : / ^ ' | ' $ / ,
25- [ rest ] : placeholder ,
24+ $ rest : placeholder ,
2625 } ,
2726 } ,
2827 'string' : / " (?: [ ^ " \\ ] | \\ .) * " / ,
@@ -51,31 +50,31 @@ export default {
5150 pattern : / ( ^ | [ ^ \\ ] ) [ | ! ] = * / ,
5251 lookbehind : true ,
5352 } ,
54- [ rest ] : placeholder ,
53+ $ rest : placeholder ,
5554 } ,
5655 } ,
5756
5857 'passthrough-block' : {
5958 pattern : / ^ ( \+ { 4 , } ) $ [ \s \S ] * ?^ \1$ / m,
6059 inside : {
6160 'punctuation' : / ^ \+ + | \+ + $ / ,
62- [ rest ] : placeholder ,
61+ $ rest : placeholder ,
6362 } ,
6463 } ,
6564 // Literal blocks and listing blocks
6665 'literal-block' : {
6766 pattern : / ^ ( - { 4 , } | \. { 4 , } ) $ [ \s \S ] * ?^ \1$ / m,
6867 inside : {
6968 'punctuation' : / ^ (?: - + | \. + ) | (?: - + | \. + ) $ / ,
70- [ rest ] : placeholder ,
69+ $ rest : placeholder ,
7170 } ,
7271 } ,
7372 // Sidebar blocks, quote blocks, example blocks and open blocks
7473 'other-block' : {
7574 pattern : / ^ ( - - | \* { 4 , } | _ { 4 , } | = { 4 , } ) $ [ \s \S ] * ?^ \1$ / m,
7675 inside : {
7776 'punctuation' : / ^ (?: - + | \* + | _ + | = + ) | (?: - + | \* + | _ + | = + ) $ / ,
78- [ rest ] : placeholder ,
77+ $ rest : placeholder ,
7978 } ,
8079 } ,
8180
@@ -102,7 +101,7 @@ export default {
102101 alias : 'important' ,
103102 inside : {
104103 'punctuation' : / ^ (?: \. | = + ) | (?: = + | - + | ~ + | \^ + | \+ + ) $ / ,
105- [ rest ] : placeholder ,
104+ $ rest : placeholder ,
106105 } ,
107106 } ,
108107 'attribute-entry' : {
@@ -215,23 +214,23 @@ export default {
215214 function copyFromAsciiDoc ( ...keys : ( keyof typeof asciidoc ) [ ] ) {
216215 const o : Grammar = { } ;
217216 for ( const key of keys ) {
218- o [ key ] = asciidoc [ key ] ;
217+ o [ key ] = asciidoc [ key ] as GrammarToken ;
219218 }
220219 return o ;
221220 }
222221
223- attributes . inside [ 'interpreted' ] . inside [ rest ] = copyFromAsciiDoc (
222+ attributes . inside [ 'interpreted' ] . inside . $ rest = copyFromAsciiDoc (
224223 'macro' ,
225224 'inline' ,
226225 'replacement' ,
227226 'entity'
228227 ) ;
229228
230- asciidoc [ 'passthrough-block' ] . inside [ rest ] = copyFromAsciiDoc ( 'macro' ) ;
229+ asciidoc [ 'passthrough-block' ] . inside . $ rest = copyFromAsciiDoc ( 'macro' ) ;
231230
232- asciidoc [ 'literal-block' ] . inside [ rest ] = copyFromAsciiDoc ( 'callout' ) ;
231+ asciidoc [ 'literal-block' ] . inside . $ rest = copyFromAsciiDoc ( 'callout' ) ;
233232
234- asciidoc [ 'table' ] . inside [ rest ] = copyFromAsciiDoc (
233+ asciidoc [ 'table' ] . inside . $ rest = copyFromAsciiDoc (
235234 'comment-block' ,
236235 'passthrough-block' ,
237236 'literal-block' ,
@@ -254,7 +253,7 @@ export default {
254253 'line-continuation'
255254 ) ;
256255
257- asciidoc [ 'other-block' ] . inside [ rest ] = copyFromAsciiDoc (
256+ asciidoc [ 'other-block' ] . inside . $ rest = copyFromAsciiDoc (
258257 'table' ,
259258 'list-punctuation' ,
260259 'indented-block' ,
@@ -272,7 +271,7 @@ export default {
272271 'line-continuation'
273272 ) ;
274273
275- asciidoc [ 'title' ] . inside [ rest ] = copyFromAsciiDoc (
274+ asciidoc [ 'title' ] . inside . $ rest = copyFromAsciiDoc (
276275 'macro' ,
277276 'inline' ,
278277 'replacement' ,
0 commit comments