GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-40222: Mark exception table function in the dis module as private by pablogsal · Pull Request #95960 · python/cpython

Conversation

@pablogsal

@pablogsal pablogsal commented Aug 13, 2022

Copy link
Copy Markdown
Member
  • Parsing VM initial structure
  • Hook things up so we can test it
  • Add debugging printf()s in anger; fix bugs
  • Implement actions
  • Support optional tokens
  • Support optional rules
  • Add vmreadme.md; OP_SUCCESS has an argument
  • Do optional items differently (with a postfix op)
  • Compute start/end line/col numbers; add some ideas to vmreadme.md
  • Tighten the code; add some speculation to vmreadme
  • Add OP_NOOP; add enums for rules & actions
  • Implement loops
  • Add a few more rules to the grammar
  • Drop debug printf()s, more flexibility in parse_string()
  • Add memoization, some debug niceties
  • Inline helper functions
  • Explain OP_OPTIONAL better
  • Skeleton of code generator
  • Simplify structure of OP_SUCCESS
  • Move opcodes around
  • Add a 'grammar' for operations
  • Move generated part of vm.h into vmparse.h
  • Clean skeleton of vm_generator
  • Better formatting of generated file; remove unneeded indentation
  • Add OP_LOOP_COLLECT_NONEMPTY -- used for a+
  • Expand description of root rules
  • Initial support for repeat_0
  • Fix name rules for repeat0 nodes
  • Eliminate OP_LOOP_START
  • Do fewer reallocs (at the cost of an extra int per frame)
  • Speculate how to implement a.b+
  • Make memo rule types distinct from token types
  • Fix small issues in vmreadme.pm
  • Add generation of root rules (very coarssely)
  • Add enum for rule types (R_)
  • Generate actions (primitively)
  • Implement code generation for keywords
  • Refactor add_opcode to optionally accept a second argument oparg
  • Translate item names in actions; use the generated vmparse.h!
  • Fix mypy (in vm_generator)
  • Avoid name conflict for 'f'
  • Generate code for repeat1 loops
  • Implement delimited loops (b.a+)
  • Generate code for delimited loop
  • Implement soft keywords (hand-written and code generation) (bpo-29643: Fix check for --enable-optimizations #129)
  • Update generated vmparse.h
  • Fix code generation for if_stmt
  • Implement lookahead ops
  • Generate code for lookaheads (only one token supported!)
  • Implement left-recursion (with hand-coded vmparse.h)
  • Code generation for left-recursive rules
  • Allow specifying different grammars
  • Generate code for 'cut'
  • Support groups and optional in code generator
  • There's no need to special-case -> in actions
  • Treat TYPE_COMMENT as a token (since it is)
  • Generate code for Grammar/parser.gram
  • Group every opcode with its argument (Optimize startup time when user site is disabled. #131)
  • Add vm target to pegen script to generate the vm parser (reinit the TLS before anything else #130)
  • Selective memoization
  • Don't call is_memoized in OP_RETURN_LEFT_REC
  • Different way of doing left-recursion
  • Remove leftover conflict markers
  • Fix deps for vm.o
  • Fix includes for vm.c
  • Regenerated vmparse.h
  • bpo-40222: Mark exception table function in the dis module as private

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gvanrossum and others added 30 commits May 26, 2020 10:35
@gvanrossum
Parsing VM initial structure
6a99107
@gvanrossum
Hook things up so we can test it
8ffc315
@gvanrossum
Add debugging printf()s in anger; fix bugs
a9ba946
@gvanrossum
Implement actions
8635a4c
@gvanrossum
Support optional tokens
1a34aeb
@gvanrossum
Support optional rules
b4a2292
@gvanrossum
Add vmreadme.md; OP_SUCCESS has an argument
b1f2a03
@gvanrossum
Do optional items differently (with a postfix op)
50aa868
@gvanrossum
Compute start/end line/col numbers; add some ideas to vmreadme.md
320266b
@gvanrossum
Tighten the code; add some speculation to vmreadme
5bf3f9c
@gvanrossum
Add OP_NOOP; add enums for rules & actions
816db75
@gvanrossum
Implement loops
d2a980f
@gvanrossum
Add a few more rules to the grammar
2befb12
@gvanrossum
Drop debug printf()s, more flexibility in parse_string()
175a127
@gvanrossum
Add memoization, some debug niceties
f3f1665
@gvanrossum
Inline helper functions
bda3517
@gvanrossum
Explain OP_OPTIONAL better
881d756
@pablogsal
Skeleton of code generator
94cfb95
Execute as "python -m pegen.vm_generator" in the Tools folder
@gvanrossum
Simplify structure of OP_SUCCESS
4ba6c61
@gvanrossum
Move opcodes around
db628e1
@gvanrossum
Add a 'grammar' for operations
7798629
@gvanrossum
Move generated part of vm.h into vmparse.h
412c741
@lysnikolaou
Merge branch 'pegenvm_generator' into pegenvm
020fbd1
@lysnikolaou
Merge branch 'master' into pegenvm
8c7cffc
@pablogsal
Clean skeleton of vm_generator
ef1fabd
@lysnikolaou
Merge branch 'pegenvm' of github.com:we-like-parsers/cpython into peg…
b497b23
…envm
@lysnikolaou
Better formatting of generated file; remove unneeded indentation
8eab7e0
@gvanrossum
Add OP_LOOP_COLLECT_NONEMPTY -- used for a+
4a5f823
@gvanrossum
Expand description of root rules
3cee73c
@pablogsal
Initial support for repeat_0
9b96df0
lysnikolaou and others added 25 commits June 1, 2020 17:09
@lysnikolaou
Implement soft keywords (hand-written and code generation) (#129)
a10babb
@gvanrossum
Update generated vmparse.h
b13169b
@gvanrossum
Fix code generation for if_stmt
c2a7cf6
@gvanrossum
Implement lookahead ops
a862a69
@gvanrossum
Generate code for lookaheads (only one token supported!)
ab863df
This is not complete, but I want to get to left-recursion before I fix
this, and I don't actually understand the code generator well enough
to know how to make it work for `&('foo'|'bar')`.
@gvanrossum
Implement left-recursion (with hand-coded vmparse.h)
1be4b62
It definitely makes parsing xxl.py 5-10% slower. :-(
@gvanrossum
Code generation for left-recursive rules
b53c2a4
This was super easy.

Benchmark time for xxl.py is now around 2.030 seconds.
(But this is with a super simple grammar. We'll have to see what is will be with the real grammar.)
@gvanrossum
Allow specifying different grammars
7a59aa0
@gvanrossum
Generate code for 'cut'
cac4149
Also silence compiler warning about default case in call_action().
@gvanrossum
Support groups and optional in code generator
180dfff
Also cleaned up the type of the second arg to add_opcode() -- it now
must always be a string, the one call that didn't pass a string now
calls str().
@gvanrossum
There's no need to special-case -> in actions
e01e643
@gvanrossum
Treat TYPE_COMMENT as a token (since it is)
13c3bbb
@gvanrossum
Generate code for Grammar/parser.gram
65304e6
(The bad news: it's currently twice as slow as the 'new' parser.)
@pablogsal
Group every opcode with its argument (#131)
10f7be1
@lysnikolaou
Add vm target to pegen script to generate the vm parser (#130)
a9a4115
@gvanrossum
Selective memoization
5bb2f57
@gvanrossum
Don't call is_memoized in OP_RETURN_LEFT_REC
ba8783b
This reduces the number of is_memoized calls dramatically, to what it
is for the recursive-descent parser (+1 for the root).

However we still have 50% more calls to insert_memo.  This has to be
investigated later.
@gvanrossum
Different way of doing left-recursion
bccd5c8
It's not any faster than before though.
@gvanrossum
Merge remote-tracking branch 'upstream/master' into pegenvm
2a138cc
@gvanrossum
Remove leftover conflict markers
2394b96
@gvanrossum
Fix deps for vm.o
be34499
@gvanrossum
Fix includes for vm.c
b9394e4
@gvanrossum
Regenerated vmparse.h
b64113b
@pablogsal
Merge remote-tracking branch 'pegen/pegenvm'
9afa67e
@pablogsal
bpo-40222: Mark exception table function in the dis module as private
a65604e
@pablogsal
pablogsal requested a review from lysnikolaou as a code owner August 13, 2022 18:12
@bedevere-bot bedevere-bot added the awaiting core review label Aug 13, 2022
@pablogsal pablogsal added the 3.11 only security fixes label Aug 13, 2022
@pablogsal pablogsal closed this Aug 13, 2022
@pablogsal

pablogsal commented Aug 13, 2022

Copy link
Copy Markdown
Member Author

Apologies for the noise :(

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lysnikolaou lysnikolaou Awaiting requested review from lysnikolaou lysnikolaou is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

3.11 only security fixes awaiting core review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@pablogsal @bedevere-bot @gvanrossum @lysnikolaou
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.