Updated language compiler for mono compat.
--HG-- extra : convert_revision : svn%3A11aa8812-6de0-41ed-92bd-ec94540cc92c%4057381
This commit is contained in:
Родитель
f0ae799cde
Коммит
a963fbcbf7
|
@ -53,7 +53,7 @@ namespace ColorCode.Compilation
|
|||
CompiledLanguage compiledLanguage = languageCompiler.Compile(stubLanguage);
|
||||
|
||||
Assert.Equal(@"(?x)
|
||||
(?-x-i-s)(?m)(a language rule)(?x)", compiledLanguage.Regex.ToString());
|
||||
(?-xis)(?m)(a language rule)(?x)", compiledLanguage.Regex.ToString());
|
||||
Assert.Null(compiledLanguage.Captures[0]);
|
||||
Assert.Equal("style for whole rule", compiledLanguage.Captures[1]);
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ namespace ColorCode.Compilation
|
|||
CompiledLanguage compiledLanguage = languageCompiler.Compile(stubLanguage);
|
||||
|
||||
Assert.Equal(@"(?x)
|
||||
(?-x-i-s)(?m)((a) (language) (rule))(?x)", compiledLanguage.Regex.ToString());
|
||||
(?-xis)(?m)((a) (language) (rule))(?x)", compiledLanguage.Regex.ToString());
|
||||
Assert.Null(compiledLanguage.Captures[0]);
|
||||
Assert.Null(compiledLanguage.Captures[1]);
|
||||
Assert.Equal("style for the a part", compiledLanguage.Captures[2]);
|
||||
|
@ -109,7 +109,7 @@ namespace ColorCode.Compilation
|
|||
CompiledLanguage compiledLanguage = languageCompiler.Compile(stubLanguage);
|
||||
|
||||
Assert.Equal(@"(?x)
|
||||
(?-x-i-s)(?m)((a) (language) (rule))(?x)", compiledLanguage.Regex.ToString());
|
||||
(?-xis)(?m)((a) (language) (rule))(?x)", compiledLanguage.Regex.ToString());
|
||||
Assert.Null(compiledLanguage.Captures[0]);
|
||||
Assert.Equal("style for whole rule", compiledLanguage.Captures[1]);
|
||||
Assert.Equal("style for the a part", compiledLanguage.Captures[2]);
|
||||
|
@ -143,11 +143,11 @@ namespace ColorCode.Compilation
|
|||
CompiledLanguage compiledLanguage = languageCompiler.Compile(stubLanguage);
|
||||
|
||||
Assert.Equal(@"(?x)
|
||||
(?-x-i-s)(?m)((a) (language) (rule))(?x)
|
||||
(?-xis)(?m)((a) (language) (rule))(?x)
|
||||
|
||||
|
|
||||
|
||||
(?-x-i-s)(?m)(a (second) language rule)(?x)", compiledLanguage.Regex.ToString());
|
||||
(?-xis)(?m)(a (second) language rule)(?x)", compiledLanguage.Regex.ToString());
|
||||
Assert.Null(compiledLanguage.Captures[0]);
|
||||
Assert.Equal("style for whole rule", compiledLanguage.Captures[1]);
|
||||
Assert.Equal("style for the a part", compiledLanguage.Captures[2]);
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace ColorCode.Compilation
|
|||
regex.AppendLine();
|
||||
}
|
||||
|
||||
regex.AppendFormat("(?-x-i-s)(?m)({0})(?x)", languageRule.Regex);
|
||||
regex.AppendFormat("(?-xis)(?m)({0})(?x)", languageRule.Regex);
|
||||
|
||||
int numberOfCaptures = GetNumberOfCaptures(languageRule.Regex);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче