kcl-lang / kcl

KCL Programming Language (CNCF Sandbox Project). https://kcl-lang.io
https://kcl-lang.io
Apache License 2.0
1.42k stars 110 forks source link

Assignments in expressions with square brackets fail #1399

Closed SjuulJanssen closed 1 month ago

SjuulJanssen commented 1 month ago

Not sure if this should be a bug report or a feature request. However the error is not helpful right now.

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

objects:

_obj = {}
_obj["x.y"] = 1

lists:

_list = [_obj]
_list[0].prop = 1

2. What did you expect to see? (Required)

Assignments to work

3. What did you see instead (Required)

objects:

4 | _obj["x.y"] = 1
  |               ^ expected one of ["identifier"] got newline

lists:

8 | _list[0].prop = 1
  |                 ^ expected one of ["identifier"] got newline

4. What is your KCL components version? (Required)

kcl version 0.9.0-beta.1-linux-amd64
Peefy commented 1 month ago

See the issue: https://github.com/kcl-lang/kcl/issues/1396 Currently, KCL does not support such syntax

SjuulJanssen commented 1 month ago

Ok closing it for you then