* Reference type proper errors gscript

Wed, 26 Nov 2014 18:54:07 +0200

author
cemkalyoncu
date
Wed, 26 Nov 2014 18:54:07 +0200
branch
gscript
changeset 584
5bfe659d0b59
parent 583
9b55341282ce
child 585
f9fdf363681b

* Reference type proper errors
* Reference type null checks
* Tons of error fixes

.hgignore file | annotate | diff | comparison | revisions
Scripts/Compiler.cmake file | annotate | diff | comparison | revisions
Source/Any.h file | annotate | diff | comparison | revisions
Source/Containers/Collection.h file | annotate | diff | comparison | revisions
Source/Containers/Hashmap.h file | annotate | diff | comparison | revisions
Source/Event.h file | annotate | diff | comparison | revisions
Source/Geometry/Bounds.h file | annotate | diff | comparison | revisions
Source/SGuid.cpp file | annotate | diff | comparison | revisions
Source/Scripting/Builtin.cpp file | annotate | diff | comparison | revisions
Source/Scripting/Data.h file | annotate | diff | comparison | revisions
Source/Scripting/Embedding.h file | annotate | diff | comparison | revisions
Source/Scripting/Exceptions.h file | annotate | diff | comparison | revisions
Source/Scripting/Keywords/For.cpp file | annotate | diff | comparison | revisions
Source/Scripting/Keywords/If.cpp file | annotate | diff | comparison | revisions
Source/Scripting/Keywords/While.cpp file | annotate | diff | comparison | revisions
Source/Scripting/Reflection.h file | annotate | diff | comparison | revisions
Source/Scripting/Scripting.cpp file | annotate | diff | comparison | revisions
Source/Scripting/Types/Array.cpp file | annotate | diff | comparison | revisions
Source/Scripting/VirtualMachine.cpp file | annotate | diff | comparison | revisions
Source/Utils/Assert.h file | annotate | diff | comparison | revisions
Source/WindowManager/WindowManager.cpp file | annotate | diff | comparison | revisions
Testing/Source/Manual/Generic.cpp file | annotate | diff | comparison | revisions
--- a/.hgignore	Wed Nov 19 11:38:22 2014 +0200
+++ b/.hgignore	Wed Nov 26 18:54:07 2014 +0200
@@ -16,5 +16,8 @@
 *.opensdf
 .kdev_include_paths
 build
+clang
+ninja
+codeblocks
 syntax: regexp
 .*\.kdev4(_.*)?
--- a/Scripts/Compiler.cmake	Wed Nov 19 11:38:22 2014 +0200
+++ b/Scripts/Compiler.cmake	Wed Nov 26 18:54:07 2014 +0200
@@ -47,6 +47,15 @@
 	ENDIF()
 ENDIF()
 
+IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+	IF(${ENABLE_64_BIT})
+		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+	ELSE()
+		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -m32")
+		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
+	ENDIF()
+ENDIF()
+
 #make sure 64bits cannot be activated
 IF(MSVC)
 	ADD_DEFINITIONS(-D_SBCS -D_CRT_SECURE_NO_WARNINGS)
--- a/Source/Any.h	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Any.h	Wed Nov 26 18:54:07 2014 +0200
@@ -38,17 +38,10 @@
 			virtual bool  IsSameType(const std::type_info &) const=0;
 			virtual long  GetSize() const = 0;
 			virtual const std::type_info &TypeInfo() const = 0;
-			bool IsPointer() const {
-				return pointer;
-			}
-			
+			virtual bool IsPointer() const = 0;
+			virtual TypeInterface *Duplicate() const=0;
 			virtual ~TypeInterface() { }
-			
-		protected:
-			bool pointer;
-#ifndef NDEBUG
-			const char *name;
-#endif
+			virtual const char *name() const=0; // for debugging
 		};
 
 		/// Type dependent implementation for TypeInterface.
@@ -56,13 +49,6 @@
 		/// functions.
 		template<class T_> class Type : public TypeInterface {
 		public:
-			Type() {
-				pointer=std::is_pointer<T_>::value;
-#ifndef NDEBUG
-				name=typeid(T_).name();
-#endif
-			}
-
 			virtual void Delete(void *obj) const override {
 				delete static_cast<T_*>(obj);
 			}
@@ -77,7 +63,9 @@
 				return typeid(T_);
 			}
 			virtual long GetSize() const override { return sizeof(T_); }
-			
+			virtual TypeInterface *Duplicate() const override { return new Type(); }
+			virtual bool IsPointer() const override { return std::is_pointer<T_>::value; }
+			virtual const char *name() const override { return typeid(T_).name(); }
 		};
 
 	public:
@@ -100,8 +88,7 @@
 		/// Requires type in the copied Any to be copy constructible.
 		Any(const Any &any) {
 			if(any.content) {
-				type=(TypeInterface*)malloc(sizeof(TypeInterface));
-				std::memcpy(type, any.type, sizeof(TypeInterface));
+				type=any.type->Duplicate();
 				content=type->Clone(any.content);
 			}
 			else {
@@ -133,8 +120,7 @@
 			Clear();
 			
 			if(any.type) {
-				type=(TypeInterface*)malloc(sizeof(TypeInterface));
-				std::memcpy(type, any.type, sizeof(TypeInterface));
+				type=any.type->Duplicate();
 				content=type->Clone(any.content);
 			}
 			else {
@@ -224,7 +210,7 @@
 #endif
 #ifndef NDEBUG
 			if(!type->IsSameType(typeid(T_))) {
-				throw std::bad_cast("Cannot cast: not the same type");
+				throw std::bad_cast();
 			}
 #endif
 
@@ -312,7 +298,7 @@
 #endif
 #ifndef NDEBUG
 			if(!type->IsSameType(typeid(T_))) {
-				throw std::bad_cast("Cannot cast: not the same type");
+				throw std::bad_cast();
 			}
 #endif
 
--- a/Source/Containers/Collection.h	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Containers/Collection.h	Wed Nov 26 18:54:07 2014 +0200
@@ -207,7 +207,6 @@
 
 			/// Move constructor
 			Collection(Collection &&col) : list(std::move(col.list)) { 
-				col;
 			}
 
 			/// Move assignment
@@ -323,9 +322,7 @@
 
 			/// this method moves the given object in the collection in front of the reference
 			void MoveBefore(unsigned index, unsigned before) {
-				if(index<0 && index>=list.size())
-					throw std::out_of_range("Invalid location");
-				if(before<0)
+				if(index>=list.size())
 					throw std::out_of_range("Invalid location");
 				if(before>list.size())
 					throw std::out_of_range("Invalid location");
--- a/Source/Containers/Hashmap.h	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Containers/Hashmap.h	Wed Nov 26 18:54:07 2014 +0200
@@ -64,7 +64,7 @@
 						throw std::runtime_error("Iterator is not valid.");
 					}
 					
-					currentit=container->mapping.erase(current);
+					currentit=container->mapping.erase(current());
 				}
 				
 				/// Deletes the item pointed by this iterator from the container. 
@@ -78,7 +78,7 @@
 					
 					typename H_::Type *item=currentit->second;
 					
-					currentit=container->mapping.erase(current);
+					currentit=container->mapping.erase(current());
 					delete item;
 				}				
 				
@@ -266,6 +266,8 @@
 			Hashmap &operator= (Hashmap &&other) {
 				RemoveAll();
 				Swap(other);
+				
+				return *this;
 			}
 			
 			/// Adds the given item with the related key. If the key already exists, the object it
--- a/Source/Event.h	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Event.h	Wed Nov 26 18:54:07 2014 +0200
@@ -88,6 +88,8 @@
 			template<class Source_, typename... Params_>
 			struct HandlerBase {
 				virtual void Fire(std::mutex &locker, Source_ *, Params_...) = 0;
+				
+				virtual ~HandlerBase() {}
 			};
 
 			template<class Source_, typename... Params_>
--- a/Source/Geometry/Bounds.h	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Geometry/Bounds.h	Wed Nov 26 18:54:07 2014 +0200
@@ -51,7 +51,7 @@
 
 		/// Constructs bounds from the given coordinates and size
 		basic_Bounds(const T_ &left, const T_ &top, const basic_Size<T_> &size) : Left(left), Top(top),
-		Right(TopLeft.X+size.Width), Bottom(TopLeft.Y+size.Height) {
+		Right(TopLeft().X+size.Width), Bottom(TopLeft().Y+size.Height) {
 			Normalize();
 		}
 
--- a/Source/SGuid.cpp	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/SGuid.cpp	Wed Nov 26 18:54:07 2014 +0200
@@ -6,6 +6,6 @@
 	unsigned SGuid::serial = 0;
 	const SGuid SGuid::Empty = SGuid();
 	
-	const SGuid::CreateNewTag SGuid::CreateNew;
+	const SGuid::CreateNewTag SGuid::CreateNew={};
 
 } 
--- a/Source/Scripting/Builtin.cpp	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Scripting/Builtin.cpp	Wed Nov 26 18:54:07 2014 +0200
@@ -66,7 +66,7 @@
 		void InitTypeType();
 		
 		Type *ArrayType();
-		std::initializer_list<Function*> ArrayFunctions();
+		std::vector<Function*> ArrayFunctions();
 		
 		Function *For();
 		Function *While();
@@ -254,6 +254,17 @@
 					MappedFunctions(Echo), MappedMethods(),
 					StretchTag, RepeatTag
 				),
+				new MappedFunction("Echo2",
+				"This function prints the given parameters to the screen.",
+				nullptr, nullptr, ParameterList{
+					new Parameter("string",
+					"The strings that will be printed.",
+					String
+					)
+				},
+				MappedFunctions(Echo), MappedMethods(),
+				StretchTag, RepeatTag
+				),
 			});
 			
 			Keywords={"Keywords", "Standard keywords like if and for.",
--- a/Source/Scripting/Data.h	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Scripting/Data.h	Wed Nov 26 18:54:07 2014 +0200
@@ -44,6 +44,7 @@
 			/// Assignment operator
 			Data &operator =(Data);
 			
+			bool IsNull() const;
 			
 			/// Returns the value of this data in the requested format
 			template <class T_>
--- a/Source/Scripting/Embedding.h	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Scripting/Embedding.h	Wed Nov 26 18:54:07 2014 +0200
@@ -169,21 +169,26 @@
 					using type=T_;
 				};
 				
+				/// This function checks if [param] parameter of function at [level] is correct or not.
 				template<int level, int param>
 				void checkfnparam() {
+					//compare with the first level
 					static_assert(std::is_same<paramof<level, param>, paramof<0, param>>::value,
 						"Function types do not match!"
 					);
 					
+					//check if the param type fits with the in-system parameters
+					
+					//if has parent and non-static, this function should have parent object as first parameter
 					if(parent.HasParent() && !parent.IsStatic()) {
 						if(param==0) {
 							if(traitsof<0>::IsMember && !parent.GetParent().IsReferenceType()) {
-								ASSERT( (parent.GetParent().GetDefaultValue().TypeCheck<typename std::remove_pointer<paramof<level, param>>::type>()) , 
+								ASSERT( (parent.GetParent().GetDefaultValue().template TypeCheck<typename std::remove_pointer<paramof<level, param>>::type>()) , 
 										"Function parameter type and object type does not match. In function: "+
 										parent.GetName()+" parameter", 5, 2);
 							}
 							else {
-								ASSERT((parent.GetParent().GetDefaultValue().TypeCheck<paramof<level, param>>()) ,
+								ASSERT((parent.GetParent().GetDefaultValue().template TypeCheck<paramof<level, param>>()) ,
 									   "Function parameter type ("+Utils::GetTypeName<paramof<level, param>>()+") "
 									   "and object type ("+parent.GetParent().GetDefaultValue().GetTypeName()+") does not match. In function: "+
 									   parent.GetName()+" parameter", 5, 2);
@@ -233,6 +238,7 @@
 					}
 				}
 				
+				/// Checks all parameters and return type of the function at [level]
 				template<int level, int ...S>
 				void checkfnlevel(TMP::Sequence<S...>) {
 					static_assert(traitsof<level>::Arity == traitsof<0>::Arity-level, 
@@ -245,13 +251,16 @@
 					char dummy[] = {0, (checkfnparam<level, S>(),'\0')...};
 				}
 				
+				/// Checks all parameters and returns types of all function levels
 				template<int ...S>
 				void checkallfns(TMP::Sequence<S...>) {
 					char dummy[]={0, (checkfnlevel<S>(typename TMP::Generate<traitsof<S>::Arity>::Type()),'\0')...};
 				}
 
+				/// Constructor, performs assignments and checks
 				fnstorageimpl(MappedFunction &parent, std::tuple<Fns_...> fns) : parent(parent), fns(fns) {
 					
+					///check number of functions
 					static_assert(sizeof...(Fns_)<=traitsof<0>::Arity+1,
 								  "Number of functions are more than possible");
 					
@@ -263,6 +272,7 @@
 					
 					checkallfns(typename TMP::Generate<sizeof...(Fns_)>::Type());
 					
+					//check optional parameters
 					bool shouldallbeoptional = false;
 					if(parent.Parameters.GetCount()>0 && parent.Parameters[0].IsOptional() && 
 						parent.Parameters.Last()->IsOptional()) {
@@ -306,6 +316,7 @@
 				static const int maxarity=traitsof<0>::Arity;
 				
 				
+				/// vector cast is for the repeating functions
 				template<int num, class T_>
 				typename std::enable_if<std::is_same<typename remove_vector<T_>::type, void>::value, T_>::type
 				vectorcast(const std::vector<Data> &datav) const {
@@ -365,6 +376,9 @@
 					
 					if(parent.HasParent() && !parent.IsStatic()) {
 						if(num==0) {
+							if(datav[num].IsNull()) {
+								throw std::runtime_error("Null value given for parent parameter");
+							}
 							if(&data.GetType() != &parent.GetParent()) {
 								throw std::runtime_error("Cannot convert $this to original parent type.");
 							}
--- a/Source/Scripting/Exceptions.h	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Scripting/Exceptions.h	Wed Nov 26 18:54:07 2014 +0200
@@ -19,7 +19,8 @@
 			MissingParameter,
 			TooManyParameters,
 			NoReturn,
-			CastError
+			CastError,
+			InstructionError
 		};
 		
 		DefineEnumStrings(ExceptionType,
@@ -33,7 +34,8 @@
 			{ExceptionType::MissingParameter, "Missing parameter"},
 			{ExceptionType::TooManyParameters, "Too many parameters"},
 			{ExceptionType::NoReturn, "No return type"},
-			{ExceptionType::CastError, "Cast error"}
+			{ExceptionType::CastError, "Cast error"},
+			{ExceptionType::InstructionError, "Instruction error"}
 		);
 		
 		enum class SymbolType {
@@ -184,6 +186,14 @@
 				this->details = details;
 			}
 		};
+		
+		class InstructionException : public Exception {
+		public:
+			explicit InstructionException(const std::string& message, const std::string &details="", long int linenumber = -1) :
+			Exception(ExceptionType::InstructionError, message, linenumber) {
+				this->details=details;
+			}
+		};
 
 
 
--- a/Source/Scripting/Keywords/For.cpp	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Scripting/Keywords/For.cpp	Wed Nov 26 18:54:07 2014 +0200
@@ -25,7 +25,7 @@
 				}
 
 				operator Data() {
-					static auto type=MappedValueType<ForScope, String::From<ForScope>, ParseThrow<ForScope>>("ForScope", "");
+					static MappedValueType<ForScope, String::From<ForScope>, ParseThrow<ForScope>> type("ForScope", "");
 
 					return Data(type, *this);
 				}
--- a/Source/Scripting/Keywords/If.cpp	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Scripting/Keywords/If.cpp	Wed Nov 26 18:54:07 2014 +0200
@@ -17,7 +17,7 @@
 			bool skipping = false;
 			
 			operator Data() {
-				static auto type=MappedValueType<IfScope, String::From<IfScope>, ParseThrow<IfScope>>("IfScope", "");
+				static MappedValueType<IfScope, String::From<IfScope>, ParseThrow<IfScope>> type("IfScope", "");
 				
 				return Data(type, *this);
 			}
--- a/Source/Scripting/Keywords/While.cpp	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Scripting/Keywords/While.cpp	Wed Nov 26 18:54:07 2014 +0200
@@ -21,7 +21,7 @@
 				}
 				
 				static Type &selftype() {
-					static auto type=MappedValueType<WhileScope, String::From<WhileScope>, ParseThrow<WhileScope>>("WhileScope", "");
+					static MappedValueType<WhileScope, String::From<WhileScope>, ParseThrow<WhileScope>> type("WhileScope", "");
 					
 					return type;
 				}
--- a/Source/Scripting/Reflection.h	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Scripting/Reflection.h	Wed Nov 26 18:54:07 2014 +0200
@@ -287,7 +287,7 @@
 			
 			
 			/// Destructor frees all parameters.
-			~Function() {
+			virtual ~Function() {
 				parameters.DeleteAll();
 			}
 
@@ -647,6 +647,8 @@
 			/// Sets the data of the data member
 			virtual void Set(Data &source, const Data &value) const = 0;
 			
+			virtual ~DataMember() { }
+			
 		protected:
 			/// @cond INTERNAL
 			void UnpackTags() { }
@@ -934,6 +936,8 @@
 			/// Inheritance list. 
 			const Containers::Hashmap<std::string, const Type, &Type::GetName, std::map, String::CaseInsensitiveLess> &InheritsFrom;
 			
+			
+			virtual ~Type() { }	
 		protected:
 
 			/// This function should delete the given object.
@@ -1020,19 +1024,31 @@
 				
 				return *this;
 			}
-			
+
 			void AddFunctions(const std::initializer_list<Function*> &list) {
 				for(auto &fn : list) {
 					functions.Add(fn);
 				}
 			}
-			
+
 			void AddTypes(const std::initializer_list<Type*> &list) {
 				for(auto &type : list) {
 					types.Add(type);
 				}
 			}
-			
+
+			void AddFunctions(const std::vector<Function*> &list) {
+				for(auto &fn : list) {
+					functions.Add(fn);
+				}
+			}
+
+			void AddTypes(const std::vector<Type*> &list) {
+				for(auto &type : list) {
+					types.Add(type);
+				}
+			}
+
 			
 			/// Returns the name of this library. Library names are also used as namespace specifiers
 			std::string GetName() const {
--- a/Source/Scripting/Scripting.cpp	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Scripting/Scripting.cpp	Wed Nov 26 18:54:07 2014 +0200
@@ -61,7 +61,17 @@
 		
 		return *this;
 	}
-
+	
+	bool Data::IsNull() const {
+		ASSERT(type, "Type is not set", 1, 2);
+		
+		if(type->IsReferenceType()) {
+			return data.Pointer()==nullptr;
+		}
+		else
+			return false;
+	}
+	
 	Data::~Data() {
 		if(type && type->IsReferenceType() && data.IsSet() && data.Pointer()) {
 			VirtualMachine::Get().References.Decrease(*this);
--- a/Source/Scripting/Types/Array.cpp	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Scripting/Types/Array.cpp	Wed Nov 26 18:54:07 2014 +0200
@@ -78,15 +78,19 @@
 						},
 						MappedFunctions(&Array::PushData), MappedMethods()	
 					},
+					new MappedFunction{"Size", "Returns the size of the array.",
+						Types::Unsigned(), array, ParameterList{ },
+						MappedFunctions([](Array *a) { return a->GetSize(); }), MappedMethods()	
+					},
 					new MappedFunction{"Resize", "Changes the size of the array. New elements will have their default value.",
-						nullptr, array, ParameterList{
-							new Parameter { "Size",
-								"The new size.",
-								Types::Unsigned()
+					nullptr, array, ParameterList{
+							new Parameter{"Size",
+							"The new size.",
+							Types::Unsigned()
 							}
 						},
-						MappedFunctions(&Array::Resize), MappedMethods()	
-					},
+							MappedFunctions(&Array::Resize), MappedMethods()
+						},
 				});
 			}
 			
@@ -106,7 +110,7 @@
 			return ret;
 		}
 		
-		std::initializer_list<Function*> ArrayFunctions() {
+		std::vector<Function*> ArrayFunctions() {
 			return {
 				new MappedFunction{"Range",
 					"Creates a range array between two numbers",
@@ -126,7 +130,7 @@
 						}
 					},
 					MappedFunctions(Range3, Range2), MappedMethods()
-				}
+				},
 			};
 		}
 	}
--- a/Source/Scripting/VirtualMachine.cpp	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Scripting/VirtualMachine.cpp	Wed Nov 26 18:54:07 2014 +0200
@@ -421,11 +421,11 @@
 				catch(ParseError) {
 					throw;
 				}
-// 				catch(Exception &ex) {
-// 					ex.SetLine(executionscopes.Last()->GetSource().GetPhysicalLine());
-// 
-// 					throw ex;
-// 				}
+ 				catch(Exception &ex) {
+ 					ex.SetLine(executionscopes.Last()->GetSource().GetPhysicalLine());
+ 
+ 					throw ex;
+ 				}
 			}
 
 			if(executionscopes.GetCount()==executiontarget) {
@@ -472,6 +472,17 @@
 			if(fn->HasParent()) {
 				if(pin!=incomingparams.end()) {
 					Data param=getvalue(*pin);
+					
+					if(fn->GetParent().IsReferenceType()) {
+						if(param.IsNull()) {
+							if(pin->Type==ValueType::Variable) {
+								throw NullValueException("$"+pin->Name);
+							}
+							else {
+								throw NullValueException("parent parameter");
+							}
+						}
+					}
 
 					if(param.GetType()==fn->GetParent()) {
 						//no worries
@@ -535,13 +546,13 @@
 					}
 					else  if(pin->Type==ValueType::Literal) {
 						if(pin->Literal.GetType()!=Types::String()) {
-							Utils::NotImplemented("Needs a proper error message");
+							throw InstructionException("Reference type can only be represented string literals and variables");
 						}
 						
 						params.push_back(pin->Literal);
 					}
 					else {
-						Utils::NotImplemented("Needs a proper error message");
+						throw InstructionException("Reference type can only be represented string literals and variables");
 					}
 				}
 				else if(pin!=incomingparams.end()) {
--- a/Source/Utils/Assert.h	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/Utils/Assert.h	Wed Nov 26 18:54:07 2014 +0200
@@ -158,10 +158,10 @@
 		#define ASSERT_ALL(expression, message, ...) do { if(!bool(expression)) { \
 			(Gorgon::Utils::CrashHandler(1, #expression, message, ##__VA_ARGS__) < expression); } } while(0)
 			
-#	ifdef MSVC
-		__declspec(noreturn) void NotImplemented(const std::string &what="This feature") { ASSERT(false, what+" is not implemented.", 0, 8); }
+#	ifdef _MSC_VER
+		__declspec(noreturn) inline void NotImplemented(const std::string &what="This feature") { ASSERT(false, what+" is not implemented.", 0, 8); }
 		
-		__declspec(noreturn) void ASSERT_FALSE(const std::string &message, int skip=1, int depth=4) { 
+		__declspec(noreturn) inline void ASSERT_FALSE(const std::string &message, int skip=1, int depth=4) {
 			ASSERT(false, message, skip, depth); 		
 		}
 #	else
--- a/Source/WindowManager/WindowManager.cpp	Wed Nov 19 11:38:22 2014 +0200
+++ b/Source/WindowManager/WindowManager.cpp	Wed Nov 26 18:54:07 2014 +0200
@@ -8,7 +8,7 @@
 
 	const Geometry::Point Window::automaticplacement={std::numeric_limits<int>::min(), std::numeric_limits<int>::min()};
 
-	const Window::FullscreenTag Window::Fullscreen;
+	const Window::FullscreenTag Window::Fullscreen={};
 	
 	namespace WindowManager {
 		/// @cond INTERNAL
--- a/Testing/Source/Manual/Generic.cpp	Wed Nov 19 11:38:22 2014 +0200
+++ b/Testing/Source/Manual/Generic.cpp	Wed Nov 26 18:54:07 2014 +0200
@@ -14,6 +14,9 @@
 -s"echo" ."1"
 -s"echo" s""
 
+#."1"=-s"nullarr"
+#*s"size" ."1"
+
 $"i" = i"1"
 + "while"
 ."1" = -s"<" $"i" i"5"
@@ -94,50 +97,50 @@
 	try {
 		vm.Start(input);
 	}
-// 	catch(const Exception &ex) {
-// 
-// 		std::cout<<std::endl<<std::endl;
-// 		Gorgon::Console::SetBold();
-// 		Gorgon::Console::SetColor(Gorgon::Console::Yellow);
-// 		std::cout<<"SOURCE CODE: "<<std::endl;
-// 		Gorgon::Console::Reset();
-// 
-// 		std::stringstream ss2(source);
-// 		std::string line;
-// 		int linenr=0;
-// 		while(std::getline(ss2, line)) {
-// 			linenr++;
-// 			if(linenr==ex.GetLine())
-// 				Gorgon::Console::SetColor(Gorgon::Console::Red);
-// 
-// 			Gorgon::Console::SetBold();
-// 			std::cout<<std::setw(3)<<linenr<<" ";
-// 			Gorgon::Console::SetBold(false);
-// 			std::cout<<line<<std::endl;
-// 			Gorgon::Console::Reset();
-// 		}
-// 		std::cout<<std::endl<<std::endl;
-// 
-// 
-// 		std::cout<<std::endl<<std::endl;
-// 		Gorgon::Console::SetBold();
-// 		Gorgon::Console::SetColor(Gorgon::Console::Yellow);
-// 		std::cout<<"ERROR: "<<std::endl;
-// 		Gorgon::Console::Reset();
-// 
-// 		Gorgon::Console::SetBold();
-// 		std::cout<<"At line "<<ex.GetLine();
-// 		Gorgon::Console::SetBold(false);
-// 		Gorgon::Console::SetColor(Gorgon::Console::Red);
-// 		std::cout<<": "<<ex.GetType();
-// 		Gorgon::Console::SetColor(Gorgon::Console::Default);
-// 		std::cout<<": "<<ex.GetMessage()<<std::endl;
-// 		if(ex.GetDetails()!="") {
-// 			std::cout<<" > "<<ex.GetDetails()<<std::endl;
-// 		}
-// 
-// 		return 1;
-// 	}
+	catch(const Exception &ex) {
+
+		std::cout<<std::endl<<std::endl;
+		Gorgon::Console::SetBold();
+		Gorgon::Console::SetColor(Gorgon::Console::Yellow);
+		std::cout<<"SOURCE CODE: "<<std::endl;
+		Gorgon::Console::Reset();
+
+		std::stringstream ss2(source);
+		std::string line;
+		int linenr=0;
+		while(std::getline(ss2, line)) {
+			linenr++;
+			if(linenr==ex.GetLine())
+				Gorgon::Console::SetColor(Gorgon::Console::Red);
+
+			Gorgon::Console::SetBold();
+			std::cout<<std::setw(3)<<linenr<<" ";
+			Gorgon::Console::SetBold(false);
+			std::cout<<line<<std::endl;
+			Gorgon::Console::Reset();
+		}
+		std::cout<<std::endl<<std::endl;
+
+
+		std::cout<<std::endl<<std::endl;
+		Gorgon::Console::SetBold();
+		Gorgon::Console::SetColor(Gorgon::Console::Yellow);
+		std::cout<<"ERROR: "<<std::endl;
+		Gorgon::Console::Reset();
+
+		Gorgon::Console::SetBold();
+		std::cout<<"At line "<<ex.GetLine();
+		Gorgon::Console::SetBold(false);
+		Gorgon::Console::SetColor(Gorgon::Console::Red);
+		std::cout<<": "<<ex.GetType();
+		Gorgon::Console::SetColor(Gorgon::Console::Default);
+		std::cout<<": "<<ex.GetMessage()<<std::endl;
+		if(ex.GetDetails()!="") {
+			std::cout<<" > "<<ex.GetDetails()<<std::endl;
+		}
+
+		return 1;
+	}
 	catch(const ParseError &ex) {
 
 		std::stringstream ss2(source);

mercurial