Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
6a99107
Parsing VM initial structure
gvanrossum May 26, 2020
8ffc315
Hook things up so we can test it
gvanrossum May 27, 2020
a9ba946
Add debugging printf()s in anger; fix bugs
gvanrossum May 27, 2020
8635a4c
Implement actions
gvanrossum May 27, 2020
1a34aeb
Support optional tokens
gvanrossum May 27, 2020
b4a2292
Support optional rules
gvanrossum May 27, 2020
b1f2a03
Add vmreadme.md; OP_SUCCESS has an argument
gvanrossum May 28, 2020
50aa868
Do optional items differently (with a postfix op)
gvanrossum May 28, 2020
320266b
Compute start/end line/col numbers; add some ideas to vmreadme.md
gvanrossum May 28, 2020
5bf3f9c
Tighten the code; add some speculation to vmreadme
gvanrossum May 28, 2020
816db75
Add OP_NOOP; add enums for rules & actions
gvanrossum May 28, 2020
d2a980f
Implement loops
gvanrossum May 29, 2020
2befb12
Add a few more rules to the grammar
gvanrossum May 29, 2020
175a127
Drop debug printf()s, more flexibility in parse_string()
gvanrossum May 29, 2020
f3f1665
Add memoization, some debug niceties
gvanrossum May 29, 2020
bda3517
Inline helper functions
gvanrossum May 29, 2020
881d756
Explain OP_OPTIONAL better
gvanrossum May 29, 2020
94cfb95
Skeleton of code generator
pablogsal May 29, 2020
4ba6c61
Simplify structure of OP_SUCCESS
gvanrossum May 29, 2020
db628e1
Move opcodes around
gvanrossum May 29, 2020
7798629
Add a 'grammar' for operations
gvanrossum May 29, 2020
412c741
Move generated part of vm.h into vmparse.h
gvanrossum May 29, 2020
020fbd1
Merge branch 'pegenvm_generator' into pegenvm
lysnikolaou May 29, 2020
8c7cffc
Merge branch 'master' into pegenvm
lysnikolaou May 29, 2020
ef1fabd
Clean skeleton of vm_generator
pablogsal May 30, 2020
b497b23
Merge branch 'pegenvm' of github.com:we-like-parsers/cpython into peg…
lysnikolaou May 30, 2020
8eab7e0
Better formatting of generated file; remove unneeded indentation
lysnikolaou May 30, 2020
4a5f823
Add OP_LOOP_COLLECT_NONEMPTY -- used for a+
gvanrossum May 30, 2020
3cee73c
Expand description of root rules
gvanrossum May 30, 2020
9b96df0
Initial support for repeat_0
pablogsal May 30, 2020
2f44ee9
Fix name rules for repeat0 nodes
pablogsal May 30, 2020
6dc7092
Eliminate OP_LOOP_START
gvanrossum May 30, 2020
9e7e12e
Do fewer reallocs (at the cost of an extra int per frame)
gvanrossum May 30, 2020
52f5a75
Speculate how to implement a.b+
gvanrossum May 30, 2020
3b93237
Make memo rule types distinct from token types
gvanrossum May 30, 2020
33522ae
Fix small issues in vmreadme.pm
gvanrossum May 30, 2020
cbd45a5
Add generation of root rules (very coarssely)
gvanrossum May 31, 2020
1a6531d
Add enum for rule types (R_)
gvanrossum May 31, 2020
0226dd5
Generate actions (primitively)
gvanrossum May 31, 2020
c64ff2f
Implement code generation for keywords
lysnikolaou May 31, 2020
e2c4a36
Refactor add_opcode to optionally accept a second argument
lysnikolaou May 31, 2020
21d8b83
Translate item names in actions; use the generated vmparse.h!
gvanrossum May 31, 2020
6fe4f0e
Fix mypy (in vm_generator)
gvanrossum May 31, 2020
6205002
Avoid name conflict for 'f'
gvanrossum May 31, 2020
f72c7b6
Generate code for repeat1 loops
gvanrossum Jun 1, 2020
fc3d4c4
Implement delimited loops (b.a+)
gvanrossum Jun 1, 2020
6c50468
Generate code for delimited loop
gvanrossum Jun 1, 2020
a10babb
Implement soft keywords (hand-written and code generation) (#129)
lysnikolaou Jun 1, 2020
b13169b
Update generated vmparse.h
gvanrossum Jun 1, 2020
c2a7cf6
Fix code generation for if_stmt
gvanrossum Jun 1, 2020
a862a69
Implement lookahead ops
gvanrossum Jun 1, 2020
ab863df
Generate code for lookaheads (only one token supported!)
gvanrossum Jun 1, 2020
1be4b62
Implement left-recursion (with hand-coded vmparse.h)
gvanrossum Jun 2, 2020
b53c2a4
Code generation for left-recursive rules
gvanrossum Jun 2, 2020
7a59aa0
Allow specifying different grammars
gvanrossum Jun 2, 2020
cac4149
Generate code for 'cut'
gvanrossum Jun 2, 2020
180dfff
Support groups and optional in code generator
gvanrossum Jun 2, 2020
e01e643
There's no need to special-case -> in actions
gvanrossum Jun 2, 2020
13c3bbb
Treat TYPE_COMMENT as a token (since it is)
gvanrossum Jun 3, 2020
65304e6
Generate code for Grammar/parser.gram
gvanrossum Jun 3, 2020
10f7be1
Group every opcode with its argument (#131)
pablogsal Jun 3, 2020
a9a4115
Add vm target to pegen script to generate the vm parser (#130)
lysnikolaou Jun 3, 2020
5bb2f57
Selective memoization
gvanrossum Jun 3, 2020
ba8783b
Don't call is_memoized in OP_RETURN_LEFT_REC
gvanrossum Jun 3, 2020
bccd5c8
Different way of doing left-recursion
gvanrossum Jun 5, 2020
2a138cc
Merge remote-tracking branch 'upstream/master' into pegenvm
gvanrossum Aug 16, 2020
2394b96
Remove leftover conflict markers
gvanrossum Aug 16, 2020
be34499
Fix deps for vm.o
gvanrossum Aug 16, 2020
b9394e4
Fix includes for vm.c
gvanrossum Aug 16, 2020
b64113b
Regenerated vmparse.h
gvanrossum Aug 16, 2020
9afa67e
Merge remote-tracking branch 'pegen/pegenvm'
pablogsal Aug 1, 2022
a65604e
bpo-40222: Mark exception table function in the dis module as private
pablogsal Aug 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into pegenvm
  • Loading branch information
gvanrossum committed Aug 16, 2020
commit 2a138cc51559f543de395d482baaceb8df430c0a
49 changes: 7 additions & 42 deletions .azure-pipelines/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
variables:
manylinux: false
coverage: false

resources:
containers:
- container: manylinux1
image: pyca/cryptography-manylinux1:x86_64
trigger: ['master', '3.9', '3.8', '3.7']

jobs:
- job: Prebuild
displayName: Pre-build checks

pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-18.04

steps:
- template: ./prebuild-checks.yml
Expand All @@ -24,7 +20,7 @@ jobs:
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))

pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-18.04

steps:
- template: ./docs-steps.yml
Expand Down Expand Up @@ -56,50 +52,19 @@ jobs:
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))

pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-18.04

variables:
testRunTitle: '$(build.sourceBranchName)-linux'
testRunPlatform: linux
openssl_version: 1.1.1f
openssl_version: 1.1.1g

steps:
- template: ./posix-steps.yml
parameters:
dependencies: apt


- job: ManyLinux1_CI_Tests
displayName: ManyLinux1 CI Tests
dependsOn: Prebuild
condition: |
and(
and(
succeeded(),
eq(variables['manylinux'], 'true')
),
eq(dependencies.Prebuild.outputs['tests.run'], 'true')
)

pool:
vmImage: ubuntu-16.04

container: manylinux1

variables:
testRunTitle: '$(build.sourceBranchName)-manylinux1'
testRunPlatform: manylinux1
openssl_version: ''

steps:
- template: ./posix-steps.yml
parameters:
dependencies: yum
sudo_dependencies: ''
xvfb: false
patchcheck: false


- job: Ubuntu_Coverage_CI_Tests
displayName: Ubuntu CI Tests (coverage)
dependsOn: Prebuild
Expand All @@ -113,12 +78,12 @@ jobs:
)

pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-18.04

variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1f
openssl_version: 1.1.1g

steps:
- template: ./posix-steps.yml
Expand Down
49 changes: 7 additions & 42 deletions .azure-pipelines/pr.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
variables:
manylinux: false
coverage: false

resources:
containers:
- container: manylinux1
image: pyca/cryptography-manylinux1:x86_64
pr: ['master', '3.9', '3.8', '3.7']

jobs:
- job: Prebuild
displayName: Pre-build checks

pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-18.04

steps:
- template: ./prebuild-checks.yml
Expand All @@ -24,7 +20,7 @@ jobs:
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))

pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-18.04

steps:
- template: ./docs-steps.yml
Expand Down Expand Up @@ -56,50 +52,19 @@ jobs:
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))

pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-18.04

variables:
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
testRunPlatform: linux
openssl_version: 1.1.1f
openssl_version: 1.1.1g

steps:
- template: ./posix-steps.yml
parameters:
dependencies: apt


- job: ManyLinux1_PR_Tests
displayName: ManyLinux1 PR Tests
dependsOn: Prebuild
condition: |
and(
and(
succeeded(),
eq(variables['manylinux'], 'true')
),
eq(dependencies.Prebuild.outputs['tests.run'], 'true')
)

pool:
vmImage: ubuntu-16.04

container: manylinux1

variables:
testRunTitle: '$(system.pullRequest.TargetBranch)-manylinux1'
testRunPlatform: manylinux1
openssl_version: ''

steps:
- template: ./posix-steps.yml
parameters:
dependencies: yum
sudo_dependencies: ''
xvfb: false
patchcheck: false


- job: Ubuntu_Coverage_PR_Tests
displayName: Ubuntu PR Tests (coverage)
dependsOn: Prebuild
Expand All @@ -113,12 +78,12 @@ jobs:
)

pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-18.04

variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1f
openssl_version: 1.1.1g

steps:
- template: ./posix-steps.yml
Expand Down
6 changes: 6 additions & 0 deletions .azure-pipelines/windows-release/msi-steps.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
steps:
- template: ./checkout.yml

- powershell: |
$d = (.\PCbuild\build.bat -V) | %{ if($_ -match '\s+(\w+):\s*(.+)\s*$') { @{$Matches[1] = $Matches[2];} }};
Write-Host "##vso[task.setvariable variable=SigningDescription]Python $($d.PythonVersion)"
displayName: 'Update signing description'
condition: and(succeeded(), not(variables['SigningDescription']))

- task: DownloadPipelineArtifact@1
displayName: 'Download artifact: doc'
inputs:
Expand Down
8 changes: 7 additions & 1 deletion .azure-pipelines/windows-release/stage-pack-msix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,15 @@ jobs:
clean: all

steps:
- checkout: none
- template: ./checkout.yml
- template: ./find-sdk.yml

- powershell: |
$d = (.\PCbuild\build.bat -V) | %{ if($_ -match '\s+(\w+):\s*(.+)\s*$') { @{$Matches[1] = $Matches[2];} }};
Write-Host "##vso[task.setvariable variable=SigningDescription]Python $($d.PythonVersion)"
displayName: 'Update signing description'
condition: and(succeeded(), not(variables['SigningDescription']))

- task: DownloadBuildArtifacts@0
displayName: 'Download Artifact: unsigned_msix'
inputs:
Expand Down
6 changes: 6 additions & 0 deletions .azure-pipelines/windows-release/stage-sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ jobs:
- template: ./checkout.yml
- template: ./find-sdk.yml

- powershell: |
$d = (.\PCbuild\build.bat -V) | %{ if($_ -match '\s+(\w+):\s*(.+)\s*$') { @{$Matches[1] = $Matches[2];} }};
Write-Host "##vso[task.setvariable variable=SigningDescription]Python $($d.PythonVersion)"
displayName: 'Update signing description'
condition: and(succeeded(), not(variables['SigningDescription']))

- powershell: |
Write-Host "##vso[build.addbuildtag]signed"
displayName: 'Add build tags'
Expand Down
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ PC/readme.txt text eol=crlf

# Generated files
# https://github.com/github/linguist#generated-code
Include/graminit.h linguist-generated=true
Python/graminit.h linguist-generated=true
Modules/clinic/*.h linguist-generated=true
Objects/clinic/*.h linguist-generated=true
PC/clinic/*.h linguist-generated=true
Expand Down
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ Include/pytime.h @pganssle @abalkin
/Modules/gcmodule.c @pablogsal
/Doc/library/gc.rst @pablogsal

# Parser/Pgen
/Parser/pgen/ @pablogsal
/Parser/pegen/ @pablogsal
/Tools/peg_generator/ @pablogsal
# Parser
/Parser/ @pablogsal @lysnikolaou
/Tools/peg_generator/ @pablogsal @lysnikolaou
/Lib/test/test_peg_generator/ @pablogsal @lysnikolaou

# SQLite 3
**/*sqlite* @berkerpeksag
Expand Down
18 changes: 18 additions & 0 deletions .github/problem-matchers/gcc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"__comment": "Taken from vscode-cpptools's Extension/package.json gcc rule",
"problemMatcher": [
{
"owner": "gcc-problem-matcher",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}
17 changes: 16 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,20 @@ jobs:
echo '::set-output name=run_tests::true'
else
git fetch origin $GITHUB_BASE_REF --depth=1
git diff --name-only origin/$GITHUB_BASE_REF... | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
# reliable than git diff "origin/$GITHUB_BASE_REF.." (2 dots),
# but it requires to download more commits (this job uses
# "git fetch --depth=1").
#
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) works with Git
# 2.26, but Git 2.28 is stricter and fails with "no merge base".
#
# git diff "origin/$GITHUB_BASE_REF.." (2 dots) should be enough on
# GitHub, since GitHub starts by merging origin/$GITHUB_BASE_REF
# into the PR branch anyway.
#
# https://github.com/python/core-workflow/issues/373
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
fi
build_win32:
name: 'Windows (x86)'
Expand Down Expand Up @@ -87,6 +100,8 @@ jobs:
OPENSSL_VER: 1.1.1f
steps:
- uses: actions/checkout@v2
- name: Register gcc problem matcher
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
- name: Install Dependencies
run: sudo ./.github/workflows/posix-deps-apt.sh
- name: 'Restore OpenSSL build'
Expand Down
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ matrix:
packages:
- xvfb
before_script:
- |
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]
then
echo "Don't run Python coverage on pull requests."
exit
fi
- ./configure
- make -j4
# Need a venv that can parse covered code.
Expand Down Expand Up @@ -109,6 +115,12 @@ matrix:
- lcov
- xvfb
before_script:
- |
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]
then
echo "Don't run C coverage on pull requests."
exit
fi
- ./configure
script:
- xvfb-run make -j4 coverage-report
Expand Down
2 changes: 1 addition & 1 deletion Doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ clean:
venv:
$(PYTHON) -m venv $(VENVDIR)
$(VENVDIR)/bin/python3 -m pip install -U pip setuptools
$(VENVDIR)/bin/python3 -m pip install -U Sphinx==2.2.0 blurb python-docs-theme
$(VENVDIR)/bin/python3 -m pip install -U Sphinx==2.3.1 blurb python-docs-theme
@echo "The venv has been created in the $(VENVDIR) directory"

dist:
Expand Down
1 change: 0 additions & 1 deletion Doc/c-api/abstract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ but whose items have not been set to some non-\ ``NULL`` value yet.
mapping.rst
iter.rst
buffer.rst
objbuffer.rst
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.