Skip to content

Commit

Permalink
Tests added for selector expression
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal <[email protected]>
  • Loading branch information
Vishalk91-4 committed Jul 4, 2024
1 parent 356dca0 commit c9d14bc
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions test/corpus/expr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,93 @@ Index expression
(string_end))
(integer)))

================================================================================
Selector expression
================================================================================

schema Person:
name: str
age: int

person = Person {
name = "Alice"
age = 18
}
name = person.name # "Alice"
age = person.age # 18

myDict = {
key = "value"
}
result = myDict.key # "value"

--------------------------------------------------------------------------------

(module
(schema_statement
(identifier)
(block
(assignment
(dotted_name
(identifier))
(basic_type))
(assignment
(dotted_name
(identifier))
(basic_type))))
(assignment
(dotted_name
(identifier))
(schema_expr
(identifier)
(dict_expr
(pair
(attribute
(identifier))
(string
(string_start)
(string_content)
(string_end)))
(pair
(attribute
(identifier))
(integer)))))
(assignment
(dotted_name
(identifier))
(dotted_name
(identifier)
(identifier)))
(comment)
(assignment
(dotted_name
(identifier))
(dotted_name
(identifier)
(identifier)))
(comment)
(assignment
(dotted_name
(identifier))
(config_expr
(config_entries
(config_entry
(test
(dotted_name
(identifier)))
(test
(string
(string_start)
(string_content)
(string_end)))))))
(assignment
(dotted_name
(identifier))
(dotted_name
(identifier)
(identifier)))
(comment))

================================================================================
slice expression
================================================================================
Expand Down

0 comments on commit c9d14bc

Please sign in to comment.