-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed conditionalized class declaration with constraints, fixes #431
fixed empty classes with conditional metadata fixed class fields with conditional function signatures fixed abstract enum abstracts with conditionals
- Loading branch information
Showing
7 changed files
with
282 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
test/testcases/emptylines/class_fields_with_conditional_function_signatures.hxtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
} | ||
|
||
|
||
--- | ||
|
||
class Test { | ||
public inline function compileShader(shader:GLShader):Void | ||
{ | ||
this.compileShader(shader); | ||
} | ||
|
||
#if !lime_webgl | ||
public inline function uniform3iv(location:GLUniformLocation, v:Int32Array, ?srcOffset:Int, ?srcLength:Int):Void | ||
#else | ||
public inline function uniform3iv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void | ||
#end | ||
{ | ||
this.uniform3iv(location, v != null ? Std.int(v.length / 3) : 0, v); | ||
} | ||
public inline function uniform3ui(location:GLUniformLocation, v0:Int, v1:Int, v2:Int):Void | ||
{ | ||
this.uniform3ui(location, v0, v1, v2); | ||
} | ||
|
||
#if !lime_webgl | ||
public function compressedTexImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, srcData:ArrayBufferView, | ||
srcOffset:Int = 0, | ||
?srcLengthOverride:Int):Void | ||
#else | ||
public inline function compressedTexImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, srcData:Dynamic, ?srcOffset:Int, | ||
?srcLengthOverride:Int):Void | ||
#end | ||
|
||
{ | ||
var imageSize = (srcLengthOverride != null) ? srcLengthOverride : (srcData != null) ? srcData.byteLength : 0; | ||
|
||
__tempPointer.set(srcData, srcOffset); | ||
this.compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, __tempPointer); | ||
} | ||
public function compressedTexImage3D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, depth:Int, border:Int, srcData:ArrayBufferView, | ||
srcOffset:Int = 0, ?srcLengthOverride:Int):Void | ||
{ | ||
var imageSize = (srcLengthOverride != null) ? srcLengthOverride : (srcData != null) ? srcData.byteLength : 0; | ||
__tempPointer.set(srcData, srcOffset); | ||
this.compressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, __tempPointer); | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Test { | ||
public inline function compileShader(shader:GLShader):Void { | ||
this.compileShader(shader); | ||
} | ||
|
||
#if !lime_webgl | ||
public inline function uniform3iv(location:GLUniformLocation, v:Int32Array, ?srcOffset:Int, ?srcLength:Int):Void | ||
#else | ||
public inline function uniform3iv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void | ||
#end | ||
{ | ||
this.uniform3iv(location, v != null ? Std.int(v.length / 3) : 0, v); | ||
} | ||
|
||
public inline function uniform3ui(location:GLUniformLocation, v0:Int, v1:Int, v2:Int):Void { | ||
this.uniform3ui(location, v0, v1, v2); | ||
} | ||
|
||
#if !lime_webgl | ||
public function compressedTexImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, srcData:ArrayBufferView, | ||
srcOffset:Int = 0, ?srcLengthOverride:Int):Void | ||
#else | ||
public inline function compressedTexImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, srcData:Dynamic, ?srcOffset:Int, | ||
?srcLengthOverride:Int):Void | ||
#end | ||
{ | ||
var imageSize = (srcLengthOverride != null) ? srcLengthOverride : (srcData != null) ? srcData.byteLength : 0; | ||
|
||
__tempPointer.set(srcData, srcOffset); | ||
this.compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, __tempPointer); | ||
} | ||
|
||
public function compressedTexImage3D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, depth:Int, border:Int, srcData:ArrayBufferView, | ||
srcOffset:Int = 0, ?srcLengthOverride:Int):Void { | ||
var imageSize = (srcLengthOverride != null) ? srcLengthOverride : (srcData != null) ? srcData.byteLength : 0; | ||
__tempPointer.set(srcData, srcOffset); | ||
this.compressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, __tempPointer); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
test/testcases/emptylines/empty_classes_with_conditional_metadata.hxtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
} | ||
|
||
|
||
--- | ||
|
||
#if FLX_DEBUG @:bitmap("assets/images/debugger/flixel.png") #end | ||
private class GraphicFlixel extends BitmapData {} | ||
#if FLX_DEBUG @:bitmap("assets/images/debugger/buttons/drawDebug.png") #end | ||
private class GraphicDrawDebug extends BitmapData {} | ||
#if FLX_DEBUG @:bitmap("assets/images/debugger/buttons/log.png") #end | ||
@:noCompletion class GraphicLog extends BitmapData {} | ||
|
||
--- | ||
|
||
#if FLX_DEBUG @:bitmap("assets/images/debugger/flixel.png") #end | ||
private class GraphicFlixel extends BitmapData {} | ||
|
||
#if FLX_DEBUG @:bitmap("assets/images/debugger/buttons/drawDebug.png") #end | ||
private class GraphicDrawDebug extends BitmapData {} | ||
|
||
#if FLX_DEBUG @:bitmap("assets/images/debugger/buttons/log.png") #end | ||
@:noCompletion class GraphicLog extends BitmapData {} |
41 changes: 41 additions & 0 deletions
41
test/testcases/emptylines/issue_431_conditionalised_class_with_constraints.hxtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
} | ||
|
||
--- | ||
|
||
#if (haxe_ver >= "4.0.0") | ||
class FlxTypedEmitter<T:FlxSprite & IFlxParticle> extends FlxTypedGroup<T> | ||
#else | ||
class FlxTypedEmitter<T:(FlxSprite, IFlxParticle)> extends FlxTypedGroup<T> | ||
#end | ||
{} | ||
|
||
#if (haxe_ver >= "4.0.0") | ||
class FlxTypedEmitter<T:FlxSprite & IFlxParticle> extends FlxTypedGroup<T> | ||
#else | ||
class FlxTypedEmitter<T:(FlxSprite, IFlxParticle) > extends FlxTypedGroup<T> | ||
#end | ||
{ | ||
var foo:Int; | ||
} | ||
enum Foo {} | ||
|
||
--- | ||
|
||
#if (haxe_ver >= "4.0.0") | ||
class FlxTypedEmitter<T:FlxSprite & IFlxParticle> extends FlxTypedGroup<T> | ||
#else | ||
class FlxTypedEmitter<T:(FlxSprite, IFlxParticle)> extends FlxTypedGroup<T> | ||
#end | ||
{} | ||
|
||
#if (haxe_ver >= "4.0.0") | ||
class FlxTypedEmitter<T:FlxSprite & IFlxParticle> extends FlxTypedGroup<T> | ||
#else | ||
class FlxTypedEmitter<T:(FlxSprite, IFlxParticle)> extends FlxTypedGroup<T> | ||
#end | ||
{ | ||
var foo:Int; | ||
} | ||
|
||
enum Foo {} |
44 changes: 44 additions & 0 deletions
44
test/testcases/emptylines/private_abstract_with_conditionals.hxtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
} | ||
|
||
|
||
--- | ||
|
||
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract SystemDirectory(Int) from Int to Int from UInt to UInt | ||
{ | ||
var APPLICATION = 0; | ||
var APPLICATION_STORAGE = 1; | ||
var DESKTOP = 2; | ||
var DOCUMENTS = 3; | ||
var FONTS = 4; | ||
var USER = 5; | ||
} | ||
|
||
#if (!lime_doc_gen || lime_cairo) | ||
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoContent(Int) from Int to Int from UInt to UInt | ||
|
||
{ | ||
public var COLOR = 0x1000; | ||
public var ALPHA = 0x2000; | ||
public var COLOR_ALPHA = 0x3000; | ||
} | ||
#end | ||
|
||
--- | ||
|
||
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract SystemDirectory(Int) from Int to Int from UInt to UInt { | ||
var APPLICATION = 0; | ||
var APPLICATION_STORAGE = 1; | ||
var DESKTOP = 2; | ||
var DOCUMENTS = 3; | ||
var FONTS = 4; | ||
var USER = 5; | ||
} | ||
|
||
#if (!lime_doc_gen || lime_cairo) | ||
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoContent(Int) from Int to Int from UInt to UInt { | ||
public var COLOR = 0x1000; | ||
public var ALPHA = 0x2000; | ||
public var COLOR_ALPHA = 0x3000; | ||
} | ||
#end |