Skip to content

Commit

Permalink
Merge branch 'release/9.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Feb 18, 2019
2 parents bf16736 + cbba1f9 commit 5aff704
Show file tree
Hide file tree
Showing 6 changed files with 410 additions and 268 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<a name="9.1.1"></a>
## [9.1.1](https://github.com/mangalam-research/salve/compare/v9.1.0...v9.1.1) (2019-02-18)


### Bug Fixes

* add back event stringification ([8c651f4](https://github.com/mangalam-research/salve/commit/8c651f4))



<a name="9.1.0"></a>
# [9.1.0](https://github.com/mangalam-research/salve/compare/v9.0.1...v9.1.0) (2019-02-13)

Expand Down
17 changes: 17 additions & 0 deletions lib/salve/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ export abstract class Event {
* @returns Whether the events are equal.
*/
abstract equals(other: Event): boolean;

/**
* Provide a specialized string representation of the event.
*/
abstract toString(): string;
}

/**
Expand All @@ -69,6 +74,10 @@ export abstract class NamePatternEvent<Name extends string> extends Event {
return this.name === other.name && this.namePattern.toString() ===
(other as NamePatternEvent<string>).namePattern.toString();
}

toString(): string {
return `Event: ${this.name}, ${this.namePattern}`;
}
}

export class EnterStartTagEvent extends NamePatternEvent<"enterStartTag"> {
Expand All @@ -91,6 +100,10 @@ export class LeaveStartTagEvent extends Event {
equals(other: Event): boolean {
return this.name === other.name;
}

toString(): string {
return `Event: ${this.name}`;
}
}

export class EndTagEvent extends NamePatternEvent<"endTag"> {
Expand Down Expand Up @@ -130,6 +143,10 @@ export abstract class ValueEvent<Name extends string> extends Event {
return this.name === other.name && this.value.toString() ===
(other as ValueEvent<string>).value.toString();
}

toString(): string {
return `Event: ${this.name}, ${this.value}`;
}
}

export class AttributeValueEvent extends ValueEvent<"attributeValue"> {
Expand Down
2 changes: 1 addition & 1 deletion lib/salve/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright Mangalam Research Center for Buddhist Languages
*/

export const version: string = "9.1.0";
export const version: string = "9.1.1";

export { eventsToTreeString, EventSet, Grammar, GrammarWalker,
BasePattern, RefError, FireEventResult,
Expand Down
Loading

0 comments on commit 5aff704

Please sign in to comment.