Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/pygments/lexers/procfile.py: 100%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

11 statements  

1""" 

2 pygments.lexers.procfile 

3 ~~~~~~~~~~~~~~~~~~~~~~~~ 

4 

5 Lexer for Procfile file format. 

6 

7 :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. 

8 :license: BSD, see LICENSE for details. 

9""" 

10 

11from pygments.lexer import RegexLexer, bygroups 

12from pygments.token import Name, Number, String, Text, Punctuation 

13 

14__all__ = ["ProcfileLexer"] 

15 

16 

17class ProcfileLexer(RegexLexer): 

18 """ 

19 Lexer for Procfile file format. 

20 

21 The format is used to run processes on Heroku or is used by Foreman or 

22 Honcho tools. 

23 """ 

24 name = 'Procfile' 

25 url = 'https://devcenter.heroku.com/articles/procfile#procfile-format' 

26 aliases = ['procfile'] 

27 filenames = ['Procfile'] 

28 version_added = '2.10' 

29 

30 tokens = { 

31 'root': [ 

32 (r'^([a-z]+)(:)', bygroups(Name.Label, Punctuation)), 

33 (r'\s+', Text.Whitespace), 

34 (r'"[^"]*"', String), 

35 (r"'[^']*'", String), 

36 (r'[0-9]+', Number.Integer), 

37 (r'\$[a-zA-Z_][\w]*', Name.Variable), 

38 (r'(\w+)(=)(\w+)', bygroups(Name.Variable, Punctuation, String)), 

39 (r'([\w\-\./]+)', Text), 

40 ], 

41 }