Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

MshFormat.cs

namespace Nop.Services.Html.CodeFormatter;

/// 
/// Generates color-coded HTML 4.01 from MSH (code name Monad) source code.
/// 
public partial class MshFormat : CodeFormat
{
    /// 
    /// Regular expression string to match single line comments (#).
    /// 
    protected override string CommentRegex => @"#.*?(?=\r|\n)";

    /// 
    /// Regular expression string to match string and character literals. 
    /// 
    protected override string StringRegex => @"@?""""|@?"".*?(?!\\).""|''|'.*?(?!\\).'";

    /// 
    /// The list of MSH keywords.
    /// 
    protected override string Keywords => "function filter global script local private if else"
                                          + " elseif for foreach in while switch continue break"
                                          + " return default param begin process end throw trap";

    /// 
    /// Use preprocessors property to highlight operators.
    /// 
    protected override string Preprocessors => "-band -bor -match -notmatch -like -notlike -eq -ne"
                                               + " -gt -ge -lt -le -is -imatch -inotmatch -ilike"
                                               + " -inotlike -ieq -ine -igt -ige -ilt -ile";
}