Skip to content

Commit

Permalink
fix variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
kn1cht committed Feb 10, 2019
1 parent dee484f commit d83940a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/latex-to-ast/environment/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ export const BeginEnvironment = (

export const EndEnvironment = (context: Context): Parsimmon.Parser<null> =>
Parsimmon((input, i) => {
const pattern = context.name.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&');
const m = input.slice(i).match(new RegExp(`^\\\\end\\{${pattern}\\}`));
const p = context.name.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&');
const m = input.slice(i).match(new RegExp(`^\\\\end\\{${p}\\}`));
if (m !== null) {
return Parsimmon.makeSuccess(i + m[0].length, null);
} else {
return Parsimmon.makeFailure(i, `\\end{${pattern}}`);
return Parsimmon.makeFailure(i, `\\end{${p}}`);
}
});

Expand Down

0 comments on commit d83940a

Please sign in to comment.