Mark Sibly 9 lat temu
rodzic
commit
1899daccce

+ 5 - 8
modules/mojo/app/app.monkey2

@@ -119,9 +119,6 @@ Class AppInstance
 #Else If __DESKTOP_TARGET__
 
 #if __TARGET__="windows"
-
-		Local gl_major:=Int( GetConfig( "GL_context_major_version",-1 ) )
-		Local gl_minor:=Int( GetConfig( "GL_context_major_version",-1 ) )
 		
 		Local gl_profile:Int
 
@@ -132,14 +129,14 @@ Class AppInstance
 			gl_profile=SDL_GL_CONTEXT_PROFILE_COMPATIBILITY
 		Default
 			gl_profile=SDL_GL_CONTEXT_PROFILE_ES
-			If gl_major=-1 gl_major=2
-			If gl_minor=-1 gl_minor=0
 		End
+
+		Local gl_major:=Int( GetConfig( "GL_context_major_version",2 ) )
+		Local gl_minor:=Int( GetConfig( "GL_context_minor_version",0 ) )
 		
 		SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK,gl_profile )
-		
-		If gl_major<>-1 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION,gl_major )
-		If gl_minor<>-1 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION,gl_minor )
+		SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION,gl_major )
+		SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION,gl_minor )
 
 #Endif
 

+ 1 - 1
modules/mojo/app/native/app.cpp

@@ -16,7 +16,7 @@ namespace bbApp{
 		uevent.data2=0;
 	
 		if( SDL_PeepEvents( (SDL_Event*)&uevent,1,SDL_ADDEVENT,SDL_FIRSTEVENT,SDL_LASTEVENT )!=1 ){
-			printf( "SDL_PeepEvents error!\n" );fflush( stdout );
+			printf( "SDL_PeepEvents error: %s\n",SDL_GetError() );fflush( stdout );
 		}
 	}
 

+ 1 - 0
modules/monkey/docs/language/expressions.md

@@ -11,6 +11,7 @@
 | `Super`			| Super instance			|
 | `True`			| Boolean true				|
 | `False`			| Boolean false				|
+| `Typeof`			| Typeof operator			|
 | `Cast`			| Cast operator				|
 | `Lambda`			| Lambda function			|
 | _identifier_		| Identifier				|

+ 0 - 1
modules/monkey/docs/language/functions.md

@@ -49,7 +49,6 @@ End )
 Note the closing `)` after the `End` to match the opening `(` after `SomeFunc`.
 
 
-
 #### Function values
 
 Monkey2 supports 'first class' functions.

+ 27 - 8
modules/monkey/types.monkey2

@@ -483,7 +483,6 @@ Class @TypeInfo Extends Void="bbTypeInfo"
 	#end
 	Property SuperType:TypeInfo()="superType"
 	
-	
 	#rem monkeydoc Implemented interfaces.
 	
 	The interfaces implemented by the class or interface type.
@@ -558,21 +557,32 @@ Class DeclInfo Extends Void="bbDeclInfo"
 	#rem monkeydoc Declaration type.
 	#end
 	Property Type:TypeInfo()="getType"
+
+	#rem monkeydoc True if Get can be used with this declaration.
+	#end	
+	Property Gettable:Bool()="gettable"
+
+	#rem monkeydoc True if Set can be used with this declaration.
+	#end	
+	Property Settable:Bool()="settable"
+
+	#rem monkeydoc True if Invoke can be used with this declaration.
+	#end	
+	Property Invokable:Bool()="invokable"
 	
 	#rem monkeydoc Gets string representation of decl.
 	#end
 	Method To:String()="toString"
-	
-	#rem monkeydoc Sets field or global value.
 
-	If the declaration kind is 'Global', the `instance` parameter is ignored.
-	
-	A runtime error will occur if the declaration kind is not 'Field' or 'Global'.
+	#rem monkeydoc Gets meta data keys.
+	#end	
+	Method GetMetaKeys:String[]()="getMetaKeys"
 	
+	#rem monkeydoc Gets meta data value for a key.
 	#end
-	Method Set( instance:Variant,value:Variant )="set"
+	Method GetMetaValue:String( key:String )="getMetaValue"
 	
-	#rem monkeydoc Gets field or global value.
+	#rem monkeydoc Gets field, property or global value.
 	
 	If the declaration kind is 'Global', the `instance` parameter is ignored.
 	
@@ -581,6 +591,15 @@ Class DeclInfo Extends Void="bbDeclInfo"
 	#end
 	Method Get:Variant( instance:Variant )="get"
 	
+	#rem monkeydoc Sets field, property or global value.
+
+	If the declaration kind is 'Global', the `instance` parameter is ignored.
+	
+	A runtime error will occur if the declaration kind is not 'Field' or 'Global'.
+	
+	#end
+	Method Set( instance:Variant,value:Variant )="set"
+	
 	#rem monkeydoc Invokes method or function.
 
 	If the declaration kind is 'Function', the `instance` parameter is ignored.