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

Support array indexing by range #628

Merged
merged 15 commits into from
Dec 12, 2024

Conversation

hdwalters
Copy link
Contributor

@hdwalters hdwalters commented Dec 5, 2024

Allow array variables to be indexed by range, for example:

let numbers = ["zero", "one", "two", "three"]
echo numbers[1..=2]

Required in order to implement #629.

@hdwalters hdwalters requested review from Ph0enixKM, mks-h and b1ek December 5, 2024 08:15
Copy link
Member

@mks-h mks-h left a comment

Choose a reason for hiding this comment

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

These are some surface level suggestions to improve the code's readability.

src/modules/variable/get.rs Outdated Show resolved Hide resolved
src/modules/variable/get.rs Outdated Show resolved Hide resolved
src/modules/variable/get.rs Outdated Show resolved Hide resolved
src/tests/validity/array_get_range_local.ab Outdated Show resolved Hide resolved
src/tests/validity/array_get_range_local.ab Outdated Show resolved Hide resolved
src/modules/variable/get.rs Outdated Show resolved Hide resolved
Copy link
Member

@Ph0enixKM Ph0enixKM left a comment

Choose a reason for hiding this comment

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

Looks good overall

src/modules/expression/expr.rs Show resolved Hide resolved
src/modules/expression/binop/range.rs Show resolved Hide resolved
src/modules/variable/get.rs Outdated Show resolved Hide resolved
src/modules/variable/get.rs Outdated Show resolved Hide resolved
@hdwalters hdwalters requested review from mks-h and Ph0enixKM December 6, 2024 07:27
Copy link
Member

@Ph0enixKM Ph0enixKM left a comment

Choose a reason for hiding this comment

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

Looks good

src/modules/expression/unop/neg.rs Outdated Show resolved Hide resolved
Mte90
Mte90 previously approved these changes Dec 10, 2024
@mks-h mks-h dismissed Mte90’s stale review December 10, 2024 16:36

Self reported lack of Rust knowledge to review code doesn't pair well with approvals of complex Rust PRs

Copy link
Member

@mks-h mks-h left a comment

Choose a reason for hiding this comment

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

Needs tests for error messages.

src/modules/expression/unop/neg.rs Show resolved Hide resolved
src/modules/variable/mod.rs Outdated Show resolved Hide resolved
src/tests/errors.rs Outdated Show resolved Hide resolved
@Mte90 Mte90 requested a review from mks-h December 12, 2024 09:26
Copy link
Member

@mks-h mks-h left a comment

Choose a reason for hiding this comment

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

Great job, thanks!

@hdwalters hdwalters merged commit a4bbf9e into amber-lang:master Dec 12, 2024
1 check passed
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.

4 participants