Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add comment highlighting to ASM blocks

Fixes issue #5
  • Loading branch information...
commit bdb5ab7de8c45a51d355e5a47c875da97dc81c3e 1 parent 898c04d
Jesse Phillips authored
Showing with 15 additions and 1 deletion.
  1. +1 −1  syntax/d.vim
  2. +14 −0 tests/asm.d
2  syntax/d.vim
View
@@ -384,7 +384,7 @@ hi def link dExternIdentifier Identifier
" Marks contents of the asm statment body as special
syn match dAsmStatement "\<asm\>"
-syn region dAsmBody start="asm[\n]*\s*{"hs=e+1 end="}"he=e-1 contains=dAsmStatement,dAsmOpCode
+syn region dAsmBody start="asm[\n]*\s*{"hs=e+1 end="}"he=e-1 contains=dAsmStatement,dAsmOpCode,dBlockComment,dNestedComment,dLineComment,DUserLabel
hi def link dAsmBody dUnicode
hi def link dAsmStatement dStatement
14 tests/asm.d
View
@@ -0,0 +1,14 @@
+struct Foo { int a,b,c; }
+int bar(Foo *f) {
+ asm {
+ // This is a comment
+ mov EBX,f ;
+ /* This is a comment */
+ mov EAX,Foo.b.offsetof[EBX] ;
+ /+ This is a comment +/
+ }
+}
+void main() {
+ Foo f = Foo(0, 2, 0);
+ assert(bar(&f) == 2);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.