Skip to content

Commit

Permalink
Move regex $ comment to more appropriate line
Browse files Browse the repository at this point in the history
Signed-off-by: Hillel <h@hillelwayne.com>
  • Loading branch information
hwayne committed Dec 20, 2024
1 parent 0e58cc4 commit 023467e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parsers/pluscal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class TranspilerStdoutParser extends ProcessOutputHandler<DCollection> {
*
* So we can start looking for labels as soon as we see (1)
* and stop as soon as we stop seeing label strings.
*
*
*/
private tryParseAddedLabels(line: string) {
// https://github.com/tlaplus/tlaplus/blob/21f92/tlatools/org.lamport.tlatools/src/pcal/ParseAlgorithm.java#L668
Expand All @@ -125,7 +125,7 @@ export class TranspilerStdoutParser extends ProcessOutputHandler<DCollection> {
return false;
}

const matcher = /^\s\s([A-Za-z0-9_]+) at line \d+, column \d+/g.exec(line);
const matcher = /^\s\s([A-Za-z0-9_]+) at line \d+, column \d+/g.exec(line); // no closing `$` to handle macro statements
if (!matcher) { // done parsing
this.nowParsingAddedLabels = false;
return false;
Expand Down Expand Up @@ -165,7 +165,7 @@ export class TranspilerStdoutParser extends ProcessOutputHandler<DCollection> {
*/

private parseLabelLocation(line: string): LocationInfo | undefined {
const rxLocation = /\s*(?:at )?line (\d+), column (\d+)(?: of macro called at line (\d+), column (\d+))?.?\s*/g; // no closing `$`
const rxLocation = /\s*(?:at )?line (\d+), column (\d+)(?: of macro called at line (\d+), column (\d+))?.?\s*$/g;
const matches = rxLocation.exec(line);
if (!matches) {
return undefined;
Expand Down

0 comments on commit 023467e

Please sign in to comment.