Reference
Version
- src.PyReprism.__version__
Current PyReprism version.
Python
- class PyReprism.languages.python.Python
Bases:
BaseLanguageThis is the class for processing Python source code
- __module__ = 'PyReprism.languages.python'
- classmethod comment_regex() Pattern
Compile and return a regular expression pattern to identify different types of comments and non-comment code in Python source files.
- Returns:
A compiled regex pattern with named groups to match single-line comments, multiline comments, and non-comment code elements.
- Return type:
- classmethod delimiters_regex() Pattern
Compile and return a regular expression pattern to identify Python delimiters.
- Returns:
A compiled regex pattern to match Python delimiters.
- Return type:
- classmethod file_extension() str
Return the file extension used for Python files.
- Returns:
The file extension for Python files.
- Return type:
- classmethod keywords() list
Return a list of Python keywords and built-in functions.
- Returns:
A list of Python keywords and built-in function names.
- Return type:
- classmethod number_regex() Pattern
Compile and return a regular expression pattern to identify numeric literals in Python code.
- Returns:
A compiled regex pattern to match Python numeric literals, including integers, floats, and complex numbers.
- Return type:
- classmethod operator_regex() Pattern
Compile and return a regular expression pattern to identify Python operators.
- Returns:
A compiled regex pattern to match various Python operators and logical keywords.
- Return type:
Java
- class PyReprism.languages.java.Java
Bases:
BaseLanguageJava language helper; migrated to BaseLanguage pattern.
Provides regex helpers and delegates comment/keyword removal to BaseLanguage.
- __annotations__ = {}
- __module__ = 'PyReprism.languages.java'
- classmethod boolean_regex() Pattern
Regex for Java boolean literals.
- Parameters:
source – The source code string from which to remove Java keywords.
- Return type:
- classmethod comment_regex() Pattern
Regex to capture comments (group ‘comment’) and non-comment fragments (group ‘noncomment’).
- Return type:
- classmethod keywords() list
Return a list of Java keywords and built-in functions. :rtype: list[str]
- classmethod keywords_regex() Pattern
Compile and return a regex that matches Java keywords.
- Return type:
C++
- class PyReprism.languages.cpp.CPP
Bases:
BaseLanguage- __annotations__ = {}
- __module__ = 'PyReprism.languages.cpp'
- classmethod comment_regex() Pattern
Return a compiled regex with named groups ‘comment’ and ‘noncomment’.
C
- class PyReprism.languages.c.C
Bases:
BaseLanguage- __annotations__ = {}
- __module__ = 'PyReprism.languages.c'
- classmethod comment_regex() Pattern
Returns a compiled regex pattern to match comments and non-comment parts in C source code. This pattern matches both single-line (//) and multi-line (/* … */) comments
- Returns:
A compiled regex pattern.
- Type:
- classmethod number_regex() Pattern
Returns a compiled regex pattern to match numeric literals in C source code. This pattern matches hexadecimal, decimal, and floating-point numbers
- Returns:
A compiled regex pattern.
- Type:
- classmethod operator_regex() Pattern
Returns a compiled regex pattern to match operators in C source code. This pattern matches various C operators including arithmetic, comparison, and logical operators.
- Returns:
A compiled regex pattern.
- Type:
Scala
- class PyReprism.languages.scala.Scala
Bases:
BaseLanguageScala language helper.
Provides keyword list and regex helpers for comment, number, operator, and delimiter handling. Delegates removal logic to BaseLanguage.
- __annotations__ = {}
- __module__ = 'PyReprism.languages.scala'
- classmethod comment_regex() Pattern
Return a compiled regex with named groups ‘comment’ and ‘noncomment’.
Dart
- class PyReprism.languages.dart.Dart
Bases:
BaseLanguageDart language helper migrated to BaseLanguage pattern.
- __annotations__ = {}
- __module__ = 'PyReprism.languages.dart'
- classmethod comment_regex() Pattern
Return a compiled regex with named groups ‘comment’ and ‘noncomment’.
Rust
- class PyReprism.languages.rust.Rust
Bases:
BaseLanguageRust language helper.
Provides comment/number/operator regexes and a list of Rust keywords.
- __annotations__ = {}
- __module__ = 'PyReprism.languages.rust'
- classmethod comment_regex() Pattern
Return a compiled regex with named groups ‘comment’ and ‘noncomment’.
Kotlin
- class PyReprism.languages.kotlin.Kotlin
Bases:
BaseLanguageKotlin language helper.
Implements comment, number, operator, delimiter and keyword helpers for Kotlin. Delegates removal logic to BaseLanguage.
- __annotations__ = {}
- __module__ = 'PyReprism.languages.kotlin'
- classmethod comment_regex() Pattern
Return a compiled regex with named groups ‘comment’ and ‘noncomment’.
Swift
- class PyReprism.languages.swift.Swift
Bases:
BaseLanguageSwift language helper.
- __annotations__ = {}
- __module__ = 'PyReprism.languages.swift'
- classmethod comment_regex() Pattern
Return a compiled regex with named groups ‘comment’ and ‘noncomment’.
JavaScript
- class PyReprism.languages.javascript.JavaScript
Bases:
BaseLanguage- __annotations__ = {}
- __module__ = 'PyReprism.languages.javascript'
- classmethod comment_regex() Pattern
Return a compiled regex with named groups ‘comment’ and ‘noncomment’.
JSX
- class PyReprism.languages.jsx.Jsx
Bases:
BaseLanguageJSX/React-like language helper migrated to BaseLanguage.
Keeps comment-removal semantics from the original implementation (only append non-empty ‘noncomment’ matches). Keywords removal is delegated to the base class.
- __annotations__ = {}
- __module__ = 'PyReprism.languages.jsx'
- classmethod comment_regex() Pattern
Compile and return a regex that captures comments and non-comment fragments in JSX-like source.
The pattern includes single-line // comments, C-style /* … / block comments, and JSX fragments like {/ … */}. It provides named groups
commentandnoncommentas required by BaseLanguage helpers.- Return type:
- classmethod delimiters_regex() Pattern
Return a regex matching delimiter characters used in JSX/JS.
- Return type:
- classmethod keywords() list
Return a list of JavaScript/JSX keywords used for token filtering.
- Return type:
- classmethod keywords_regex() Pattern
Compile a regex that matches any of the language keywords.
- Return type:
- classmethod number_regex() Pattern
Return a regex matching numeric literals used in JSX/JavaScript.
- Return type:
- classmethod operator_regex() Pattern
Return a regex matching common JavaScript operators.
- Return type: