Skip to content

Commit

Permalink
fix issue parsing code note containing bitflags string and array size…
Browse files Browse the repository at this point in the history
… notation (#430)
  • Loading branch information
Jamiras authored Feb 11, 2024
1 parent 299348c commit 966e11a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/Data/CodeNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private void CalculateLength()
if (Char.IsLetter(c) && c != 's' && c != 'S')
{
bitIndex = token.IndexOf("bit", StringComparison.OrdinalIgnoreCase);
byteIndex = token.IndexOf("byte", StringComparison.OrdinalIgnoreCase);
continue;
}
}
Expand Down
2 changes: 2 additions & 0 deletions Tests/Data/CodeNoteTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class CodeNoteTests

[TestCase("100 32-bit pointers [400 bytes]", 400, FieldSize.DWord)]
[TestCase("[400 bytes] 100 32-bit pointers", 400, FieldSize.None)]

[TestCase("Bitflags (array of ~40 bytes)", 40, FieldSize.None)]
public void TestGetSizeFromNote(string note, int expectedLength, FieldSize expectedFieldSize)
{
var n = new CodeNote(1, note);
Expand Down

0 comments on commit 966e11a

Please sign in to comment.