z_mirror/luapls

git clone https://git.raiguard.me/z_mirror/luapls

Caleb HeuerFix testsa9d7242

main
4.4 KiB164 linesraw
1[
2  {
3    "Label": "continue",
4    "Input": "for i = 1, 100 do if i > 50 then goto continue end print(i) ::continue:: end",
5    "AST": {
6      "Type": "Block",
7      "Range": {
8        "Start": 0,
9        "End": 76
10      },
11      "Stmts": [
12        {
13          "Type": "ForStatement",
14          "Range": {
15            "Start": 0,
16            "End": 76
17          },
18          "Name": {
19            "Type": "Identifier",
20            "Range": {
21              "Start": 4,
22              "End": 5
23            },
24            "Literal": "i"
25          },
26          "Start": {
27            "Type": "NumberLiteral",
28            "Range": {
29              "Start": 8,
30              "End": 9
31            },
32            "Literal": "1",
33            "Value": 1
34          },
35          "Finish": {
36            "Type": "NumberLiteral",
37            "Range": {
38              "Start": 11,
39              "End": 14
40            },
41            "Literal": "100",
42            "Value": 100
43          },
44          "Step": null,
45          "Body": {
46            "Type": "Block",
47            "Range": {
48              "Start": 18,
49              "End": 72
50            },
51            "Stmts": [
52              {
53                "Type": "IfStatement",
54                "Range": {
55                  "Start": 18,
56                  "End": 50
57                },
58                "Clauses": [
59                  {
60                    "Type": "IfClause",
61                    "Range": {
62                      "Start": 18,
63                      "End": 46
64                    },
65                    "Condition": {
66                      "Type": "InfixExpression",
67                      "Range": {
68                        "Start": 21,
69                        "End": 27
70                      },
71                      "Left": {
72                        "Type": "Identifier",
73                        "Range": {
74                          "Start": 21,
75                          "End": 22
76                        },
77                        "Literal": "i"
78                      },
79                      "Operator": "gt",
80                      "Right": {
81                        "Type": "NumberLiteral",
82                        "Range": {
83                          "Start": 25,
84                          "End": 27
85                        },
86                        "Literal": "50",
87                        "Value": 50
88                      }
89                    },
90                    "Body": {
91                      "Type": "Block",
92                      "Range": {
93                        "Start": 33,
94                        "End": 46
95                      },
96                      "Stmts": [
97                        {
98                          "Type": "GotoStatement",
99                          "Range": {
100                            "Start": 33,
101                            "End": 46
102                          },
103                          "Name": {
104                            "Type": "Identifier",
105                            "Range": {
106                              "Start": 38,
107                              "End": 46
108                            },
109                            "Literal": "continue"
110                          }
111                        }
112                      ]
113                    }
114                  }
115                ],
116                "StartPos": 18
117              },
118              {
119                "Type": "FunctionCall",
120                "Range": {
121                  "Start": 51,
122                  "End": 59
123                },
124                "Left": {
125                  "Type": "Identifier",
126                  "Range": {
127                    "Start": 51,
128                    "End": 56
129                  },
130                  "Literal": "print"
131                },
132                "Args": [
133                  {
134                    "Type": "Identifier",
135                    "Range": {
136                      "Start": 57,
137                      "End": 58
138                    },
139                    "Literal": "i"
140                  }
141                ]
142              },
143              {
144                "Type": "LabelStatement",
145                "Range": {
146                  "Start": 60,
147                  "End": 72
148                },
149                "Name": {
150                  "Type": "Identifier",
151                  "Range": {
152                    "Start": 62,
153                    "End": 70
154                  },
155                  "Literal": "continue"
156                }
157              }
158            ]
159          }
160        }
161      ]
162    }
163  }
164]