summaryrefslogtreecommitdiffstats
path: root/llparse-builder/src/property.ts
diff options
context:
space:
mode:
Diffstat (limited to 'llparse-builder/src/property.ts')
-rw-r--r--llparse-builder/src/property.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/llparse-builder/src/property.ts b/llparse-builder/src/property.ts
new file mode 100644
index 0000000..cf2fe4b
--- /dev/null
+++ b/llparse-builder/src/property.ts
@@ -0,0 +1,12 @@
+export type PropertyType = 'i8' | 'i16' | 'i32' | 'i64' | 'ptr';
+
+/**
+ * Class describing allocated property in parser's state
+ */
+export class Property {
+ constructor(public readonly ty: PropertyType, public readonly name: string) {
+ if (/^_/.test(name)) {
+ throw new Error(`Can't use internal property name: "${name}"`);
+ }
+ }
+}