Commit Graph
28 Commits
Author SHA1 Message Date
Miguel de Icaza c11152b046 2008-01-22 Miguel de Icaza <[email protected]>
* BinaryExpression.cs: Unleash the power of cut and paste.

	Bring a bunch of operatros from mcs/expression.cs

	* Expression.cs: There is no op_LogicalAnd or op_LogicalOr, I just
	used those from mcs, that was wrong.   use the proper ones, clean
	up the result.

	* BinaryExpression.cs: Add method invocations for binary methods. 


svn path=/trunk/mcs/; revision=93613
2008-01-23 01:18:25 +00:00
Miguel de Icaza aeaffaada3 2008-01-22 Miguel de Icaza <[email protected]>
* Expression.cs: There is no op_LogicalAnd or op_LogicalOr, I just
	used those from mcs, that was wrong.   use the proper ones, clean
	up the result.

	* BinaryExpression.cs: Add method invocations for binary methods. 



svn path=/trunk/mcs/; revision=93605
2008-01-22 23:51:22 +00:00
Miguel de Icaza b9b9a664e0 2008-01-22 Miguel de Icaza <[email protected]>
* BinaryExpression.cs (EmitCoalesce): Add support for emitting
	code for Coalesce.

	TODO: this does not use the "Conversion" Lambda, which am not sure
	who generates this or what it is used for.

	(EmitLogical): Fix a couple of bugs in AndAlso, OrElse.	

	* Expression.cs: Add support for Coalesce.
	(BinaryCoreCheck): Move more checking here, instead of the helper
	routines, will remove them next.
	
	* LambdaExpression.cs (Compile): Create the delegate last, so we
	manage to save the assembly while debugging in case of error


svn path=/trunk/mcs/; revision=93480
2008-01-22 07:01:58 +00:00
Miguel de Icaza 70bf0fecac 2008-01-21 Miguel de Icaza <[email protected]>
* Expression.cs (BinaryCoreCheck): Add checking for a few
	operators here (to avoid doing a second pass, handles AndAlso and
	OrElse). 

	(AndAlso, OrElse): Add some code.

	* BinaryExpression.cs: Instead of using GetValueOrDefault use
	get_Value, as we already probed for the lack of value.

	Split out support for And/Or to a separate routine as the code is
	not very easy to share with the arithmetics code. 


svn path=/trunk/mcs/; revision=93471
2008-01-22 01:25:04 +00:00
Marek Safar b4b685024a 2008-01-21 Marek Safar <[email protected]>
* BinaryExpression.cs: Fixed initobj initialization.
	

svn path=/trunk/mcs/; revision=93437
2008-01-21 19:31:05 +00:00
Marek Safar 2ece240c14 2008-01-21 Marek Safar <[email protected]>
* BinaryExpression.cs: Fixed initobj initialization.
	

svn path=/trunk/mcs/; revision=93434
2008-01-21 19:18:00 +00:00
Jb Evain 619e5002f0 2008-01-21 Jb Evain <[email protected]>
* Expression.cs, UnaryExpression.cs, BinaryExpression.cs:
	Move the IsUnsigned helper from BinaryExpression to Expression,
	so it can be used in UnaryExpression.


svn path=/trunk/mcs/; revision=93387
2008-01-21 14:12:21 +00:00
Miguel de Icaza 6b6d7966f4 Improve this, still wrong
svn path=/trunk/mcs/; revision=93370
2008-01-21 06:14:06 +00:00
Miguel de Icaza b032fe6df6 2008-01-21 Miguel de Icaza <[email protected]>
* Start code generation for nullables, currently this generates
	incorrect code for things like:
	
	Expression<Func<int?, int?, int?>> e2 = (a, b) => a + b;
	e2.Compile ().Invoke (null, 3))

	This should return null, but returns something else.

	* Introduce LINQ_DBG env variable, which generates a linq file in
	/tmp;   It currently does not work as well as it should, as the
	Func<> parameters do not mwatch the generated method.
	Investigate. 


svn path=/trunk/mcs/; revision=93369
2008-01-21 06:05:28 +00:00
Miguel de Icaza 1affd8bf07 2008-01-20 Miguel de Icaza <[email protected]>
Introduce support for Nullable arguments, no code is generated for
	these yet, its only tests + node creation behavior at this point.
	
	* Expression.cs (BinaryCoreCheck): Do not allow "int?" and "int"
	as operators, they must both be nullable.

	NullableTypes in the arguments are transformed into the underlying
	values when doing the method validation.  


svn path=/trunk/mcs/; revision=93368
2008-01-21 00:45:16 +00:00
Jb Evain c60bc5dd0b spaces to tabs
svn path=/trunk/mcs/; revision=93244
2008-01-18 12:11:34 +00:00
Miguel de Icaza aeff6b77be Remove TypeCode in a few places, there is one place where its actually useful (ConstantExpression.Emit) and I dont feel like rewriting that one
svn path=/trunk/mcs/; revision=93232
2008-01-18 08:30:30 +00:00
Miguel de Icaza 9586c1c5c5 2008-01-18 Miguel de Icaza <[email protected]>
* BinaryExpression.cs: Add support for emitting code for some
	operators (ported from the Mono C# compiler).   

	Add tests.


svn path=/trunk/mcs/; revision=93231
2008-01-18 08:03:10 +00:00
Jb Evain c45a2971f7 2008-01-17 Jb Evain <[email protected]>
* Expression.cs, ExpressionPrinter.cs, BinaryExpression.cs:
	implement ArrayIndex.


svn path=/trunk/mcs/; revision=93148
2008-01-17 13:04:32 +00:00
Miguel de Icaza 68b16f4347 2008-01-14 Miguel de Icaza <[email protected]>
* Expression.cs: Bring back the (most) of binary operators.  Added
	type checking as well and reorganized the source file by topic
	instead of alphabetical sorting.


svn path=/trunk/mcs/; revision=92917
2008-01-15 00:19:41 +00:00
Jb Evain 604ad2679b 2008-01-14 Jb Evain <[email protected]>
* BinaryExpression.cs,
	* Expression.cs: revert part of Miguel's last patch.
	MakeBinary is expected to call the appropriate factory
	methods. Whose methods that are responsible for creating
	the good BinaryExpression, wether they use a custom method
	or not.


svn path=/trunk/mcs/; revision=92837
2008-01-14 09:52:31 +00:00
Miguel de Icaza 622befc4b3 2008-01-14 Miguel de Icaza <[email protected]>
* Expression.cs (Constant, MakeBinary and consumers of it): Some
	more fill-up changes.

	MakeBinary will need much more work to support user-provided
	types. 


svn path=/trunk/mcs/; revision=92833
2008-01-14 05:02:54 +00:00
Jb Evain 71088609e9 fresh impl
svn path=/trunk/mcs/; revision=92823
2008-01-13 22:16:25 +00:00
Jb Evain f6359e4092 make some room
svn path=/trunk/mcs/; revision=92822
2008-01-13 22:11:43 +00:00
Jb Evain c53053a916 tabs instead of spaces
svn path=/trunk/mcs/; revision=92514
2008-01-09 15:52:22 +00:00
Marek Safar cc6cda3ecf 2007-12-04 Marek Safar <[email protected]>
* ElementInit.cs: New implementation.
	
	* Funclet.cs, FuncletExpression.cs, LiftExpression.cs: Removed.
	* ListInitExpression.cs, MemberListBinding.cs, Expression.cs,
	  ExpressionType.cs, BinaryExpression.cs, NewExpression.cs: API update.
	  

svn path=/trunk/mcs/; revision=90663
2007-12-04 12:57:54 +00:00
Federico Di Gregorio ee1bbb12c3 Implemented Or and OrElse.
svn path=/trunk/mcs/; revision=84246
2007-08-16 23:03:15 +00:00
Jb Evain 9424574856 revert after 2.1 corlib fix
svn path=/trunk/mcs/; revision=84162
2007-08-15 19:26:11 +00:00
Jb Evain 1e7e49ab87 use only 2.1 available AppendFormat method
svn path=/trunk/mcs/; revision=84157
2007-08-15 17:03:03 +00:00
Federico Di Gregorio ad98df1a44 MethodCallExpression complete. Added ArrayIndex and ArrayLength.
svn path=/trunk/mcs/; revision=84124
2007-08-14 22:12:39 +00:00
Miguel de Icaza f4389f3b61 2007-08-13 Federico Di Gregorio <[email protected]>
* Added Test/ directory, modified Makefile to build and execute
	them
	
	* Changed a couple of Expression methods to raise exceptions
	identicals to MS ones
	
	* Added tests for AddExpression and ConstantExpression
	* Implemented somme missing stuff in BinaryExpression
	* The stuff in ExpressionUtils is very generic and does quite some
	  redundant checks: I started splitting the stuff there into more   
	  "specific" methods that should be both understandable and fast.
	
	I fixed the StringBuilder problem, added unique IDs to all tests,
	used Assert.IsNull where appropriate and fixed one more Expression

svn path=/trunk/mcs/; revision=84011
2007-08-13 21:08:24 +00:00
Miguel de Icaza 7a419ba406 command line options, and dos2unix
svn path=/trunk/mcs/; revision=74904
2007-03-23 19:11:16 +00:00
Antonello Provenzano 0a4912d7a2 Implementation of the basic features of LINQ Expressions.
svn path=/trunk/mcs/; revision=74894
2007-03-23 18:03:41 +00:00