@lowgular/code-graph 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/apps/code-graph/src/main.js +50 -0
  2. package/libs/cli/code-graph/src/index.js +39 -0
  3. package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.js +72 -0
  4. package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.stateful.js +68 -0
  5. package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.doc.js +147 -0
  6. package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.graph.js +55 -0
  7. package/libs/cli/code-graph/src/lib/class-declarations/index.js +27 -0
  8. package/libs/cli/code-graph/src/lib/code.graph.factory.js +63 -0
  9. package/libs/cli/code-graph/src/lib/code.graph.js +62 -0
  10. package/libs/cli/code-graph/src/lib/core/core.js +58 -0
  11. package/libs/cli/code-graph/src/lib/core.js +85 -0
  12. package/libs/cli/code-graph/src/lib/decorators/index.js +36 -0
  13. package/libs/cli/code-graph/src/lib/docs/index.js +21 -0
  14. package/libs/cli/code-graph/src/lib/docs/specs.js +36 -0
  15. package/libs/cli/code-graph/src/lib/expressions/call-expressions.graph.js +28 -0
  16. package/libs/cli/code-graph/src/lib/fixtures/reactive-event-bus/src/app/examples.event-bus.js +53 -0
  17. package/libs/cli/code-graph/src/lib/method-declarations/index.js +23 -0
  18. package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.doc.js +106 -0
  19. package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.graph.js +56 -0
  20. package/libs/cli/code-graph/src/lib/parameters/index.js +42 -0
  21. package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.evals.js +139 -0
  22. package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.js +104 -0
  23. package/libs/cli/code-graph/src/lib/property-declarations/index.js +25 -0
  24. package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.doc.js +74 -0
  25. package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.graph.js +43 -0
  26. package/libs/cli/code-graph/src/lib/tools/index.js +34 -0
  27. package/libs/cli/code-graph/src/lib/tools/match-code-graph.tool.js +64 -0
  28. package/libs/cli/code-graph/src/lib/types/index.js +99 -0
  29. package/libs/cli/code-graph/src/lib/v2/extractors/extractor.doc.js +345 -0
  30. package/libs/cli/code-graph/src/lib/v2/extractors/extractor.js +52 -0
  31. package/libs/cli/code-graph/src/lib/v2/extractors/index.js +23 -0
  32. package/libs/cli/code-graph/src/lib/v2/graph-builder/code-graph.builder.js +76 -0
  33. package/libs/cli/code-graph/src/lib/v2/graph-builder/index.js +21 -0
  34. package/libs/cli/code-graph/src/lib/v2/graph-builder/node.processor.js +48 -0
  35. package/libs/cli/code-graph/src/lib/v2/graph-builder/relationship.processor.js +79 -0
  36. package/libs/cli/code-graph/src/lib/v2/graph-builder/type.processor.js +45 -0
  37. package/libs/cli/code-graph/src/lib/v2/index.js +37 -0
  38. package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.doc.js +220 -0
  39. package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.tool.js +42 -0
  40. package/libs/cli/cypher/src/index.js +25 -0
  41. package/libs/cli/cypher/src/lib/docs/features/advanced-optional-match.feature.js +277 -0
  42. package/libs/cli/cypher/src/lib/docs/features/anonymous-relationship.feature.js +69 -0
  43. package/libs/cli/cypher/src/lib/docs/features/anonymous-variable-length.feature.js +105 -0
  44. package/libs/cli/cypher/src/lib/docs/features/basic-filtering.feature.js +70 -0
  45. package/libs/cli/cypher/src/lib/docs/features/basic-optional-match.feature.js +99 -0
  46. package/libs/cli/cypher/src/lib/docs/features/basic-relationship.feature.js +125 -0
  47. package/libs/cli/cypher/src/lib/docs/features/index.js +51 -0
  48. package/libs/cli/cypher/src/lib/docs/features/limit.feature.js +50 -0
  49. package/libs/cli/cypher/src/lib/docs/features/match-nodes.feature.js +106 -0
  50. package/libs/cli/cypher/src/lib/docs/features/multiple-relationship-types.feature.js +105 -0
  51. package/libs/cli/cypher/src/lib/docs/features/order-by.feature.js +143 -0
  52. package/libs/cli/cypher/src/lib/docs/features/property-matching.feature.js +152 -0
  53. package/libs/cli/cypher/src/lib/docs/features/relationship-without-variable.feature.js +48 -0
  54. package/libs/cli/cypher/src/lib/docs/features/return-statement.feature.js +65 -0
  55. package/libs/cli/cypher/src/lib/docs/features/unidirected-relationship.feature.js +82 -0
  56. package/libs/cli/cypher/src/lib/docs/features/variable-length-path.feature.js +136 -0
  57. package/libs/cli/cypher/src/lib/docs/features/where-conditional.feature.js +187 -0
  58. package/libs/cli/cypher/src/lib/docs/features/where-operators.feature.js +302 -0
  59. package/libs/cli/cypher/src/lib/docs/prompts.js +36 -0
  60. package/libs/cli/cypher/src/lib/docs/specs.js +181 -0
  61. package/libs/cli/cypher/src/lib/executor/condition-evaluator.js +158 -0
  62. package/libs/cli/cypher/src/lib/executor/executor.js +83 -0
  63. package/libs/cli/cypher/src/lib/executor/graph.js +15 -0
  64. package/libs/cli/cypher/src/lib/executor/match-engine.js +153 -0
  65. package/libs/cli/cypher/src/lib/executor/pattern-matcher.js +109 -0
  66. package/libs/cli/cypher/src/lib/executor/relationship-navigator.js +64 -0
  67. package/libs/cli/cypher/src/lib/executor/result-formatter.js +143 -0
  68. package/libs/cli/cypher/src/lib/executor/traverse-engine.js +164 -0
  69. package/libs/cli/cypher/src/lib/executor/utils.js +37 -0
  70. package/libs/cli/cypher/src/lib/graph.stub.js +63 -0
  71. package/libs/cli/cypher/src/lib/index.js +74 -0
  72. package/libs/cli/cypher/src/lib/lexer.js +398 -0
  73. package/libs/cli/cypher/src/lib/parser.js +602 -0
  74. package/libs/cli/cypher/src/lib/validator/query-validator.js +95 -0
  75. package/libs/cli/cypher/src/lib/validator/supported-features.config.js +111 -0
  76. package/libs/cli/cypher/src/lib/validator/unsupported-features.config.js +150 -0
  77. package/libs/cli/shared/src/index.js +53 -0
  78. package/libs/cli/shared/src/lib/admin-token.js +121 -0
  79. package/libs/cli/shared/src/lib/config.js +49 -0
  80. package/libs/cli/shared/src/lib/consts.js +57 -0
  81. package/libs/cli/shared/src/lib/core.js +46 -0
  82. package/libs/cli/shared/src/lib/infrastructure/cli.js +47 -0
  83. package/libs/cli/shared/src/lib/infrastructure/config.js +47 -0
  84. package/libs/cli/shared/src/lib/infrastructure/config.reporitory.js +51 -0
  85. package/libs/cli/shared/src/lib/infrastructure/formatters/console-formatter.js +96 -0
  86. package/libs/cli/shared/src/lib/infrastructure/formatters/index.js +41 -0
  87. package/libs/cli/shared/src/lib/infrastructure/formatters/json-formatter.js +64 -0
  88. package/libs/cli/shared/src/lib/infrastructure/formatters/markdown-formatter.js +120 -0
  89. package/libs/cli/shared/src/lib/infrastructure/formatters/types.js +15 -0
  90. package/libs/cli/shared/src/lib/infrastructure/formatters/utils.js +72 -0
  91. package/libs/cli/shared/src/lib/infrastructure/git.js +147 -0
  92. package/libs/cli/shared/src/lib/infrastructure/http.js +257 -0
  93. package/libs/cli/shared/src/lib/infrastructure/markdown.js +95 -0
  94. package/libs/cli/shared/src/lib/infrastructure/transformers/embeddings.js +88 -0
  95. package/libs/cli/shared/src/lib/infrastructure/transformers/index.js +25 -0
  96. package/libs/cli/shared/src/lib/infrastructure/transformers/rag-eval.js +154 -0
  97. package/libs/cli/shared/src/lib/infrastructure/transformers/similarity.js +210 -0
  98. package/libs/cli/shared/src/lib/infrastructure/workspace.js +297 -0
  99. package/libs/cli/shared/src/lib/infrastructure/yaml.js +237 -0
  100. package/libs/cli/shared/src/lib/lowgular.config.js +120 -0
  101. package/libs/cli/shared/src/lib/token.js +135 -0
  102. package/libs/cli/shared/src/lib/utils/solution.util.js +35 -0
  103. package/libs/cli/shared/src/lib/utils/utils.js +89 -0
  104. package/libs/cli/typescript/src/index.js +21 -0
  105. package/libs/cli/typescript/src/lib/base/index.js +23 -0
  106. package/libs/cli/typescript/src/lib/base/nameable.js +34 -0
  107. package/libs/cli/typescript/src/lib/base/nodeable.js +36 -0
  108. package/libs/cli/typescript/src/lib/class.implementation.js +52 -0
  109. package/libs/cli/typescript/src/lib/core/declaration.registry.js +107 -0
  110. package/libs/cli/typescript/src/lib/core/design-pattern.js +55 -0
  111. package/libs/cli/typescript/src/lib/core/index.js +35 -0
  112. package/libs/cli/typescript/src/lib/core/navigable-declaration.js +69 -0
  113. package/libs/cli/typescript/src/lib/core/program-context.js +71 -0
  114. package/libs/cli/typescript/src/lib/core/syntax-kind.utils.js +40 -0
  115. package/libs/cli/typescript/src/lib/core/type.js +374 -0
  116. package/libs/cli/typescript/src/lib/declaration.abstraction.js +90 -0
  117. package/libs/cli/typescript/src/lib/decorator.implementation.js +35 -0
  118. package/libs/cli/typescript/src/lib/enum.implementation.js +35 -0
  119. package/libs/cli/typescript/src/lib/function-declaration.implementation.js +35 -0
  120. package/libs/cli/typescript/src/lib/index.js +57 -0
  121. package/libs/cli/typescript/src/lib/interface.implementation.js +51 -0
  122. package/libs/cli/typescript/src/lib/members/method-abstraction.resolver.js +90 -0
  123. package/libs/cli/typescript/src/lib/members/method-declaration.implementation.js +44 -0
  124. package/libs/cli/typescript/src/lib/members/method-signature.implementation.js +46 -0
  125. package/libs/cli/typescript/src/lib/members/method.util.js +32 -0
  126. package/libs/cli/typescript/src/lib/members/parameter.implementation.js +38 -0
  127. package/libs/cli/typescript/src/lib/members/property-declaration.implementation.js +64 -0
  128. package/libs/cli/typescript/src/lib/members/property-signature.implementation.js +34 -0
  129. package/libs/cli/typescript/src/lib/members/property.util.js +61 -0
  130. package/libs/cli/typescript/src/lib/members/statements/expressions/binary-expression.implementation.js +42 -0
  131. package/libs/cli/typescript/src/lib/members/statements/expressions/call-expression.implementation.js +114 -0
  132. package/libs/cli/typescript/src/lib/members/statements/expressions/expression.abstraction.js +188 -0
  133. package/libs/cli/typescript/src/lib/members/statements/expressions/property-access-expression.implementation.js +35 -0
  134. package/libs/cli/typescript/src/lib/members/statements/expressions/unary-expression.implementation.js +51 -0
  135. package/libs/cli/typescript/src/lib/members/statements/statement.implementation.js +49 -0
  136. package/libs/cli/typescript/src/lib/members/statements/utils.js +51 -0
  137. package/libs/cli/typescript/src/lib/plugins/built-in.plugin.js +258 -0
  138. package/libs/cli/typescript/src/lib/plugins/plugin.interface.js +15 -0
  139. package/libs/cli/typescript/src/lib/plugins/rxjs.plugin.js +228 -0
  140. package/libs/cli/typescript/src/lib/plugins/signal.plugin.js +126 -0
  141. package/libs/cli/typescript/src/lib/plugins/stubs.js +66 -0
  142. package/libs/cli/typescript/src/lib/type-alias.implementation.js +72 -0
  143. package/libs/cli/typescript/src/lib/utils.js +39 -0
  144. package/libs/cli/typescript/src/lib/variable-declaration.implementation.js +35 -0
  145. package/libs/core/codegular/src/index.js +21 -0
  146. package/libs/core/codegular/src/lib/index.js +29 -0
  147. package/libs/core/codegular/src/lib/node.js +112 -0
  148. package/libs/core/codegular/src/lib/program.js +92 -0
  149. package/libs/core/codegular/src/lib/string.js +168 -0
  150. package/libs/core/codegular/src/lib/type-checker.js +170 -0
  151. package/libs/core/codegular/src/lib/utils.js +347 -0
  152. package/main.js +43 -0
  153. package/package.json +12 -0
@@ -0,0 +1,398 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var lexer_exports = {};
19
+ __export(lexer_exports, {
20
+ Lexer: () => Lexer,
21
+ TokenType: () => TokenType
22
+ });
23
+ module.exports = __toCommonJS(lexer_exports);
24
+ var TokenType = /* @__PURE__ */ ((TokenType2) => {
25
+ TokenType2["MATCH"] = "MATCH";
26
+ TokenType2["OPTIONAL"] = "OPTIONAL";
27
+ TokenType2["RETURN"] = "RETURN";
28
+ TokenType2["WHERE"] = "WHERE";
29
+ TokenType2["AND"] = "AND";
30
+ TokenType2["OR"] = "OR";
31
+ TokenType2["AS"] = "AS";
32
+ TokenType2["IN"] = "IN";
33
+ TokenType2["NOT"] = "NOT";
34
+ TokenType2["IS"] = "IS";
35
+ TokenType2["NULL"] = "NULL";
36
+ TokenType2["TRUE"] = "TRUE";
37
+ TokenType2["FALSE"] = "FALSE";
38
+ TokenType2["STARTS"] = "STARTS";
39
+ TokenType2["ENDS"] = "ENDS";
40
+ TokenType2["CONTAINS"] = "CONTAINS";
41
+ TokenType2["WITH"] = "WITH";
42
+ TokenType2["LIMIT"] = "LIMIT";
43
+ TokenType2["ORDER"] = "ORDER";
44
+ TokenType2["BY"] = "BY";
45
+ TokenType2["ASC"] = "ASC";
46
+ TokenType2["DESC"] = "DESC";
47
+ TokenType2["IDENTIFIER"] = "IDENTIFIER";
48
+ TokenType2["LABEL"] = "LABEL";
49
+ TokenType2["LPAREN"] = "LPAREN";
50
+ TokenType2["RPAREN"] = "RPAREN";
51
+ TokenType2["LBRACKET"] = "LBRACKET";
52
+ TokenType2["RBRACKET"] = "RBRACKET";
53
+ TokenType2["LBRACE"] = "LBRACE";
54
+ TokenType2["RBRACE"] = "RBRACE";
55
+ TokenType2["DASH"] = "DASH";
56
+ TokenType2["ARROW"] = "ARROW";
57
+ TokenType2["EQUALS"] = "EQUALS";
58
+ TokenType2["NOT_EQUALS"] = "NOT_EQUALS";
59
+ TokenType2["GT"] = "GT";
60
+ TokenType2["LT"] = "LT";
61
+ TokenType2["GTE"] = "GTE";
62
+ TokenType2["LTE"] = "LTE";
63
+ TokenType2["COMMA"] = "COMMA";
64
+ TokenType2["DOT"] = "DOT";
65
+ TokenType2["PIPE"] = "PIPE";
66
+ TokenType2["ASTERISK"] = "ASTERISK";
67
+ TokenType2["REGEX_MATCH"] = "REGEX_MATCH";
68
+ TokenType2["STRING"] = "STRING";
69
+ TokenType2["NUMBER"] = "NUMBER";
70
+ TokenType2["EOF"] = "EOF";
71
+ return TokenType2;
72
+ })(TokenType || {});
73
+ class Lexer {
74
+ constructor(input) {
75
+ this.input = input;
76
+ this.position = 0;
77
+ this.currentChar = input.length > 0 ? input[0] : null;
78
+ }
79
+ advance() {
80
+ this.position++;
81
+ this.currentChar = this.position >= this.input.length ? null : this.input[this.position];
82
+ }
83
+ skipWhitespace() {
84
+ while (this.currentChar && /\s/.test(this.currentChar)) {
85
+ this.advance();
86
+ }
87
+ }
88
+ readIdentifier() {
89
+ let result = "";
90
+ while (this.currentChar && /[a-zA-Z0-9_]/.test(this.currentChar)) {
91
+ result += this.currentChar;
92
+ this.advance();
93
+ }
94
+ return result;
95
+ }
96
+ readString() {
97
+ const quote = this.currentChar;
98
+ this.advance();
99
+ let result = "";
100
+ while (this.currentChar && this.currentChar !== quote) {
101
+ if (this.currentChar === "\\") {
102
+ this.advance();
103
+ if (this.currentChar === "n") {
104
+ result += "\n";
105
+ } else if (this.currentChar === "t") {
106
+ result += " ";
107
+ } else {
108
+ result += this.currentChar;
109
+ }
110
+ this.advance();
111
+ } else {
112
+ result += this.currentChar;
113
+ this.advance();
114
+ }
115
+ }
116
+ if (this.currentChar === quote) {
117
+ this.advance();
118
+ }
119
+ return result;
120
+ }
121
+ readNumber() {
122
+ let result = "";
123
+ while (this.currentChar && /[0-9.]/.test(this.currentChar)) {
124
+ result += this.currentChar;
125
+ this.advance();
126
+ }
127
+ return result;
128
+ }
129
+ peekKeyword() {
130
+ const savedPos = this.position;
131
+ const savedChar = this.currentChar;
132
+ const keyword = this.readIdentifier();
133
+ this.position = savedPos;
134
+ this.currentChar = savedChar;
135
+ return keyword.length > 0 ? keyword.toUpperCase() : null;
136
+ }
137
+ tokenize() {
138
+ const tokens = [];
139
+ this.position = 0;
140
+ this.currentChar = this.input.length > 0 ? this.input[0] : null;
141
+ while (this.currentChar !== null) {
142
+ this.skipWhitespace();
143
+ if (!this.currentChar)
144
+ break;
145
+ const startPos = this.position;
146
+ const keyword = this.peekKeyword();
147
+ const keywordMap = {
148
+ MATCH: "MATCH" /* MATCH */,
149
+ OPTIONAL: "OPTIONAL" /* OPTIONAL */,
150
+ RETURN: "RETURN" /* RETURN */,
151
+ WHERE: "WHERE" /* WHERE */,
152
+ AND: "AND" /* AND */,
153
+ OR: "OR" /* OR */,
154
+ AS: "AS" /* AS */,
155
+ IN: "IN" /* IN */,
156
+ NOT: "NOT" /* NOT */,
157
+ IS: "IS" /* IS */,
158
+ NULL: "NULL" /* NULL */,
159
+ TRUE: "TRUE" /* TRUE */,
160
+ FALSE: "FALSE" /* FALSE */,
161
+ STARTS: "STARTS" /* STARTS */,
162
+ ENDS: "ENDS" /* ENDS */,
163
+ CONTAINS: "CONTAINS" /* CONTAINS */,
164
+ WITH: "WITH" /* WITH */,
165
+ LIMIT: "LIMIT" /* LIMIT */,
166
+ ORDER: "ORDER" /* ORDER */,
167
+ BY: "BY" /* BY */,
168
+ ASC: "ASC" /* ASC */,
169
+ DESC: "DESC" /* DESC */
170
+ };
171
+ if (keyword && keywordMap[keyword]) {
172
+ tokens.push({
173
+ type: keywordMap[keyword],
174
+ value: keyword,
175
+ position: startPos
176
+ });
177
+ this.readIdentifier();
178
+ continue;
179
+ }
180
+ switch (this.currentChar) {
181
+ case "(":
182
+ tokens.push({
183
+ type: "LPAREN" /* LPAREN */,
184
+ value: "(",
185
+ position: startPos
186
+ });
187
+ this.advance();
188
+ break;
189
+ case ")":
190
+ tokens.push({
191
+ type: "RPAREN" /* RPAREN */,
192
+ value: ")",
193
+ position: startPos
194
+ });
195
+ this.advance();
196
+ break;
197
+ case "[":
198
+ tokens.push({
199
+ type: "LBRACKET" /* LBRACKET */,
200
+ value: "[",
201
+ position: startPos
202
+ });
203
+ this.advance();
204
+ break;
205
+ case "]":
206
+ tokens.push({
207
+ type: "RBRACKET" /* RBRACKET */,
208
+ value: "]",
209
+ position: startPos
210
+ });
211
+ this.advance();
212
+ break;
213
+ case "{":
214
+ tokens.push({
215
+ type: "LBRACE" /* LBRACE */,
216
+ value: "{",
217
+ position: startPos
218
+ });
219
+ this.advance();
220
+ break;
221
+ case "}":
222
+ tokens.push({
223
+ type: "RBRACE" /* RBRACE */,
224
+ value: "}",
225
+ position: startPos
226
+ });
227
+ this.advance();
228
+ break;
229
+ case "<":
230
+ if (this.position + 1 < this.input.length && this.input[this.position + 1] === "-") {
231
+ tokens.push({
232
+ type: "ARROW" /* ARROW */,
233
+ value: "<-",
234
+ position: startPos
235
+ });
236
+ this.advance();
237
+ this.advance();
238
+ } else if (this.position + 1 < this.input.length && this.input[this.position + 1] === "=") {
239
+ tokens.push({
240
+ type: "LTE" /* LTE */,
241
+ value: "<=",
242
+ position: startPos
243
+ });
244
+ this.advance();
245
+ this.advance();
246
+ } else {
247
+ tokens.push({
248
+ type: "LT" /* LT */,
249
+ value: "<",
250
+ position: startPos
251
+ });
252
+ this.advance();
253
+ }
254
+ break;
255
+ case "-":
256
+ if (this.position + 1 < this.input.length && this.input[this.position + 1] === ">") {
257
+ tokens.push({
258
+ type: "ARROW" /* ARROW */,
259
+ value: "->",
260
+ position: startPos
261
+ });
262
+ this.advance();
263
+ this.advance();
264
+ } else {
265
+ tokens.push({
266
+ type: "DASH" /* DASH */,
267
+ value: "-",
268
+ position: startPos
269
+ });
270
+ this.advance();
271
+ }
272
+ break;
273
+ case "=":
274
+ if (this.position + 1 < this.input.length && this.input[this.position + 1] === "~") {
275
+ tokens.push({
276
+ type: "REGEX_MATCH" /* REGEX_MATCH */,
277
+ value: "=~",
278
+ position: startPos
279
+ });
280
+ this.advance();
281
+ this.advance();
282
+ } else {
283
+ tokens.push({
284
+ type: "EQUALS" /* EQUALS */,
285
+ value: "=",
286
+ position: startPos
287
+ });
288
+ this.advance();
289
+ }
290
+ break;
291
+ case "!":
292
+ if (this.position + 1 < this.input.length && this.input[this.position + 1] === "=") {
293
+ tokens.push({
294
+ type: "NOT_EQUALS" /* NOT_EQUALS */,
295
+ value: "!=",
296
+ position: startPos
297
+ });
298
+ this.advance();
299
+ this.advance();
300
+ } else {
301
+ throw new Error(`Unexpected character: ! at position ${startPos}`);
302
+ }
303
+ break;
304
+ case ">":
305
+ if (this.position + 1 < this.input.length && this.input[this.position + 1] === "=") {
306
+ tokens.push({
307
+ type: "GTE" /* GTE */,
308
+ value: ">=",
309
+ position: startPos
310
+ });
311
+ this.advance();
312
+ this.advance();
313
+ } else {
314
+ tokens.push({
315
+ type: "GT" /* GT */,
316
+ value: ">",
317
+ position: startPos
318
+ });
319
+ this.advance();
320
+ }
321
+ break;
322
+ case ",":
323
+ tokens.push({
324
+ type: "COMMA" /* COMMA */,
325
+ value: ",",
326
+ position: startPos
327
+ });
328
+ this.advance();
329
+ break;
330
+ case ".":
331
+ tokens.push({
332
+ type: "DOT" /* DOT */,
333
+ value: ".",
334
+ position: startPos
335
+ });
336
+ this.advance();
337
+ break;
338
+ case "|":
339
+ tokens.push({
340
+ type: "PIPE" /* PIPE */,
341
+ value: "|",
342
+ position: startPos
343
+ });
344
+ this.advance();
345
+ break;
346
+ case "*":
347
+ tokens.push({
348
+ type: "ASTERISK" /* ASTERISK */,
349
+ value: "*",
350
+ position: startPos
351
+ });
352
+ this.advance();
353
+ break;
354
+ case ":":
355
+ tokens.push({
356
+ type: "LABEL" /* LABEL */,
357
+ value: ":",
358
+ position: startPos
359
+ });
360
+ this.advance();
361
+ break;
362
+ case '"':
363
+ case "'":
364
+ tokens.push({
365
+ type: "STRING" /* STRING */,
366
+ value: this.readString(),
367
+ position: startPos
368
+ });
369
+ break;
370
+ default:
371
+ if (/[0-9]/.test(this.currentChar)) {
372
+ tokens.push({
373
+ type: "NUMBER" /* NUMBER */,
374
+ value: this.readNumber(),
375
+ position: startPos
376
+ });
377
+ } else if (/[a-zA-Z_]/.test(this.currentChar)) {
378
+ tokens.push({
379
+ type: "IDENTIFIER" /* IDENTIFIER */,
380
+ value: this.readIdentifier(),
381
+ position: startPos
382
+ });
383
+ } else {
384
+ throw new Error(
385
+ `Unexpected character: ${this.currentChar} at position ${startPos}`
386
+ );
387
+ }
388
+ }
389
+ }
390
+ tokens.push({ type: "EOF" /* EOF */, value: "", position: this.position });
391
+ return tokens;
392
+ }
393
+ }
394
+ // Annotate the CommonJS export names for ESM import in node:
395
+ 0 && (module.exports = {
396
+ Lexer,
397
+ TokenType
398
+ });