Skip to content

Commit

Permalink
version updated, and minor stype updates
Browse files Browse the repository at this point in the history
  • Loading branch information
HJLebbink committed Sep 29, 2019
1 parent 7468e78 commit 8d38a34
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 29 deletions.
3 changes: 2 additions & 1 deletion VS/CSHARP/asm-dude-vsix/BraceMatching/BraceMatchingTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ internal BraceMatchingTagger(ITextView view, ITextBuffer buffer)
};
this._view.Caret.PositionChanged += this.CaretPositionChanged;
this._view.LayoutChanged += this.ViewLayoutChanged;
} else
}
else
{
AsmDudeToolsStatic.Output_WARNING(string.Format("{0}:BraceMatchingTagger; file {1} contains {2} lines which is more than maxLines {3}; switching off brace matching", this.ToString(), AsmDudeToolsStatic.GetFilename(buffer), buffer.CurrentSnapshot.LineCount, AsmDudeToolsStatic.MaxFileLines));
}
Expand Down
3 changes: 2 additions & 1 deletion VS/CSHARP/asm-dude-vsix/CodeFolding/CodeFoldingTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public CodeFoldingTagger(

this._enabled = true;

if (buffer.CurrentSnapshot.LineCount >= AsmDudeToolsStatic.MaxFileLines) {
if (buffer.CurrentSnapshot.LineCount >= AsmDudeToolsStatic.MaxFileLines)
{
this._enabled = false;
AsmDudeToolsStatic.Output_WARNING(string.Format("{0}:CodeFoldingTagger; file {1} contains {2} lines which is more than maxLines {3}; switching off code folding", this.ToString(), AsmDudeToolsStatic.GetFilename(buffer), buffer.CurrentSnapshot.LineCount, AsmDudeToolsStatic.MaxFileLines));
}
Expand Down
3 changes: 2 additions & 1 deletion VS/CSHARP/asm-dude-vsix/HighlightWord/HighlightWordTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ public HighlightWordTagger(ITextView view, ITextBuffer buffer, ITextSearchServic
// or the caret is moved, we refresh our list of highlighted words.
this._view.Caret.PositionChanged += this.CaretPositionChanged;
this._view.LayoutChanged += this.ViewLayoutChanged;
} else
}
else
{
AsmDudeToolsStatic.Output_WARNING(string.Format("{0}:HighlightWordTagger; file {1} contains {2} lines which is more than maxLines {3}; switching off word highlighting", this.ToString(), AsmDudeToolsStatic.GetFilename(buffer), buffer.CurrentSnapshot.LineCount, AsmDudeToolsStatic.MaxFileLines));
}
Expand Down
4 changes: 2 additions & 2 deletions VS/CSHARP/asm-dude-vsix/QuickInfo/AsmQuickInfoSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ public static void RegisterCommandHandlers(Type controlType, bool acceptsRichCon

public static TextEditorWrapper CreateFor(TextBlock tb)
{
var textContainer = TextContainerProp.GetValue(tb);
object textContainer = TextContainerProp.GetValue(tb);

var editor = new TextEditorWrapper(textContainer, tb, false);
TextEditorWrapper editor = new TextEditorWrapper(textContainer, tb, false);
IsReadOnlyProp.SetValue(editor._editor, true);
TextViewProp.SetValue(editor._editor, TextContainerTextViewProp.GetValue(textContainer));

Expand Down
10 changes: 5 additions & 5 deletions VS/CSHARP/asm-dude-vsix/asm-dude-vsix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
<Version>10.0.3</Version>
</PackageReference>
<PackageReference Include="Extended.Wpf.Toolkit">
<Version>3.5.0</Version>
<Version>3.6.0</Version>
</PackageReference>
<PackageReference Include="LoadingIndicators.WPF">
<Version>0.0.1</Version>
Expand All @@ -349,7 +349,7 @@
<Version>1.2.0-beta2</Version>
</PackageReference>
<PackageReference Include="Microsoft.CSharp">
<Version>4.5.0</Version>
<Version>4.6.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.CoreUtility">
<Version>14.3.25407</Version>
Expand All @@ -373,10 +373,10 @@
<Version>14.3.25407</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading">
<Version>16.3.13</Version>
<Version>16.3.52</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers">
<Version>16.3.13</Version>
<Version>16.3.52</Version>
</PackageReference>
<PackageReference Include="Microsoft.Xaml">
<Version>4.0.0.1</Version>
Expand All @@ -398,7 +398,7 @@
<Version>1.2.0-beta2</Version>
</PackageReference>
<PackageReference Include="System.ComponentModel.Composition">
<Version>4.5.0</Version>
<Version>4.6.0</Version>
</PackageReference>
<PackageReference Include="System.Drawing.Primitives">
<Version>4.3.0</Version>
Expand Down
21 changes: 17 additions & 4 deletions VS/CSHARP/asm-sim-main/ProgramZ3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,31 @@ private static void Main(string[] args)
//TestMnemonic();
//Test_Rep();
//Test_Usage();
if (true) TestMemorySpeed();
if (true)
{
TestMemorySpeed();
}
//TestDynamicFlow();
//TestSIMD();
if (false) EmptyMemoryTest();
if (false)
{
EmptyMemoryTest();
}
//ProgramSynthesis1();
//TestFunctions();
//TacticTest();
//TestMemoryLeak();
//Test_NullReference_Bsf_1();

if (false) AsmSourceTools.SpeedTestMnemonic();
if (false) AsmSourceTools.SpeedTestRegister();
if (false)
{
AsmSourceTools.SpeedTestMnemonic();
}

if (false)
{
AsmSourceTools.SpeedTestRegister();
}

double elapsedSec = (double)(DateTime.Now.Ticks - startTime.Ticks) / 10000000;
Console.WriteLine(string.Format("Elapsed time " + elapsedSec + " sec"));
Expand Down
54 changes: 39 additions & 15 deletions VS/CSHARP/asm-tools-lib/Mnemonic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2463,7 +2463,7 @@ public enum Mnemonic

VP2INTERSECTD,
VP2INTERSECTQ
}
}

/// <summary>
/// Suffix for AT&T mnemonic
Expand Down Expand Up @@ -2495,12 +2495,12 @@ static AsmSourceTools()

private static string ToCapitals(string str, bool strIsCapitals)
{
#if DEBUG
#if DEBUG
if (strIsCapitals && (str != str.ToUpper()))
{
throw new Exception();
}
#endif
#endif
return (strIsCapitals) ? str : str.ToUpper();
}

Expand All @@ -2522,11 +2522,11 @@ private static bool IsAttType(char c)
{
switch (c)
{
case 'B':
case 'S':
case 'W':
case 'L':
case 'Q':
case 'B':
case 'S':
case 'W':
case 'L':
case 'Q':
case 'T': return true;
default: return false;
}
Expand Down Expand Up @@ -4708,10 +4708,22 @@ public static bool IsMnemonic(string keyword, bool strIsCapitals = false)
public static bool IsMnemonic_Att(string keyword, bool strIsCapitals = false)
{
int length = keyword.Length;
if (length < 2) return false;
if (length < 2)
{
return false;
}

string str2 = ToCapitals(keyword, strIsCapitals);
if (IsMnemonic(str2, true)) return true;
if (!IsAttType(str2[length - 1])) return false;
if (IsMnemonic(str2, true))
{
return true;
}

if (!IsAttType(str2[length - 1]))
{
return false;
}

return IsMnemonic(str2.Substring(0, length - 1), true);
}

Expand All @@ -4730,13 +4742,19 @@ public static void SpeedTestMnemonic()
stopwatch1.Start();
Mnemonic m1 = ParseMnemonic_OLD(str, strCapitals);
stopwatch1.Stop();
if (m1 != mnemonic) Console.WriteLine("NOT OK OLD mnemonic=" + mnemonic.ToString() + "; str=" + str + "; m1=" + m1.ToString());
if (m1 != mnemonic)
{
Console.WriteLine("NOT OK OLD mnemonic=" + mnemonic.ToString() + "; str=" + str + "; m1=" + m1.ToString());
}
}
{
stopwatch2.Start();
Mnemonic m1 = ParseMnemonic(str, strCapitals);
stopwatch2.Stop();
if (m1 != mnemonic) Console.WriteLine("NOT OK mnemonic=" + mnemonic.ToString() + "; str=" + str + "; m1=" + m1.ToString());
if (m1 != mnemonic)
{
Console.WriteLine("NOT OK mnemonic=" + mnemonic.ToString() + "; str=" + str + "; m1=" + m1.ToString());
}
}
}
}
Expand All @@ -4758,13 +4776,19 @@ public static void SpeedTestRegister()
stopwatch1.Start();
Rn m1 = RegisterTools.ParseRn_OLD(str, strCapitals);
stopwatch1.Stop();
if (m1 != mnemonic) Console.WriteLine("NOT OK OLD rn=" + mnemonic.ToString() + "; str=" + str + "; m1=" + m1.ToString());
if (m1 != mnemonic)
{
Console.WriteLine("NOT OK OLD rn=" + mnemonic.ToString() + "; str=" + str + "; m1=" + m1.ToString());
}
}
{
stopwatch2.Start();
Rn m1 = RegisterTools.ParseRn(str, strCapitals);
stopwatch2.Stop();
if (m1 != mnemonic) Console.WriteLine("NOT OK rn=" + mnemonic.ToString() + "; str=" + str + "; m1=" + m1.ToString());
if (m1 != mnemonic)
{
Console.WriteLine("NOT OK rn=" + mnemonic.ToString() + "; str=" + str + "; m1=" + m1.ToString());
}
}
}
}
Expand Down

0 comments on commit 8d38a34

Please sign in to comment.