From 4d372dc9b58c6fffd033969e6659cba71517d398 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Wed, 13 Jan 2010 13:57:46 +0000 Subject: [PATCH] Converted VBNet-Mode.xshd to new file format. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5401 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Highlighting/Resources/VBNET-Mode.xshd | 467 ++++++++---------- .../Highlighting/Xshd/V2Loader.cs | 8 +- 2 files changed, 211 insertions(+), 264 deletions(-) diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/VBNET-Mode.xshd b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/VBNET-Mode.xshd index 576e1edc5e..84cc5e64b8 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/VBNET-Mode.xshd +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/VBNET-Mode.xshd @@ -2,264 +2,209 @@ - - - - - - - - - - - - - ~!@%^*()-+=|\#/{}[]:;"'<>,.? - - - " - " - - - - # - - - - # - # - - - - ' - - - - REM@C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ~!@%^*()-+=|\#/{}[]:;"'<>,.? - - - - - - - - - - - - - - + + + + + + + " + " + + + + + + (?<=(^\s*))\# + + + + (?<!(^\s*))\# + \# + + + ''' + + + ' + + + \bREM\b + + + Boolean + Byte + Char + Date + Decimal + Double + Integer + Long + Object + SByte + Short + Single + String + UInteger + ULong + UShort + Variant + + + AddressOf + And + AndAlso + Is + IsNot + Like + Mod + New + Not + Or + OrElse + Xor + + + False + Me + MyBase + MyClass + Nothing + True + As + Of + New + End + CBool + CByte + CChar + CDate + CDec + CDbl + CInt + CLng + CObj + CSByte + CShort + CSng + CStr + CType + CUInt + CULng + CUShort + DirectCast + GetType + TryCast + TypeOf + ByRef + ByVal + Optional + ParamArray + Friend + Private + Protected + Public + Const + Custom + Default + Global + MustInherit + MustOverride + Narrowing + NotInheritable + NotOverridable + Overloads + Overridable + Overrides + Partial + ReadOnly + Shadows + Shared + Static + Widening + WithEvents + WriteOnly + Throw + Stop + Return + Resume + AddHandler + RemoveHandler + RaiseEvent + Option + Let + GoTo + GoSub + Call + Continue + Dim + ReDim + Erase + On + Error + Exit + Namespace + Class + Imports + Implements + Inherits + Interface + Delegate + Module + Structure + Enum + Sub + Function + Handles + Declare + Lib + Alias + Get + Set + Property + Operator + Event + SyncLock + Using + With + Do + While + Loop + Wend + Try + Catch + When + Finally + If + Then + Else + ElseIf + EndIf + For + To + Step + Each + In + Next + Select + Case + Ansi + Auto + Unicode + Preserve + Until + + + + + Const + If + ElseIf + Else + End + ExternalSource + Region + ExternalChecksum + + + \ No newline at end of file diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V2Loader.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V2Loader.cs index 4bc18cdeb8..f881ee72ef 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V2Loader.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V2Loader.cs @@ -210,6 +210,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting.Xshd { string ruleSet = reader.GetAttribute("ruleSet"); if (ruleSet != null) { + // '/' is valid in highlighting definition names, so we need the last occurence int pos = ruleSet.LastIndexOf('/'); if (pos >= 0) { return new XshdReference(ruleSet.Substring(0, pos), ruleSet.Substring(pos + 1)); @@ -226,7 +227,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting.Xshd if (name != null) { if (name.Length == 0) throw Error(reader, "The empty string is not a valid name."); - if (name.Contains("/")) + if (name.IndexOf('/') >= 0) throw Error(reader, "Element names must not contain a slash."); } } @@ -235,8 +236,9 @@ namespace ICSharpCode.AvalonEdit.Highlighting.Xshd static XshdColor ParseNamedColor(XmlReader reader) { XshdColor color = ParseColorAttributes(reader); - if (color.Foreground == null && color.FontWeight == null && color.FontStyle == null) - throw Error(reader, "A named color must have at least one element."); + // check removed: invisible named colors may be useful now that apps can read highlighting data + //if (color.Foreground == null && color.FontWeight == null && color.FontStyle == null) + // throw Error(reader, "A named color must have at least one element."); color.Name = reader.GetAttribute("name"); CheckElementName(reader, color.Name); return color;