code-d icon indicating copy to clipboard operation
code-d copied to clipboard

Function contract lacking syntax highlighting

Open HuskyNator opened this issue 2 years ago • 7 comments

When using an in contract for a function, the expression inside the parentheses is not highlighted if it is on the same line as the { bracket. When it's on a line before it it however does highlight correctly. When out is used instead of in (eg out(; i > 0)), no highlighting is applied in either case.

module app;
import std.stdio;

void test(int i)
in (i > 0) {
	writeln(i);
}

// or
void test(int i)
in (i > 0) 
{
	writeln(i);
}

// or
void test(int i)
out (; i > 0) {
	writeln(i);
}

// or
int test(int i)
out (r; r > 0) {
	writeln(i);
        return i;
}

void main() {
	test(2);
}

HuskyNator avatar Apr 14 '22 20:04 HuskyNator

color highlighting example

hm in seems to work fine here in either case, out doesn't have any highlighting.

WebFreak001 avatar Apr 15 '22 06:04 WebFreak001

Interesting, it works for me now too. Can't imagine why it didn't last week, apologies for the inconvenience.

HuskyNator avatar Apr 21 '22 16:04 HuskyNator

keeping this open for the out highlighting and inconsistent parentheses

WebFreak001 avatar Apr 21 '22 19:04 WebFreak001

I've forgotten to make notes about that . . . but yeah, several parts of my code have strange indentation, if that's what you mean.

HuskyNator avatar Apr 21 '22 21:04 HuskyNator

I have once again encountered this. I however have no idea how to replicate the issue. image

HuskyNator avatar Apr 22 '22 11:04 HuskyNator

send full code

WebFreak001 avatar Apr 22 '22 21:04 WebFreak001

overig.zip

HuskyNator avatar Apr 26 '22 11:04 HuskyNator