Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/pygments/lexers/procfile.py: 100%
9 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:16 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:16 +0000
1"""
2 pygments.lexers.procfile
3 ~~~~~~~~~~~~~~~~~~~~~~~~
5 Lexer for Procfile file format.
7 :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
8 :license: BSD, see LICENSE for details.
9"""
11from pygments.lexer import RegexLexer, bygroups
12from pygments.token import Name, Number, String, Text, Punctuation
14__all__ = ["ProcfileLexer"]
17class ProcfileLexer(RegexLexer):
18 """
19 Lexer for Procfile file format.
21 The format is used to run processes on Heroku or is used by Foreman or
22 Honcho tools.
24 .. versionadded:: 2.10
25 """
26 name = 'Procfile'
27 url = 'https://devcenter.heroku.com/articles/procfile#procfile-format'
28 aliases = ['procfile']
29 filenames = ['Procfile']
31 tokens = {
32 'root': [
33 (r'^([a-z]+)(:)', bygroups(Name.Label, Punctuation)),
34 (r'\s+', Text.Whitespace),
35 (r'"[^"]*"', String),
36 (r"'[^']*'", String),
37 (r'[0-9]+', Number.Integer),
38 (r'\$[a-zA-Z_][\w]*', Name.Variable),
39 (r'(\w+)(=)(\w+)', bygroups(Name.Variable, Punctuation, String)),
40 (r'([\w\-\./]+)', Text),
41 ],
42 }