-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update TypeScript Scanner code to TypeScript current main (microsoft/…
- Loading branch information
1 parent
08e74ed
commit 1b7ffa9
Showing
13 changed files
with
1,858 additions
and
191 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
namespace Serenity.TypeScript; | ||
|
||
partial class Scanner | ||
{ | ||
private static readonly Dictionary<int, RegularExpressionFlags> CharCodeToRegExpFlag = new() | ||
{ | ||
[CharacterCodes.d] = RegularExpressionFlags.HasIndices, | ||
[CharacterCodes.g] = RegularExpressionFlags.Global, | ||
[CharacterCodes.i] = RegularExpressionFlags.IgnoreCase, | ||
[CharacterCodes.m] = RegularExpressionFlags.Multiline, | ||
[CharacterCodes.s] = RegularExpressionFlags.DotAll, | ||
[CharacterCodes.u] = RegularExpressionFlags.Unicode, | ||
[CharacterCodes.v] = RegularExpressionFlags.UnicodeSets, | ||
[CharacterCodes.y] = RegularExpressionFlags.Sticky, | ||
}; | ||
|
||
RegularExpressionFlags? CharacterCodeToRegularExpressionFlag(int ch) | ||
{ | ||
return CharCodeToRegExpFlag.TryGetValue(ch, out RegularExpressionFlags value) ? value : null; | ||
} | ||
|
||
private static readonly Dictionary<RegularExpressionFlags, LanguageFeatureMinimumTarget> RegExpFlagToFirstAvailableLanguageVersion = new() | ||
{ | ||
[RegularExpressionFlags.HasIndices] = LanguageFeatureMinimumTarget.RegularExpressionFlagsHasIndices, | ||
[RegularExpressionFlags.DotAll] = LanguageFeatureMinimumTarget.RegularExpressionFlagsDotAll, | ||
[RegularExpressionFlags.Unicode] = LanguageFeatureMinimumTarget.RegularExpressionFlagsUnicode, | ||
[RegularExpressionFlags.UnicodeSets] = LanguageFeatureMinimumTarget.RegularExpressionFlagsUnicodeSets, | ||
[RegularExpressionFlags.Sticky] = LanguageFeatureMinimumTarget.RegularExpressionFlagsSticky | ||
}; | ||
|
||
public class RegexGroupNameRef : TextRange | ||
{ | ||
public string Name { get; set; } | ||
} | ||
|
||
public class RegexDecimalEscape : TextRange | ||
{ | ||
public decimal Value { get; set; } | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.