PyReprism 0.0.1__py3-none-any.whl

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.
Files changed (154) hide show
  1. PyReprism/__init__.py +0 -0
  2. PyReprism/languages/__init__.py +147 -0
  3. PyReprism/languages/_base.py +30 -0
  4. PyReprism/languages/abap.py +52 -0
  5. PyReprism/languages/actionscript.py +52 -0
  6. PyReprism/languages/ada.py +53 -0
  7. PyReprism/languages/apacheconf.py +52 -0
  8. PyReprism/languages/apl.py +52 -0
  9. PyReprism/languages/applescript.py +52 -0
  10. PyReprism/languages/arduino.py +52 -0
  11. PyReprism/languages/arff.py +52 -0
  12. PyReprism/languages/asciidoc.py +52 -0
  13. PyReprism/languages/asm6502.py +51 -0
  14. PyReprism/languages/aspnet.py +51 -0
  15. PyReprism/languages/autohotkey.py +51 -0
  16. PyReprism/languages/autoit.py +50 -0
  17. PyReprism/languages/bash.py +52 -0
  18. PyReprism/languages/basic.py +52 -0
  19. PyReprism/languages/batch.py +52 -0
  20. PyReprism/languages/bison.py +52 -0
  21. PyReprism/languages/brainfuck.py +52 -0
  22. PyReprism/languages/bro.py +50 -0
  23. PyReprism/languages/c.py +52 -0
  24. PyReprism/languages/clike.py +52 -0
  25. PyReprism/languages/clojure.py +50 -0
  26. PyReprism/languages/coffeescript.py +50 -0
  27. PyReprism/languages/cpp.py +52 -0
  28. PyReprism/languages/crystal.py +50 -0
  29. PyReprism/languages/csharp.py +53 -0
  30. PyReprism/languages/csp.py +50 -0
  31. PyReprism/languages/css.py +50 -0
  32. PyReprism/languages/css_extras.py +50 -0
  33. PyReprism/languages/d.py +50 -0
  34. PyReprism/languages/dart.py +52 -0
  35. PyReprism/languages/diff.py +49 -0
  36. PyReprism/languages/django.py +55 -0
  37. PyReprism/languages/docker.py +50 -0
  38. PyReprism/languages/eiffel.py +49 -0
  39. PyReprism/languages/elixir.py +50 -0
  40. PyReprism/languages/erb.py +0 -0
  41. PyReprism/languages/erlang.py +50 -0
  42. PyReprism/languages/flow.py +0 -0
  43. PyReprism/languages/fortran.py +49 -0
  44. PyReprism/languages/fsharp.py +49 -0
  45. PyReprism/languages/gedcom.py +0 -0
  46. PyReprism/languages/gherkin.py +0 -0
  47. PyReprism/languages/git.py +0 -0
  48. PyReprism/languages/glsl.py +0 -0
  49. PyReprism/languages/go.py +53 -0
  50. PyReprism/languages/graphql.py +50 -0
  51. PyReprism/languages/groovy.py +53 -0
  52. PyReprism/languages/haml.py +50 -0
  53. PyReprism/languages/handlebars.py +0 -0
  54. PyReprism/languages/haskell.py +53 -0
  55. PyReprism/languages/haxe.py +0 -0
  56. PyReprism/languages/hpkp.py +0 -0
  57. PyReprism/languages/hsts.py +0 -0
  58. PyReprism/languages/html.py +50 -0
  59. PyReprism/languages/ichigojam.py +0 -0
  60. PyReprism/languages/icon.py +0 -0
  61. PyReprism/languages/inform7.py +0 -0
  62. PyReprism/languages/ini.py +41 -0
  63. PyReprism/languages/io.py +0 -0
  64. PyReprism/languages/j.py +50 -0
  65. PyReprism/languages/java.py +53 -0
  66. PyReprism/languages/javascript.py +53 -0
  67. PyReprism/languages/jolie.py +50 -0
  68. PyReprism/languages/json.py +50 -0
  69. PyReprism/languages/jsx.py +53 -0
  70. PyReprism/languages/julia.py +53 -0
  71. PyReprism/languages/keyman.py +0 -0
  72. PyReprism/languages/kotlin.py +53 -0
  73. PyReprism/languages/latex.py +50 -0
  74. PyReprism/languages/less.py +50 -0
  75. PyReprism/languages/liquid.py +49 -0
  76. PyReprism/languages/livescript.py +49 -0
  77. PyReprism/languages/lolcode.py +0 -0
  78. PyReprism/languages/lua.py +0 -0
  79. PyReprism/languages/makefile.py +50 -0
  80. PyReprism/languages/markdown.py +31 -0
  81. PyReprism/languages/markup.py +50 -0
  82. PyReprism/languages/markup_templating.py +0 -0
  83. PyReprism/languages/matlab.py +51 -0
  84. PyReprism/languages/mel.py +0 -0
  85. PyReprism/languages/mizar.py +0 -0
  86. PyReprism/languages/monkey.py +0 -0
  87. PyReprism/languages/n4js.py +50 -0
  88. PyReprism/languages/nasm.py +0 -0
  89. PyReprism/languages/nginx.py +50 -0
  90. PyReprism/languages/nim.py +0 -0
  91. PyReprism/languages/nix.py +0 -0
  92. PyReprism/languages/nsis.py +0 -0
  93. PyReprism/languages/objectivec.py +49 -0
  94. PyReprism/languages/ocaml.py +51 -0
  95. PyReprism/languages/opencl.py +0 -0
  96. PyReprism/languages/oz.py +0 -0
  97. PyReprism/languages/parigp.py +0 -0
  98. PyReprism/languages/parser.py +0 -0
  99. PyReprism/languages/pascal.py +49 -0
  100. PyReprism/languages/perl.py +53 -0
  101. PyReprism/languages/php.py +50 -0
  102. PyReprism/languages/php_extras.py +0 -0
  103. PyReprism/languages/plsql.py +0 -0
  104. PyReprism/languages/powershell.py +0 -0
  105. PyReprism/languages/processing.py +0 -0
  106. PyReprism/languages/prolog.py +51 -0
  107. PyReprism/languages/properties.py +0 -0
  108. PyReprism/languages/protobuf.py +0 -0
  109. PyReprism/languages/pug.py +0 -0
  110. PyReprism/languages/puppet.py +0 -0
  111. PyReprism/languages/pure.py +0 -0
  112. PyReprism/languages/python.py +54 -0
  113. PyReprism/languages/q.py +0 -0
  114. PyReprism/languages/qore.py +0 -0
  115. PyReprism/languages/r.py +0 -0
  116. PyReprism/languages/reason.py +0 -0
  117. PyReprism/languages/renpy.py +0 -0
  118. PyReprism/languages/rest.py +0 -0
  119. PyReprism/languages/rip.py +0 -0
  120. PyReprism/languages/roboconf.py +0 -0
  121. PyReprism/languages/ruby.py +50 -0
  122. PyReprism/languages/rust.py +52 -0
  123. PyReprism/languages/sas.py +0 -0
  124. PyReprism/languages/sass.py +0 -0
  125. PyReprism/languages/scala.py +53 -0
  126. PyReprism/languages/scheme.py +51 -0
  127. PyReprism/languages/scss.py +50 -0
  128. PyReprism/languages/smalltalk.py +51 -0
  129. PyReprism/languages/smarty.py +0 -0
  130. PyReprism/languages/soy.py +0 -0
  131. PyReprism/languages/stylus.py +52 -0
  132. PyReprism/languages/swift.py +52 -0
  133. PyReprism/languages/tcl.py +0 -0
  134. PyReprism/languages/textile.py +0 -0
  135. PyReprism/languages/tsx.py +52 -0
  136. PyReprism/languages/twig.py +0 -0
  137. PyReprism/languages/typescript.py +52 -0
  138. PyReprism/languages/vbnet.py +51 -0
  139. PyReprism/languages/velocity.py +52 -0
  140. PyReprism/languages/verilog.py +0 -0
  141. PyReprism/languages/vhdl.py +0 -0
  142. PyReprism/languages/vim.py +52 -0
  143. PyReprism/languages/visual_basic.py +52 -0
  144. PyReprism/languages/wasam.py +0 -0
  145. PyReprism/languages/xeora.py +0 -0
  146. PyReprism/languages/xojo.py +0 -0
  147. PyReprism/languages/yaml.py +53 -0
  148. PyReprism/utils/__init__.py +0 -0
  149. PyReprism/utils/extension.py +149 -0
  150. PyReprism/utils/normalizer.py +18 -0
  151. pyreprism-0.0.1.dist-info/METADATA +94 -0
  152. pyreprism-0.0.1.dist-info/RECORD +154 -0
  153. pyreprism-0.0.1.dist-info/WHEEL +4 -0
  154. pyreprism-0.0.1.dist-info/licenses/LICENSE +21 -0
PyReprism/__init__.py ADDED
File without changes
@@ -0,0 +1,147 @@
1
+ from .python import *
2
+ from .java import *
3
+ from .c import *
4
+ from .csharp import *
5
+ from .bash import *
6
+ from .markup import *
7
+ from .perl import *
8
+ from .php import *
9
+ from .ruby import *
10
+ from .rust import *
11
+ from .abap import *
12
+ from .actionscript import *
13
+ from .ada import *
14
+ from .apacheconf import *
15
+ from .apl import *
16
+ from .applescript import *
17
+ from .arduino import *
18
+ from .arff import *
19
+ from .asciidoc import *
20
+ from .asm6502 import *
21
+ from .aspnet import *
22
+ from .autohotkey import *
23
+ from .autoit import *
24
+ from .bash import *
25
+ from .basic import *
26
+ from .batch import *
27
+ from .bison import *
28
+ from .brainfuck import *
29
+ from .bro import *
30
+ from .clike import *
31
+ from .clojure import *
32
+ from .coffeescript import *
33
+ from .cpp import *
34
+ from .crystal import *
35
+ from .csp import *
36
+ from .css_extras import *
37
+ from .css import *
38
+ from .d import *
39
+ from .dart import *
40
+ from .diff import *
41
+ from .django import *
42
+ from .docker import *
43
+ from .eiffel import *
44
+ from .elixir import *
45
+ from .erb import *
46
+ from .erlang import *
47
+ from .flow import *
48
+ from .fortran import *
49
+ from .fsharp import *
50
+ from .gedcom import *
51
+ from .gherkin import *
52
+ from .git import *
53
+ from .glsl import *
54
+ from .go import *
55
+ from .graphql import *
56
+ from .groovy import *
57
+ from .haml import *
58
+ from .handlebars import *
59
+ from .haskell import *
60
+ from .haxe import *
61
+ from .hpkp import *
62
+ from .hsts import *
63
+ from .ichigojam import *
64
+ from .icon import *
65
+ from .inform7 import *
66
+ from .ini import *
67
+ from .io import *
68
+ from .j import *
69
+ from .javascript import *
70
+ from .jolie import *
71
+ from .json import *
72
+ from .jsx import *
73
+ from .julia import *
74
+ from .keyman import *
75
+ from .kotlin import *
76
+ from .latex import *
77
+ from .less import *
78
+ from .liquid import *
79
+ from .livescript import *
80
+ from .lolcode import *
81
+ from .lua import *
82
+ from .makefile import *
83
+ from .markdown import *
84
+ from .markup_templating import *
85
+ from .markup import *
86
+ from .matlab import *
87
+ from .mel import *
88
+ from .mizar import *
89
+ from .monkey import *
90
+ from .n4js import *
91
+ from .nasm import *
92
+ from .nginx import *
93
+ from .nim import *
94
+ from .nix import *
95
+ from .nsis import *
96
+ from .objectivec import *
97
+ from .ocaml import *
98
+ from .opencl import *
99
+ from .oz import *
100
+ from .parigp import *
101
+ from .parser import *
102
+ from .pascal import *
103
+ from .perl import *
104
+ from .php_extras import *
105
+ from .plsql import *
106
+ from .powershell import *
107
+ from .processing import *
108
+ from .prolog import *
109
+ from .properties import *
110
+ from .protobuf import *
111
+ from .pug import *
112
+ from .puppet import *
113
+ from .pure import *
114
+ from .q import *
115
+ from .qore import *
116
+ from .r import *
117
+ from .r import *
118
+ from .reason import *
119
+ from .renpy import *
120
+ from .rest import *
121
+ from .rip import *
122
+ from .roboconf import *
123
+ from .sas import *
124
+ from .sass import *
125
+ from .scala import *
126
+ from .scheme import *
127
+ from .scss import *
128
+ from .smalltalk import *
129
+ from .smarty import *
130
+ from .soy import *
131
+ from .stylus import *
132
+ from .swift import *
133
+ from .tcl import *
134
+ from .textile import *
135
+ from .tsx import *
136
+ from .twig import *
137
+ from .typescript import *
138
+ from .vbnet import *
139
+ from .velocity import *
140
+ from .verilog import *
141
+ from .vhdl import *
142
+ from .vim import *
143
+ from .visual_basic import *
144
+ from .wasam import *
145
+ from .xeora import *
146
+ from .xojo import *
147
+ from .yaml import *
@@ -0,0 +1,30 @@
1
+ from abc import ABC, abstractmethod
2
+
3
+ class Base(ABC):
4
+
5
+ @staticmethod
6
+ @abstractmethod
7
+ def comments():
8
+ pass
9
+
10
+ @staticmethod
11
+ @abstractmethod
12
+ def remove_comments(source: str):
13
+ pass
14
+
15
+ @staticmethod
16
+ @abstractmethod
17
+ def keywords() -> list:
18
+ pass
19
+
20
+ @staticmethod
21
+ @abstractmethod
22
+ def remove_keywords():
23
+ pass
24
+
25
+ @staticmethod
26
+ @abstractmethod
27
+ def file_extension() -> str:
28
+ pass
29
+
30
+
@@ -0,0 +1,52 @@
1
+ import re
2
+ from PyReprism.utils import extension
3
+
4
+
5
+ class Abap:
6
+ def __init__():
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
+
17
+ return keyword
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, isList: bool = False) -> 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)
47
+
48
+
49
+ @staticmethod
50
+ def remove_keywords(source: str):
51
+ return re.sub(re.compile(Abap.keywords_regex()), '', source)
52
+
@@ -0,0 +1,52 @@
1
+ import re
2
+ from PyReprism.utils import extension
3
+
4
+
5
+ class ActionScript:
6
+ def __init__():
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
+
17
+ return keyword
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'\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]')
32
+ return pattern
33
+
34
+ @staticmethod
35
+ def keywords_regex():
36
+ return re.compile(r'\b(' + '|'.join(ActionScript.keywords()) + r')\b')
37
+
38
+ @staticmethod
39
+ def remove_comments(source_code: str, isList: bool = False) -> str:
40
+ result = []
41
+ for match in ActionScript.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)
47
+
48
+
49
+ @staticmethod
50
+ def remove_keywords(source: str):
51
+ return re.sub(re.compile(ActionScript.keywords_regex()), '', source)
52
+
@@ -0,0 +1,53 @@
1
+ import re
2
+ from PyReprism.utils import extension
3
+
4
+
5
+ class Ada:
6
+ def __init__():
7
+ pass
8
+
9
+ @staticmethod
10
+ def file_extension() -> str:
11
+ return extension.ada
12
+
13
+ @staticmethod
14
+ def keywords() -> list:
15
+ keyword = 'abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|new|return|elsif|end|entry|exception|exit|for|function|generic|Adato|if|in|interface|is|limited|loop|mod|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor|true|false'.split('|')
16
+
17
+ return keyword
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
+
25
+ @staticmethod
26
+ def number_regex():
27
+ pattern = re.compile(r'\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?')
28
+ return pattern
29
+
30
+ @staticmethod
31
+ def operator_regex():
32
+ pattern = re.compile(r'<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]')
33
+ return pattern
34
+
35
+ @staticmethod
36
+ def keywords_regex():
37
+ return re.compile(r'\b(' + '|'.join(Ada.keywords()) + r')\b')
38
+
39
+ @staticmethod
40
+ def remove_comments(source_code: str, isList: bool = False) -> str:
41
+ result = []
42
+ for match in Ada.comment_regex().finditer(source_code):
43
+ if match.group('noncomment'):
44
+ result.append(match.group('noncomment'))
45
+ if isList:
46
+ return result
47
+ return ''.join(result)
48
+
49
+
50
+ @staticmethod
51
+ def remove_keywords(source: str):
52
+ return re.sub(re.compile(Ada.keywords_regex()), '', source)
53
+
@@ -0,0 +1,52 @@
1
+ import re
2
+ from PyReprism.utils import extension
3
+
4
+
5
+ class ApacheConf:
6
+ def __init__():
7
+ pass
8
+
9
+ @staticmethod
10
+ def file_extension() -> str:
11
+ return extension.apacheconf
12
+
13
+ @staticmethod
14
+ def keywords() -> list:
15
+ keyword = 'AcceptFilter|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding|AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch|Allow|AllowCONNECT|AllowEncodedSlashes|AllowMethods|AllowOverride|AllowOverrideList|Anonymous|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail|AsyncRequestWorkerFactor|AuthBasicAuthoritative|AuthBasicFake|AuthBasicProvider|AuthBasicUseDigestAlgorithm|AuthDBDUserPWQuery|AuthDBDUserRealmQuery|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm|AuthDigestDomain|AuthDigestNonceLifetime|AuthDigestProvider|AuthDigestQop|AuthDigestShmemSize|AuthFormAuthoritative|AuthFormBody|AuthFormDisableNoStore|AuthFormFakeBasicAuth|AuthFormLocation|AuthFormLoginRequiredLocation|AuthFormLoginSuccessLocation|AuthFormLogoutLocation|AuthFormMethod|AuthFormMimetype|AuthFormPassword|AuthFormProvider|AuthFormSitePassphrase|AuthFormSize|AuthFormUsername|AuthGroupFile|AuthLDAPAuthorizePrefix|AuthLDAPBindAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareAsUser|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPInitialBindAsUser|AuthLDAPInitialBindPattern|AuthLDAPMaxSubGroupDepth|AuthLDAPRemoteUserAttribute|AuthLDAPRemoteUserIsDN|AuthLDAPSearchAsUser|AuthLDAPSubGroupAttribute|AuthLDAPSubGroupClass|AuthLDAPUrl|AuthMerging|AuthName|AuthnCacheContext|AuthnCacheEnable|AuthnCacheProvideFor|AuthnCacheSOCache|AuthnCacheTimeout|AuthnzFcgiCheckAuthnProvider|AuthnzFcgiDefineProvider|AuthType|AuthUserFile|AuthzDBDLoginToReferer|AuthzDBDQuery|AuthzDBDRedirectQuery|AuthzDBMType|AuthzSendForbiddenOnFailure|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferedLogs|BufferSize|CacheDefaultExpire|CacheDetailHeader|CacheDirLength|CacheDirLevels|CacheDisable|CacheEnable|CacheFile|CacheHeader|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheIgnoreQueryString|CacheIgnoreURLSessionIdentifiers|CacheKeyBaseURL|CacheLastModifiedFactor|CacheLock|CacheLockMaxAge|CacheLockPath|CacheMaxExpire|CacheMaxFileSize|CacheMinExpire|CacheMinFileSize|CacheNegotiatedDocs|CacheQuickHandler|CacheReadSize|CacheReadTime|CacheRoot|CacheSocache|CacheSocacheMaxSize|CacheSocacheMaxTime|CacheSocacheMinTime|CacheSocacheReadSize|CacheSocacheReadTime|CacheStaleOnError|CacheStoreExpired|CacheStoreNoStore|CacheStorePrivate|CGIDScriptTimeout|CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateInflateLimitRequestBody|DeflateInflateRatioBurst|DeflateInflateRatioLimit|DeflateMemLevel|DeflateWindowSize|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DTracePrivileges|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|HeartbeatAddress|HeartbeatListen|HeartbeatMaxServers|HeartbeatStorage|HeartbeatStorage|HostnameLookups|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|IndexHeadInsert|IndexIgnore|IndexIgnoreReset|IndexOptions|IndexOrderDefault|IndexStyleSheet|InputSed|ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer|KeepAlive|KeepAliveTimeout|KeptBodySize|LanguagePriority|LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionPoolTTL|LDAPConnectionTimeout|LDAPLibraryDebug|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPReferralHopLimit|LDAPReferrals|LDAPRetries|LDAPRetryDelay|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTimeout|LDAPTrustedClientCert|LDAPTrustedGlobalCert|LDAPTrustedMode|LDAPVerifyServerCert|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|LuaHookAccessChecker|LuaHookAuthChecker|LuaHookCheckUserID|LuaHookFixups|LuaHookInsertFilter|LuaHookLog|LuaHookMapToStorage|LuaHookTranslateName|LuaHookTypeChecker|LuaInherit|LuaInputFilter|LuaMapHandler|LuaOutputFilter|LuaPackageCPath|LuaPackagePath|LuaQuickHandler|LuaRoot|LuaScope|MaxConnectionsPerChild|MaxKeepAliveRequests|MaxMemFree|MaxRangeOverlaps|MaxRangeReversals|MaxRanges|MaxRequestWorkers|MaxSpareServers|MaxSpareThreads|MaxThreads|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|MMapFile|ModemStandard|ModMimeUsePathInfo|MultiviewsMatch|Mutex|NameVirtualHost|NoProxy|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|ProxyAddHeaders|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyExpressDBMFile|ProxyExpressDBMType|ProxyExpressEnable|ProxyFtpDirCharset|ProxyFtpEscapeWildcards|ProxyFtpListOnWildcard|ProxyHTMLBufSize|ProxyHTMLCharsetOut|ProxyHTMLDocType|ProxyHTMLEnable|ProxyHTMLEvents|ProxyHTMLExtended|ProxyHTMLFixups|ProxyHTMLInterp|ProxyHTMLLinks|ProxyHTMLMeta|ProxyHTMLStripComments|ProxyHTMLURLMap|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassInherit|ProxyPassInterpolateEnv|ProxyPassMatch|ProxyPassReverse|ProxyPassReverseCookieDomain|ProxyPassReverseCookiePath|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxySCGIInternalRedirect|ProxySCGISendfile|ProxySet|ProxySourceAddress|ProxyStatus|ProxyTimeout|ProxyVia|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIPHeader|RemoteIPInternalProxy|RemoteIPInternalProxyList|RemoteIPProxiesHeader|RemoteIPTrustedProxy|RemoteIPTrustedProxyList|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|RewriteBase|RewriteCond|RewriteEngine|RewriteMap|RewriteOptions|RewriteRule|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScoreBoardFile|Script|ScriptAlias|ScriptAliasMatch|ScriptInterpreterSource|ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock|SecureListen|SeeRequestTail|SendBufferSize|ServerAdmin|ServerAlias|ServerLimit|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|Session|SessionCookieName|SessionCookieName2|SessionCookieRemove|SessionCryptoCipher|SessionCryptoDriver|SessionCryptoPassphrase|SessionCryptoPassphraseFile|SessionDBDCookieName|SessionDBDCookieName2|SessionDBDCookieRemove|SessionDBDDeleteLabel|SessionDBDInsertLabel|SessionDBDPerUser|SessionDBDSelectLabel|SessionDBDUpdateLabel|SessionEnv|SessionExclude|SessionHeader|SessionInclude|SessionMaxAge|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIETag|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSLCACertificateFile|SSLCACertificatePath|SSLCADNRequestFile|SSLCADNRequestPath|SSLCARevocationCheck|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLCompression|SSLCryptoDevice|SSLEngine|SSLFIPS|SSLHonorCipherOrder|SSLInsecureRenegotiation|SSLOCSPDefaultResponder|SSLOCSPEnable|SSLOCSPOverrideResponder|SSLOCSPResponderTimeout|SSLOCSPResponseMaxAge|SSLOCSPResponseTimeSkew|SSLOCSPUseRequestNonce|SSLOpenSSLConfCmd|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationCheck|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCheckPeerCN|SSLProxyCheckPeerExpire|SSLProxyCheckPeerName|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateChainFile|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRenegBufferSize|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLSessionTicketKeyFile|SSLSRPUnknownUserSeed|SSLSRPVerifierFile|SSLStaplingCache|SSLStaplingErrorCacheTimeout|SSLStaplingFakeTryLater|SSLStaplingForceURL|SSLStaplingResponderTimeout|SSLStaplingResponseMaxAge|SSLStaplingResponseTimeSkew|SSLStaplingReturnResponderErrors|SSLStaplingStandardCacheTimeout|SSLStrictSNIVHostCheck|SSLUserName|SSLUseStapling|SSLVerifyClient|SSLVerifyDepth|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse'.split('|')
16
+
17
+ return keyword
18
+
19
+ @staticmethod
20
+ def comment_regex():
21
+ pattern = re.compile(r'(?P<comment>#.*?$)|(?P<noncomment>[^#]*)', re.MULTILINE)
22
+ return pattern
23
+
24
+ @staticmethod
25
+ def number_regex():
26
+ pattern = ''
27
+ return pattern
28
+
29
+ @staticmethod
30
+ def operator_regex():
31
+ pattern = ''
32
+ return pattern
33
+
34
+ @staticmethod
35
+ def keywords_regex():
36
+ return re.compile(r'\b(' + '|'.join(ApacheConf.keywords()) + r')\b')
37
+
38
+ @staticmethod
39
+ def remove_comments(source_code: str, isList: bool = False) -> str:
40
+ result = []
41
+ for match in ApacheConf.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)
47
+
48
+
49
+ @staticmethod
50
+ def remove_keywords(source: str):
51
+ return re.sub(re.compile(ApacheConf.keywords_regex()), '', source)
52
+
@@ -0,0 +1,52 @@
1
+ import re
2
+ from PyReprism.utils import extension
3
+
4
+
5
+ class Apl:
6
+ def __init__():
7
+ pass
8
+
9
+ @staticmethod
10
+ def file_extension() -> str:
11
+ return extension.apl
12
+
13
+ @staticmethod
14
+ def keywords() -> list:
15
+ keyword = ''.split('|')
16
+
17
+ return keyword
18
+
19
+ @staticmethod
20
+ def comment_regex():
21
+ pattern = re.compile(r'(?P<comment>⍝.*?$)|(?P<noncomment>[^⍝]*)', re.MULTILINE)
22
+ return pattern
23
+
24
+ @staticmethod
25
+ def number_regex():
26
+ pattern = ''
27
+ return pattern
28
+
29
+ @staticmethod
30
+ def operator_regex():
31
+ pattern = ''
32
+ return pattern
33
+
34
+ @staticmethod
35
+ def keywords_regex():
36
+ return re.compile(r'\b(' + '|'.join(Apl.keywords()) + r')\b')
37
+
38
+ @staticmethod
39
+ def remove_comments(source_code: str, isList: bool = False) -> str:
40
+ result = []
41
+ for match in Apl.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)
47
+
48
+
49
+ @staticmethod
50
+ def remove_keywords(source: str):
51
+ return re.sub(re.compile(Apl.keywords_regex()), '', source)
52
+
@@ -0,0 +1,52 @@
1
+ import re
2
+ from PyReprism.utils import extension
3
+
4
+
5
+ class AppleScript:
6
+ def __init__():
7
+ pass
8
+
9
+ @staticmethod
10
+ def file_extension() -> str:
11
+ return extension.applescript
12
+
13
+ @staticmethod
14
+ def keywords() -> list:
15
+ keyword = 'about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without|alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)'.split('|')
16
+
17
+ return keyword
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+\.?\d*|\B\.\d+)(?:e-?\d+)?\b')
27
+ return pattern
28
+
29
+ @staticmethod
30
+ def operator_regex():
31
+ pattern = re.compile(r'[&=≠≤≥*+\-\/÷^]|[<>]=?')
32
+ return pattern
33
+
34
+ @staticmethod
35
+ def keywords_regex():
36
+ return re.compile(r'\b(' + '|'.join(AppleScript.keywords()) + r')\b')
37
+
38
+ @staticmethod
39
+ def remove_comments(source_code: str, isList: bool = False) -> str:
40
+ result = []
41
+ for match in AppleScript.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)
47
+
48
+
49
+ @staticmethod
50
+ def remove_keywords(source: str):
51
+ return re.sub(re.compile(AppleScript.keywords_regex()), '', source)
52
+
@@ -0,0 +1,52 @@
1
+ import re
2
+ from PyReprism.utils import extension
3
+
4
+
5
+ class Arduino:
6
+ def __init__():
7
+ pass
8
+
9
+ @staticmethod
10
+ def file_extension() -> str:
11
+ return extension.arduino
12
+
13
+ @staticmethod
14
+ def keywords() -> list:
15
+ keyword = 'setup|if|else|while|do|for|return|in|instanceof|default|function|loop|goto|switch|case|new|try|throw|catch|finally|null|break|continue|boolean|bool|void|byte|word|string|String|array|int|long|integer|double|KeyboardController|MouseController|SoftwareSerial|EthernetServer|EthernetClient|LiquidCrystal|LiquidCrystal_I2C|RobotControl|GSMVoiceCall|EthernetUDP|EsploraTFT|HttpClient|RobotMotor|WiFiClient|GSMScanner|FileSystem|Scheduler|GSMServer|YunClient|YunServer|IPAddress|GSMClient|GSMModem|Keyboard|Ethernet|Console|GSMBand|Esplora|Stepper|Process|WiFiUDP|GSM_SMS|Mailbox|USBHost|Firmata|PImage|Client|Server|GSMPIN|FileIO|Bridge|Serial|EEPROM|Stream|Mouse|Audio|Servo|File|Task|GPRS|WiFi|Wire|TFT|GSM|SPI|SD|runShellCommandAsynchronously|analogWriteResolution|retrieveCallingNumber|printFirmwareVersion|analogReadResolution|sendDigitalPortPair|noListenOnLocalhost|readJoystickButton|setFirmwareVersion|readJoystickSwitch|scrollDisplayRight|getVoiceCallStatus|scrollDisplayLeft|writeMicroseconds|delayMicroseconds|beginTransmission|getSignalStrength|runAsynchronously|getAsynchronously|listenOnLocalhost|getCurrentCarrier|readAccelerometer|messageAvailable|sendDigitalPorts|lineFollowConfig|countryNameWrite|runShellCommand|readStringUntil|rewindDirectory|readTemperature|setClockDivider|readLightSensor|endTransmission|analogReference|detachInterrupt|countryNameRead|attachInterrupt|encryptionType|readBytesUntil|robotNameWrite|readMicrophone|robotNameRead|cityNameWrite|userNameWrite|readJoystickY|readJoystickX|mouseReleased|openNextFile|scanNetworks|noInterrupts|digitalWrite|beginSpeaker|mousePressed|isActionDone|mouseDragged|displayLogos|noAutoscroll|addParameter|remoteNumber|getModifiers|keyboardRead|userNameRead|waitContinue|processInput|parseCommand|printVersion|readNetworks|writeMessage|blinkVersion|cityNameRead|readMessage|setDataMode|parsePacket|isListening|setBitOrder|beginPacket|isDirectory|motorsWrite|drawCompass|digitalRead|clearScreen|serialEvent|rightToLeft|setTextSize|leftToRight|requestFrom|keyReleased|compassRead|analogWrite|interrupts|WiFiServer|disconnect|playMelody|parseFloat|autoscroll|getPINUsed|setPINUsed|setTimeout|sendAnalog|readSlider|analogRead|beginWrite|createChar|motorsStop|keyPressed|tempoWrite|readButton|subnetMask|debugPrint|macAddress|writeGreen|randomSeed|attachGPRS|readString|sendString|remotePort|releaseAll|mouseMoved|background|getXChange|getYChange|answerCall|getResult|voiceCall|endPacket|constrain|getSocket|writeJSON|getButton|available|connected|findUntil|readBytes|exitValue|readGreen|writeBlue|startLoop|IPAddress|isPressed|sendSysex|pauseMode|gatewayIP|setCursor|getOemKey|tuneWrite|noDisplay|loadImage|switchPIN|onRequest|onReceive|changePIN|playFile|noBuffer|parseInt|overflow|checkPIN|knobRead|beginTFT|bitClear|updateIR|bitWrite|position|writeRGB|highByte|writeRed|setSpeed|readBlue|noStroke|remoteIP|transfer|shutdown|hangCall|beginSMS|endWrite|attached|maintain|noCursor|checkReg|checkPUK|shiftOut|isValid|shiftIn|pulseIn|connect|println|localIP|pinMode|getIMEI|display|noBlink|process|getBand|running|beginSD|drawBMP|lowByte|setBand|release|bitRead|prepare|pointTo|readRed|setMode|noFill|remove|listen|stroke|detach|attach|noTone|exists|buffer|height|bitSet|circle|config|cursor|random|IRread|setDNS|endSMS|getKey|micros|millis|begin|print|write|ready|flush|width|isPIN|blink|clear|press|mkdir|rmdir|close|point|yield|image|BSSID|click|delay|read|text|move|peek|beep|rect|line|open|seek|fill|size|turn|stop|home|find|step|tone|sqrt|RSSI|SSID|end|bit|tan|cos|sin|pow|map|abs|max|min|get|run|put'.split('|')
16
+
17
+ return keyword
18
+
19
+ @staticmethod
20
+ def comment_regex():
21
+ pattern = re.compile(r'(?P<comment>//.*?$|/\*.*?\*/|/\*.*?$|^.*?\*/|[{}]+)|(?P<noncomment>\'(\\.|[^\\\'])*\'|"(\\.|[^\\"])*"|.[^/\'"{}]*)', re.DOTALL | re.MULTILINE)
22
+ return pattern
23
+
24
+
25
+ @staticmethod
26
+ def number_regex():
27
+ pattern = re.compile(r'(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*')
28
+ return pattern
29
+
30
+ @staticmethod
31
+ def operator_regex():
32
+ pattern = re.compile(r'--?|\+\+?|!=?|<{1,2}=?|>{1,2}=?|->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|\|?|\?|\*|\/|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b')
33
+ return pattern
34
+
35
+ @staticmethod
36
+ def keywords_regex():
37
+ return re.compile(r'\b(' + '|'.join(Arduino.keywords()) + r')\b')
38
+
39
+ @staticmethod
40
+ def remove_comments(source_code: str, isList: bool = False) -> str:
41
+ result = []
42
+ for match in Arduino.comment_regex().finditer(source_code):
43
+ if match.group('noncomment'):
44
+ result.append(match.group('noncomment'))
45
+ if isList:
46
+ return result
47
+ return ''.join(result)
48
+
49
+
50
+ @staticmethod
51
+ def remove_keywords(source: str):
52
+ return re.sub(re.compile(Arduino.keywords_regex()), '', source)
@@ -0,0 +1,52 @@
1
+ import re
2
+ from PyReprism.utils import extension
3
+
4
+
5
+ class Arff:
6
+ def __init__():
7
+ pass
8
+
9
+ @staticmethod
10
+ def file_extension() -> str:
11
+ return extension.arff
12
+
13
+ @staticmethod
14
+ def keywords() -> list:
15
+ keyword = 'attribute|data|end|relation'.split('|')
16
+
17
+ return keyword
18
+
19
+ @staticmethod
20
+ def comment_regex():
21
+ pattern = re.compile(r'(?P<comment>%.*?$)|(?P<noncomment>[^%]*)', re.MULTILINE)
22
+ return pattern
23
+
24
+ @staticmethod
25
+ def number_regex():
26
+ pattern = re.compile(r'\b\d+(?:\.\d+)?\b')
27
+ return pattern
28
+
29
+ @staticmethod
30
+ def operator_regex():
31
+ pattern = ''
32
+ return pattern
33
+
34
+ @staticmethod
35
+ def keywords_regex():
36
+ return re.compile(r'\b(' + '|'.join(Arff.keywords()) + r')\b')
37
+
38
+ @staticmethod
39
+ def remove_comments(source_code: str, isList: bool = False) -> str:
40
+ result = []
41
+ for match in Arff.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)
47
+
48
+
49
+ @staticmethod
50
+ def remove_keywords(source: str):
51
+ return re.sub(re.compile(Arff.keywords_regex()), '', source)
52
+