mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-08-06 21:43:57 -06:00
Extended G-code syntax
- Parenthesized comments - Multiple E values split by colons (RepRapFirmware)
This commit is contained in:
parent
5108e4b6aa
commit
4e7187b926
2 changed files with 40 additions and 1 deletions
|
@ -97,6 +97,12 @@ contexts:
|
|||
2: punctuation.quote.double.open.gcode
|
||||
push: gcode_string_arg_quoted_double
|
||||
|
||||
# parameter and list of values
|
||||
- match: ([Ee])\s*(({{decimal}}\s*:\s*)+{{decimal}})
|
||||
captures:
|
||||
1: keyword.param.gcode
|
||||
2: constant.numeric.param.gcode
|
||||
|
||||
# parameter and numeric value
|
||||
- match: ([A-Za-z])\s*({{decimal}})
|
||||
captures:
|
||||
|
@ -189,6 +195,9 @@ contexts:
|
|||
- match: \s*;
|
||||
scope: punctuation.comment.eol.start
|
||||
set: gcode_comment
|
||||
- match: \s*\(
|
||||
scope: punctuation.paren.comment.open
|
||||
push: gcode_comment_paren
|
||||
|
||||
# Comment to end of line.
|
||||
gcode_comment:
|
||||
|
@ -196,6 +205,18 @@ contexts:
|
|||
- match: \s*$
|
||||
pop: true
|
||||
|
||||
gcode_comment_paren:
|
||||
- meta_content_scope: paren.comment.gcode
|
||||
|
||||
- match: '[^)]+'
|
||||
|
||||
- match: '[)]'
|
||||
scope: punctuation.paren.comment.close
|
||||
pop: true
|
||||
|
||||
- match: \s*$
|
||||
pop: true
|
||||
|
||||
# Everything after this point is broken by a syntax error
|
||||
syntax_error:
|
||||
- meta_scope: invalid.error.syntax.gcode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue