Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler subsystem #26

Merged
merged 29 commits into from
Jan 27, 2021
Merged

Compiler subsystem #26

merged 29 commits into from
Jan 27, 2021

Commits on Jan 21, 2021

  1. add compiler subpackage

    This commit adds the compiler subpackage to implement issue #25.
    The compiler subpackage currently contains abstract base classes
    and will receive implementations later.
    Deric-W committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    a697e8c View commit details
    Browse the repository at this point in the history
  2. add RegexParser

    The RegexParser is a Parser implementation identifying
    the start and end of a code section with regular expressions.
    This is the standart implementation modified to implement issue #25.
    Deric-W committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    d280444 View commit details
    Browse the repository at this point in the history
  3. multiple improvements to compiler abc

    - add CompileError for exceptions during compiling
    - replace Mapping in Code.execute with Dict because exec needs a dict
    - move line offset handling from CodeBuilder to Parser
    - replace name and loader with ModuleSpec
    Deric-W committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    a0e98e3 View commit details
    Browse the repository at this point in the history
  4. fix RegexParser, improve CompileError

    This commit changes RegexParser to comply to the new abc.
    Furthermore, CompileError is changed to show the section which failed.
    Deric-W committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    d740e95 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dc926c7 View commit details
    Browse the repository at this point in the history
  6. add generic code implementation to compiler

    This commit adds the current implementation of code objects to the compiler subpackage.
    This requires to raise the minimal python version to 3.8 as stated in issue #25.
    Deric-W committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    b55eee9 View commit details
    Browse the repository at this point in the history
  7. remove pypy3 from tested versions

    This is necessary because the generic code implementation requires the
    CodeType.replace method, which is available in python 3.8+.
    Deric-W committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    5d7d217 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2021

  1. Configuration menu
    Copy the full SHA
    e98570a View commit details
    Browse the repository at this point in the history
  2. add Compiler facade

    This commit adds a facade to the compiler subsystem as mentioned in issue #25.
    Deric-W committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    3874e2b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    685b5ed View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2021

  1. add Dedenter

    This commits adds the dedenting feature as a decorator as mentioned in issue #25.
    Deric-W committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    04d0366 View commit details
    Browse the repository at this point in the history
  2. add tests for compiler abc

    Deric-W committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    c88e286 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b83d3ac View commit details
    Browse the repository at this point in the history
  4. update setup.cfg classifiers

    Deric-W committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    600f927 View commit details
    Browse the repository at this point in the history
  5. add Dedenter.is_code

    To allow for better testing, the code for detecting code lines is moved into a seperate method.
    Deric-W committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    80daf79 View commit details
    Browse the repository at this point in the history
  6. move the tracking of the section number into the parser

    Before this commit, every builder kept track the section number themself,
    resulting in redundancy and susceptibility to errors.
    This commit modifies compiler.CodeBuilder.add_* to accept the current section number.
    Deric-W committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    e37d469 View commit details
    Browse the repository at this point in the history
  7. update docstrings

    Deric-W committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    e74531b View commit details
    Browse the repository at this point in the history
  8. add bytecode code implementation

    This commit adds a implementation of compiler.Code in python bytecode as mentioned in issue #25.
    It is implemented using a generator and currently slower than the generic implementation to
    allow for variables to be passed to .execute.
    If MAKE_FUNCTION gets faster or the compiler subsystem gets changed it may be faster.
    Deric-W committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    99cab7f View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2021

  1. Configuration menu
    Copy the full SHA
    047505c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8aab53f View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2021

  1. Improve typing of compiler subpackage

    This commit replaces a few type hints in the compiler subpackage with generics.
    This allows detaching a CodeBuilderDecorator which was detached from another CodeBuilderDecorator
    and fixes the result of CodeBuilder.copy() not having the same type as his 'parent'.
    Deric-W committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    65d5a08 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2021

  1. Configuration menu
    Copy the full SHA
    19440c7 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2021

  1. replace CompileError with SyntaxError and correct lineno

    To allow for better error discovery, this commit replaces CompileError with
    a normal SyntaxError with the correct line number set.
    Deric-W committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    16e5402 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e52b8eb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ac669b7 View commit details
    Browse the repository at this point in the history
  4. refactor GenericCodeBuilder to allow for Python 3.7+

    To allow for Python version 3.7 to be used, GenericCodeBuilder now uses the ast module
    instead of CodeType.replace.
    Deric-W committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    5db5224 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9319966 View commit details
    Browse the repository at this point in the history
  6. dont run MyPy on pypy-3.7

    This commit updates the workflow to not run MyPy on pypy-3.7 because it is not supported.
    Deric-W committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    ae70c67 View commit details
    Browse the repository at this point in the history
  7. small cleanups

    Deric-W committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    efdee0b View commit details
    Browse the repository at this point in the history