aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2023-03-14 20:11:27 +0100
committerDanielGavin <danielgavin5@hotmail.com>2023-03-14 20:11:27 +0100
commit8314a4ee00e3d63e020935e2da0b525f9d5d4a83 (patch)
treea3abb723bd5b40841a1437ca858a732455156346 /tools
parent688060e56f6c92b543250bad002c4fb3e1cf741d (diff)
formatter: fix bug with odinfmt: disable and enable
Diffstat (limited to 'tools')
-rw-r--r--tools/odinfmt/tests/.snapshots/comments.odin16
-rw-r--r--tools/odinfmt/tests/comments.odin18
2 files changed, 33 insertions, 1 deletions
diff --git a/tools/odinfmt/tests/.snapshots/comments.odin b/tools/odinfmt/tests/.snapshots/comments.odin
index 7063971..9550b08 100644
--- a/tools/odinfmt/tests/.snapshots/comments.odin
+++ b/tools/odinfmt/tests/.snapshots/comments.odin
@@ -62,3 +62,19 @@ disabled_comments_with_multiple_statements_one_lined :: proc() {
i:int;b:int
//odinfmt: enable
}
+
+//odinfmt: disable
+AH :: Reg { index = 0b000, size = .Bits_8H }
+//
+AL :: Reg { index = 0b000, size = .Bits_8 }
+//
+AX :: Reg { index = 0b000, size = .Bits_16 }
+//
+EAX :: Reg { index = 0b000, size = .Bits_32 }
+
+//odinfmt: enable
+Instruction :: struct {
+ mnemonic: Mnemonic,
+ prefixes: LegacyPrefixes,
+ operands: []Operand,
+}
diff --git a/tools/odinfmt/tests/comments.odin b/tools/odinfmt/tests/comments.odin
index 0d5e547..658bc76 100644
--- a/tools/odinfmt/tests/comments.odin
+++ b/tools/odinfmt/tests/comments.odin
@@ -61,4 +61,20 @@ disabled_comments_with_multiple_statements_one_lined :: proc() {
//odinfmt: disable
i:int;b:int
//odinfmt: enable
-} \ No newline at end of file
+}
+
+//odinfmt: disable
+AH :: Reg { index = 0b000, size = .Bits_8H }
+//
+AL :: Reg { index = 0b000, size = .Bits_8 }
+//
+AX :: Reg { index = 0b000, size = .Bits_16 }
+//
+EAX :: Reg { index = 0b000, size = .Bits_32 }
+
+//odinfmt: enable
+Instruction :: struct {
+ mnemonic: Mnemonic,
+ prefixes: LegacyPrefixes,
+ operands: []Operand,
+}