文件操作 - gcodelexer.py
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/pygments/lexers/gcodelexer.py
编辑文件内容
""" pygments.lexers.gcodelexer ~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for the G Code Language. :copyright: Copyright 2006-2023 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), ] }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件