Make dot-get work in the compiler AND with parens exprs #12

Merged
defunkt merged 1 commits from dot-get-the-sequel into main 2025-10-29 20:20:59 +00:00

Make the dot-get work in the compiler AND make it work with parens expressions. These compiler tests we're broken before, but now they work!

describe('dot get', () => {
  const array = (...items: any) => items
  const dict = (atNamed: any) => atNamed

  test('access array element', () => {
    expect(`arr = array 'a' 'b' 'c'; arr.1`).toEvaluateTo('b', { array })
  })

  test('access dict element', () => {
    expect(`dict = dict a=1 b=2; dict.a`).toEvaluateTo(1, { dict })
  })

  test('use parens expr with dot-get', () => {
    expect(`a = 1; arr = array 'a' 'b' 'c'; arr.(1 + a)`).toEvaluateTo('c', { array })
  })
})
Make the dot-get work in the compiler AND make it work with parens expressions. These compiler tests we're broken before, but now they work! ```ts describe('dot get', () => { const array = (...items: any) => items const dict = (atNamed: any) => atNamed test('access array element', () => { expect(`arr = array 'a' 'b' 'c'; arr.1`).toEvaluateTo('b', { array }) }) test('access dict element', () => { expect(`dict = dict a=1 b=2; dict.a`).toEvaluateTo(1, { dict }) }) test('use parens expr with dot-get', () => { expect(`a = 1; arr = array 'a' 'b' 'c'; arr.(1 + a)`).toEvaluateTo('c', { array }) }) }) ```
probablycorey added 1 commit 2025-10-28 17:12:56 +00:00
defunkt force-pushed dot-get-the-sequel from a1693078f9 to 1053a5ff52 2025-10-29 20:20:15 +00:00 Compare
Owner

👯👯👯

👯👯👯
defunkt merged commit 5594fc4fe0 into main 2025-10-29 20:20:59 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: probablycorey/shrimp#12
No description provided.