Sha256: e449619e2bd5bdd92e0c522fbd2c9d706fd4eecb3375ac1ae617aad20727f28d
Contents?: true
Size: 850 Bytes
Versions: 2
Compression:
Stored size: 850 Bytes
Contents
# -*- coding: utf-8 -*- """ pygments.lexers.gcodelexer ~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for the G Code Language. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, bygroups from pygments.token import Comment, Name, Text, Keyword, Number __all__ = ['GcodeLexer'] class GcodeLexer(RegexLexer): """ For gcode source code. .. versionadded:: 2.9 """ name = 'g-code' aliases = ['gcode'] filenames = ['*.gcode'] tokens = { 'root': [ (r';.*\n', Comment), (r'^[gmGM]\d{1,4}\s', Name.Builtin), # M or G commands (r'([^gGmM])([+-]?\d*[.]?\d+)', bygroups(Keyword, Number)), (r'\s', Text.Whitespace), (r'.*\n', Text), ] }
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pygments.rb-2.3.1 | vendor/pygments-main/pygments/lexers/gcodelexer.py |
pygments.rb-2.3.0 | vendor/pygments-main/pygments/lexers/gcodelexer.py |