浏览代码

require ; after blockless function expression (fixed issue #1449)

Simon Krajewski 12 年之前
父节点
当前提交
74dd8fef13

+ 3 - 1
parser.ml

@@ -596,7 +596,9 @@ and parse_class_field s =
 				name, punion p1 p2, FVar (t,e))
 		| [< '(Kwd Function,p1); name = parse_fun_name; pl = parse_constraint_params; '(POpen,_); al = psep Comma parse_fun_param; '(PClose,_); t = parse_type_opt; s >] ->
 			let e, p2 = (match s with parser
-				| [< e = toplevel_expr >] -> Some e, pos e
+				| [< e = toplevel_expr; s >] ->
+					(try ignore(semicolon s) with Error (Missing_semicolon,p) -> !display_error Missing_semicolon p);
+					Some e, pos e
 				| [< '(Semicolon,p) >] -> None, p
 				| [< >] -> serror()
 			) in

+ 4 - 4
std/Map.hx

@@ -65,7 +65,7 @@ abstract Map< K, V > (IMap< K, V > ) {
 		
 		If [key] is null, the result is unspecified.
 	**/
-	public inline function set(key:K, value:V) this.set(key, value)
+	public inline function set(key:K, value:V) this.set(key, value);
 	
 	/**
 		Returns the current mapping of [key].
@@ -79,14 +79,14 @@ abstract Map< K, V > (IMap< K, V > ) {
 		
 		If [key] is null, the result is unspecified.
 	**/
-	@:arrayAccess public inline function get(key:K) return this.get(key)
+	@:arrayAccess public inline function get(key:K) return this.get(key);
 	
 	/**
 		Returns true if [key] has a mapping, false otherwise.
 		
 		If [key] is null, the result is unspecified.
 	**/
-	public inline function exists(key:K) return this.exists(key)
+	public inline function exists(key:K) return this.exists(key);
 	
 	/**
 		Removes the mapping of [key] and returns true if such a mapping existed,
@@ -94,7 +94,7 @@ abstract Map< K, V > (IMap< K, V > ) {
 		
 		If [key] is null, the result is unspecified.
 	**/
-	public inline function remove(key:K) return this.remove(key)
+	public inline function remove(key:K) return this.remove(key);
 	
 	/**
 		Returns an Iterator over the keys of [this] Map.

+ 1 - 1
std/StringTools.hx

@@ -376,7 +376,7 @@ class StringTools {
 	}
 
 	#if java
-	private static inline function _charAt(str:String, idx:Int):java.StdTypes.Char16 return untyped str._charAt(idx)
+	private static inline function _charAt(str:String, idx:Int):java.StdTypes.Char16 return untyped str._charAt(idx);
 	#end
 	
 	#if neko

+ 27 - 18
std/haxe/EnumTools.hx

@@ -38,8 +38,9 @@ extern class EnumTools {
 		
 		The enum name does not include any type parameters.
 	**/
-	static public inline function getName<T>(e:Enum<T>):String
-		return Type.getEnumName(e)
+	static public inline function getName<T>(e:Enum<T>):String {
+		return Type.getEnumName(e);
+	}
 		
 	/**
 		Creates an instance of enum [e] by calling its constructor [constr] with
@@ -50,8 +51,9 @@ extern class EnumTools {
 		expected number of constructor arguments, or if any argument has an
 		invalid type, the result is unspecified.
 	**/
-	static public inline function createByName<T>(e:Enum<T>, constr:String, ?params:Array<Dynamic>):T
-		return Type.createEnum(e, constr, params)
+	static public inline function createByName<T>(e:Enum<T>, constr:String, ?params:Array<Dynamic>):T {
+		return Type.createEnum(e, constr, params);
+	}
 	
 	/**
 		Creates an instance of enum [e] by calling its constructor number
@@ -65,8 +67,9 @@ extern class EnumTools {
 		expected number of constructor arguments, or if any argument has an
 		invalid type, the result is unspecified.
 	**/
-	static public inline function createByIndex<T>(e:Enum<T>, index:Int, ?params:Array<Dynamic>):T
-		return Type.createEnumIndex(e, index, params)
+	static public inline function createByIndex<T>(e:Enum<T>, index:Int, ?params:Array<Dynamic>):T {
+		return Type.createEnumIndex(e, index, params);
+	}
 		
 	/**
 		Returns a list of all constructors of enum [e] that require no
@@ -81,8 +84,9 @@ extern class EnumTools {
 		
 		If [e] is null, the result is unspecified.
 	**/
-	static public inline function createAll<T>(e:Enum<T>):Array<T>
-		return Type.allEnums(e)
+	static public inline function createAll<T>(e:Enum<T>):Array<T> {
+		return Type.allEnums(e);
+	}
 		
 	/**
 		Returns a list of the names of all constructors of enum [e].
@@ -92,8 +96,9 @@ extern class EnumTools {
 		
 		If [c] is null, the result is unspecified.
 	**/
-	static public inline function getConstructors<T>(e:Enum<T>):Array<String>
-		return Type.getEnumConstructs(e)
+	static public inline function getConstructors<T>(e:Enum<T>):Array<String> {
+		return Type.getEnumConstructs(e);
+	}
 }
 
 extern class EnumValueTools {
@@ -106,8 +111,9 @@ extern class EnumValueTools {
 		
 		If [a] or [b] are null, the result is unspecified.
 	**/
-	static public inline function equals<T:EnumValue>(a:T, b:T):Bool
-		return Type.enumEq(a, b)
+	static public inline function equals<T:EnumValue>(a:T, b:T):Bool {
+		return Type.enumEq(a, b);
+	}
 		
 	/**
 		Returns the constructor name of enum instance [e].
@@ -116,8 +122,9 @@ extern class EnumValueTools {
 		
 		If [e] is null, the result is unspecified.
 	**/
-	static public inline function getName(e:EnumValue):String
-		return Type.enumConstructor(e)
+	static public inline function getName(e:EnumValue):String {
+		return Type.enumConstructor(e);
+	}
 		
 	/**
 		Returns a list of the constructor arguments of enum instance [e].
@@ -129,8 +136,9 @@ extern class EnumValueTools {
 		
 		If [e] is null, the result is unspecified.
 	**/
-	static public inline function getParameters(e:EnumValue):Array<Dynamic>
-		return Type.enumParameters(e)
+	static public inline function getParameters(e:EnumValue):Array<Dynamic> {
+		return Type.enumParameters(e);
+	}
 		
 	/**
 		Returns the index of enum instance [e].
@@ -140,6 +148,7 @@ extern class EnumValueTools {
 		
 		If [e] is null, the result is unspecified.
 	**/
-	static public inline function getIndex(e:EnumValue):Int
-		return Type.enumIndex(e)
+	static public inline function getIndex(e:EnumValue):Int {
+		return Type.enumIndex(e);
+	}
 }

+ 2 - 2
std/haxe/ds/Vector.hx

@@ -103,7 +103,7 @@ abstract Vector<T>(VectorData<T>) {
 		This returns the internal representation type.
 	**/
 	public inline function toData():VectorData<T>
-		return cast this
+		return cast this;
 
 	/**
 		Initializes a new Vector from [data].
@@ -113,7 +113,7 @@ abstract Vector<T>(VectorData<T>) {
 		If [data] is null, the corresponding Vector is also [null].
 	**/
 	static public inline function fromData<T>(data:VectorData<T>):Vector<T>
-		return cast data
+		return cast data;
 
 	/**
 		Creates a new Vector by copying the elements of [array].

+ 2 - 2
std/haxe/macro/ComplexTypeTools.hx

@@ -36,9 +36,9 @@ class ComplexTypeTools {
 		
 		The result is guaranteed to be valid haxe code, but there may be
 		differences from the original lexical syntax.
-	**/	
+	**/
 	static public function toString( c : ComplexType ) : String
-		return new Printer().printComplexType(c)
+		return new Printer().printComplexType(c);
 		
 	#if macro
 	

+ 4 - 4
std/haxe/macro/ExprTools.hx

@@ -39,7 +39,7 @@ class ExprTools {
 		return { expr : EConst(CIdent(s)), pos : p }
 
 	static public function toFieldExpr ( sl : Array<String> ) : Expr
-		return sl.fold(function(s, e) return e == null ? (macro $i{s}) : (macro $e.$s), null)
+		return sl.fold(function(s, e) return e == null ? (macro $i{s}) : (macro $e.$s), null);
 
 	/**
 		Converts expression [e] to a human-readable String representation.
@@ -48,7 +48,7 @@ class ExprTools {
 		differences from the original lexical syntax.
 	**/
 	static public function toString( e : Expr ) : String
-		return new Printer().printExpr(e)
+		return new Printer().printExpr(e);
 
 	/**
 		Calls function [f] on each sub-expression of [e].
@@ -216,10 +216,10 @@ class ExprTools {
 	}
 
 	static inline function opt(e:Null<Expr>, f : Expr -> Expr):Expr
-		return e == null ? null : f(e)
+		return e == null ? null : f(e);
 
 	static inline function opt2(e:Null<Expr>, f : Expr -> Void):Void
-		if (e != null) f(e)
+		if (e != null) f(e);
 }
 
 /**

+ 9 - 9
std/haxe/macro/Printer.hx

@@ -88,7 +88,7 @@ class Printer {
 		(tp.pack.length > 0 ? tp.pack.join(".") + "." : "")
 		+ tp.name
 		+ (tp.sub != null ? '.${tp.sub}' : "")
-		+ (tp.params.length > 0 ? "<" + tp.params.map(printTypeParam).join(",") + ">" : "")
+		+ (tp.params.length > 0 ? "<" + tp.params.map(printTypeParam).join(",") + ">" : "");
 
 	// TODO: check if this can cause loops
 	public function printComplexType(ct:ComplexType) return switch(ct) {
@@ -102,7 +102,7 @@ class Printer {
 
 	public function printMetadata(meta:MetadataEntry) return
 		'@${meta.name}'
-		+ (meta.params.length > 0 ? '(${printExprs(meta.params,",")})' : "")
+		+ (meta.params.length > 0 ? '(${printExprs(meta.params,",")})' : "");
 
 	public function printAccess(access:Access) return switch(access) {
 		case AStatic: "static";
@@ -127,24 +127,24 @@ class Printer {
 	public function printTypeParamDecl(tpd:TypeParamDecl) return
 		tpd.name
 		+ (tpd.params.length > 0 ? "<" + tpd.params.map(printTypeParamDecl).join(",") + ">" : "")
-		+ (tpd.constraints.length > 0 ? ":(" + tpd.constraints.map(printComplexType).join(",") + ")" : "")
+		+ (tpd.constraints.length > 0 ? ":(" + tpd.constraints.map(printComplexType).join(",") + ")" : "");
 
 	public function printFunctionArg(arg:FunctionArg) return
 		(arg.opt ? "?" : "")
 		+ arg.name
 		+ opt(arg.type, printComplexType, ":")
-		+ opt(arg.value, printExpr, "=")
+		+ opt(arg.value, printExpr, "=");
 
 	public function printFunction(func:Function) return
 		(func.params.length > 0 ? "<" + func.params.map(printTypeParamDecl).join(",") + ">" : "")
 		+ "(" + func.args.map(printFunctionArg).join(",") + ")"
 		+ opt(func.ret, printComplexType, ":")
-		+ opt(func.expr, printExpr, " ")
+		+ opt(func.expr, printExpr, " ");
 
 	public function printVar(v:Var) return
 		v.name
 		+ opt(v.type, printComplexType, ":")
-		+ opt(v.expr, printExpr, "=")
+		+ opt(v.expr, printExpr, "=");
 
 
 	public function printExpr(e:Expr) return e == null ? "#NULL" : switch(e.expr) {
@@ -216,9 +216,9 @@ class Printer {
 		var str = t == null ? "#NULL" :
 			(printPackage && t.pack.length > 0 && t.pack[0] != "" ? "package " + t.pack.join(".") + ";\n" : "") +
 			(t.meta != null && t.meta.length > 0 ? t.meta.map(printMetadata).join(" ") + " " : "") + (t.isExtern ? "extern " : "") + switch (t.kind) {
-				case TDEnum:				
+				case TDEnum:
 					"enum " + t.name + (t.params.length > 0 ? "<" + t.params.map(printTypeParamDecl).join(",") + ">" : "") + " {\n"
-					+ [for (field in t.fields) 
+					+ [for (field in t.fields)
 						tabs + (field.doc != null && field.doc != "" ? "/**\n" + tabs + tabs + StringTools.replace(field.doc, "\n", "\n" + tabs + tabs) + "\n" + tabs + "**/\n" + tabs : "")
 						+ (field.meta != null && field.meta.length > 0 ? field.meta.map(printMetadata).join(" ") + " " : "")
 						+ (switch(field.kind) {
@@ -260,5 +260,5 @@ class Printer {
 		return str;
 	}
 
-	function opt<T>(v:T, f:T->String, prefix = "") return v == null ? "" : (prefix + f(v))
+	function opt<T>(v:T, f:T->String, prefix = "") return v == null ? "" : (prefix + f(v));
 }

+ 3 - 3
std/java/_std/haxe/Int64.hx

@@ -26,9 +26,9 @@ private typedef NativeInt64 = Int;
 @:coreApi
 @:nativeGen class Int64
 {
-	@:extern private static inline function asNative(i:Int64):NativeInt64 return untyped i
-	@:extern private static inline function ofNative(i:NativeInt64):Int64 return untyped i
-	@:extern private static inline function mkNative(i:Dynamic):NativeInt64 return i
+	@:extern private static inline function asNative(i:Int64):NativeInt64 return untyped i;
+	@:extern private static inline function ofNative(i:NativeInt64):Int64 return untyped i;
+	@:extern private static inline function mkNative(i:Dynamic):NativeInt64 return i;
 
 	public static inline function make( high : Int, low : Int ) : Int64
 	{

+ 12 - 12
std/java/_std/haxe/ds/IntMap.hx

@@ -405,37 +405,37 @@ import java.NativeArray;
 		#end
 	}
 
-	private static inline function defaultK():Int return 0
+	private static inline function defaultK():Int return 0;
 
 	private static inline function arrayCopy(sourceArray:Dynamic, sourceIndex:Int, destinationArray:Dynamic, destinationIndex:Int, length:Int):Void
-		java.lang.System.arraycopy(sourceArray, sourceIndex, destinationArray, destinationIndex, length)
+		java.lang.System.arraycopy(sourceArray, sourceIndex, destinationArray, destinationIndex, length);
 
 	private static inline function getInc(k:Int, mask:Int):Int
-		return (((k) >> 3 ^ (k) << 3) | 1) & (mask)
+		return (((k) >> 3 ^ (k) << 3) | 1) & (mask);
 
 	private static inline function hash(i:Int):Int
-		return i
+		return i;
 
 	private static inline function flagIsEmpty(flag:NativeArray<Int>, i:Int):Bool
-		return ( (flag[i >> 4] >>> ((i & 0xf) << 1)) & 2 ) != 0
+		return ( (flag[i >> 4] >>> ((i & 0xf) << 1)) & 2 ) != 0;
 
 	private static inline function flagIsDel(flag:NativeArray<Int>, i:Int):Bool
-		return ((flag[i >> 4] >>> ((i & 0xf) << 1)) & 1) != 0
+		return ((flag[i >> 4] >>> ((i & 0xf) << 1)) & 1) != 0;
 
 	private static inline function isEither(flag:NativeArray<Int>, i:Int):Bool
-		return ((flag[i >> 4] >>> ((i & 0xf) << 1)) & 3) != 0
+		return ((flag[i >> 4] >>> ((i & 0xf) << 1)) & 3) != 0;
 
 	private static inline function setIsDelFalse(flag:NativeArray<Int>, i:Int):Void
-		flag[i >> 4] &= ~(1 << ((i & 0xf) << 1))
+		flag[i >> 4] &= ~(1 << ((i & 0xf) << 1));
 
 	private static inline function setIsEmptyFalse(flag:NativeArray<Int>, i:Int):Void
-		flag[i >> 4] &= ~(2 << ((i & 0xf) << 1))
+		flag[i >> 4] &= ~(2 << ((i & 0xf) << 1));
 
 	private static inline function setIsBothFalse(flag:NativeArray<Int>, i:Int):Void
-		flag[i >> 4] &= ~(3 << ((i & 0xf) << 1))
+		flag[i >> 4] &= ~(3 << ((i & 0xf) << 1));
 
 	private static inline function setIsDelTrue(flag:NativeArray<Int>, i:Int):Void
-		flag[i >> 4] |= 1 << ((i & 0xf) << 1)
+		flag[i >> 4] |= 1 << ((i & 0xf) << 1);
 
 	private static inline function roundUp(x:Int):Int
 	{
@@ -449,5 +449,5 @@ import java.NativeArray;
 	}
 
 	private static inline function flagsSize(m:Int):Int
-		return ((m) < 16? 1 : (m) >> 4)
+		return ((m) < 16? 1 : (m) >> 4);
 }

+ 5 - 5
std/java/_std/haxe/ds/ObjectMap.hx

@@ -434,16 +434,16 @@ import java.NativeArray;
 	}
 
 	@:extern private static inline function getInc(k:Int, mask:Int):Int //return 1 for linear probing
-		return (((k) >> 3 ^ (k) << 3) | 1) & (mask)
+		return (((k) >> 3 ^ (k) << 3) | 1) & (mask);
 
 	@:extern private static inline function isEither(v:HashType):Bool
-		return (v & 0xFFFFFFFE) == 0
+		return (v & 0xFFFFFFFE) == 0;
 
 	@:extern private static inline function isEmpty(v:HashType):Bool
-		return v == FLAG_EMPTY
+		return v == FLAG_EMPTY;
 
 	@:extern private static inline function isDel(v:HashType):Bool
-		return v == FLAG_DEL
+		return v == FLAG_DEL;
 
 	//guarantee: Whatever this function is, it will never return 0 nor 1
 	@:extern private static inline function hash(s:Dynamic):HashType
@@ -475,7 +475,7 @@ import java.NativeArray;
 	}
 
 	@:extern private static inline function arrayCopy(sourceArray:Dynamic, sourceIndex:Int, destinationArray:Dynamic, destinationIndex:Int, length:Int):Void
-		java.lang.System.arraycopy(sourceArray, sourceIndex, destinationArray, destinationIndex, length)
+		java.lang.System.arraycopy(sourceArray, sourceIndex, destinationArray, destinationIndex, length);
 
 	@:extern private static inline function assert(x:Bool):Void
 	{

+ 5 - 5
std/java/_std/haxe/ds/StringMap.hx

@@ -434,16 +434,16 @@ import java.NativeArray;
 	}
 
 	@:extern private static inline function getInc(k:Int, mask:Int):Int //return 1 for linear probing
-		return (((k) >> 3 ^ (k) << 3) | 1) & (mask)
+		return (((k) >> 3 ^ (k) << 3) | 1) & (mask);
 
 	@:extern private static inline function isEither(v:HashType):Bool
-		return (v & 0xFFFFFFFE) == 0
+		return (v & 0xFFFFFFFE) == 0;
 
 	@:extern private static inline function isEmpty(v:HashType):Bool
-		return v == FLAG_EMPTY
+		return v == FLAG_EMPTY;
 
 	@:extern private static inline function isDel(v:HashType):Bool
-		return v == FLAG_DEL
+		return v == FLAG_DEL;
 
 	//guarantee: Whatever this function is, it will never return 0 nor 1
 	@:extern private static inline function hash(s:String):HashType
@@ -475,7 +475,7 @@ import java.NativeArray;
 	}
 
 	@:extern private static inline function arrayCopy(sourceArray:Dynamic, sourceIndex:Int, destinationArray:Dynamic, destinationIndex:Int, length:Int):Void
-		java.lang.System.arraycopy(sourceArray, sourceIndex, destinationArray, destinationIndex, length)
+		java.lang.System.arraycopy(sourceArray, sourceIndex, destinationArray, destinationIndex, length);
 
 	@:extern private static inline function assert(x:Bool):Void
 	{

+ 18 - 18
std/neko/_std/Math.hx

@@ -31,25 +31,25 @@ import neko.Lib;
 	public static function min(a:Float,b:Float) : Float { return if( a < b ) a else b; }
 	public static function max(a:Float,b:Float) : Float { return if( a < b ) b else a; }
 
-	public static function abs( v : Float ) : Float return 0.
-	public static function sin( v : Float ) : Float return 0.
-	public static function cos( v : Float ) : Float return 0.
-	public static function atan2( y : Float, x : Float ) : Float return 0.
-	public static function tan( v : Float ) : Float return 0.
-	public static function exp( v : Float ) : Float return 0.
-	public static function log( v : Float ) : Float return 0.
-	public static function sqrt( v : Float ) : Float return 0.
-	public static function round( v : Float ) : Int return 0
-	public static function floor( v : Float ) : Int return 0
-	public static function ceil( v : Float ) : Int return 0
-	public static function atan( v : Float ) : Float return 0.
-	public static function asin( v : Float ) : Float return 0.
-	public static function acos( v : Float ) : Float return 0.
-	public static function pow( v : Float, exp : Float ) : Float return 0.
+	public static function abs( v : Float ) : Float return 0.;
+	public static function sin( v : Float ) : Float return 0.;
+	public static function cos( v : Float ) : Float return 0.;
+	public static function atan2( y : Float, x : Float ) : Float return 0.;
+	public static function tan( v : Float ) : Float return 0.;
+	public static function exp( v : Float ) : Float return 0.;
+	public static function log( v : Float ) : Float return 0.;
+	public static function sqrt( v : Float ) : Float return 0.;
+	public static function round( v : Float ) : Int return 0;
+	public static function floor( v : Float ) : Int return 0;
+	public static function ceil( v : Float ) : Int return 0;
+	public static function atan( v : Float ) : Float return 0.;
+	public static function asin( v : Float ) : Float return 0.;
+	public static function acos( v : Float ) : Float return 0.;
+	public static function pow( v : Float, exp : Float ) : Float return 0.;
 
-	public static function fround( v : Float ) : Float return 0.
-	public static function ffloor( v : Float ) : Float return 0.
-	public static function fceil( v : Float ) : Float return 0.
+	public static function fround( v : Float ) : Float return 0.;
+	public static function ffloor( v : Float ) : Float return 0.;
+	public static function fceil( v : Float ) : Float return 0.;
 
 	static var __rnd;
 	static var _rand_float = Lib.load("std","random_float",1);

+ 13 - 13
tests/unit/MyAbstract.hx

@@ -23,7 +23,7 @@ abstract TemplateWrap(haxe.Template) {
 	}
 
 	public inline function get()
-		return this
+		return this;
 
 	@:from static inline public function fromString(s:String) {
 		return new TemplateWrap(s);
@@ -37,24 +37,24 @@ abstract TemplateWrap(haxe.Template) {
 
 abstract Meter(Float) from Float to Float {
 	public inline function new(f)
-		this = f
+		this = f;
 
 	public inline function get()
-		return this
+		return this;
 
 	@:to public inline function toString()
-		return this + "m"
+		return this + "m";
 }
 
 abstract Kilometer(Float) from Float to Float {
 	public inline function new(f)
-		this = f
+		this = f;
 
 	@:to public inline function toString()
-		return this + "km"
+		return this + "km";
 
 	@:from static public inline function fromMeter(m:Meter)
-		return new Kilometer(m.get() / 1000.)
+		return new Kilometer(m.get() / 1000.);
 }
 
 abstract MyHash<V>(haxe.ds.StringMap<V>) {
@@ -62,11 +62,11 @@ abstract MyHash<V>(haxe.ds.StringMap<V>) {
 		this = new haxe.ds.StringMap<V>();
 	}
 	public inline function set(k:String, v:V)
-		this.set(k, v)
+		this.set(k, v);
 	public inline function get(k:String)
-		return this.get(k)
+		return this.get(k);
 	public inline function toString()
-		return this.toString()
+		return this.toString();
 
 	@:from static public function fromStringArray(arr:Array<String>):MyHash<String> {
 		var hash = new MyHash();
@@ -140,10 +140,10 @@ abstract MyVector(MyPoint3) from MyPoint3 to MyPoint3 {
 	}
 	
 	public inline function get():MyPoint3
-		return this
+		return this;
 
 	@:to public inline function toString():String
-		return untyped '(${this.x},${this.y},${this.z})'
+		return untyped '(${this.x},${this.y},${this.z})';
 }
 
 abstract MyInt(Int) from Int to Int {
@@ -186,7 +186,7 @@ abstract MyString(String) from String to String {
 class ClassWithHashCode {
 	var i:Int;
 	public function new(i) { this.i = i; }
-	public function hashCode() return i
+	public function hashCode() return i;
 }
 
 class ClassWithoutHashCode {

+ 16 - 16
tests/unit/MyClass.hx

@@ -32,8 +32,8 @@ class MyClass {
 
 class MyParent {
 	public function new() { }
-	function a() return 11
-	function b() return 20
+	function a() return 11;
+	function b() return 20;
 }
 
 class MyDynamicChildWithToString extends MyParent implements Dynamic
@@ -50,12 +50,12 @@ class MyDynamicChildWithoutToString extends MyParent implements Dynamic
 
 class MyChild1 extends MyParent {
 	public override function a() { return 12; }
-	override function b() return 21
-	function c() return 19
+	override function b() return 21;
+	function c() return 19;
 }
 #if !as3
 class MyChild2 extends MyParent {
-	public function test1(mc1:MyChild1) return mc1.b()
+	public function test1(mc1:MyChild1) return mc1.b();
 }
 #end
 
@@ -146,8 +146,8 @@ class InitProperties {
 	public var accNever(default, never):Int = 3;
 	public var accDynamic(default, dynamic):Int = 3;
 
-	function set_accFunc(v) return throw "setter was called"
-	function set_accDynamic(v) return throw "setter was called"
+	function set_accFunc(v) return throw "setter was called";
+	function set_accDynamic(v) return throw "setter was called";
 	public function new() { }
 }
 
@@ -175,8 +175,8 @@ class ParamConstraintsClass2<T> {
 }
 
 class UsingBase {
-	static function privFunc(s:String) return s.toUpperCase()
-	static public function pupFunc(s:String) return s.toUpperCase()
+	static function privFunc(s:String) return s.toUpperCase();
+	static public function pupFunc(s:String) return s.toUpperCase();
 }
 
 class UsingChild1 extends UsingBase {
@@ -184,7 +184,7 @@ class UsingChild1 extends UsingBase {
 		return "foo".pupFunc() + "foo".privFunc() + "FOO".siblingFunc();
 	}
 
-	static function siblingFunc(s:String) return s.toLowerCase()
+	static function siblingFunc(s:String) return s.toLowerCase();
 }
 
 class UsingChild2 extends UsingBase {
@@ -195,7 +195,7 @@ class UsingChild2 extends UsingBase {
 		return "foo".siblingFunc();
 	}
 
-	static public function siblingFunc(s:String) return s.toUpperCase()
+	static public function siblingFunc(s:String) return s.toUpperCase();
 }
 
 class UsingUnrelated {
@@ -273,15 +273,15 @@ class BaseSuperProp {
 
 	}
 
-	function get_prop() return 1
-	function set_prop(v) return v
+	function get_prop() return 1;
+	function set_prop(v) return v;
 
-	function get_fProp() return function(i:Int) return "test" +i
+	function get_fProp() return function(i:Int) return "test" +i;
 }
 
 class ChildSuperProp extends BaseSuperProp {
-	public override function get_prop() return super.prop + 1
-	public override function set_prop(v) return (super.prop = v) + 1
+	public override function get_prop() return super.prop + 1;
+	public override function set_prop(v) return (super.prop = v) + 1;
 
 	public override function get_fProp() {
 		var s = super.fProp(0);

+ 10 - 10
tests/unit/TestDCE.hx

@@ -6,30 +6,30 @@ class DCEClass {
 	@:keep static function staticKeep() { }
 	static var staticVarUsed = "foo";
 	@:isVar static var staticPropUsed(get, set):Int = 1;
-	static function get_staticPropUsed() return staticPropUsed
-	static function set_staticPropUsed(i:Int) return 0
+	static function get_staticPropUsed() return staticPropUsed;
+	static function set_staticPropUsed(i:Int) return 0;
 	
 	// used members
 	function memberUsed() { }
 	@:keep function memberKeep() { }
 	var memberVarUsed = 0;
 	@:isVar var memberPropUsed(get, set):Int = 1;
-	function get_memberPropUsed() return memberPropUsed
-	function set_memberPropUsed(i:Int) return 0
+	function get_memberPropUsed() return memberPropUsed;
+	function set_memberPropUsed(i:Int) return 0;
 	
 	// unused statics
 	static function staticUnused() { }
 	static var staticVarUnused = "bar";
 	static var staticPropUnused(get, set):Int = 1;
-	static function get_staticPropUnused() return 0
-	static function set_staticPropUnused(i:Int) return 0
+	static function get_staticPropUnused() return 0;
+	static function set_staticPropUnused(i:Int) return 0;
 	
 	// unused members
 	function memberUnused() { }
 	var memberVarUnused = 1;
 	var memberPropUnused(get, set):Int = 1;
-	function get_memberPropUnused() return 0
-	function set_memberPropUnused(i:Int) return 0
+	function get_memberPropUnused() return 0;
+	function set_memberPropUnused(i:Int) return 0;
 	
 	static var c :Array<Dynamic> = [null, unit.UsedReferenced2];
 	
@@ -190,8 +190,8 @@ interface PropertyInterface {
 }
 
 class PropertyAccessorsFromBaseClass {
-	public function get_x() return throw "must not set"
-	public function set_x(x:String) return "ok"
+	public function get_x() return throw "must not set";
+	public function set_x(x:String) return "ok";
 }
 
 class PropertyAccessorsFromBaseClassChild extends PropertyAccessorsFromBaseClass implements PropertyInterface {

+ 2 - 2
tests/unit/TestMisc.hx

@@ -28,7 +28,7 @@ class MyDynamicClass {
 	}
 
 	@:isVar public static var W(get, set) : Int = 55;
-	static function get_W() return W + 2
+	static function get_W() return W + 2;
 	static function set_W(v) { W = v; return v; }
 
 }
@@ -451,7 +451,7 @@ class TestMisc extends Test {
 		eq(o.blabla,3);
 	}
 
-	static inline function foo(x) return x + 5
+	static inline function foo(x) return x + 5;
 
 	function testInline() {
 		// check that operations are correctly generated

+ 2 - 2
tests/unit/TestSpecification.hx

@@ -33,7 +33,7 @@ private class EmptyClass {
 
 private class ClassWithToString {
 	public function new() { }
-	public function toString() return "ClassWithToString.toString()"
+	public function toString() return "ClassWithToString.toString()";
 }
 
 private class ClassWithToStringChild extends ClassWithToString {
@@ -41,7 +41,7 @@ private class ClassWithToStringChild extends ClassWithToString {
 }
 
 private class ClassWithToStringChild2 extends ClassWithToString {
-	public override function toString() return "ClassWithToStringChild2.toString()"
+	public override function toString() return "ClassWithToStringChild2.toString()";
 }
 
 @:keep private class ClassWithCtorDefaultValues {

+ 1 - 1
typer.ml

@@ -270,7 +270,7 @@ let parse_expr_string ctx s p inl =
 	let head = "class X{static function main() " in
 	let head = (if p.pmin > String.length head then head ^ String.make (p.pmin - String.length head) ' ' else head) in
 	let rec loop e = let e = Ast.map_expr loop e in (fst e,p) in
-	match parse_string ctx (head ^ s ^ "}") p inl with
+	match parse_string ctx (head ^ s ^ ";}") p inl with
 	| EClass { d_data = [{ cff_name = "main"; cff_kind = FFun { f_expr = Some e } }]} -> if inl then e else loop e
 	| _ -> assert false