|
@@ -1,4 +1,5 @@
|
|
|
import haxe.macro.Context;
|
|
|
+import haxe.macro.PositionTools;
|
|
|
|
|
|
class Main {
|
|
|
#if !macro
|
|
@@ -8,9 +9,14 @@ class Main {
|
|
|
#end
|
|
|
static macro function test() {
|
|
|
var pos = Context.makePosition({min: 20, max: 23, file: 'my_template.mtt' });
|
|
|
- Context.warning('check pos', pos);
|
|
|
+ var range = PositionTools.toLocation(pos).range;
|
|
|
+ if(range.start.line != range.end.line || range.end.line != 2) {
|
|
|
+ Context.fatalError('Invalid position', pos);
|
|
|
+ }
|
|
|
Context.parse('foo', pos);
|
|
|
- Context.warning('check pos', pos);
|
|
|
+ if(range.start.line != range.end.line || range.end.line != 2) {
|
|
|
+ Context.fatalError('Invalid position after Context.parse', pos);
|
|
|
+ }
|
|
|
return macro null;
|
|
|
}
|
|
|
}
|