comparison mercurial/parser.py @ 25655:b8b73652c1c9

parser: update documentation about tokenizer and elements
author Yuya Nishihara <yuya@tcha.org>
date Sun, 21 Jun 2015 00:56:09 +0900
parents af329a84310c
children 48919d246a47
comparison
equal deleted inserted replaced
25654:af329a84310c 25655:b8b73652c1c9
8 # see http://effbot.org/zone/simple-top-down-parsing.htm and 8 # see http://effbot.org/zone/simple-top-down-parsing.htm and
9 # http://eli.thegreenplace.net/2010/01/02/top-down-operator-precedence-parsing/ 9 # http://eli.thegreenplace.net/2010/01/02/top-down-operator-precedence-parsing/
10 # for background 10 # for background
11 11
12 # takes a tokenizer and elements 12 # takes a tokenizer and elements
13 # tokenizer is an iterator that returns type, value pairs 13 # tokenizer is an iterator that returns (type, value, pos) tuples
14 # elements is a mapping of types to binding strength, prefix and infix actions 14 # elements is a mapping of types to binding strength, prefix, infix and
15 # optional suffix actions
15 # an action is a tree node name, a tree label, and an optional match 16 # an action is a tree node name, a tree label, and an optional match
16 # __call__(program) parses program into a labeled tree 17 # __call__(program) parses program into a labeled tree
17 18
18 import error 19 import error
19 from i18n import _ 20 from i18n import _