KCL parser: Allow .prop or [index] to follow any expression (#7371)

Previously in a member expression like `foo.x` or `foo[3]`, `foo` had to be an identifier. You could not do something like `f().x` (and if you tried, you got a cryptic error). Rather than make the error better, we should just accept any expression to be the LHS of a member expression (aka its 'object').

This does knock our "parse lots of function calls" from 58 to 55 calls before it stack overflows. But I think it's fine, we'll address this in https://github.com/KittyCAD/modeling-app/pull/6226 when I get back to it.

Closes https://github.com/KittyCAD/modeling-app/issues/7273
This commit is contained in:
Adam Chalmers
2025-06-05 08:23:48 -05:00
committed by GitHub
parent 9136fb0d1b
commit 4575b32dbc
77 changed files with 3397 additions and 1987 deletions

View File

@ -177,72 +177,72 @@ flowchart LR
2 ---- 34
17 --- 35
17 x--> 52
17 --- 67
17 --- 84
17 --- 66
17 --- 83
18 --- 36
18 x--> 52
18 --- 58
18 --- 75
18 --- 54
18 --- 71
19 --- 37
19 x--> 52
19 --- 56
19 --- 73
19 --- 61
19 --- 78
20 --- 38
20 x--> 52
20 --- 68
20 --- 85
20 --- 67
20 --- 84
21 --- 39
21 x--> 52
21 --- 63
21 --- 80
21 --- 57
21 --- 74
22 --- 40
22 x--> 52
22 --- 54
22 --- 71
22 --- 64
22 --- 81
23 --- 41
23 x--> 52
23 --- 60
23 --- 77
23 --- 62
23 --- 79
24 --- 42
24 x--> 52
24 --- 57
24 --- 74
24 --- 68
24 --- 85
25 --- 43
25 x--> 52
25 --- 64
25 --- 81
25 --- 70
25 --- 87
26 --- 44
26 x--> 52
26 --- 59
26 --- 76
26 --- 56
26 --- 73
27 --- 45
27 x--> 52
27 --- 69
27 --- 86
28 --- 46
28 x--> 52
28 --- 66
28 --- 83
28 --- 65
28 --- 82
29 --- 47
29 x--> 52
29 --- 55
29 --- 72
30 --- 48
30 x--> 52
30 --- 61
30 --- 78
30 --- 58
30 --- 75
31 --- 49
31 x--> 52
31 --- 70
31 --- 87
31 --- 60
31 --- 77
32 --- 50
32 x--> 52
32 --- 65
32 --- 82
32 --- 63
32 --- 80
33 --- 51
33 x--> 52
33 --- 62
33 --- 79
33 --- 59
33 --- 76
34 --- 35
34 --- 36
34 --- 37
@ -296,57 +296,57 @@ flowchart LR
34 --- 85
34 --- 86
34 --- 87
35 --- 67
83 <--x 35
35 --- 84
36 --- 58
74 <--x 36
36 --- 75
37 --- 56
72 <--x 37
37 --- 73
38 --- 68
84 <--x 38
38 --- 85
39 --- 63
79 <--x 39
39 --- 80
40 --- 54
40 --- 71
87 <--x 40
41 --- 60
76 <--x 41
41 --- 77
42 --- 57
73 <--x 42
42 --- 74
43 --- 64
80 <--x 43
43 --- 81
44 --- 59
75 <--x 44
44 --- 76
35 --- 66
82 <--x 35
35 --- 83
36 --- 54
36 --- 71
87 <--x 36
37 --- 61
77 <--x 37
37 --- 78
38 --- 67
83 <--x 38
38 --- 84
39 --- 57
73 <--x 39
39 --- 74
40 --- 64
80 <--x 40
40 --- 81
41 --- 62
78 <--x 41
41 --- 79
42 --- 68
84 <--x 42
42 --- 85
43 --- 70
86 <--x 43
43 --- 87
44 --- 56
72 <--x 44
44 --- 73
45 --- 69
85 <--x 45
45 --- 86
46 --- 66
82 <--x 46
46 --- 83
46 --- 65
81 <--x 46
46 --- 82
47 --- 55
71 <--x 47
47 --- 72
48 --- 61
77 <--x 48
48 --- 78
49 --- 70
86 <--x 49
49 --- 87
50 --- 65
81 <--x 50
50 --- 82
51 --- 62
78 <--x 51
51 --- 79
48 --- 58
74 <--x 48
48 --- 75
49 --- 60
76 <--x 49
49 --- 77
50 --- 63
79 <--x 50
50 --- 80
51 --- 59
75 <--x 51
51 --- 76
54 <--x 53
55 <--x 53
56 <--x 53