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

Enhancement: Smaller Interpreter Suggestion Footprint #51

Merged
merged 2 commits into from
Sep 24, 2021

Conversation

tigh-latte
Copy link
Contributor

@tigh-latte tigh-latte commented Sep 24, 2021

Currently, if you import the interpreter and type interpreter. a lot of options that aren't related to using the interpreter appear, this could overwhelming and create the impression that the package is harder to use than it actually is.
image

To address this I've:

  • moved errors into their own subpackage
  • moved the scriptflags into their own subpackage.
  • Removed the NewOpcodeParser function and instead provided a DefaultOpcodeParser struct which implements the OpcodeParser interface is useful from zero value.

And with this, package usage is friendlier upon import:
image

@mergify mergify bot added the enhancement New feature or request label Sep 24, 2021
@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2021

Codecov Report

Merging #51 (079e1e8) into master (25661c5) will decrease coverage by 0.02%.
The diff coverage is 88.37%.

❗ Current head 079e1e8 differs from pull request most recent head 08684a8. Consider uploading reports for the commit 08684a8 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
- Coverage   85.98%   85.96%   -0.03%     
==========================================
  Files          26       26              
  Lines        2862     2871       +9     
==========================================
+ Hits         2461     2468       +7     
- Misses        272      275       +3     
+ Partials      129      128       -1     
Impacted Files Coverage Δ
bscript/interpreter/errs/error.go 50.00% <0.00%> (ø)
bscript/interpreter/opcodeparser.go 80.55% <72.09%> (+3.25%) ⬆️
bscript/interpreter/thread.go 90.74% <86.11%> (+0.17%) ⬆️
bscript/interpreter/operations.go 96.16% <97.64%> (+0.03%) ⬆️
bscript/interpreter/engine.go 100.00% <100.00%> (ø)
bscript/interpreter/scriptnum.go 100.00% <100.00%> (ø)
bscript/interpreter/stack.go 93.87% <100.00%> (-0.39%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25661c5...08684a8. Read the comment docs.

Copy link
Contributor

@theflyingcodr theflyingcodr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, LGTM

@mergify mergify bot merged commit c41f54a into master Sep 24, 2021
@mergify mergify bot deleted the enhancement/cleanup-interpreter branch September 24, 2021 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants