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

Syntax highlighting of range in foreach with function

Open HuskyNator opened this issue 2 years ago • 0 comments

When a foreach loop with a range, the syntax highlighting also highlights the second dot. (May be related to #410, though likely not) This does not happen when used as a slice. Not really an issue, just something I noticed. (This also happens with cast(type) 5)

module app;
import std.stdio;

int test(){return 5;}

void main(string[] args) {
	int[] a = [1,2,3,4,5,6,7];

	foreach (i; 0 .. test()) {
		writeln(a[i]);
	}

	writeln(a[0..test()]);
}

Result: image

HuskyNator avatar Jun 28 '22 16:06 HuskyNator