mercurial/templater.py
changeset 25815 e71e5629e006
parent 25801 272ff3680bf3
child 25985 7eb357b5f774
child 26502 4ca98a389152
equal deleted inserted replaced
25814:dc1a49264628 25815:e71e5629e006
    13 import minirst
    13 import minirst
    14 
    14 
    15 # template parsing
    15 # template parsing
    16 
    16 
    17 elements = {
    17 elements = {
    18     # token-type: binding-strength, prefix, infix, suffix
    18     # token-type: binding-strength, primary, prefix, infix, suffix
    19     "(": (20, ("group", 1, ")"), ("func", 1, ")"), None),
    19     "(": (20, None, ("group", 1, ")"), ("func", 1, ")"), None),
    20     ",": (2, None, ("list", 2), None),
    20     ",": (2, None, None, ("list", 2), None),
    21     "|": (5, None, ("|", 5), None),
    21     "|": (5, None, None, ("|", 5), None),
    22     "%": (6, None, ("%", 6), None),
    22     "%": (6, None, None, ("%", 6), None),
    23     ")": (0, None, None, None),
    23     ")": (0, None, None, None, None),
    24     "integer": (0, ("integer",), None, None),
    24     "integer": (0, "integer", None, None, None),
    25     "symbol": (0, ("symbol",), None, None),
    25     "symbol": (0, "symbol", None, None, None),
    26     "string": (0, ("string",), None, None),
    26     "string": (0, "string", None, None, None),
    27     "template": (0, ("template",), None, None),
    27     "template": (0, "template", None, None, None),
    28     "end": (0, None, None, None),
    28     "end": (0, None, None, None, None),
    29 }
    29 }
    30 
    30 
    31 def tokenize(program, start, end):
    31 def tokenize(program, start, end):
    32     pos = start
    32     pos = start
    33     while pos < end:
    33     while pos < end: