-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HRON basic parser now supports NET2.0. In addition added help functio…
…ns to help backmigrate code to NET2.0.
- Loading branch information
Showing
19 changed files
with
1,697 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
| ||
// ---------------------------------------------------------------------------------------------- | ||
// Copyright (c) Mårten Rånge. | ||
// ---------------------------------------------------------------------------------------------- | ||
// This source code is subject to terms and conditions of the Microsoft Public License. A | ||
// copy of the license can be found in the License.html file at the root of this distribution. | ||
// If you cannot locate the Microsoft Public License, please send an email to | ||
// [email protected]. By using this source code in any fashion, you are agreeing to be bound | ||
// by the terms of the Microsoft Public License. | ||
// ---------------------------------------------------------------------------------------------- | ||
// You must not remove this notice, or any other, from this software. | ||
// ---------------------------------------------------------------------------------------------- | ||
|
||
// ### INCLUDE: ../Common/Config.cs | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
<# | ||
// ---------------------------------------------------------------------------------------------- | ||
// Copyright (c) Mårten Rånge. | ||
// ---------------------------------------------------------------------------------------------- | ||
// This source code is subject to terms and conditions of the Microsoft Public License. A | ||
// copy of the license can be found in the License.html file at the root of this distribution. | ||
// If you cannot locate the Microsoft Public License, please send an email to | ||
// [email protected]. By using this source code in any fashion, you are agreeing to be bound | ||
// by the terms of the Microsoft Public License. | ||
// ---------------------------------------------------------------------------------------------- | ||
// You must not remove this notice, or any other, from this software. | ||
// ---------------------------------------------------------------------------------------------- | ||
#> | ||
// ---------------------------------------------------------------------------------------------- | ||
// Copyright (c) Mårten Rånge. | ||
// ---------------------------------------------------------------------------------------------- | ||
// This source code is subject to terms and conditions of the Microsoft Public License. A | ||
// copy of the license can be found in the License.html file at the root of this distribution. | ||
// If you cannot locate the Microsoft Public License, please send an email to | ||
// [email protected]. By using this source code in any fashion, you are agreeing to be bound | ||
// by the terms of the Microsoft Public License. | ||
// ---------------------------------------------------------------------------------------------- | ||
// You must not remove this notice, or any other, from this software. | ||
// ---------------------------------------------------------------------------------------------- | ||
|
||
// ### INCLUDE: ../Common/Config.cs | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// ---------------------------------------------------------------------------------------------- | ||
// Copyright (c) Mårten Rånge. | ||
// ---------------------------------------------------------------------------------------------- | ||
// This source code is subject to terms and conditions of the Microsoft Public License. A | ||
// copy of the license can be found in the License.html file at the root of this distribution. | ||
// If you cannot locate the Microsoft Public License, please send an email to | ||
// [email protected]. By using this source code in any fashion, you are agreeing to be bound | ||
// by the terms of the Microsoft Public License. | ||
// ---------------------------------------------------------------------------------------------- | ||
// You must not remove this notice, or any other, from this software. | ||
// ---------------------------------------------------------------------------------------------- | ||
|
||
// ### INCLUDE: Generated_Common.cs | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
using System; | ||
|
||
sealed class ExtensionAttribute : Attribute | ||
{ | ||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
// ---------------------------------------------------------------------------------------------- | ||
// Copyright (c) Mårten Rånge. | ||
// ---------------------------------------------------------------------------------------------- | ||
// This source code is subject to terms and conditions of the Microsoft Public License. A | ||
// copy of the license can be found in the License.html file at the root of this distribution. | ||
// If you cannot locate the Microsoft Public License, please send an email to | ||
// [email protected]. By using this source code in any fashion, you are agreeing to be bound | ||
// by the terms of the Microsoft Public License. | ||
// ---------------------------------------------------------------------------------------------- | ||
// You must not remove this notice, or any other, from this software. | ||
// ---------------------------------------------------------------------------------------------- | ||
|
||
// ############################################################################ | ||
// # # | ||
// # ---==> T H I S F I L E I S G E N E R A T E D <==--- # | ||
// # # | ||
// # This means that any edits to the .cs file will be lost when its # | ||
// # regenerated. Changes should instead be applied to the corresponding # | ||
// # template file (.tt) # | ||
// ############################################################################ | ||
|
||
|
||
|
||
|
||
|
||
|
||
namespace System | ||
{ | ||
public delegate TResult Func<out TResult> (); | ||
public delegate TResult Func<in T0, out TResult> (T0 v0); | ||
|
||
public delegate void Action< | ||
in T0 | ||
, in T1 | ||
> ( | ||
T0 v0 | ||
, T1 v1 | ||
); | ||
|
||
public delegate TResult Func< | ||
in T0 | ||
, in T1 | ||
, out TResult | ||
> ( | ||
T0 v0 | ||
, T1 v1 | ||
); | ||
|
||
public delegate void Action< | ||
in T0 | ||
, in T1 | ||
, in T2 | ||
> ( | ||
T0 v0 | ||
, T1 v1 | ||
, T2 v2 | ||
); | ||
|
||
public delegate TResult Func< | ||
in T0 | ||
, in T1 | ||
, in T2 | ||
, out TResult | ||
> ( | ||
T0 v0 | ||
, T1 v1 | ||
, T2 v2 | ||
); | ||
|
||
public delegate void Action< | ||
in T0 | ||
, in T1 | ||
, in T2 | ||
, in T3 | ||
> ( | ||
T0 v0 | ||
, T1 v1 | ||
, T2 v2 | ||
, T3 v3 | ||
); | ||
|
||
public delegate TResult Func< | ||
in T0 | ||
, in T1 | ||
, in T2 | ||
, in T3 | ||
, out TResult | ||
> ( | ||
T0 v0 | ||
, T1 v1 | ||
, T2 v2 | ||
, T3 v3 | ||
); | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// ---------------------------------------------------------------------------------------------- | ||
// Copyright (c) Mårten Rånge. | ||
// ---------------------------------------------------------------------------------------------- | ||
// This source code is subject to terms and conditions of the Microsoft Public License. A | ||
// copy of the license can be found in the License.html file at the root of this distribution. | ||
// If you cannot locate the Microsoft Public License, please send an email to | ||
// [email protected]. By using this source code in any fashion, you are agreeing to be bound | ||
// by the terms of the Microsoft Public License. | ||
// ---------------------------------------------------------------------------------------------- | ||
// You must not remove this notice, or any other, from this software. | ||
// ---------------------------------------------------------------------------------------------- | ||
|
||
<#@ include file = "..\T4\Header.ttinclude" #> | ||
|
||
<# | ||
var count = 5; | ||
#> | ||
|
||
namespace System | ||
{ | ||
public delegate TResult Func<out TResult> (); | ||
public delegate TResult Func<in T0, out TResult> (T0 v0); | ||
|
||
<# | ||
for (var iter = 2; iter < count; ++iter) | ||
{ | ||
#> | ||
public delegate void Action< | ||
in T0 | ||
<# | ||
for (var inner = 1; inner < iter; ++inner) | ||
{ | ||
#> | ||
, in T<#=inner#> | ||
<# | ||
} | ||
#> | ||
> ( | ||
T0 v0 | ||
<# | ||
for (var inner = 1; inner < iter; ++inner) | ||
{ | ||
#> | ||
, T<#=inner#> v<#=inner#> | ||
<# | ||
} | ||
#> | ||
); | ||
|
||
public delegate TResult Func< | ||
in T0 | ||
<# | ||
for (var inner = 1; inner < iter; ++inner) | ||
{ | ||
#> | ||
, in T<#=inner#> | ||
<# | ||
} | ||
#> | ||
, out TResult | ||
> ( | ||
T0 v0 | ||
<# | ||
for (var inner = 1; inner < iter; ++inner) | ||
{ | ||
#> | ||
, T<#=inner#> v<#=inner#> | ||
<# | ||
} | ||
#> | ||
); | ||
|
||
<# | ||
} | ||
#> | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// ---------------------------------------------------------------------------------------------- | ||
// Copyright (c) Mårten Rånge. | ||
// ---------------------------------------------------------------------------------------------- | ||
// This source code is subject to terms and conditions of the Microsoft Public License. A | ||
// copy of the license can be found in the License.html file at the root of this distribution. | ||
// If you cannot locate the Microsoft Public License, please send an email to | ||
// [email protected]. By using this source code in any fashion, you are agreeing to be bound | ||
// by the terms of the Microsoft Public License. | ||
// ---------------------------------------------------------------------------------------------- | ||
// You must not remove this notice, or any other, from this software. | ||
// ---------------------------------------------------------------------------------------------- | ||
|
||
// ### INCLUDE: Common.cs | ||
|
||
namespace System.Linq | ||
{ | ||
using System.Collections.Generic; | ||
|
||
public interface IOrderedEnumerable<TElement> : IEnumerable<TElement> | ||
{ | ||
IOrderedEnumerable<TElement> CreateOrderedEnumerable<TKey>(Func<TElement, TKey> keySelector, IComparer<TKey> comparer, bool descending); | ||
} | ||
|
||
static partial class Enumerable | ||
{ | ||
public static IEnumerable<T> Where<T>( | ||
this IEnumerable<T> source, | ||
Func<T, bool> predicate | ||
) | ||
{ | ||
foreach (var v in source) | ||
{ | ||
if (predicate(v)) | ||
{ | ||
yield return v; | ||
} | ||
} | ||
} | ||
|
||
public static IEnumerable<TResult> Select<T>( | ||
this IEnumerable<T> source, | ||
Func<T, TResult> predicate | ||
) | ||
{ | ||
foreach (var v in source) | ||
{ | ||
yield return predicate(v); | ||
} | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.