Browse Source

Boo highlighting: fixed regex for regex literals

pull/14/head
Daniel Grunwald 15 years ago
parent
commit
b463371d1c
  1. 9
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/InteractiveInterpreter.cs
  2. 11
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Boo.xshd

9
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/InteractiveInterpreter.cs

@ -3,7 +3,9 @@ @@ -3,7 +3,9 @@
using System;
using System.Reflection;
using Boo.Lang.Compiler;
using Boo.Lang.Interpreter;
using Boo.Lang.Interpreter.Builtins;
using ICSharpCode.SharpDevelop.Gui;
namespace Grunwald.BooBinding
@ -72,7 +74,12 @@ namespace Grunwald.BooBinding @@ -72,7 +74,12 @@ namespace Grunwald.BooBinding
}
processing = true;
try {
interpreter.Eval(command);
CompilerContext results = interpreter.Eval(command);
if (results.Errors.Count > 0) {
PrintLine("ERROR: " + results.Errors[0].Message);
} else if (interpreter.LastValue != null) {
PrintLine(ReprModule.repr(interpreter.LastValue));
}
} catch (System.Reflection.TargetInvocationException ex) {
PrintLine(ex.InnerException);
}

11
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Boo.xshd

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
<SyntaxDefinition name="Boo" extensions=".boo" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Comment" foreground="Green" />
<Color name="String" foreground="Blue" />
<Color name="Regex" foreground="#FFFF6600" />
<RuleSet>
<Span color="Comment" multiline="true">
<Begin>"""</Begin>
@ -35,14 +36,14 @@ @@ -35,14 +36,14 @@
<Span begin="\\" end="." />
</RuleSet>
</Span>
<Span foreground="#FFFF6600" multiline="true">
<Span color="Regex" multiline="true">
<Begin>@/</Begin>
<End>/</End>
</Span>
<Span foreground="#FFFF6600">
<Begin>/(?!(\ ))</Begin>
<End>/</End>
</Span>
<!-- regex rule must be in front of any keywords -->
<Rule color="Regex">
/\S+/
</Rule>
<Keywords foreground="Black" fontWeight="bold">
<Word>self</Word>
<Word>super</Word>

Loading…
Cancel
Save