Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions t/t4018/typescript-class-method
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export class RIGHT {
unique = 0
constructor () {
this.doNothing()
}
function ChangeMe() { }
}
7 changes: 7 additions & 0 deletions t/t4018/typescript-export-default-class
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default class RIGHT {
private x = 0;
private y = 0;
private z = 0;
// ChangeMe
render() {}
}
7 changes: 7 additions & 0 deletions t/t4018/typescript-export-function
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export async function RIGHT(url: string): Promise<string> {
const a = 1;
const b = 2;
const c = 3;
ChangeMe
return url;
}
15 changes: 15 additions & 0 deletions userdiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,21 @@ PATTERNS("scheme",
"|([^][)(}{[ \t])+"),
PATTERNS("tex", "^(\\\\((sub)*section|chapter|part)\\*{0,1}\\{.*)$",
"\\\\[a-zA-Z@]+|\\\\.|([a-zA-Z0-9]|[^\x01-\x7f])+"),
PATTERNS("typescript",
/* Starting with optional whitespace */
"^[ \t]*"
"("
/* Followed by an optional export and/or async and/or default keyword */
"(export[ \t]+)?(default[ \t]+)?(async[ \t]+)?"
/* Followed by either a function or class declaration */
"((function|class)[ \t]+[a-zA-Z_][a-zA-Z0-9_]*[^{]*)"
/* or */
"|"
/* a variable declaration with const, let, or var */
"^(const|let|var)[ \\t]+[a-zA-Z_][a-zA-Z0-9_]*[ \\t]*="
")",
/* -- */
"[a-zA-Z_][a-zA-Z0-9_]*"),
{ .name = "default", .binary = -1 },
};
#undef PATTERNS
Expand Down
Loading