Skip to content

Commit

Permalink
Remove attributes for a sec
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-y committed Sep 13, 2024
1 parent e50b69b commit 8d660d5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/syntax-objects/syntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ export abstract class Syntax {
/** For tagged unions */
abstract readonly syntaxType: string;
readonly syntaxId = getSyntaxId();
private attributes: Map<string, unknown>;
// private attributes: Map<string, unknown>;
location?: SourceLocation;
parent?: Expr;

constructor(metadata: SyntaxMetadata) {
const { location, parent } = metadata;
this.location = location;
this.parent = parent;
this.attributes = metadata.attributes ?? new Map();
// this.attributes = metadata.attributes ?? new Map();
}

get parentFn(): Fn | undefined {
Expand All @@ -65,7 +65,7 @@ export abstract class Syntax {
return {
location: this.location,
parent: this.parent,
attributes: new Map(this.attributes),
// attributes: new Map(this.attributes),
};
}

Expand Down Expand Up @@ -130,17 +130,17 @@ export abstract class Syntax {
/** Should emit in compliance with core language spec */
abstract toJSON(): unknown;

setAttribute(key: string, value: unknown) {
this.attributes.set(key, value);
}
// setAttribute(key: string, value: unknown) {
// this.attributes.set(key, value);
// }

getAttribute(key: string): unknown {
return this.attributes.get(key);
}
// getAttribute(key: string): unknown {
// return this.attributes.get(key);
// }

hasAttribute(key: string): boolean {
return this.attributes.has(key);
}
// hasAttribute(key: string): boolean {
// return this.attributes.has(key);
// }

isScopedEntity(): this is ScopedEntity {
return (this as unknown as ScopedEntity).lexicon instanceof LexicalContext;
Expand Down

0 comments on commit 8d660d5

Please sign in to comment.