kyleoneill / chimerascript

0 stars 0 forks source link

Variable subfielding #2

Closed kyleoneill closed 11 months ago

kyleoneill commented 11 months ago

Necessary for almost any usage of a variable system, ex

- var res = GET /my_endpoint
- ASSERT EQUALS (res.status_code) 200

Subfield accessing must account for both JSON objects and arrays/vecs/lists. If we get a response which contains a list, we might want to access a field on the second item in that list like:

- var res = GET /my_endpoint?items=10
- var field_name= (res.body.items.1.name)
kyleoneill commented 11 months ago

Consider adding support for a variable being used in the nest, ex

- var res = GET /my_endpoint?items=10
- var item_index = LITERAL 1
- var field_name = (res.body.items.(item_index).name)

Will need to modify grammar file for this and access using abstract_syntax_tree::Value

kyleoneill commented 11 months ago

Nested var use moved to https://github.com/kyleoneill/chimerascript/issues/6