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

fix: 複合代入文の左辺が1回だけ評価されるように #847

Merged

Conversation

takejohn
Copy link
Contributor

@takejohn takejohn commented Nov 6, 2024

What

複合代入文(+=, -=)の左辺が1回だけ評価されるようになります。
例:

var index = -1
let array = [0, 0]

@next() {
    index += 1
    return index
}

array[next()] += 1

<: array.map(Core:to_str).join(', ') // => '1, 0'

Why

Resolve #842

Additional info (optional)

@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 96.03960% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/interpreter/reference.ts 94.93% 4 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files with missing lines Coverage Δ
src/interpreter/index.ts 94.07% <100.00%> (+8.27%) ⬆️
src/interpreter/reference.ts 94.93% <94.93%> (ø)

... and 29 files with indirect coverage changes

src/interpreter/index.ts Outdated Show resolved Hide resolved
@takejohn takejohn merged commit 2a8abf6 into aiscript-dev:master Nov 9, 2024
4 checks passed
@takejohn takejohn deleted the fix/842_assign-left-eval-once branch November 9, 2024 02:32
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.

複合代入文の左辺が2回評価されてしまう
5 participants