Skip to content

Commit 4a0b834

Browse files
authored
Merge pull request #38 from belivo/typeofInAttributes
support typeof in attribute parameters
2 parents a8f8948 + 951e37f commit 4a0b834

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

spec/csharp/ClassInsideNamespace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace MyNamespace
44
{
55
[SomeAttribute]
6-
[SomeAttributeWithParameters(MyName = "Foo", 28, Framework.Blah)]
6+
[SomeAttributeWithParameters(MyName = "Foo", 28, Framework.Blah, typeof(BlahBlah))]
77
abstract class MyPoco<WithGenerics> where WithGenerics : new()
88
{
99
public string[] Name { get; set; }

src/RegExHelper.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
return this.wrapInGroup(capture, false, "'" + this.wrapInGroup(false, false, "\\\\?.") + "'");
4848
}
4949

50+
public getTypeOfRegex(capture: boolean) {
51+
return this.wrapInGroup(capture, false, "typeof" + this.wrapInGroup(false, true, this.getMethodParametersWrapperRegex(false, false)));
52+
}
53+
5054
public getLiteralRegex(capture: boolean) {
5155
return this.wrapInGroup(capture, true,
5256
this.getLiteralNumberRegex(false) + "{1}?|" +
@@ -289,7 +293,8 @@
289293
var result = "";
290294

291295
result += this.wrapInGroup(false, true, this.getNameRegex(captureName) + "=") + "??";
292-
result += this.getLiteralRegex(captureValue);
296+
result += this.getLiteralRegex(captureValue) + "|";
297+
result += this.getTypeOfRegex(captureValue);
293298

294299
return this.wrapInGroup(capture, true, result);
295300
}

0 commit comments

Comments
 (0)