Browse Source

Merge Python and Ruby addin to trunk.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5612 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Matt Ward 16 years ago
parent
commit
19d1eb15b3
  1. 15
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/Python.xshd
  2. 62
      src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonSyntaxModeTestFixture.cs
  3. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/Tests/PythonParserHelperTests.cs
  4. 1326
      src/AddIns/BackendBindings/Ruby/IronRuby/CHANGELOG.txt
  5. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.Libraries.Yaml.dll
  6. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.Libraries.dll
  7. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.dll
  8. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Dynamic.dll
  9. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.Debugging.dll
  10. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.dll
  11. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/ir.exe
  12. 6
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/ir.exe.config
  13. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding.sln
  14. 5
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyParser.cs
  15. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RunRubyCommand.cs
  16. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Templates/ConsoleProject.xpt
  17. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Templates/FormsProject.xpt
  18. 8
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/ir.exe.config
  19. 1
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Converter/ConvertToRubyProjectCommandTestFixture.cs
  20. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/DebugRunRubyCommandTestFixture.cs
  21. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RunRubyCommandTestFixture.cs
  22. 1
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/AddInHelper.cs

15
src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/Python.xshd

@ -11,16 +11,16 @@
<Delimiters>()[]{}@,:.`=;+-*/% &amp;|^&gt;&lt;</Delimiters> <Delimiters>()[]{}@,:.`=;+-*/% &amp;|^&gt;&lt;</Delimiters>
<Span name="Char" stopateol="true" color="Magenta" escapecharacter="\">
<Begin>'</Begin>
<End>'</End>
</Span>
<Span name="DocComment" color="Green"> <Span name="DocComment" color="Green">
<Begin>"""</Begin> <Begin>"""</Begin>
<End>"""</End> <End>"""</End>
</Span> </Span>
<Span name="SingleQuoteDocComment" color="Green">
<Begin>'''</Begin>
<End>'''</End>
</Span>
<Span name="LineComment" stopateol="true" color="Green"> <Span name="LineComment" stopateol="true" color="Green">
<Begin>#</Begin> <Begin>#</Begin>
</Span> </Span>
@ -30,6 +30,11 @@
<End>"</End> <End>"</End>
</Span> </Span>
<Span name="Char" stopateol="true" color="Magenta" escapecharacter="\">
<Begin>'</Begin>
<End>'</End>
</Span>
<MarkPrevious bold="true" color="MidnightBlue">(</MarkPrevious> <MarkPrevious bold="true" color="MidnightBlue">(</MarkPrevious>
<KeyWords name="BuiltInStatements" bold="true" color="MidnightBlue"> <KeyWords name="BuiltInStatements" bold="true" color="MidnightBlue">

62
src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonSyntaxModeTestFixture.cs

@ -34,6 +34,7 @@ namespace PythonBinding.Tests
Span stringSpan; Span stringSpan;
Span charSpan; Span charSpan;
Span docCommentSpan; Span docCommentSpan;
Span singleQuoteDocCommentSpan;
const string SyntaxModePath = SyntaxModeDoozer.Path; const string SyntaxModePath = SyntaxModeDoozer.Path;
XmlElement importsKeyWordsElement; XmlElement importsKeyWordsElement;
XmlElement iterationStatementsKeyWordsElement; XmlElement iterationStatementsKeyWordsElement;
@ -139,6 +140,8 @@ namespace PythonBinding.Tests
charSpan = s; charSpan = s;
} else if (s.Name == "DocComment") { } else if (s.Name == "DocComment") {
docCommentSpan = s; docCommentSpan = s;
} else if (s.Name == "SingleQuoteDocComment") {
singleQuoteDocCommentSpan = s;
} }
} }
} }
@ -246,6 +249,65 @@ namespace PythonBinding.Tests
Assert.AreEqual(expectedColor.ToString(), docCommentSpan.Color.ToString()); Assert.AreEqual(expectedColor.ToString(), docCommentSpan.Color.ToString());
} }
[Test]
public void DocCommentSpanOccursBeforeStringSpan()
{
Assert.IsTrue(SpanOccursBefore("DocComment", "String"));
}
bool SpanOccursBefore(string before, string after)
{
int beforeIndex = -1;
int afterIndex = -1;
for (int i = 0; i < defaultRuleSet.Spans.Count; ++i) {
Span span = (Span)defaultRuleSet.Spans[i];
if (span.Name == before) {
beforeIndex = i;
} else if (span.Name == after) {
afterIndex = i;
}
}
Assert.AreNotEqual(-1, beforeIndex);
Assert.AreNotEqual(-1, afterIndex);
return beforeIndex < afterIndex;
}
[Test]
public void SingleQuoteDocCommentStopAtEndOfLine()
{
Assert.IsFalse(singleQuoteDocCommentSpan.StopEOL);
}
[Test]
public void SingleQuoteDocCommentBegin()
{
char[] begin = new char[] {'\'', '\'', '\''};
Assert.AreEqual(begin, singleQuoteDocCommentSpan.Begin);
}
[Test]
public void SingleQuoteDocCommentEnd()
{
char[] begin = new char[] {'\'', '\'', '\''};
Assert.AreEqual(begin, singleQuoteDocCommentSpan.End);
}
[Test]
public void SingleQuoteDocCommentSpanColor()
{
HighlightColor expectedColor = new HighlightColor(Color.Green, false, false);
Assert.AreEqual(expectedColor.ToString(), singleQuoteDocCommentSpan.Color.ToString());
}
[Test]
public void SingleQuoteDocCommentSpanOccursBeforeCharSpan()
{
Assert.IsTrue(SpanOccursBefore("DocComment", "Char"));
}
[Test] [Test]
public void ImportsKeyWordsExist() public void ImportsKeyWordsExist()
{ {

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/Tests/PythonParserHelperTests.cs

@ -24,7 +24,7 @@ namespace PythonBinding.Tests.Utils.Tests
"pass"; "pass";
ParseInformation parseInfo = PythonParserHelper.CreateParseInfo(code); ParseInformation parseInfo = PythonParserHelper.CreateParseInfo(code);
Assert.AreEqual("foo", parseInfo.MostRecentCompilationUnit.Classes[0].Name); Assert.AreEqual("foo", parseInfo.CompilationUnit.Classes[0].Name);
} }
[Test] [Test]

1326
src/AddIns/BackendBindings/Ruby/IronRuby/CHANGELOG.txt

File diff suppressed because it is too large Load Diff

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.Libraries.Yaml.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.Libraries.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Dynamic.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.Debugging.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/ir.exe

Binary file not shown.

6
src/AddIns/BackendBindings/Ruby/IronRuby/bin/ir.exe.config

@ -1,13 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<configuration> <configuration>
<configSections> <configSections>
<section name='microsoft.scripting' requirePermission='false' type='Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, Version=1.0.30207.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'/> <section name='microsoft.scripting' requirePermission='false' type='Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'/>
</configSections> </configSections>
<microsoft.scripting> <microsoft.scripting>
<languages> <languages>
<language extensions='.py' displayName='IronPython 2.6' type='IronPython.Runtime.PythonContext, IronPython, Version=2.6.10920.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' names='IronPython;Python;py'/> <language extensions='.py' displayName='IronPython 2.6.1' type='IronPython.Runtime.PythonContext, IronPython, Version=2.6.10920.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' names='IronPython;Python;py'/>
<language extensions='.rb' displayName='IronRuby' type='IronRuby.Runtime.RubyContext, IronRuby, Version=0.9.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' names='IronRuby;Ruby;rb'/> <language extensions='.rb' displayName='IronRuby' type='IronRuby.Runtime.RubyContext, IronRuby, Version=0.9.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' names='IronRuby;Ruby;rb'/>
</languages> </languages>
<options> <options>

2
src/AddIns/BackendBindings/Ruby/RubyBinding.sln

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 11.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010 # Visual Studio 2010
# SharpDevelop 4.0.0.5293 # SharpDevelop 4.0.0.5545
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RubyBinding", "RubyBinding\Project\RubyBinding.csproj", "{C896FFFF-5B6C-4B0E-B6DF-049865F501B4}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RubyBinding", "RubyBinding\Project\RubyBinding.csproj", "{C896FFFF-5B6C-4B0E-B6DF-049865F501B4}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RubyBinding.Tests", "RubyBinding\Test\RubyBinding.Tests.csproj", "{01DF0475-0CB2-4E81-971B-BADC60CDE3A5}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RubyBinding.Tests", "RubyBinding\Test\RubyBinding.Tests.csproj", "{01DF0475-0CB2-4E81-971B-BADC60CDE3A5}"

5
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyParser.cs

@ -7,6 +7,7 @@
using Microsoft.Scripting; using Microsoft.Scripting;
using Microsoft.Scripting.Hosting; using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Hosting.Providers;
using Microsoft.Scripting.Runtime; using Microsoft.Scripting.Runtime;
using System; using System;
using System.IO; using System.IO;
@ -73,8 +74,8 @@ namespace ICSharpCode.RubyBinding
if (scriptEngine == null) { if (scriptEngine == null) {
scriptEngine = Ruby.CreateEngine(); scriptEngine = Ruby.CreateEngine();
} }
RubyContext rubyContext = Ruby.GetExecutionContext(scriptEngine); RubyContext rubyContext = HostingHelpers.GetLanguageContext(scriptEngine) as RubyContext;
SourceUnit sourceUnit = rubyContext.CreateFileUnit(fileName, fileContent.Text); SourceUnit sourceUnit = rubyContext.CreateFileUnit(fileName, fileContent.Text);
RubyCompilerSink sink = new RubyCompilerSink(); RubyCompilerSink sink = new RubyCompilerSink();
RubyCompilerOptions compilerOptions = new RubyCompilerOptions((RubyOptions)rubyContext.Options); RubyCompilerOptions compilerOptions = new RubyCompilerOptions((RubyOptions)rubyContext.Options);

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RunRubyCommand.cs

@ -65,8 +65,8 @@ namespace ICSharpCode.RubyBinding
string GetArguments() string GetArguments()
{ {
// Get the Ruby script filename. // Get the Ruby script filename.
string rubyScriptFileName = "\"" + workbench.ActiveWorkbenchWindow.ActiveViewContent.PrimaryFileName + "\""; string rubyScriptFileName = Path.GetFileName(workbench.ActiveWorkbenchWindow.ActiveViewContent.PrimaryFileName);
string args = "-19 " + rubyScriptFileName; string args = "-1.9 " + rubyScriptFileName;
if (Debug) { if (Debug) {
return "-D " + args; return "-D " + args;

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Templates/ConsoleProject.xpt

@ -22,14 +22,14 @@
<PropertyGroup configuration="Debug" escapeValue="false"> <PropertyGroup configuration="Debug" escapeValue="false">
<DebugInfo>True</DebugInfo> <DebugInfo>True</DebugInfo>
<StartArguments>-19 -D Program.rb</StartArguments> <StartArguments>-1.9 -D Program.rb</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory> <StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction> <StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram> <StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram>
</PropertyGroup> </PropertyGroup>
<PropertyGroup configuration="Release" escapeValue="false"> <PropertyGroup configuration="Release" escapeValue="false">
<StartArguments>-19 Program.rb</StartArguments> <StartArguments>-1.9 Program.rb</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory> <StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction> <StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram> <StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram>

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Templates/FormsProject.xpt

@ -21,14 +21,14 @@
<PropertyGroup configuration="Debug" escapeValue="false"> <PropertyGroup configuration="Debug" escapeValue="false">
<DebugInfo>True</DebugInfo> <DebugInfo>True</DebugInfo>
<StartArguments>-19 -D Program.rb</StartArguments> <StartArguments>-1.9 -D Program.rb</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory> <StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction> <StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram> <StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram>
</PropertyGroup> </PropertyGroup>
<PropertyGroup configuration="Release" escapeValue="false"> <PropertyGroup configuration="Release" escapeValue="false">
<StartArguments>-19 Program.rb</StartArguments> <StartArguments>-1.9 Program.rb</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory> <StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction> <StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram> <StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram>

8
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/ir.exe.config

@ -1,17 +1,17 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<configuration> <configuration>
<configSections> <configSections>
<section name='microsoft.scripting' requirePermission='false' type='Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, Version=1.0.30207.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'/> <section name='microsoft.scripting' requirePermission='false' type='Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'/>
</configSections> </configSections>
<microsoft.scripting> <microsoft.scripting>
<languages> <languages>
<language extensions='.py' displayName='IronPython 2.6.1' type='IronPython.Runtime.PythonContext, IronPython, Version=2.6.10920.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' names='IronPython;Python;py'/> <language extensions='.py' displayName='IronPython 2.6.1' type='IronPython.Runtime.PythonContext, IronPython, Version=2.6.10920.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' names='IronPython;Python;py'/>
<language extensions='.rb' displayName='IronRuby' type='IronRuby.Runtime.RubyContext, IronRuby, Version=0.9.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' names='IronRuby;Ruby;rb'/> <language extensions='.rb' displayName='IronRuby' type='IronRuby.Runtime.RubyContext, IronRuby, Version=0.9.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' names='IronRuby;Ruby;rb'/>
</languages> </languages>
<options> <options>
<set language='Ruby' option='LibraryPaths' value='lib\IronRuby;lib\ruby\site_ruby\1.8;lib\ruby\site_ruby;lib\ruby\1.8'/> <set language='Ruby' option='LibraryPaths' value='..\lib\IronRuby;..\lib\ruby\site_ruby\1.8;..\lib\ruby\site_ruby;..\lib\ruby\1.8'/>
</options> </options>
</microsoft.scripting> </microsoft.scripting>
</configuration> </configuration>

1
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Converter/ConvertToRubyProjectCommandTestFixture.cs

@ -13,7 +13,6 @@ using ICSharpCode.Core;
using ICSharpCode.NRefactory; using ICSharpCode.NRefactory;
using ICSharpCode.RubyBinding; using ICSharpCode.RubyBinding;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.DefaultEditor.Codons;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
using NUnit.Framework; using NUnit.Framework;

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/DebugRunRubyCommandTestFixture.cs

@ -57,7 +57,7 @@ namespace RubyBinding.Tests
[Test] [Test]
public void ProcessInfoArgs() public void ProcessInfoArgs()
{ {
Assert.AreEqual("-D -19 \"C:\\Projects\\test.rb\"", debugger.ProcessStartInfo.Arguments); Assert.AreEqual("-D -1.9 test.rb", debugger.ProcessStartInfo.Arguments);
} }
} }
} }

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RunRubyCommandTestFixture.cs

@ -65,12 +65,12 @@ namespace RubyBinding.Tests
} }
/// <summary> /// <summary>
/// The -19 parameter is used to enable Ruby 1.9 mode otherwise UTF8 files cannot be processed. /// The -1.9 parameter is used to enable Ruby 1.9 mode otherwise UTF8 files cannot be processed.
/// </summary> /// </summary>
[Test] [Test]
public void ProcessInfoArgs() public void ProcessInfoArgs()
{ {
Assert.AreEqual("-19 \"C:\\Projects\\test.rb\"", debugger.ProcessStartInfo.Arguments); Assert.AreEqual("-1.9 test.rb", debugger.ProcessStartInfo.Arguments);
} }
[Test] [Test]

1
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/AddInHelper.cs

@ -9,7 +9,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.DefaultEditor.Codons;
namespace RubyBinding.Tests.Utils namespace RubyBinding.Tests.Utils
{ {

Loading…
Cancel
Save