Ver Fonte

Removed Min/Max keywords.
They have been replaced by Functions in brl.blitz.

woollybah há 6 anos atrás
pai
commit
83f78dd37c
5 ficheiros alterados com 0 adições e 149 exclusões
  1. 0 4
      config.bmx
  2. 0 37
      ctranslator.bmx
  3. 0 72
      expr.bmx
  4. 0 28
      parser.bmx
  5. 0 8
      translator.bmx

+ 0 - 4
config.bmx

@@ -304,10 +304,6 @@ Function MakeKeywords:String()
 	keywords :+ "Sgn#(v#)=~qbrl_blitz_keywords_sgn~q~n"
 	keywords :+ "Sgn#(v#)=~qbrl_blitz_keywords_sgn~q~n"
 	keywords :+ "Chr$(v%)=~qbrl_blitz_keywords_chr~q~n"
 	keywords :+ "Chr$(v%)=~qbrl_blitz_keywords_chr~q~n"
 	keywords :+ "Len%(v:Object)=~qbrl_blitz_keywords_len~q~n"
 	keywords :+ "Len%(v:Object)=~qbrl_blitz_keywords_len~q~n"
-	keywords :+ "Min%(v1%,v2%)=~qbrl_blitz_keywords_min~q~n"
-	keywords :+ "Max%(v1%,v2%)=~qbrl_blitz_keywords_max~q~n"
-	'keywords :+ "SizeOf%(v%)=~qbrl_blitz_keywords_sizeof~q~n"
-	'keywords :+ "Incbin(v$)=~qbrl_blitz_keywords_incbin~q~n"
 	keywords :+ "IncbinPtr@*(v$)=~qbbIncbinPtr~q~n"
 	keywords :+ "IncbinPtr@*(v$)=~qbbIncbinPtr~q~n"
 	keywords :+ "IncbinLen%(v$)=~qbbIncbinLen~q~n"
 	keywords :+ "IncbinLen%(v$)=~qbbIncbinLen~q~n"
  
  

+ 0 - 37
ctranslator.bmx

@@ -1383,43 +1383,6 @@ t:+"NULLNULLNULL"
 '		End If
 '		End If
 	End Method
 	End Method
 
 
-	Method TransMinExpr:String(expr:TMinExpr)
-		Local s:String
-		If TDecimalType(expr.exprType) Then
-			s = "bbFloatMin"
-		Else If TLongType(expr.exprType) Then
-			s = "bbLongMin"
-		Else If TSizeTType(expr.exprType) Then
-			s = "bbSizetMin"
-		Else If TUIntType(expr.exprType) Then
-			s = "bbUIntMin"
-		Else If TULongType(expr.exprType) Then
-			s = "bbULongMin"
-		Else
-			s = "bbIntMin"
-		End If
-
-		Return s + Bra(expr.expr.trans() + "," + expr.expr2.Trans())
-	End Method
-
-	Method TransMaxExpr:String(expr:TMaxExpr)
-		Local s:String
-		If TDecimalType(expr.exprType) Then
-			s = "bbFloatMax"
-		Else If TLongType(expr.exprType) Then
-			s = "bbLongMax"
-		Else If TSizeTType(expr.exprType) Then
-			s = "bbSizetMax"
-		Else If TUIntType(expr.exprType) Then
-			s = "bbUIntMax"
-		Else If TULongType(expr.exprType) Then
-			s = "bbULongMax"
-		Else
-			s = "bbIntMax"
-		End If
-		Return s + Bra(expr.expr.trans() + "," + expr.expr2.Trans())
-	End Method
-
 	Method TransAscExpr:String(expr:TAscExpr)
 	Method TransAscExpr:String(expr:TAscExpr)
 		Return "bbStringAsc" + Bra(expr.expr.Trans())
 		Return "bbStringAsc" + Bra(expr.expr.Trans())
 	End Method
 	End Method

+ 0 - 72
expr.bmx

@@ -3063,78 +3063,6 @@ Type TSgnExpr Extends TBuiltinExpr
 
 
 End Type
 End Type
 
 
-Type TMinExpr Extends TBuiltinExpr
-
-	Field expr2:TExpr
-
-	Method Create:TMinExpr( lhs:TExpr, rhs:TExpr )
-		Self.id="min"
-		Self.expr=lhs
-		Self.expr2=rhs
-		Return Self
-	End Method
-
-	Method Semant:TExpr()
-		If exprType Return Self
-
-		expr=expr.Semant()
-		expr2=expr2.Semant()
-		
-		If TInt128Type(expr.exprType) Or TInt128Type(expr2.exprType) Err "'Min' does not support Int128 type. Use specific intrinsic function instead."
-		If TFloat64Type(expr.exprType) Or TFloat64Type(expr2.exprType) Err "'Min' does not support Float64 type. Use specific intrinsic function instead."
-		If TFloat128Type(expr.exprType) Or TFloat128Type(expr2.exprType) Err "'Min' does not support Float128 type. Use specific intrinsic function instead."
-		If TDouble128Type(expr.exprType) Or TDouble128Type(expr2.exprType) Err "'Min' does not support Double128 type. Use specific intrinsic function instead."
-
-		exprType=BalanceTypes(expr.exprType, expr2.exprType)
-		Return Self
-	End Method
-
-	Method Copy:TExpr()
-		Return New TMinExpr.Create( CopyExpr(expr), CopyExpr(expr2) )
-	End Method
-
-	Method ToString$()
-		Return "TMinExpr("+expr.ToString()+"," + expr2.ToString() + ")"
-	End Method
-
-End Type
-
-Type TMaxExpr Extends TBuiltinExpr
-
-	Field expr2:TExpr
-
-	Method Create:TMaxExpr( lhs:TExpr, rhs:TExpr )
-		Self.id="max"
-		Self.expr=lhs
-		Self.expr2=rhs
-		Return Self
-	End Method
-
-	Method Semant:TExpr()
-		If exprType Return Self
-
-		expr=expr.Semant()
-		expr2=expr2.Semant()
-
-		If TInt128Type(expr.exprType) Or TInt128Type(expr2.exprType) Err "'Max' does not support Int128 type. Use specific intrinsic function instead."
-		If TFloat64Type(expr.exprType) Or TFloat64Type(expr2.exprType) Err "'Max' does not support Float64 type. Use specific intrinsic function instead."
-		If TFloat128Type(expr.exprType) Or TFloat128Type(expr2.exprType) Err "'Max' does not support Float128 type. Use specific intrinsic function instead."
-		If TDouble128Type(expr.exprType) Or TDouble128Type(expr2.exprType) Err "'Max' does not support Double128 type. Use specific intrinsic function instead."
-
-		exprType=BalanceTypes(expr.exprType, expr2.exprType)
-		Return Self
-	End Method
-
-	Method Copy:TExpr()
-		Return New TMaxExpr.Create( CopyExpr(expr), CopyExpr(expr2) )
-	End Method
-
-	Method ToString$()
-		Return "TMaxExpr("+expr.ToString()+"," + expr2.ToString() + ")"
-	End Method
-
-End Type
-
 Type TSizeOfExpr Extends TBuiltinExpr
 Type TSizeOfExpr Extends TBuiltinExpr
 
 
 	Method Create:TSizeOfExpr( expr:TExpr )
 	Method Create:TSizeOfExpr( expr:TExpr )

+ 0 - 28
parser.bmx

@@ -1281,34 +1281,6 @@ Type TParser Extends TGenProcessor
 				expr=ParseExpr()
 				expr=ParseExpr()
 				expr=New TAbsExpr.Create( expr )
 				expr=New TAbsExpr.Create( expr )
 			EndIf
 			EndIf
-		Case "min"
-			NextToke
-			' optional brackets
-			Local b:Int = CParse( "(" )
-
-			expr=ParseExpr()
-			Parse ","
-			Local expr2:TExpr=ParseExpr()
-
-			If b Then
-				Parse ")"
-			End If
-
-			expr=New TMinExpr.Create( expr, expr2 )
-		Case "max"
-			NextToke
-			' optional brackets
-			Local b:Int = CParse( "(" )
-
-			expr=ParseExpr()
-			Parse ","
-			Local expr2:TExpr=ParseExpr()
-
-			If b Then
-				Parse ")"
-			End If
-
-			expr=New TMaxExpr.Create( expr, expr2 )
 		Case "asc"
 		Case "asc"
 			NextToke
 			NextToke
 
 

+ 0 - 8
translator.bmx

@@ -1312,8 +1312,6 @@ End Rem
 	End Method
 	End Method
 
 
 	Method TransBuiltinExpr$( expr:TBuiltinExpr )
 	Method TransBuiltinExpr$( expr:TBuiltinExpr )
-		If TMinExpr(expr) Return TransMinExpr(TMinExpr(expr))
-		If TMaxExpr(expr) Return TransMaxExpr(TMaxExpr(expr))
 		If TAbsExpr(expr) Return TransAbsExpr(TAbsExpr(expr))
 		If TAbsExpr(expr) Return TransAbsExpr(TAbsExpr(expr))
 		If TAscExpr(expr) Return TransAscExpr(TAscExpr(expr))
 		If TAscExpr(expr) Return TransAscExpr(TAscExpr(expr))
 		If TChrExpr(expr) Return TransChrExpr(TChrExpr(expr))
 		If TChrExpr(expr) Return TransChrExpr(TChrExpr(expr))
@@ -1323,12 +1321,6 @@ End Rem
 		Err "TODO : TransBuiltinExpr()"
 		Err "TODO : TransBuiltinExpr()"
 	End Method
 	End Method
 	
 	
-	Method TransMinExpr:String(expr:TMinExpr)
-	End Method
-
-	Method TransMaxExpr:String(expr:TMaxExpr)
-	End Method
-
 	Method TransAbsExpr:String(expr:TAbsExpr)
 	Method TransAbsExpr:String(expr:TAbsExpr)
 	End Method
 	End Method