Skip to content

Conversation

@advikkabra
Copy link
Collaborator

  • Changed In and NotIn in the AST from compare operators to membership operators
  • Implemented membership checks for dictionaries and sets, need to implement for lists, tuples and strings
  • Searching could be further optimized, but there is a bug.

a: set[str] = {'a', 'b', 'c', 'e', 'f'}
i: str
assert ('a' in a)
# assert ('d' not in a)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Try assert not ('d' in a). It should also fail.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can be fixed in subsequent PR.

@czgdp1807 czgdp1807 enabled auto-merge June 14, 2024 12:22
@czgdp1807 czgdp1807 merged commit e5308f1 into lcompilers:main Jun 14, 2024
@advikkabra advikkabra deleted the membership branch July 21, 2024 13:22
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 participants