From patchwork Sun Jun 21 08:28:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,2] parser: update documentation about tokenizer and elements From: Yuya Nishihara X-Patchwork-Id: 9742 Message-Id: <90851ca8141f20b498f4.1434875322@mimosa> To: mercurial-devel@selenic.com Date: Sun, 21 Jun 2015 17:28:42 +0900 # HG changeset patch # User Yuya Nishihara # Date 1434815769 -32400 # Sun Jun 21 00:56:09 2015 +0900 # Node ID 90851ca8141f20b498f4d2239c6d5f5c2a1eaed0 # Parent f872d2a17b67f9c34140cb9a94279ce910985cc4 parser: update documentation about tokenizer and elements diff --git a/mercurial/parser.py b/mercurial/parser.py --- a/mercurial/parser.py +++ b/mercurial/parser.py @@ -10,8 +10,9 @@ # for background # takes a tokenizer and elements -# tokenizer is an iterator that returns type, value pairs -# elements is a mapping of types to binding strength, prefix and infix actions +# tokenizer is an iterator that returns (type, value, pos) tuples +# elements is a mapping of types to binding strength, prefix, infix and +# optional suffix actions # an action is a tree node name, a tree label, and an optional match # __call__(program) parses program into a labeled tree