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

feat: overdraft function #14

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ascandone
Copy link
Contributor

@ascandone ascandone commented Oct 28, 2024

Added an overdraft() function which returns the absolute value of the negative balance of the given account and currency; 0 if overdraft is non negative (see tests as reference)

This is a new numscript functionality which is not implemented in the current machine implementation; thus the functionality is under the experimental-overdraft-function feature flag

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

Attention: Patch coverage is 82.89474% with 26 lines in your changes missing coverage. Please review.

Project coverage is 63.34%. Comparing base (661c6a1) to head (8f26655).

Files with missing lines Patch % Lines
internal/interpreter/interpreter.go 76.59% 7 Missing and 4 partials ⚠️
internal/cmd/run.go 0.00% 8 Missing ⚠️
internal/parser/antlr/numscript_parser.go 94.56% 5 Missing ⚠️
internal/interpreter/interpreter_error.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #14      +/-   ##
==========================================
+ Coverage   63.33%   63.34%   +0.01%     
==========================================
  Files          29       29              
  Lines        6395     6461      +66     
==========================================
+ Hits         4050     4093      +43     
- Misses       2167     2187      +20     
- Partials      178      181       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ascandone
Copy link
Contributor Author

ascandone commented Oct 28, 2024

EDIT: fixed

It turns out I couldn't call this function overdraft because that is already a token.
So we would need to use something like overdraft_amount instead (or workaround this issue, which I'm not sure is a good idea)

Base automatically changed from dev to main October 29, 2024 08:59
@ascandone ascandone changed the title draft implementation feat: overdraft function Oct 30, 2024
@ascandone ascandone force-pushed the feat/experiment-overdraft-function branch from c26bdb0 to d619d6e Compare November 21, 2024 02:35
@ascandone ascandone marked this pull request as ready for review November 21, 2024 12:11
@ascandone ascandone force-pushed the feat/experiment-overdraft-function branch from d619d6e to c5dcc88 Compare November 26, 2024 12:48
@ascandone ascandone force-pushed the feat/experiment-overdraft-function branch from 8f1fd3a to be5b6d9 Compare November 27, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant