mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
GH-88116: Use a compact format to represent end line and column offsets. (GH-91666)
* Stores all location info in linetable to conform to PEP 626. * Remove column table from code objects. * Remove end-line table from code objects. * Document new location table format
This commit is contained in:
parent
2a5f171759
commit
944fffee89
20 changed files with 859 additions and 539 deletions
|
@ -240,8 +240,6 @@ class Printer:
|
|||
co_name = self.generate(name + "_name", code.co_name)
|
||||
co_qualname = self.generate(name + "_qualname", code.co_qualname)
|
||||
co_linetable = self.generate(name + "_linetable", code.co_linetable)
|
||||
co_endlinetable = self.generate(name + "_endlinetable", code.co_endlinetable)
|
||||
co_columntable = self.generate(name + "_columntable", code.co_columntable)
|
||||
co_exceptiontable = self.generate(name + "_exceptiontable", code.co_exceptiontable)
|
||||
# These fields are not directly accessible
|
||||
localsplusnames, localspluskinds = get_localsplus(code)
|
||||
|
@ -280,8 +278,6 @@ class Printer:
|
|||
self.write(f".co_name = {co_name},")
|
||||
self.write(f".co_qualname = {co_qualname},")
|
||||
self.write(f".co_linetable = {co_linetable},")
|
||||
self.write(f".co_endlinetable = {co_endlinetable},")
|
||||
self.write(f".co_columntable = {co_columntable},")
|
||||
self.write(f".co_code_adaptive = {co_code_adaptive},")
|
||||
name_as_code = f"(PyCodeObject *)&{name}"
|
||||
self.deallocs.append(f"_PyStaticCode_Dealloc({name_as_code});")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue