@@ -324,49 +324,111 @@ contexts:
324324 - meta_scope : meta.error.log
325325 - match : (?:^|\.)$
326326 pop : 1
327- - include : content
327+ - include : log- content
328328
329329 log-exception-body :
330330 - meta_scope : meta.exception.log
331331 - match : ^$
332332 pop : 1
333- - include : content
333+ - include : log- content
334334
335335 log-fatal-body :
336336 - meta_scope : meta.error.log
337337 - match : (?:^|\.)$
338338 set :
339339 - log-fatal-hint-body
340340 - log-fatal-desc-body
341- - include : content
341+ - include : log- content
342342
343343 log-fatal-desc-body :
344344 # expect line, starting with fatal error location (line number e.g.: l.10)
345345 - match : ^l\.\d+\b
346346 pop : 1
347- - include : content
347+ - include : log- content
348348
349349 log-fatal-hint-body :
350350 - meta_content_scope : meta.error.log meta.description.log
351351 - match : ^$
352352 pop : 1
353- - include : content
353+ - include : log- content
354354
355355 log-info-body :
356356 - meta_scope : meta.info.log
357357 - match : (?:^|\.)$
358358 pop : 1
359- - include : content
359+ - include : log- content
360360
361361 log-warning-body :
362362 - meta_scope : meta.warning.log
363363 - match : (?:^|\.)$
364364 pop : 1
365- - include : content
365+ - include : log- content
366366
367367 log-box-warning-body :
368368 - meta_scope : meta.warning.box.log
369- - include : content
369+ - include : log-content
370+
371+ log-content :
372+ - include : parens
373+ - include : brackets
374+ - include : comments
375+ - include : log-cmds
376+ - include : constants
377+ - include : strings
378+
379+ log-cmds :
380+ - match : (\\)[\w@]+
381+ scope : support.function.latex
382+ captures :
383+ 1 : punctuation.definition.variable.latex
384+ push : log-cmd-args
385+ - match : :?=
386+ scope : keyword.operator.assignment.latex
387+ push : value
388+ - match : ;
389+ scope : punctuation.separator.latex
390+
391+ log-cmd-args :
392+ - meta_scope : meta.function-call.latex
393+ - include : comments
394+ - match : \s*(\{)
395+ captures :
396+ 1 : meta.braces.log punctuation.section.braces.begin.log
397+ push : log-cmd-args-body
398+ - match : \s*(\[)
399+ captures :
400+ 1 : meta.brackets.log punctuation.section.brackets.begin.log
401+ push : log-bracket-body
402+ - match : \s*(\()
403+ captures :
404+ 1 : meta.parens.log punctuation.section.parens.begin.log
405+ push : log-paren-body
406+ - match : ^|(?=\s*\S)
407+ pop : 1
408+
409+ log-cmd-args-body :
410+ - meta_content_scope : meta.braces.log
411+ - match : \}
412+ scope : meta.braces.log punctuation.section.braces.end.log
413+ pop : 1
414+ - include : log-content
415+
416+ log-bracket-body :
417+ - meta_content_scope : meta.brackets.log
418+ - match : \]
419+ scope : meta.brackets.log punctuation.section.brackets.end.log
420+ pop : 1
421+ - include : log-content
422+
423+ log-paren-body :
424+ - meta_content_scope : meta.parens.log
425+ - match : \)
426+ scope : meta.parens.log punctuation.section.parens.end.log
427+ pop : 1
428+ - include : log-entries
429+ - include : log-content
430+
431+ # ##[ COMMANDS ]#################################################################
370432
371433 commands :
372434 - match : (\\)[\w@]+
@@ -382,13 +444,13 @@ contexts:
382444
383445 cmd-args :
384446 - meta_scope : meta.function-call.latex
385- - include : brackets
386- - include : parens
387447 - match : \{
388448 scope : punctuation.section.braces.begin.log
389449 push : cmd-args-body
390- - match : ' '
391- pop : 1
450+ - include : comments
451+ - include : brackets
452+ - include : parens
453+ - include : immediately-pop
392454
393455 cmd-args-body :
394456 - meta_scope : meta.braces.log
@@ -488,3 +550,7 @@ contexts:
488550 bol-pop :
489551 - match : ^
490552 pop : 1
553+
554+ immediately-pop :
555+ - match : ' '
556+ pop : 1
0 commit comments