<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Parser/parser.c, branch misc-acks-comment</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/'/>
<entry>
<title>fix warnings by adding more const (GH-12924)</title>
<updated>2019-04-23T11:39:37+00:00</updated>
<author>
<name>Inada Naoki</name>
<email>songofacandy@gmail.com</email>
</author>
<published>2019-04-23T11:39:37+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=09415ff0ebbbe97c8cd08ac1f94673d7a49c8018'/>
<id>09415ff0ebbbe97c8cd08ac1f94673d7a49c8018</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-36623: Clean parser headers and include files (GH-12253)</title>
<updated>2019-04-13T16:05:14+00:00</updated>
<author>
<name>Pablo Galindo</name>
<email>Pablogsal@gmail.com</email>
</author>
<published>2019-04-13T16:05:14+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=f2cf1e3e2892a6326949c2570f1bb6d6c95715fb'/>
<id>f2cf1e3e2892a6326949c2570f1bb6d6c95715fb</id>
<content type='text'>
After the removal of pgen, multiple header and function prototypes that lack implementation or are unused are still lying around.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After the removal of pgen, multiple header and function prototypes that lack implementation or are unused are still lying around.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-35766: Merge typed_ast back into CPython (GH-11645)</title>
<updated>2019-01-31T11:40:27+00:00</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2019-01-31T11:40:27+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c'/>
<id>dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-33416: Add end positions to Python AST (GH-11605)</title>
<updated>2019-01-22T11:18:22+00:00</updated>
<author>
<name>Ivan Levkivskyi</name>
<email>levkivskyi@gmail.com</email>
</author>
<published>2019-01-22T11:18:22+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=9932a22897ef9905161dac7476e6976370e13515'/>
<id>9932a22897ef9905161dac7476e6976370e13515</id>
<content type='text'>
The majority of this PR is tediously passing `end_lineno` and `end_col_offset` everywhere. Here are non-trivial points:
* It is not possible to reconstruct end positions in AST "on the fly", some information is lost after an AST node is constructed, so we need two more attributes for every AST node `end_lineno` and `end_col_offset`.
* I add end position information to both CST and AST.  Although it may be technically possible to avoid adding end positions to CST, the code becomes more cumbersome and less efficient.
* Since the end position is not known for non-leaf CST nodes while the next token is added, this requires a bit of extra care (see `_PyNode_FinalizeEndPos`). Unless I made some mistake, the algorithm should be linear.
* For statements, I "trim" the end position of suites to not include the terminal newlines and dedent (this seems to be what people would expect), for example in
  ```python
  class C:
      pass

  pass
  ```
  the end line and end column for the class definition is (2, 8).
* For `end_col_offset` I use the common Python convention for indexing, for example for `pass` the `end_col_offset` is 4 (not 3), so that `[0:4]` gives one the source code that corresponds to the node.
* I added a helper function `ast.get_source_segment()`, to get source text segment corresponding to a given AST node. It is also useful for testing.

An (inevitable) downside of this PR is that AST now takes almost 25% more memory. I think however it is probably justified by the benefits.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The majority of this PR is tediously passing `end_lineno` and `end_col_offset` everywhere. Here are non-trivial points:
* It is not possible to reconstruct end positions in AST "on the fly", some information is lost after an AST node is constructed, so we need two more attributes for every AST node `end_lineno` and `end_col_offset`.
* I add end position information to both CST and AST.  Although it may be technically possible to avoid adding end positions to CST, the code becomes more cumbersome and less efficient.
* Since the end position is not known for non-leaf CST nodes while the next token is added, this requires a bit of extra care (see `_PyNode_FinalizeEndPos`). Unless I made some mistake, the algorithm should be linear.
* For statements, I "trim" the end position of suites to not include the terminal newlines and dedent (this seems to be what people would expect), for example in
  ```python
  class C:
      pass

  pass
  ```
  the end line and end column for the class definition is (2, 8).
* For `end_col_offset` I use the common Python convention for indexing, for example for `pass` the `end_col_offset` is 4 (not 3), so that `[0:4]` gives one the source code that corresponds to the node.
* I added a helper function `ast.get_source_segment()`, to get source text segment corresponding to a given AST node. It is also useful for testing.

An (inevitable) downside of this PR is that AST now takes almost 25% more memory. I think however it is probably justified by the benefits.</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #26130: Remove redundant variable 's' from Parser/parser.c</title>
<updated>2016-03-27T21:45:28+00:00</updated>
<author>
<name>Berker Peksag</name>
<email>berker.peksag@gmail.com</email>
</author>
<published>2016-03-27T21:45:28+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=2a65ecb780e2a5cd47bc4b9af947b1127e972a11'/>
<id>2a65ecb780e2a5cd47bc4b9af947b1127e972a11</id>
<content type='text'>
Patch by Oren Milman.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Patch by Oren Milman.
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #1772673: The type of `char*` arguments now changed to `const char*`.</title>
<updated>2013-10-19T18:03:34+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2013-10-19T18:03:34+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=c679227e31245b0e8dec74a1f7cc77710541d985'/>
<id>c679227e31245b0e8dec74a1f7cc77710541d985</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #18722: Remove uses of the "register" keyword in C code.</title>
<updated>2013-08-13T18:18:52+00:00</updated>
<author>
<name>Antoine Pitrou</name>
<email>solipsis@pitrou.net</email>
</author>
<published>2013-08-13T18:18:52+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=9ed5f2726607c57c894af24159b6a7ccf660da7f'/>
<id>9ed5f2726607c57c894af24159b6a7ccf660da7f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Recorded merge of revisions 81029 via svnmerge from</title>
<updated>2010-05-09T15:52:27+00:00</updated>
<author>
<name>Antoine Pitrou</name>
<email>solipsis@pitrou.net</email>
</author>
<published>2010-05-09T15:52:27+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=f95a1b3c53bdd678b64aa608d4375660033460c3'/>
<id>f95a1b3c53bdd678b64aa608d4375660033460c3</id>
<content type='text'>
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines

  Untabify C files. Will watch buildbots.
........
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines

  Untabify C files. Will watch buildbots.
........
</pre>
</div>
</content>
</entry>
<entry>
<title>The BDFL has retired! Long live the FLUFL (Friendly Language Uncle For Life)!</title>
<updated>2009-04-01T05:08:41+00:00</updated>
<author>
<name>Brett Cannon</name>
<email>bcannon@gmail.com</email>
</author>
<published>2009-04-01T05:08:41+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=e3944a5e1ecf67aa722fd9ce0c0a4ee72ee5ba2d'/>
<id>e3944a5e1ecf67aa722fd9ce0c0a4ee72ee5ba2d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merged revisions 67030-67031 via svnmerge from</title>
<updated>2008-10-26T20:58:53+00:00</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2008-10-26T20:58:53+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=9aebc61ad8e3b0eddd43dc563380025cc2fd8d02'/>
<id>9aebc61ad8e3b0eddd43dc563380025cc2fd8d02</id>
<content type='text'>
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67030 | benjamin.peterson | 2008-10-26 15:21:13 -0500 (Sun, 26 Oct 2008) | 1 line

  fix __future__ imports when multiple features are given
........
  r67031 | benjamin.peterson | 2008-10-26 15:33:19 -0500 (Sun, 26 Oct 2008) | 1 line

  add forgotten test for r67030
........
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67030 | benjamin.peterson | 2008-10-26 15:21:13 -0500 (Sun, 26 Oct 2008) | 1 line

  fix __future__ imports when multiple features are given
........
  r67031 | benjamin.peterson | 2008-10-26 15:33:19 -0500 (Sun, 26 Oct 2008) | 1 line

  add forgotten test for r67030
........
</pre>
</div>
</content>
</entry>
</feed>
