PyReprism 0.0.2__tar.gz → 0.0.4__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.4/.flake8 +7 -0
- pyreprism-0.0.4/.github/FUNDING.yaml +1 -0
- pyreprism-0.0.4/.github/ISSUE_TEMPLATE/bug_report.md +17 -0
- pyreprism-0.0.4/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
- pyreprism-0.0.4/.github/PULL_REQUEST_TEMPLATE.md +13 -0
- pyreprism-0.0.4/.github/workflows/ci.yml +41 -0
- pyreprism-0.0.4/.github/workflows/publish.yml +38 -0
- pyreprism-0.0.4/.readthedocs.yaml +31 -0
- pyreprism-0.0.4/CONTRIBUTING.md +65 -0
- pyreprism-0.0.4/PKG-INFO +98 -0
- pyreprism-0.0.4/README.md +96 -0
- pyreprism-0.0.4/codecov.yml +13 -0
- pyreprism-0.0.4/dev-requirements.txt +9 -0
- pyreprism-0.0.4/docs/intro.rst +53 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/pyproject.toml +8 -9
- pyreprism-0.0.4/src/PyReprism/__init__.py +1 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/__init__.py +1 -1
- pyreprism-0.0.4/src/PyReprism/languages/abap.py +50 -0
- pyreprism-0.0.4/src/PyReprism/languages/actionscript.py +43 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/ada.py +7 -11
- pyreprism-0.0.4/src/PyReprism/languages/apacheconf.py +49 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/apl.py +7 -10
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/applescript.py +7 -10
- pyreprism-0.0.4/src/PyReprism/languages/arduino.py +49 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/arff.py +7 -10
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/asciidoc.py +7 -10
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/asm6502.py +7 -9
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/aspnet.py +7 -9
- pyreprism-0.0.4/src/PyReprism/languages/autohotkey.py +49 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/autoit.py +9 -10
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/bash.py +8 -11
- pyreprism-0.0.4/src/PyReprism/languages/basic.py +49 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/batch.py +7 -10
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/bison.py +9 -11
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/brainfuck.py +8 -10
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/bro.py +8 -9
- pyreprism-0.0.4/src/PyReprism/languages/c.py +113 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/clike.py +8 -11
- pyreprism-0.0.4/src/PyReprism/languages/clojure.py +50 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/coffeescript.py +7 -8
- pyreprism-0.0.4/src/PyReprism/languages/cpp.py +113 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/crystal.py +7 -8
- pyreprism-0.0.4/src/PyReprism/languages/csharp.py +82 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/csp.py +7 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/css.py +8 -9
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/css_extras.py +8 -9
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/d.py +7 -8
- pyreprism-0.0.4/src/PyReprism/languages/dart.py +74 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/diff.py +8 -8
- pyreprism-0.0.4/src/PyReprism/languages/django.py +124 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/docker.py +7 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/eiffel.py +8 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/elixir.py +7 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/erlang.py +7 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/fortran.py +6 -6
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/fsharp.py +8 -8
- pyreprism-0.0.4/src/PyReprism/languages/go.py +82 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/graphql.py +7 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/groovy.py +7 -11
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/haml.py +7 -8
- pyreprism-0.0.4/src/PyReprism/languages/haskell.py +49 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/html.py +10 -17
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/ini.py +5 -6
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/j.py +7 -8
- pyreprism-0.0.4/src/PyReprism/languages/java.py +113 -0
- pyreprism-0.0.4/src/PyReprism/languages/javascript.py +122 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/jolie.py +7 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/json.py +7 -8
- pyreprism-0.0.4/src/PyReprism/languages/jsx.py +115 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/julia.py +7 -11
- pyreprism-0.0.4/src/PyReprism/languages/kotlin.py +81 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/latex.py +7 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/less.py +8 -9
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/liquid.py +8 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/livescript.py +8 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/makefile.py +7 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/markdown.py +4 -5
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/markup.py +9 -10
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/matlab.py +10 -12
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/n4js.py +8 -9
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/nginx.py +7 -8
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/objectivec.py +10 -10
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/ocaml.py +10 -12
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/pascal.py +10 -11
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/perl.py +9 -13
- pyreprism-0.0.4/src/PyReprism/languages/php.py +124 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/prolog.py +9 -11
- pyreprism-0.0.4/src/PyReprism/languages/python.py +124 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/ruby.py +8 -9
- pyreprism-0.0.4/src/PyReprism/languages/rust.py +81 -0
- pyreprism-0.0.4/src/PyReprism/languages/scala.py +81 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/scheme.py +9 -11
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/scss.py +10 -10
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/smalltalk.py +9 -11
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/stylus.py +8 -11
- pyreprism-0.0.4/src/PyReprism/languages/swift.py +81 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/tsx.py +7 -10
- pyreprism-0.0.4/src/PyReprism/languages/typescript.py +79 -0
- pyreprism-0.0.4/src/PyReprism/languages/vbnet.py +74 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/velocity.py +8 -11
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/vim.py +9 -11
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/visual_basic.py +9 -11
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/yaml.py +9 -12
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/utils/extension.py +1 -1
- pyreprism-0.0.4/src/PyReprism/utils/normalizer.py +15 -0
- pyreprism-0.0.2/.flake8 +0 -6
- pyreprism-0.0.2/.readthedocs.yaml +0 -0
- pyreprism-0.0.2/PKG-INFO +0 -118
- pyreprism-0.0.2/README.md +0 -71
- pyreprism-0.0.2/src/PyReprism/languages/_base.py +0 -30
- pyreprism-0.0.2/src/PyReprism/languages/abap.py +0 -52
- pyreprism-0.0.2/src/PyReprism/languages/actionscript.py +0 -52
- pyreprism-0.0.2/src/PyReprism/languages/apacheconf.py +0 -52
- pyreprism-0.0.2/src/PyReprism/languages/arduino.py +0 -52
- pyreprism-0.0.2/src/PyReprism/languages/autohotkey.py +0 -51
- pyreprism-0.0.2/src/PyReprism/languages/basic.py +0 -52
- pyreprism-0.0.2/src/PyReprism/languages/c.py +0 -52
- pyreprism-0.0.2/src/PyReprism/languages/clojure.py +0 -50
- pyreprism-0.0.2/src/PyReprism/languages/cpp.py +0 -52
- pyreprism-0.0.2/src/PyReprism/languages/csharp.py +0 -53
- pyreprism-0.0.2/src/PyReprism/languages/dart.py +0 -52
- pyreprism-0.0.2/src/PyReprism/languages/django.py +0 -55
- pyreprism-0.0.2/src/PyReprism/languages/go.py +0 -53
- pyreprism-0.0.2/src/PyReprism/languages/haskell.py +0 -53
- pyreprism-0.0.2/src/PyReprism/languages/java.py +0 -53
- pyreprism-0.0.2/src/PyReprism/languages/javascript.py +0 -53
- pyreprism-0.0.2/src/PyReprism/languages/jsx.py +0 -53
- pyreprism-0.0.2/src/PyReprism/languages/kotlin.py +0 -53
- pyreprism-0.0.2/src/PyReprism/languages/php.py +0 -50
- pyreprism-0.0.2/src/PyReprism/languages/python.py +0 -53
- pyreprism-0.0.2/src/PyReprism/languages/rust.py +0 -52
- pyreprism-0.0.2/src/PyReprism/languages/scala.py +0 -53
- pyreprism-0.0.2/src/PyReprism/languages/swift.py +0 -52
- pyreprism-0.0.2/src/PyReprism/languages/typescript.py +0 -52
- pyreprism-0.0.2/src/PyReprism/languages/vbnet.py +0 -51
- pyreprism-0.0.2/src/PyReprism/utils/__init__.py +0 -0
- pyreprism-0.0.2/src/PyReprism/utils/normalizer.py +0 -18
- {pyreprism-0.0.2 → pyreprism-0.0.4}/.gitignore +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/LICENSE +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/pytest.ini +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/requirements.txt +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/erb.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/flow.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/gedcom.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/gherkin.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/git.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/glsl.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/handlebars.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/haxe.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/hpkp.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/hsts.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/ichigojam.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/icon.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/inform7.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/io.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/keyman.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/lolcode.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/lua.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/markup_templating.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/mel.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/mizar.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/monkey.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/nasm.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/nim.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/nix.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/nsis.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/opencl.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/oz.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/parigp.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/parser.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/php_extras.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/plsql.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/powershell.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/processing.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/properties.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/protobuf.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/pug.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/puppet.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/pure.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/q.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/qore.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/r.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/reason.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/renpy.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/rest.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/rip.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/roboconf.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/sas.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/sass.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/smarty.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/soy.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/tcl.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/textile.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/twig.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/verilog.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/vhdl.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/wasam.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/xeora.py +0 -0
- {pyreprism-0.0.2 → pyreprism-0.0.4}/src/PyReprism/languages/xojo.py +0 -0
- {pyreprism-0.0.2/src/PyReprism → pyreprism-0.0.4/src/PyReprism/utils}/__init__.py +0 -0
pyreprism-0.0.4/.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:.
|
pyreprism-0.0.4/PKG-INFO
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: PyReprism
|
|
3
|
+
Version: 0.0.4
|
|
4
|
+
Summary: Framework for Source Code Preprocessing
|
|
5
|
+
Project-URL: Homepage, https://github.com/unlv-evol/PyReprism
|
|
6
|
+
Project-URL: Documentation, https://pyreprism.readthedocs.io
|
|
7
|
+
Project-URL: Issues, https://github.com/unlv-evol/PyReprism/issues
|
|
8
|
+
Author-email: UNLV EVOL LAB <ogenrwot@unlv.nevada.edu>
|
|
9
|
+
License: MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2024 UNLV EVOL
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
32
|
+
Classifier: Environment :: Console
|
|
33
|
+
Classifier: Intended Audience :: Developers
|
|
34
|
+
Classifier: Intended Audience :: Science/Research
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Operating System :: OS Independent
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
39
|
+
Requires-Python: >=3.6
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: flake8; extra == 'dev'
|
|
42
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
43
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
44
|
+
Description-Content-Type: text/x-rst
|
|
45
|
+
|
|
46
|
+
.. _intro_toplevel:
|
|
47
|
+
|
|
48
|
+
==================
|
|
49
|
+
Overview / Install
|
|
50
|
+
==================
|
|
51
|
+
|
|
52
|
+
PyReprism is a Python framework that helps researchers and developers the task of source code preprocessing. With PyReprism, you can easily match, extract, count, and remove comments, whitespaces, operators, numbers and other language specific constructs from over 150 programming languages and file extensions.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
Requirements
|
|
56
|
+
============
|
|
57
|
+
|
|
58
|
+
* `Python`_ 3.6 or newer
|
|
59
|
+
* `Git`_
|
|
60
|
+
|
|
61
|
+
.. _Python: https://www.python.org
|
|
62
|
+
.. _Git: https://git-scm.com/
|
|
63
|
+
|
|
64
|
+
Installing PyReprism
|
|
65
|
+
====================
|
|
66
|
+
|
|
67
|
+
Installing PyReprism is easily done using `pip`_. Assuming it is installed, just run the following from the command-line:
|
|
68
|
+
|
|
69
|
+
.. _pip: https://pip.pypa.io/en/latest/installing.html
|
|
70
|
+
|
|
71
|
+
.. sourcecode:: none
|
|
72
|
+
|
|
73
|
+
$ pip install PyReprism
|
|
74
|
+
|
|
75
|
+
Source Code
|
|
76
|
+
===========
|
|
77
|
+
|
|
78
|
+
PyReprism's git repo is available on GitHub, which can be browsed at:
|
|
79
|
+
|
|
80
|
+
* https://github.com/unlv-evol/PyReprism.git
|
|
81
|
+
|
|
82
|
+
and cloned using::
|
|
83
|
+
|
|
84
|
+
$ git clone https://github.com/unlv-evol/PyReprism.git
|
|
85
|
+
$ cd PyReprism
|
|
86
|
+
|
|
87
|
+
Optionally (but suggested), make use of virtual environment. Therefore, before installing the requirements run::
|
|
88
|
+
|
|
89
|
+
$ python3 -m venv venv
|
|
90
|
+
$ source venv/bin/activate
|
|
91
|
+
|
|
92
|
+
Install the requirements::
|
|
93
|
+
|
|
94
|
+
$ pip install -r requirements.txt
|
|
95
|
+
|
|
96
|
+
and run the tests using pytest::
|
|
97
|
+
|
|
98
|
+
$ pytest
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+

|
|
8
|
+

|
|
9
|
+
[](https://codecov.io/gh/unlv-evol/PyReprism)
|
|
10
|
+

|
|
11
|
+

|
|
12
|
+
[](https://archive.softwareheritage.org/browse/origin/?origin_url=https://pypi.org/project/PyReprism/)
|
|
13
|
+
|
|
14
|
+
# PyReprism
|
|
15
|
+
|
|
16
|
+
PyReprism is a Python framework that helps researchers and developers the task of source code preprocessing. With PyReprism, you can easily match, extract, count, and remove comments, whitespaces, operators, numbers and other language specific constructs from over **150 programming languages and file extensions**.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
```shell
|
|
20
|
+
pip install PyReprism
|
|
21
|
+
```
|
|
22
|
+
## Quick Usage
|
|
23
|
+
Use case 1: Removing comments
|
|
24
|
+
```python
|
|
25
|
+
|
|
26
|
+
from PyReprism.languages import Python
|
|
27
|
+
# from PyReprism.languages import Java
|
|
28
|
+
|
|
29
|
+
source = """
|
|
30
|
+
# single line comment
|
|
31
|
+
x = 5 + 6
|
|
32
|
+
'''
|
|
33
|
+
multiline
|
|
34
|
+
comment
|
|
35
|
+
'''
|
|
36
|
+
print(x)
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
source = Python.remove_comments(source)
|
|
40
|
+
|
|
41
|
+
# expected output
|
|
42
|
+
|
|
43
|
+
x = 5 + 6
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
print(x)
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Use case 2: Removing whitespaces
|
|
51
|
+
```python
|
|
52
|
+
from PyReprism.utils.normalizer import Normalizer
|
|
53
|
+
source = """
|
|
54
|
+
|
|
55
|
+
x = 5 + 6
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
print(x)
|
|
59
|
+
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
source = Normalizer.remove_whitespaces(source)
|
|
64
|
+
|
|
65
|
+
# expected output
|
|
66
|
+
x=5+6
|
|
67
|
+
print(x)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Read the [docs](https://pyreprism.readthedocs.io) for more usage examples.
|
|
71
|
+
|
|
72
|
+
NB: The beta versions of PyReprism is still unstable, but we are working 24/7 to ensure the tool is usable.
|
|
73
|
+
|
|
74
|
+
## How to Contribute
|
|
75
|
+
We invite you to help us build this tool and make it more extensive. Contribution is open to OSS community.
|
|
76
|
+
|
|
77
|
+
```shell
|
|
78
|
+
$ git clone https://github.com/unlv-evol/PyReprism.git
|
|
79
|
+
$ cd PyReprism
|
|
80
|
+
```
|
|
81
|
+
**(Optional)** It is suggested to make use of virtualenv. Therefore, before installing the requirements run:
|
|
82
|
+
|
|
83
|
+
```shell
|
|
84
|
+
$ python3 -m venv venv
|
|
85
|
+
$ source venv/bin/activate
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Then, install the requirements:
|
|
89
|
+
|
|
90
|
+
```shell
|
|
91
|
+
$ pip install -r requirements.txt
|
|
92
|
+
```
|
|
93
|
+
For more information on how to contribute, read our [contributing guidelines](CONTRIBUTING.md).
|
|
94
|
+
|
|
95
|
+
## Issues
|
|
96
|
+
If you experience any issue, feel free to report it.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.. _intro_toplevel:
|
|
2
|
+
|
|
3
|
+
==================
|
|
4
|
+
Overview / Install
|
|
5
|
+
==================
|
|
6
|
+
|
|
7
|
+
PyReprism is a Python framework that helps researchers and developers the task of source code preprocessing. With PyReprism, you can easily match, extract, count, and remove comments, whitespaces, operators, numbers and other language specific constructs from over 150 programming languages and file extensions.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Requirements
|
|
11
|
+
============
|
|
12
|
+
|
|
13
|
+
* `Python`_ 3.6 or newer
|
|
14
|
+
* `Git`_
|
|
15
|
+
|
|
16
|
+
.. _Python: https://www.python.org
|
|
17
|
+
.. _Git: https://git-scm.com/
|
|
18
|
+
|
|
19
|
+
Installing PyReprism
|
|
20
|
+
====================
|
|
21
|
+
|
|
22
|
+
Installing PyReprism is easily done using `pip`_. Assuming it is installed, just run the following from the command-line:
|
|
23
|
+
|
|
24
|
+
.. _pip: https://pip.pypa.io/en/latest/installing.html
|
|
25
|
+
|
|
26
|
+
.. sourcecode:: none
|
|
27
|
+
|
|
28
|
+
$ pip install PyReprism
|
|
29
|
+
|
|
30
|
+
Source Code
|
|
31
|
+
===========
|
|
32
|
+
|
|
33
|
+
PyReprism's git repo is available on GitHub, which can be browsed at:
|
|
34
|
+
|
|
35
|
+
* https://github.com/unlv-evol/PyReprism.git
|
|
36
|
+
|
|
37
|
+
and cloned using::
|
|
38
|
+
|
|
39
|
+
$ git clone https://github.com/unlv-evol/PyReprism.git
|
|
40
|
+
$ cd PyReprism
|
|
41
|
+
|
|
42
|
+
Optionally (but suggested), make use of virtual environment. Therefore, before installing the requirements run::
|
|
43
|
+
|
|
44
|
+
$ python3 -m venv venv
|
|
45
|
+
$ source venv/bin/activate
|
|
46
|
+
|
|
47
|
+
Install the requirements::
|
|
48
|
+
|
|
49
|
+
$ pip install -r requirements.txt
|
|
50
|
+
|
|
51
|
+
and run the tests using pytest::
|
|
52
|
+
|
|
53
|
+
$ pytest
|
|
@@ -1,28 +1,26 @@
|
|
|
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.4"
|
|
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"
|
|
14
|
-
readme = "
|
|
15
|
+
readme = "docs/intro.rst"
|
|
15
16
|
requires-python = ">=3.6"
|
|
16
17
|
classifiers = [
|
|
17
18
|
"Environment :: Console",
|
|
18
|
-
"Development Status ::
|
|
19
|
+
"Development Status :: 5 - Production/Stable",
|
|
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
|
]
|
|
@@ -45,4 +43,5 @@ dev = [
|
|
|
45
43
|
|
|
46
44
|
[project.urls]
|
|
47
45
|
Homepage = "https://github.com/unlv-evol/PyReprism"
|
|
46
|
+
Documentation = "https://pyreprism.readthedocs.io"
|
|
48
47
|
Issues = "https://github.com/unlv-evol/PyReprism/issues"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.4"
|
|
@@ -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)
|