PyReprism 0.0.1__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyreprism-0.0.3/.flake8 +7 -0
- pyreprism-0.0.3/.github/FUNDING.yaml +1 -0
- pyreprism-0.0.3/.github/ISSUE_TEMPLATE/bug_report.md +17 -0
- pyreprism-0.0.3/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
- pyreprism-0.0.3/.github/PULL_REQUEST_TEMPLATE.md +13 -0
- pyreprism-0.0.3/.github/workflows/ci.yml +41 -0
- pyreprism-0.0.3/.github/workflows/publish.yml +38 -0
- pyreprism-0.0.3/.readthedocs.yaml +31 -0
- pyreprism-0.0.3/CONTRIBUTING.md +65 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/PKG-INFO +56 -15
- pyreprism-0.0.3/README.md +91 -0
- pyreprism-0.0.3/codecov.yml +13 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/pyproject.toml +5 -7
- pyreprism-0.0.3/requirements.txt +7 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/__init__.py +1 -1
- pyreprism-0.0.3/src/PyReprism/languages/abap.py +50 -0
- pyreprism-0.0.3/src/PyReprism/languages/actionscript.py +43 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/ada.py +7 -11
- pyreprism-0.0.3/src/PyReprism/languages/apacheconf.py +49 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/apl.py +7 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/applescript.py +7 -10
- pyreprism-0.0.3/src/PyReprism/languages/arduino.py +49 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/arff.py +7 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/asciidoc.py +7 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/asm6502.py +7 -9
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/aspnet.py +7 -9
- pyreprism-0.0.3/src/PyReprism/languages/autohotkey.py +49 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/autoit.py +9 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/bash.py +8 -11
- pyreprism-0.0.3/src/PyReprism/languages/basic.py +49 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/batch.py +7 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/bison.py +9 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/brainfuck.py +8 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/bro.py +8 -9
- pyreprism-0.0.3/src/PyReprism/languages/c.py +43 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/clike.py +8 -11
- pyreprism-0.0.3/src/PyReprism/languages/clojure.py +50 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/coffeescript.py +7 -8
- pyreprism-0.0.3/src/PyReprism/languages/cpp.py +43 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/crystal.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/csharp.py +7 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/csp.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/css.py +8 -9
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/css_extras.py +8 -9
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/d.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/dart.py +8 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/diff.py +8 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/django.py +12 -19
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/docker.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/eiffel.py +8 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/elixir.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/erlang.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/fortran.py +6 -6
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/fsharp.py +8 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/go.py +7 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/graphql.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/groovy.py +7 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/haml.py +7 -8
- pyreprism-0.0.3/src/PyReprism/languages/haskell.py +49 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/html.py +10 -17
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/ini.py +5 -6
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/j.py +7 -8
- pyreprism-0.0.3/src/PyReprism/languages/java.py +43 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/javascript.py +7 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/jolie.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/json.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/jsx.py +7 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/julia.py +7 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/kotlin.py +7 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/latex.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/less.py +8 -9
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/liquid.py +8 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/livescript.py +8 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/makefile.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/markdown.py +4 -5
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/markup.py +9 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/matlab.py +10 -12
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/n4js.py +8 -9
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/nginx.py +7 -8
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/objectivec.py +10 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/ocaml.py +10 -12
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/pascal.py +10 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/perl.py +9 -13
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/php.py +9 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/prolog.py +9 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/python.py +11 -15
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/ruby.py +8 -9
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/rust.py +8 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/scala.py +7 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/scheme.py +9 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/scss.py +10 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/smalltalk.py +9 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/stylus.py +8 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/swift.py +8 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/tsx.py +7 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/typescript.py +7 -10
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/vbnet.py +9 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/velocity.py +8 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/vim.py +9 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/visual_basic.py +9 -11
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/yaml.py +9 -12
- pyreprism-0.0.3/src/PyReprism/utils/extension.py +149 -0
- pyreprism-0.0.3/src/PyReprism/utils/normalizer.py +15 -0
- pyreprism-0.0.1/.flake8 +0 -6
- pyreprism-0.0.1/.readthedocs.yaml +0 -0
- pyreprism-0.0.1/README.md +0 -47
- pyreprism-0.0.1/requirements.txt +0 -3
- pyreprism-0.0.1/src/PyReprism/languages/_base.py +0 -30
- pyreprism-0.0.1/src/PyReprism/languages/abap.py +0 -52
- pyreprism-0.0.1/src/PyReprism/languages/actionscript.py +0 -52
- pyreprism-0.0.1/src/PyReprism/languages/apacheconf.py +0 -52
- pyreprism-0.0.1/src/PyReprism/languages/arduino.py +0 -52
- pyreprism-0.0.1/src/PyReprism/languages/autohotkey.py +0 -51
- pyreprism-0.0.1/src/PyReprism/languages/basic.py +0 -52
- pyreprism-0.0.1/src/PyReprism/languages/c.py +0 -52
- pyreprism-0.0.1/src/PyReprism/languages/clojure.py +0 -50
- pyreprism-0.0.1/src/PyReprism/languages/cpp.py +0 -52
- pyreprism-0.0.1/src/PyReprism/languages/haskell.py +0 -53
- pyreprism-0.0.1/src/PyReprism/languages/java.py +0 -53
- pyreprism-0.0.1/src/PyReprism/utils/extension.py +0 -149
- pyreprism-0.0.1/src/PyReprism/utils/normalizer.py +0 -18
- {pyreprism-0.0.1 → pyreprism-0.0.3}/.gitignore +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/LICENSE +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/pytest.ini +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/__init__.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/erb.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/flow.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/gedcom.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/gherkin.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/git.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/glsl.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/handlebars.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/haxe.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/hpkp.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/hsts.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/ichigojam.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/icon.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/inform7.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/io.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/keyman.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/lolcode.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/lua.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/markup_templating.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/mel.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/mizar.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/monkey.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/nasm.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/nim.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/nix.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/nsis.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/opencl.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/oz.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/parigp.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/parser.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/php_extras.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/plsql.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/powershell.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/processing.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/properties.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/protobuf.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/pug.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/puppet.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/pure.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/q.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/qore.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/r.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/reason.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/renpy.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/rest.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/rip.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/roboconf.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/sas.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/sass.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/smarty.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/soy.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/tcl.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/textile.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/twig.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/verilog.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/vhdl.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/wasam.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/xeora.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/languages/xojo.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.3}/src/PyReprism/utils/__init__.py +0 -0
pyreprism-0.0.3/.flake8
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: unlv-evol
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the bug. For example, a specific commit in a repository, and/or a modification.
|
|
15
|
+
|
|
16
|
+
**OS Version:**
|
|
17
|
+
Windows/MacOS/Linux
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Example: I often have the problem of [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Additional context**
|
|
17
|
+
Add any other information or screenshots about the feature request here.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
* **What is the current behavior?** (You can also link to an open issue here)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* **What is the new behavior (if this is a feature change)?**
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
* **Other information**:
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches-ignore:
|
|
5
|
+
- main
|
|
6
|
+
pull_request:
|
|
7
|
+
branches-ignore:
|
|
8
|
+
- main
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
publish:
|
|
12
|
+
name: "Lint, test and upload to codecov"
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Check out the code
|
|
16
|
+
uses: actions/checkout@v3
|
|
17
|
+
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
uses: actions/setup-python@v3
|
|
20
|
+
with:
|
|
21
|
+
python-version: '3.x'
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: |
|
|
25
|
+
python -m pip install --upgrade pip
|
|
26
|
+
pip install flake8 pytest pytest-cov
|
|
27
|
+
|
|
28
|
+
- name: Lint with flake8
|
|
29
|
+
run: |
|
|
30
|
+
flake8 .
|
|
31
|
+
|
|
32
|
+
- name: Run tests with pytest
|
|
33
|
+
run: |
|
|
34
|
+
pytest --cov=src/ --cov-report=xml
|
|
35
|
+
|
|
36
|
+
- name: Upload coverage to Codecov
|
|
37
|
+
uses: codecov/codecov-action@v4
|
|
38
|
+
with:
|
|
39
|
+
verbose: true
|
|
40
|
+
env:
|
|
41
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Publish Python 🐍 distributions 📦 to PyPI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags:
|
|
5
|
+
- 'v*'
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
- stable
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
publish:
|
|
12
|
+
name: "Build and upload to pypi"
|
|
13
|
+
runs-on: "ubuntu-latest"
|
|
14
|
+
# environment:
|
|
15
|
+
# name: pypi
|
|
16
|
+
# url: https://pypi.org/project/PyReprism/
|
|
17
|
+
# permissions:
|
|
18
|
+
# id-token: write
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v3
|
|
22
|
+
- name: Install python
|
|
23
|
+
uses: actions/setup-python@v4
|
|
24
|
+
with:
|
|
25
|
+
python-version: '3.11'
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: |
|
|
28
|
+
python -m pip install --upgrade pip
|
|
29
|
+
pip install hatchling twine build hatch-vcs
|
|
30
|
+
- name: Build app
|
|
31
|
+
run: |
|
|
32
|
+
python -m build
|
|
33
|
+
- name: Publish distribution 📦 to PyPI
|
|
34
|
+
if: startsWith(github.ref, 'refs/tags')
|
|
35
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
36
|
+
with:
|
|
37
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
38
|
+
# run: twine upload dist/*
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# .readthedocs.yaml
|
|
2
|
+
# Read the Docs configuration file
|
|
3
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
4
|
+
|
|
5
|
+
# Required
|
|
6
|
+
version: 2
|
|
7
|
+
|
|
8
|
+
# Set the version of Python and other tools you might need
|
|
9
|
+
build:
|
|
10
|
+
os: ubuntu-22.04
|
|
11
|
+
tools:
|
|
12
|
+
python: "3.10"
|
|
13
|
+
# You can also specify other tool versions:
|
|
14
|
+
# nodejs: "16"
|
|
15
|
+
# rust: "1.55"
|
|
16
|
+
# golang: "1.17"
|
|
17
|
+
|
|
18
|
+
# Build documentation in the docs/ directory with Sphinx
|
|
19
|
+
sphinx:
|
|
20
|
+
configuration: docs/conf.py
|
|
21
|
+
|
|
22
|
+
# If using Sphinx, optionally build your docs in additional formats such as PDF
|
|
23
|
+
# formats:
|
|
24
|
+
# - pdf
|
|
25
|
+
|
|
26
|
+
# Optionally declare the Python requirements required to build your docs
|
|
27
|
+
python:
|
|
28
|
+
install:
|
|
29
|
+
- requirements: docs/requirements.txt
|
|
30
|
+
- method: pip
|
|
31
|
+
path: .
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# PyReprism Contributing Guide
|
|
2
|
+
|
|
3
|
+
Thank you for investing your time in contributing to this project!
|
|
4
|
+
|
|
5
|
+
In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
|
|
6
|
+
|
|
7
|
+
## New contributor guide
|
|
8
|
+
|
|
9
|
+
To get an overview of this project, to read the `README`:
|
|
10
|
+
|
|
11
|
+
- [README](README.md)
|
|
12
|
+
Here are some resources to help you get started with open source contributions:
|
|
13
|
+
|
|
14
|
+
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
|
|
15
|
+
- [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git)
|
|
16
|
+
- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests)
|
|
17
|
+
|
|
18
|
+
## Getting started
|
|
19
|
+
|
|
20
|
+
### Issues
|
|
21
|
+
|
|
22
|
+
#### Create a new issue
|
|
23
|
+
|
|
24
|
+
If you spot a problem with any of our product, check the [existing issues](https://github.com/unlv-evol/PyReprism/issues) to establish if the problem has already been reported. If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/unlv-evol/PyReprism/issues/new/choose).
|
|
25
|
+
|
|
26
|
+
#### Solve an issue
|
|
27
|
+
|
|
28
|
+
Scan through the [existing issues](https://github.com/unlv-evol/PyReprism/issues) to find one that interests you. You can narrow down the search using `labels` as filters. If you find an issue to work on, you are welcome to open a PR with a fix.
|
|
29
|
+
|
|
30
|
+
**Note** that you don't need to be assigned to this issue to work on it. Simply raise a PR that address it and add `closes #issue-number` in the PR description to [automatically link your PR to the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword).
|
|
31
|
+
|
|
32
|
+
### Make Changes
|
|
33
|
+
|
|
34
|
+
#### Make changes locally
|
|
35
|
+
|
|
36
|
+
1. [Fork the repository](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#fork-an-example-repository).
|
|
37
|
+
|
|
38
|
+
2. [Create a working branch](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-a-branch-for-an-issue) and start with your changes!
|
|
39
|
+
|
|
40
|
+
## Style Guides
|
|
41
|
+
We try our best to adhere to the style guide for Python which is the main languages for this project. Please ensure that you follow the style guides according.
|
|
42
|
+
- [Python](https://google.github.io/styleguide/pyguide.html)
|
|
43
|
+
|
|
44
|
+
### Commit your update
|
|
45
|
+
|
|
46
|
+
Commit the changes, with a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) once you are happy with them.
|
|
47
|
+
|
|
48
|
+
Once your changes are ready, don't forget to test and self-review them to speed up the review process:zap:.
|
|
49
|
+
|
|
50
|
+
### Pull Request
|
|
51
|
+
|
|
52
|
+
When you're finished with the changes, create a pull request, also known as a PR.
|
|
53
|
+
|
|
54
|
+
- Fill the "Ready for review" template so that we can review your PR. This template helps reviewers understand your changes as well as the purpose of your pull request.
|
|
55
|
+
- Don't forget to [link PR to issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one.
|
|
56
|
+
- Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge.
|
|
57
|
+
Once you submit your PR, maintainers will review your proposal.
|
|
58
|
+
- We may ask for changes to be made before a PR can be merged. You can apply suggested changes and/or make any other changes in your fork, then commit them to your branch.
|
|
59
|
+
- As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations).
|
|
60
|
+
- If you run into any merge conflict issues, checkout this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to help you resolve merge conflicts and other issues.
|
|
61
|
+
|
|
62
|
+
### Your PR is merged!
|
|
63
|
+
|
|
64
|
+
Congratulations :tada::tada: <br />
|
|
65
|
+
The PyReprism team thanks you :sparkles:.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: PyReprism
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3
|
|
4
4
|
Summary: Framework for Source Code Preprocessing
|
|
5
5
|
Project-URL: Homepage, https://github.com/unlv-evol/PyReprism
|
|
6
6
|
Project-URL: Issues, https://github.com/unlv-evol/PyReprism/issues
|
|
@@ -33,11 +33,8 @@ Classifier: Intended Audience :: Developers
|
|
|
33
33
|
Classifier: Intended Audience :: Science/Research
|
|
34
34
|
Classifier: License :: OSI Approved :: MIT License
|
|
35
35
|
Classifier: Operating System :: OS Independent
|
|
36
|
-
Classifier: Programming Language :: Python :: 3
|
|
37
|
-
Classifier: Programming Language :: Python :: 3.
|
|
38
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
39
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
40
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
41
38
|
Requires-Python: >=3.6
|
|
42
39
|
Provides-Extra: dev
|
|
43
40
|
Requires-Dist: flake8; extra == 'dev'
|
|
@@ -46,6 +43,12 @@ Requires-Dist: pytest-cov; extra == 'dev'
|
|
|
46
43
|
Description-Content-Type: text/markdown
|
|
47
44
|
|
|
48
45
|
[](https://opensource.org/licenses/MIT)
|
|
46
|
+
[](https://pepy.tech/project/pyreprism)
|
|
47
|
+
[](https://app.fossa.com/projects/custom%2B46484%2Fgithub.com%2Funlv-evol%2FPyReprism?ref=badge_shield&issueType=license)
|
|
48
|
+
[](https://app.fossa.com/projects/custom%2B46484%2Fgithub.com%2Funlv-evol%2FPyReprism?ref=badge_shield&issueType=security)
|
|
49
|
+
[](https://pyreprism.readthedocs.io/en/latest/?badge=latest)
|
|
50
|
+

|
|
51
|
+
<!-- [](https://codecov.io/gh/unlv-evol/PyReprism) -->
|
|
49
52
|
|
|
50
53
|
# PyReprism
|
|
51
54
|
|
|
@@ -56,9 +59,11 @@ PyReprism is a suite of essential methods designed for common preprocessing task
|
|
|
56
59
|
pip install PyReprism
|
|
57
60
|
```
|
|
58
61
|
## Quick Usage
|
|
62
|
+
Use case 1: Removing comments
|
|
59
63
|
```python
|
|
60
64
|
|
|
61
65
|
from PyReprism.languages import Python
|
|
66
|
+
# from PyReprism.languages import Java
|
|
62
67
|
|
|
63
68
|
source = """
|
|
64
69
|
# single line comment
|
|
@@ -70,25 +75,61 @@ comment
|
|
|
70
75
|
print(x)
|
|
71
76
|
"""
|
|
72
77
|
|
|
73
|
-
source =
|
|
78
|
+
source = Python.remove_comments(source)
|
|
79
|
+
|
|
80
|
+
# expected output
|
|
81
|
+
|
|
82
|
+
x = 5 + 6
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
print(x)
|
|
86
|
+
|
|
74
87
|
```
|
|
75
|
-
|
|
88
|
+
|
|
89
|
+
Use case 2: Removing whitespaces
|
|
90
|
+
```python
|
|
91
|
+
from PyReprism.utils.normalizer import Normalizer
|
|
92
|
+
source = """
|
|
93
|
+
|
|
94
|
+
x = 5 + 6
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
print(x)
|
|
98
|
+
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
source = Normalizer.remove_whitespaces(source)
|
|
103
|
+
|
|
104
|
+
# expected output
|
|
105
|
+
x=5+6
|
|
106
|
+
print(x)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Read the [docs](https://pyreprism.readthedocs.io) for more usage examples.
|
|
110
|
+
|
|
111
|
+
NB: The beta versions of PyReprism is still unstable, but we are working 24/7 to ensure the tool is usable.
|
|
76
112
|
|
|
77
113
|
## How to Contribute
|
|
114
|
+
We invite you to help us build this tool and make it more extensive. Contribution is open to OSS community.
|
|
78
115
|
|
|
79
116
|
```shell
|
|
80
|
-
git clone https://github.com/unlv-evol/PyReprism.git
|
|
81
|
-
cd PyReprism
|
|
117
|
+
$ git clone https://github.com/unlv-evol/PyReprism.git
|
|
118
|
+
$ cd PyReprism
|
|
82
119
|
```
|
|
83
120
|
**(Optional)** It is suggested to make use of virtualenv. Therefore, before installing the requirements run:
|
|
84
121
|
|
|
85
|
-
```
|
|
86
|
-
python3 -m venv venv
|
|
87
|
-
source venv/bin/activate
|
|
122
|
+
```shell
|
|
123
|
+
$ python3 -m venv venv
|
|
124
|
+
$ source venv/bin/activate
|
|
88
125
|
```
|
|
89
126
|
|
|
90
127
|
Then, install the requirements:
|
|
91
128
|
|
|
129
|
+
```shell
|
|
130
|
+
$ pip install -r requirements.txt
|
|
92
131
|
```
|
|
93
|
-
|
|
94
|
-
|
|
132
|
+
For more information on how to contribute, read our [contributing guidelines](CONTRIBUTING.md).
|
|
133
|
+
|
|
134
|
+
## Issues
|
|
135
|
+
If you experience any issue, feel free to report it.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
[](https://opensource.org/licenses/MIT)
|
|
2
|
+
[](https://pepy.tech/project/pyreprism)
|
|
3
|
+
[](https://app.fossa.com/projects/custom%2B46484%2Fgithub.com%2Funlv-evol%2FPyReprism?ref=badge_shield&issueType=license)
|
|
4
|
+
[](https://app.fossa.com/projects/custom%2B46484%2Fgithub.com%2Funlv-evol%2FPyReprism?ref=badge_shield&issueType=security)
|
|
5
|
+
[](https://pyreprism.readthedocs.io/en/latest/?badge=latest)
|
|
6
|
+

|
|
7
|
+
<!-- [](https://codecov.io/gh/unlv-evol/PyReprism) -->
|
|
8
|
+
|
|
9
|
+
# PyReprism
|
|
10
|
+
|
|
11
|
+
PyReprism is a suite of essential methods designed for common preprocessing tasks in code clone detection research.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
```shell
|
|
15
|
+
pip install PyReprism
|
|
16
|
+
```
|
|
17
|
+
## Quick Usage
|
|
18
|
+
Use case 1: Removing comments
|
|
19
|
+
```python
|
|
20
|
+
|
|
21
|
+
from PyReprism.languages import Python
|
|
22
|
+
# from PyReprism.languages import Java
|
|
23
|
+
|
|
24
|
+
source = """
|
|
25
|
+
# single line comment
|
|
26
|
+
x = 5 + 6
|
|
27
|
+
'''
|
|
28
|
+
multiline
|
|
29
|
+
comment
|
|
30
|
+
'''
|
|
31
|
+
print(x)
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
source = Python.remove_comments(source)
|
|
35
|
+
|
|
36
|
+
# expected output
|
|
37
|
+
|
|
38
|
+
x = 5 + 6
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
print(x)
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Use case 2: Removing whitespaces
|
|
46
|
+
```python
|
|
47
|
+
from PyReprism.utils.normalizer import Normalizer
|
|
48
|
+
source = """
|
|
49
|
+
|
|
50
|
+
x = 5 + 6
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
print(x)
|
|
54
|
+
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
source = Normalizer.remove_whitespaces(source)
|
|
59
|
+
|
|
60
|
+
# expected output
|
|
61
|
+
x=5+6
|
|
62
|
+
print(x)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Read the [docs](https://pyreprism.readthedocs.io) for more usage examples.
|
|
66
|
+
|
|
67
|
+
NB: The beta versions of PyReprism is still unstable, but we are working 24/7 to ensure the tool is usable.
|
|
68
|
+
|
|
69
|
+
## How to Contribute
|
|
70
|
+
We invite you to help us build this tool and make it more extensive. Contribution is open to OSS community.
|
|
71
|
+
|
|
72
|
+
```shell
|
|
73
|
+
$ git clone https://github.com/unlv-evol/PyReprism.git
|
|
74
|
+
$ cd PyReprism
|
|
75
|
+
```
|
|
76
|
+
**(Optional)** It is suggested to make use of virtualenv. Therefore, before installing the requirements run:
|
|
77
|
+
|
|
78
|
+
```shell
|
|
79
|
+
$ python3 -m venv venv
|
|
80
|
+
$ source venv/bin/activate
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Then, install the requirements:
|
|
84
|
+
|
|
85
|
+
```shell
|
|
86
|
+
$ pip install -r requirements.txt
|
|
87
|
+
```
|
|
88
|
+
For more information on how to contribute, read our [contributing guidelines](CONTRIBUTING.md).
|
|
89
|
+
|
|
90
|
+
## Issues
|
|
91
|
+
If you experience any issue, feel free to report it.
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["hatchling"]
|
|
2
|
+
requires = ["hatchling", "hatch_vcs"]
|
|
3
3
|
build-backend = "hatchling.build"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "PyReprism"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.3"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name= "UNLV EVOL LAB", email="ogenrwot@unlv.nevada.edu" },
|
|
10
10
|
]
|
|
11
|
+
|
|
11
12
|
license={file="LICENSE" }
|
|
12
13
|
python_requires = ">=3.5"
|
|
13
14
|
description = "Framework for Source Code Preprocessing"
|
|
@@ -18,11 +19,8 @@ classifiers = [
|
|
|
18
19
|
"Development Status :: 4 - Beta",
|
|
19
20
|
"Intended Audience :: Developers",
|
|
20
21
|
"Intended Audience :: Science/Research",
|
|
21
|
-
"Programming Language :: Python :: 3
|
|
22
|
-
"Programming Language :: Python :: 3.
|
|
23
|
-
"Programming Language :: Python :: 3.8",
|
|
24
|
-
"Programming Language :: Python :: 3.9",
|
|
25
|
-
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
26
24
|
"License :: OSI Approved :: MIT License",
|
|
27
25
|
"Operating System :: OS Independent",
|
|
28
26
|
]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
__version__ = "0.0.3"
|
|
1
2
|
from .python import *
|
|
2
3
|
from .java import *
|
|
3
4
|
from .c import *
|
|
@@ -114,7 +115,6 @@ from .pure import *
|
|
|
114
115
|
from .q import *
|
|
115
116
|
from .qore import *
|
|
116
117
|
from .r import *
|
|
117
|
-
from .r import *
|
|
118
118
|
from .reason import *
|
|
119
119
|
from .renpy import *
|
|
120
120
|
from .rest import *
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from PyReprism.utils import extension
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Abap:
|
|
6
|
+
def __init__(self):
|
|
7
|
+
pass
|
|
8
|
+
|
|
9
|
+
@staticmethod
|
|
10
|
+
def file_extension() -> str:
|
|
11
|
+
return extension.abap
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def keywords() -> list:
|
|
15
|
+
# keyword = 'SCIENTIFIC_WITH_LEADING_ZERO|SCALE_PRESERVING_SCIENTIFIC|RMC_COMMUNICATION_FAILURE|END-ENHANCEMENT-SECTION|MULTIPLY-CORRESPONDING|SUBTRACT-CORRESPONDING|VERIFICATION-MESSAGE|DIVIDE-CORRESPONDING|ENHANCEMENT-SECTION|CURRENCY_CONVERSION|RMC_SYSTEM_FAILURE|START-OF-SELECTION|MOVE-CORRESPONDING|RMC_INVALID_STATUS|CUSTOMER-FUNCTION|END-OF-DEFINITION|ENHANCEMENT-POINT|SYSTEM-EXCEPTIONS|ADD-CORRESPONDING|SCALE_PRESERVING|SELECTION-SCREEN|CURSOR-SELECTION|END-OF-SELECTION|LOAD-OF-PROGRAM|SCROLL-BOUNDARY|SELECTION-TABLE|EXCEPTION-TABLE|IMPLEMENTATIONS|PARAMETER-TABLE|RIGHT-JUSTIFIED|UNIT_CONVERSION|AUTHORITY-CHECK|LIST-PROCESSING|SIGN_AS_POSTFIX|COL_BACKGROUND|IMPLEMENTATION|INTERFACE-POOL|TRANSFORMATION|IDENTIFICATION|ENDENHANCEMENT|LINE-SELECTION|INITIALIZATION|LEFT-JUSTIFIED|SELECT-OPTIONS|SELECTION-SETS|COMMUNICATION|CORRESPONDING|DECIMAL_SHIFT|PRINT-CONTROL|VALUE-REQUEST|CHAIN-REQUEST|FUNCTION-POOL|FIELD-SYMBOLS|FUNCTIONALITY|INVERTED-DATE|SELECTION-SET|CLASS-METHODS|OUTPUT-LENGTH|CLASS-CODING|COL_NEGATIVE|ERRORMESSAGE|FIELD-GROUPS|HELP-REQUEST|NO-EXTENSION|NO-TOPOFPAGE|REDEFINITION|DISPLAY-MODE|ENDINTERFACE|EXIT-COMMAND|FIELD-SYMBOL|NO-SCROLLING|SHORTDUMP-ID|ACCESSPOLICY|CLASS-EVENTS|COL_POSITIVE|DECLARATIONS|ENHANCEMENTS|FILTER-TABLE|SWITCHSTATES|SYNTAX-CHECK|TRANSPORTING|ASYNCHRONOUS|SYNTAX-TRACE|TOKENIZATION|USER-COMMAND|WITH-HEADING|ABAP-SOURCE|BREAK-POINT|CHAIN-INPUT|COMPRESSION|FIXED-POINT|NEW-SECTION|NON-UNICODE|OCCURRENCES|RESPONSIBLE|SYSTEM-CALL|TRACE-TABLE|ABBREVIATED|CHAR-TO-HEX|END-OF-FILE|ENDFUNCTION|ENVIRONMENT|ASSOCIATION|COL_HEADING|EDITOR-CALL|END-OF-PAGE|ENGINEERING|IMPLEMENTED|INTENSIFIED|RADIOBUTTON|SYSTEM-EXIT|TOP-OF-PAGE|TRANSACTION|APPLICATION|CONCATENATE|DESTINATION|ENHANCEMENT|IMMEDIATELY|NO-GROUPING|PRECOMPILED|REPLACEMENT|TITLE-LINES|ACTIVATION|BYTE-ORDER|CLASS-POOL|CONNECTION|CONVERSION|DEFINITION|DEPARTMENT|EXPIRATION|INHERITING|MESSAGE-ID|NO-HEADING|PERFORMING|QUEUE-ONLY|RIGHTSPACE|SCIENTIFIC|STATUSINFO|STRUCTURES|SYNCPOINTS|WITH-TITLE|ATTRIBUTES|BOUNDARIES|CLASS-DATA|COL_NORMAL|DD\/MM\/YYYY|DESCENDING|INTERFACES|LINE-COUNT|MM\/DD\/YYYY|NON-UNIQUE|PRESERVING|SELECTIONS|STATEMENTS|SUBROUTINE|TRUNCATION|TYPE-POOLS|ARITHMETIC|BACKGROUND|ENDPROVIDE|EXCEPTIONS|IDENTIFIER|INDEX-LINE|OBLIGATORY|PARAMETERS|PERCENTAGE|PUSHBUTTON|RESOLUTION|COMPONENTS|DEALLOCATE|DISCONNECT|DUPLICATES|FIRST-LINE|HEAD-LINES|NO-DISPLAY|OCCURRENCE|RESPECTING|RETURNCODE|SUBMATCHES|TRACE-FILE|ASCENDING|BYPASSING|ENDMODULE|EXCEPTION|EXCLUDING|EXPORTING|INCREMENT|MATCHCODE|PARAMETER|PARTIALLY|PREFERRED|REFERENCE|REPLACING|RETURNING|SELECTION|SEPARATED|SPECIFIED|STATEMENT|TIMESTAMP|TYPE-POOL|ACCEPTING|APPENDAGE|ASSIGNING|COL_GROUP|COMPARING|CONSTANTS|DANGEROUS|IMPORTING|INSTANCES|LEFTSPACE|LOG-POINT|QUICKINFO|READ-ONLY|SCROLLING|SQLSCRIPT|STEP-LOOP|TOP-LINES|TRANSLATE|APPENDING|AUTHORITY|CHARACTER|COMPONENT|CONDITION|DIRECTORY|DUPLICATE|MESSAGING|RECEIVING|SUBSCREEN|ACCORDING|COL_TOTAL|END-LINES|ENDMETHOD|ENDSELECT|EXPANDING|EXTENSION|INCLUDING|INFOTYPES|INTERFACE|INTERVALS|LINE-SIZE|PF-STATUS|PROCEDURE|PROTECTED|REQUESTED|RESUMABLE|RIGHTPLUS|SAP-SPOOL|SECONDARY|STRUCTURE|SUBSTRING|TABLEVIEW|NUMOFCHAR|ADJACENT|ANALYSIS|ASSIGNED|BACKWARD|CHANNELS|CHECKBOX|CONTINUE|CRITICAL|DATAINFO|DD\/MM\/YY|DURATION|ENCODING|ENDCLASS|FUNCTION|LEFTPLUS|LINEFEED|MM\/DD\/YY|OVERFLOW|RECEIVED|SKIPPING|SORTABLE|STANDARD|SUBTRACT|SUPPRESS|TABSTRIP|TITLEBAR|TRUNCATE|UNASSIGN|WHENEVER|ANALYZER|COALESCE|COMMENTS|CONDENSE|DECIMALS|DEFERRED|ENDWHILE|EXPLICIT|KEYWORDS|MESSAGES|POSITION|PRIORITY|RECEIVER|RENAMING|TIMEZONE|TRAILING|ALLOCATE|CENTERED|CIRCULAR|CONTROLS|CURRENCY|DELETING|DESCRIBE|DISTANCE|ENDCATCH|EXPONENT|EXTENDED|GENERATE|IGNORING|INCLUDES|INTERNAL|MAJOR-ID|MODIFIER|NEW-LINE|OPTIONAL|PROPERTY|ROLLBACK|STARTING|SUPPLIED|ABSTRACT|CHANGING|CONTEXTS|CREATING|CUSTOMER|DATABASE|DAYLIGHT|DEFINING|DISTINCT|DIVISION|ENABLING|ENDCHAIN|ESCAPING|HARMLESS|IMPLICIT|INACTIVE|LANGUAGE|MINOR-ID|MULTIPLY|NEW-PAGE|NO-TITLE|POS_HIGH|SEPARATE|TEXTPOOL|TRANSFER|SELECTOR|DBMAXLEN|ITERATOR|SELECTOR|ARCHIVE|BIT-XOR|BYTE-CO|COLLECT|COMMENT|CURRENT|DEFAULT|DISPLAY|ENDFORM|EXTRACT|LEADING|LISTBOX|LOCATOR|MEMBERS|METHODS|NESTING|POS_LOW|PROCESS|PROVIDE|RAISING|RESERVE|SECONDS|SUMMARY|VISIBLE|BETWEEN|BIT-AND|BYTE-CS|CLEANUP|COMPUTE|CONTROL|CONVERT|DATASET|ENDCASE|FORWARD|HEADERS|HOTSPOT|INCLUDE|INVERSE|KEEPING|NO-ZERO|OBJECTS|OVERLAY|PADDING|PATTERN|PROGRAM|REFRESH|SECTION|SUMMING|TESTING|VERSION|WINDOWS|WITHOUT|BIT-NOT|BYTE-CA|BYTE-NA|CASTING|CONTEXT|COUNTRY|DYNAMIC|ENABLED|ENDLOOP|EXECUTE|FRIENDS|HANDLER|HEADING|INITIAL|\*-INPUT|LOGFILE|MAXIMUM|MINIMUM|NO-GAPS|NO-SIGN|PRAGMAS|PRIMARY|PRIVATE|REDUCED|REPLACE|REQUEST|RESULTS|UNICODE|WARNING|ALIASES|BYTE-CN|BYTE-NS|CALLING|COL_KEY|COLUMNS|CONNECT|ENDEXEC|ENTRIES|EXCLUDE|FILTERS|FURTHER|HELP-ID|LOGICAL|MAPPING|MESSAGE|NAMETAB|OPTIONS|PACKAGE|PERFORM|RECEIVE|STATICS|VARYING|BINDING|CHARLEN|GREATER|XSTRLEN|ACCEPT|APPEND|DETAIL|ELSEIF|ENDING|ENDTRY|FORMAT|FRAMES|GIVING|HASHED|HEADER|IMPORT|INSERT|MARGIN|MODULE|NATIVE|OBJECT|OFFSET|REMOTE|RESUME|SAVING|SIMPLE|SUBMIT|TABBED|TOKENS|UNIQUE|UNPACK|UPDATE|WINDOW|YELLOW|ACTUAL|ASPECT|CENTER|CURSOR|DELETE|DIALOG|DIVIDE|DURING|ERRORS|EVENTS|EXTEND|FILTER|HANDLE|HAVING|IGNORE|LITTLE|MEMORY|NO-GAP|OCCURS|OPTION|PERSON|PLACES|PUBLIC|REDUCE|REPORT|RESULT|SINGLE|SORTED|SWITCH|SYNTAX|TARGET|VALUES|WRITER|ASSERT|BLOCKS|BOUNDS|BUFFER|CHANGE|COLUMN|COMMIT|CONCAT|COPIES|CREATE|DDMMYY|DEFINE|ENDIAN|ESCAPE|EXPAND|KERNEL|LAYOUT|LEGACY|LEVELS|MMDDYY|NUMBER|OUTPUT|RANGES|READER|RETURN|SCREEN|SEARCH|SELECT|SHARED|SOURCE|STABLE|STATIC|SUBKEY|SUFFIX|TABLES|UNWIND|YYMMDD|ASSIGN|BACKUP|BEFORE|BINARY|BIT-OR|BLANKS|CLIENT|CODING|COMMON|DEMAND|DYNPRO|EXCEPT|EXISTS|EXPORT|FIELDS|GLOBAL|GROUPS|LENGTH|LOCALE|MEDIUM|METHOD|MODIFY|NESTED|OTHERS|REJECT|SCROLL|SUPPLY|SYMBOL|ENDFOR|STRLEN|ALIGN|BEGIN|BOUND|ENDAT|ENTRY|EVENT|FINAL|FLUSH|GRANT|INNER|SHORT|USING|WRITE|AFTER|BLACK|BLOCK|CLOCK|COLOR|COUNT|DUMMY|EMPTY|ENDDO|ENDON|GREEN|INDEX|INOUT|LEAVE|LEVEL|LINES|MODIF|ORDER|OUTER|RANGE|RESET|RETRY|RIGHT|SMART|SPLIT|STYLE|TABLE|THROW|UNDER|UNTIL|UPPER|UTF-8|WHERE|ALIAS|BLANK|CLEAR|CLOSE|EXACT|FETCH|FIRST|FOUND|GROUP|LLANG|LOCAL|OTHER|REGEX|SPOOL|TITLE|TYPES|VALID|WHILE|ALPHA|BOXED|CATCH|CHAIN|CHECK|CLASS|COVER|ENDIF|EQUIV|FIELD|FLOOR|FRAME|INPUT|LOWER|MATCH|NODES|PAGES|PRINT|RAISE|ROUND|SHIFT|SPACE|SPOTS|STAMP|STATE|TASKS|TIMES|TRMAC|ULINE|UNION|VALUE|WIDTH|EQUAL|LOG10|TRUNC|BLOB|CASE|CEIL|CLOB|COND|EXIT|FILE|GAPS|HOLD|INCL|INTO|KEEP|KEYS|LAST|LINE|LONG|LPAD|MAIL|MODE|OPEN|PINK|READ|ROWS|TEST|THEN|ZERO|AREA|BACK|BADI|BYTE|CAST|EDIT|EXEC|FAIL|FIND|FKEQ|FONT|FREE|GKEQ|HIDE|INIT|ITNO|LATE|LOOP|MAIN|MARK|MOVE|NEXT|NULL|RISK|ROLE|UNIT|WAIT|ZONE|BASE|CALL|CODE|DATA|DATE|FKGE|GKGE|HIGH|KIND|LEFT|LIST|MASK|MESH|NAME|NODE|PACK|PAGE|POOL|SEND|SIGN|SIZE|SOME|STOP|TASK|TEXT|TIME|USER|VARY|WITH|WORD|BLUE|CONV|COPY|DEEP|ELSE|FORM|FROM|HINT|ICON|JOIN|LIKE|LOAD|ONLY|PART|SCAN|SKIP|SORT|TYPE|UNIX|VIEW|WHEN|WORK|ACOS|ASIN|ATAN|COSH|EACH|FRAC|LESS|RTTI|SINH|SQRT|TANH|AVG|BIT|DIV|ISO|LET|OUT|PAD|SQL|ALL|CI_|CPI|END|LOB|LPI|MAX|MIN|NEW|OLE|RUN|SET|\?TO|YES|ABS|ADD|AND|BIG|FOR|HDB|JOB|LOW|NOT|SAP|TRY|VIA|XML|ANY|GET|IDS|KEY|MOD|OFF|PUT|RAW|RED|REF|SUM|TAB|XSD|CNT|COS|EXP|LOG|SIN|TAN|XOR|AT|CO|CP|DO|GT|ID|IF|NS|OR|BT|CA|CS|GE|NA|NB|EQ|IN|LT|NE|NO|OF|ON|PF|TO|AS|BY|CN|IS|LE|NP|UP|E|I|M|O|Z|C|X'.split('|')
|
|
16
|
+
# return keyword
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
@staticmethod
|
|
20
|
+
def comment_regex():
|
|
21
|
+
pattern = re.compile(r'(?P<comment>^\*.*?$|".*?$|\(\*[\s\S]*?\*\)|\(\*.*?$|^.*?\*\))|(?P<noncomment>\'(\\.|[^\\\'])*\'|"(\\.|[^\\"])*"|.[^*"\'"]*)', re.DOTALL | re.MULTILINE)
|
|
22
|
+
return pattern
|
|
23
|
+
|
|
24
|
+
@staticmethod
|
|
25
|
+
def number_regex():
|
|
26
|
+
pattern = re.compile(r'\b\d+\b')
|
|
27
|
+
return pattern
|
|
28
|
+
|
|
29
|
+
@staticmethod
|
|
30
|
+
def operator_regex():
|
|
31
|
+
pattern = re.compile(r'(\s)(?:\*\*?|<[=>]?|>=?|\?=|[-+\/=])(?=\s)')
|
|
32
|
+
return pattern
|
|
33
|
+
|
|
34
|
+
@staticmethod
|
|
35
|
+
def keywords_regex():
|
|
36
|
+
return re.compile(r'\b(' + '|'.join(Abap.keywords()) + r')\b')
|
|
37
|
+
|
|
38
|
+
@staticmethod
|
|
39
|
+
def remove_comments(source_code: str) -> str:
|
|
40
|
+
result = []
|
|
41
|
+
for match in Abap.comment_regex().finditer(source_code):
|
|
42
|
+
if match.group('noncomment'):
|
|
43
|
+
result.append(match.group('noncomment'))
|
|
44
|
+
# if isList:
|
|
45
|
+
# return result
|
|
46
|
+
return ''.join(result).strip()
|
|
47
|
+
|
|
48
|
+
@staticmethod
|
|
49
|
+
def remove_keywords(source: str):
|
|
50
|
+
return re.sub(re.compile(Abap.keywords_regex()), '', source)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from PyReprism.utils import extension
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class ActionScript:
|
|
6
|
+
def __init__(self):
|
|
7
|
+
pass
|
|
8
|
+
|
|
9
|
+
@staticmethod
|
|
10
|
+
def file_extension() -> str:
|
|
11
|
+
return extension.actionscript
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def keywords() -> list:
|
|
15
|
+
keyword = 'as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static'.split('|')
|
|
16
|
+
return keyword
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def comment_regex():
|
|
20
|
+
pattern = re.compile(r'(?P<comment>//.*?$|/\*[^*]*\*+(?:[^/*][^*]*\*+)*?/)|(?P<noncomment>[^/]+)', re.DOTALL | re.MULTILINE)
|
|
21
|
+
return pattern
|
|
22
|
+
|
|
23
|
+
@staticmethod
|
|
24
|
+
def number_regex():
|
|
25
|
+
pattern = re.compile(r'\b\d+\b')
|
|
26
|
+
return pattern
|
|
27
|
+
|
|
28
|
+
@staticmethod
|
|
29
|
+
def operator_regex():
|
|
30
|
+
pattern = re.compile(r'\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]')
|
|
31
|
+
return pattern
|
|
32
|
+
|
|
33
|
+
@staticmethod
|
|
34
|
+
def keywords_regex():
|
|
35
|
+
return re.compile(r'\b(' + '|'.join(ActionScript.keywords()) + r')\b')
|
|
36
|
+
|
|
37
|
+
@staticmethod
|
|
38
|
+
def remove_comments(source_code: str) -> str:
|
|
39
|
+
return ActionScript.comment_regex().sub(lambda match: match.group('noncomment') if match.group('noncomment') else '', source_code).strip()
|
|
40
|
+
|
|
41
|
+
@staticmethod
|
|
42
|
+
def remove_keywords(source: str):
|
|
43
|
+
return re.sub(re.compile(ActionScript.keywords_regex()), '', source)
|