/BlogEngine/BlogEngine.NET/App_Code/Extensions/CodeFormatter/MshFormat.cs
C# | 56 lines | 36 code | 5 blank | 15 comment | 0 complexity | 429a64aa2307963cf2abb390259b5731 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
- namespace CodeFormatter
- {
- /// <summary>
- /// Generates color-coded HTML 4.01 from MSH (code name Monad) source code.
- /// </summary>
- public class MshFormat : CodeFormat
- {
- #region Properties
-
- /// <summary>
- /// Regular expression string to match single line comments (#).
- /// </summary>
- protected override string CommentRegEx
- {
- get
- {
- return @"#.*?(?=\r|\n)";
- }
- }
-
- /// <summary>
- /// The list of MSH keywords.
- /// </summary>
- protected override string Keywords
- {
- get
- {
- return "function filter global script local private if else elseif for foreach in while switch continue break return default param begin process end throw trap";
- }
- }
-
- /// <summary>
- /// Use preprocessors property to hilight operators.
- /// </summary>
- protected override string Preprocessors
- {
- get
- {
- return "-band -bor -match -notmatch -like -notlike -eq -ne -gt -ge -lt -le -is -imatch -inotmatch -ilike -inotlike -ieq -ine -igt -ige -ilt -ile";
- }
- }
-
- /// <summary>
- /// Regular expression string to match string and character literals.
- /// </summary>
- protected override string StringRegEx
- {
- get
- {
- return @"@?""""|@?"".*?(?!\\).""|''|'.*?(?!\\).'";
- }
- }
-
- #endregion
- }
- }