├── .editorconfig
├── .gitattributes
├── .gitignore
├── .travis.yml
├── Core
├── .gitignore
├── AssemblyVersion.cs
├── Lib
│ ├── Aga.Controls.dll
│ ├── UpdateControls.Forms.XML
│ ├── UpdateControls.Forms.dll
│ ├── UpdateControls.dll
│ └── UpdateControls.xml
├── License.txt
├── Loyc.Collections.nuspec
├── Loyc.Collections
│ ├── ALists
│ │ ├── AList.cd
│ │ ├── AList.cs
│ │ ├── AListBase.cs
│ │ ├── AListIndexer.cs
│ │ ├── AListInner.cs
│ │ ├── AListInnerBase.cs
│ │ ├── AListLeaf.cs
│ │ ├── AListNode.cs
│ │ ├── AListNodeObserver.cs
│ │ ├── AListNodes.cd
│ │ ├── BDictionary.cs
│ │ ├── BList.cs
│ │ ├── BListInner.cs
│ │ ├── BListLeaf.cs
│ │ ├── BMultiMap.cs
│ │ ├── IAListTreeObserver.cs
│ │ ├── IndexedAList.cs
│ │ ├── SparseAList.cs
│ │ └── SparseAListLeaf.cs
│ ├── CG.cs
│ ├── Heap.cs
│ ├── InternalDArray.cs
│ ├── Loyc.Collections.csproj
│ ├── Loyc.Collections.net45.csproj
│ ├── OpenSourceKey.snk
│ ├── Other
│ │ ├── ArrayOf4.cs
│ │ ├── Bijection.cs
│ │ ├── BloomFilterM64K2.cs
│ │ ├── Co.cs
│ │ ├── NestedEnumerator.cs
│ │ └── SimpleCache.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Sets
│ │ ├── InternalSet.cs
│ │ ├── InternalSetV1.cs
│ │ ├── InvertibleSet.cs
│ │ ├── MMap.cs
│ │ ├── MSet.cs
│ │ ├── Map.cs
│ │ └── Set.cs
│ ├── TypeDictionaryWithBaseTypeLookups.cs
│ └── VLists
│ │ ├── Diagrams
│ │ ├── ChangingPList.png
│ │ ├── IdealVList.png
│ │ ├── LinkedList.png
│ │ ├── PathologicalVList.png
│ │ ├── VListSharing1.png
│ │ ├── VListSharing2.png
│ │ ├── WList.png
│ │ ├── WListImmutification.png
│ │ └── WListRemutification.png
│ │ ├── FVList.cs
│ │ ├── FWList.cs
│ │ ├── VList.cs
│ │ ├── VListBlock.cs
│ │ ├── VListBlockArray.cs
│ │ ├── VListBlockOfTwo.cs
│ │ ├── WList.cs
│ │ └── WListBase.cs
├── Loyc.Essentials.nuspec
├── Loyc.Essentials
│ ├── Collections
│ │ ├── Adapters
│ │ │ ├── ArraySlice.cs
│ │ │ ├── BufferedSequence.cs
│ │ │ ├── CollectionAsSource.cs
│ │ │ ├── DictionaryAsSink.cs
│ │ │ ├── ListAsListSource.cs
│ │ │ ├── ListAsSink.cs
│ │ │ ├── ListSlice.cs
│ │ │ ├── ListSourceAsList.cs
│ │ │ ├── ListSourceAsSparse.cs
│ │ │ ├── NegList.cs
│ │ │ ├── NegListSlice.cs
│ │ │ ├── NegListSource.cs
│ │ │ ├── ROLSlice.cs
│ │ │ ├── ReadOnlyListAsListSource.cs
│ │ │ ├── ReverseBinumerator.cs
│ │ │ ├── ReversedList.cs
│ │ │ ├── ReversedListSource.cs
│ │ │ ├── SelectDictionaryFromKeys.cs
│ │ │ ├── Slice.cs
│ │ │ ├── SourceAsCollection.cs
│ │ │ └── SparseListSourceSlice.cs
│ │ ├── BaseClasses
│ │ │ ├── CollectionWrapper.cs
│ │ │ ├── DictionaryWrapper.cs
│ │ │ ├── EnumeratorBase.cs
│ │ │ ├── ListExBase.cs
│ │ │ ├── ListSourceBase.cs
│ │ │ ├── ListWrapper.cs
│ │ │ ├── ReadOnlyCollectionBase.cs
│ │ │ └── SetWrapper.cs
│ │ ├── CollectionDebugView.cs
│ │ ├── ExtensionMethods
│ │ │ ├── DictionaryExt.cs
│ │ │ ├── EnumerableExt.ecs
│ │ │ ├── EnumerableExt.out.cs
│ │ │ ├── ICollectionExt.cs
│ │ │ ├── IPush, IPop.cs
│ │ │ ├── LCExtensions.cs
│ │ │ ├── LinqToLists.ecs
│ │ │ ├── LinqToLists.out.cs
│ │ │ ├── ListExt.cs
│ │ │ └── Range.cs
│ │ ├── HelperClasses
│ │ │ ├── CollectionWithChangeEvents.cs
│ │ │ ├── DictionaryWithChangeEvents.cs
│ │ │ ├── EmptyArray.cs
│ │ │ ├── EmptyEnumerator.cs
│ │ │ ├── EmptyList.cs
│ │ │ ├── ListWithChangeEvents.cs
│ │ │ ├── NumRange.cs
│ │ │ ├── RangeEnumerator.cs
│ │ │ ├── Repeated.cs
│ │ │ ├── ReverseComparer.cs
│ │ │ ├── SelectCollection.ecs
│ │ │ ├── SelectCollection.out.cs
│ │ │ ├── SelectListSource.ecs
│ │ │ └── SelectListSource.out.cs
│ │ └── Implementations
│ │ │ ├── DList.cs
│ │ │ ├── InternalDList.cs
│ │ │ ├── InternalList.cs
│ │ │ ├── WeakKeyComparer.cs
│ │ │ └── WeakKeyDictionary.cs
│ ├── Compatibility
│ │ └── WeakReference.cs
│ ├── Loyc.Essentials.csproj
│ ├── Loyc.Essentials.net45.csproj
│ ├── MessageSinks
│ │ ├── BasicSinks.cs
│ │ ├── LogException.cs
│ │ ├── LogMessage.cs
│ │ ├── MessageHolder.cs
│ │ ├── MessageSink.ecs
│ │ ├── MessageSink.out.cs
│ │ └── WrapperSinks.cs
│ ├── OpenSourceKey.snk
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Strings
│ │ ├── StringBuilderExt.cs
│ │ └── StringExt.cs
│ ├── Utilities
│ │ ├── ByteArrayInString.cs
│ │ ├── Extensions.cs
│ │ ├── EzStopwatch.cs
│ │ ├── G.cs
│ │ ├── GRange.ecs
│ │ ├── GRange.out.cs
│ │ ├── HashTags.cs
│ │ ├── Holder.cs
│ │ ├── IoC.cs
│ │ ├── MiniTest.cs
│ │ ├── PrintHelpers.cs
│ │ ├── RunTests.cs
│ │ ├── SavedValue.cs
│ │ ├── ThreadEx.cs
│ │ ├── Triplet.cs
│ │ ├── ValueComparer.cs
│ │ └── WrapperBase.cs
│ ├── app.config
│ └── void.cs
├── Loyc.Interfaces.nuspec
├── Loyc.Interfaces
│ ├── Collections
│ │ ├── Disambiguation interfaces.cs
│ │ ├── Extended interfaces.cs
│ │ ├── IAutoCreatePool.cs
│ │ ├── ICharSource.cs
│ │ ├── ICollectionSource.cs
│ │ ├── ICount.cs
│ │ ├── IDictionaryEx.cs
│ │ ├── IDictionarySource.cs
│ │ ├── IListSource.cs
│ │ ├── INegListSource.cs
│ │ ├── INotifyListChanged.cs
│ │ ├── INotifyListChanging.cs
│ │ ├── IRanges.cs
│ │ ├── ISetImm.cs
│ │ ├── ISparseList.cs
│ │ ├── ITuple.cs
│ │ ├── New enumerators.cs
│ │ ├── Other interfaces.cs
│ │ ├── Queue interfaces.cs
│ │ └── Sink interfaces.cs
│ ├── Concrete
│ │ ├── BaseDictionary.cs
│ │ ├── Either.cs
│ │ ├── EmptySourceFile.cs
│ │ ├── Exceptions.cs
│ │ ├── IndexRange.cs
│ │ ├── KeyCollection.cs
│ │ ├── ListChangeInfo.cs
│ │ ├── Localize.cs
│ │ ├── Maybe.cs
│ │ ├── MemoizedTypeName.cs
│ │ ├── NoValue.cs
│ │ ├── Pair.cs
│ │ ├── RangeEnumerator.cs
│ │ ├── SavedThreadLocal.cs
│ │ ├── ScratchBuffer.cs
│ │ ├── SourcePos.cs
│ │ ├── Symbol.cs
│ │ ├── UString.cs
│ │ ├── ValueCollection.cs
│ │ └── WeakValueDictionary.cs
│ ├── Geometry
│ │ ├── IPoint.cs
│ │ ├── IPoint3.cs
│ │ ├── IRectangle.cs
│ │ └── IRectangle3.cs
│ ├── ILocation.cs
│ ├── ILogMessage.cs
│ ├── IMessageSink.cs
│ ├── Loyc.Interfaces.csproj
│ ├── Loyc.Interfaces.net45.csproj
│ ├── Math
│ │ └── Interfaces.cs
│ ├── Misc.cs
│ ├── MiscInterfaces.cs
│ ├── NamespaceDocs.cs
│ ├── OpenSourceKey.snk
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Syntax
│ │ ├── IIndexPositionMapper.cs
│ │ ├── ILNode.cs
│ │ ├── ILNodePrinterOptions.cs
│ │ ├── ILineColumnFile.cs
│ │ ├── ILiteralParser.cs
│ │ ├── ILiteralPrinter.cs
│ │ ├── ILiteralValue.cs
│ │ ├── ISourceFile.cs
│ │ ├── ISourceRange.cs
│ │ ├── NodeStyle.cs
│ │ └── ParsingMode.cs
├── Loyc.Math.nuspec
├── Loyc.Math
│ ├── Geometry
│ │ ├── BoundingBox.cs
│ │ ├── BoundingBoxMathTT.cs
│ │ ├── BoundingBoxMathTT.tt
│ │ ├── LineMath.cs
│ │ ├── LineMathTT.cs
│ │ ├── LineMathTT.tt
│ │ ├── LineSegment.cs
│ │ ├── PointExt.cs
│ │ ├── PointMath.cs
│ │ ├── PointMathTT.cs
│ │ ├── PointMathTT.tt
│ │ ├── PointT.cs
│ │ ├── PolygonMathTT.cs
│ │ ├── PolygonMathTT.tt
│ │ ├── Rectangle3Ext.cs
│ │ ├── RectangleExt.cs
│ │ ├── Vector3T.cs
│ │ └── VectorT.cs
│ ├── Loyc.Math.csproj
│ ├── Loyc.Math.net45.csproj
│ ├── Math
│ │ ├── FixedPoint.cs
│ │ ├── FixedPoint.tt
│ │ ├── Math128.cs
│ │ ├── MathEx.cs
│ │ ├── Maths.cs
│ │ ├── Maths.tt
│ │ ├── MathsT.cs
│ │ └── NumTraits.ttinclude
│ ├── OpenSourceKey.snk
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Range.ecs
│ └── Range.out.cs
├── Loyc.Syntax.nuspec
├── Loyc.Syntax
│ ├── CodeSymbols.cs
│ ├── ILNodePrinterHelper.cs
│ ├── IParsingOptions.cs
│ ├── IParsingService.cs
│ ├── LES
│ │ ├── CustomLiteral.cs
│ │ ├── INodePrinterWriter.cs
│ │ ├── Les2LanguageService.cs
│ │ ├── Les2Lexer.cs
│ │ ├── Les2LexerGrammar.les
│ │ ├── Les2LexerGrammar.out.cs
│ │ ├── Les2Parser.cs
│ │ ├── Les2ParserGrammar.les
│ │ ├── Les2ParserGrammar.out.cs
│ │ ├── Les2Printer.cs
│ │ ├── Les2PrinterWriter.cs
│ │ ├── Les3.cs
│ │ ├── Les3LanguageService.cs
│ │ ├── Les3Lexer.ecs
│ │ ├── Les3Lexer.out.cs
│ │ ├── Les3Parser.ecs
│ │ ├── Les3Parser.out.cs
│ │ ├── Les3PrettyPrinter.cs
│ │ ├── Les3Printer.cs
│ │ ├── Les3PrinterOptions.cs
│ │ ├── Les3Printer_CanPrintAsNumber.ecs
│ │ ├── Les3Printer_CanPrintAsNumber.out.cs
│ │ ├── LesPrecedence.cs
│ │ ├── LesPrecedenceMap.cs
│ │ └── TokenType.cs
│ ├── LNodePrinterHelper.cs
│ ├── LNodes
│ │ ├── AbstractNodes.cs
│ │ ├── DescendantsFrame.cs
│ │ ├── ILNodePrinter.cs
│ │ ├── ILiteralValueProvider.cs
│ │ ├── LNode.cs
│ │ ├── LNodeExt.cs
│ │ ├── LNodeFactory.cs
│ │ ├── LNodeList.cs
│ │ ├── LNodePrintingOptions.cs
│ │ ├── LNodeVisitor.cs
│ │ ├── LiteralFromParser.cs
│ │ ├── LiteralValue.cs
│ │ ├── StdCallNode.cs
│ │ ├── StdIdNode.cs
│ │ ├── StdLiteralNode.cs
│ │ ├── StdTriviaNode.cs
│ │ └── UninterpretedLiteral.cs
│ ├── LeMP
│ │ ├── IMacroContext.cs
│ │ └── MacroAttributes.cs
│ ├── Lexing
│ │ ├── BaseILexer.cs
│ │ ├── BaseLexer.cs
│ │ ├── CharCategories.html
│ │ ├── CharCategory.ecs
│ │ ├── CharCategory.out.cs
│ │ ├── ILexer.cs
│ │ ├── ILllpgApi.cs
│ │ ├── IndentTokenGenerator.cs
│ │ ├── LexerSource.cs
│ │ ├── Token.cs
│ │ ├── TokenKind.cs
│ │ ├── TokenListAsLexer.cs
│ │ ├── TokenTree.cs
│ │ ├── TokensToTree.cs
│ │ ├── TriviaSaver.cs
│ │ ├── UnicodeData.txt
│ │ └── WhitespaceFilter.cs
│ ├── Loyc.Syntax.csproj
│ ├── Loyc.Syntax.net45.csproj
│ ├── NodeLocationMapper.cs
│ ├── OpenSourceKey.snk
│ ├── Parsing
│ │ ├── AbstractTriviaInjector.cs
│ │ ├── BaseParser.cs
│ │ ├── BaseParserForList.cs
│ │ ├── BaseParserNoBacktracking.cs
│ │ ├── LiteralHandlerTable.cs
│ │ ├── OperatorShape.cs
│ │ ├── ParseHelpers.cs
│ │ ├── ParserSource.cs
│ │ ├── Precedence.cs
│ │ ├── StandardLiteralHandlers.cs
│ │ └── StandardTriviaInjector.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── SourceFiles
│ │ ├── IndexPositionMapper.cs
│ │ ├── LineRemapper.cs
│ │ ├── SourceFile.cs
│ │ ├── SourceRange.cs
│ │ └── StreamCharSource.cs
├── Loyc.Utilities.nuspec
├── Loyc.Utilities
│ ├── Collections
│ │ ├── AListExt.cs
│ │ ├── AListStatisticTracker.cs
│ │ ├── CPTrie
│ │ │ ├── Benchmark.xlsx
│ │ │ ├── CPBNode.cs
│ │ │ ├── CPBitArrayLeaf.cs
│ │ │ ├── CPByteTrie.cs
│ │ │ ├── CPIntTrie.cs
│ │ │ ├── CPSNode.cs
│ │ │ ├── CPStringTrie.cs
│ │ │ ├── CPTrie.cs
│ │ │ ├── CPTrieBenchmark.cs
│ │ │ ├── CPTrieMisc.cs
│ │ │ ├── CPTrieTests.cs
│ │ │ └── remember.txt
│ │ └── KeylessHashtable.cs
│ ├── GoInterface test project
│ │ ├── GoInterface tests.csproj
│ │ ├── GoInterface tests.sln
│ │ ├── Program.cs
│ │ ├── app.config
│ │ └── nunit.framework.dll
│ ├── GoInterface.cs
│ ├── GoInterfaceBenchmark.cs
│ ├── IntSet.cs
│ ├── Loyc.Utilities.csproj
│ ├── Loyc.Utilities.net45.csproj
│ ├── OpenSourceKey.snk
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── SimpleTimer.cs
│ ├── Statistic.cs
│ ├── SymbolSet.cs
│ ├── TagsInWList.cs
│ ├── UG.cs
│ └── app.config
├── LoycCore.Benchmarks
│ ├── Benchmarks
│ │ ├── Benchmark.cs
│ │ ├── BenchmarkSets.cs
│ │ ├── Benchmarker.cs
│ │ ├── EzChartForm.Designer.cs
│ │ ├── EzChartForm.cs
│ │ ├── EzChartForm.resx
│ │ ├── GoInterfaceBenchmark.cs
│ │ └── ListBenchmarks.cs
│ ├── LoycCore.Benchmarks.net45.csproj
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── 2of12.txt
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ └── packages.config
├── LoycCore.netfx.sln
├── LoycCore.netstd.sln
├── LoycCore.nuspec
├── MiniTestRunner
│ ├── MiniTestRunner.net45.csproj
│ ├── Model
│ │ ├── ApplicationModel.cs
│ │ ├── ContainerRowModel.cs
│ │ ├── CrossDomainPropertyChangeHandler.cs
│ │ ├── IRowModel.cs
│ │ ├── NPCHelper.cs
│ │ ├── OptionsModel.cs
│ │ ├── ProjectModel.cs
│ │ ├── ResultSet.cs
│ │ ├── RowModel.cs
│ │ ├── TaskRowModel.cs
│ │ ├── TaskRunner.cs
│ │ └── TreeModel.cs
│ ├── OpenSourceKey.snk
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Resources
│ │ ├── Assembly.png
│ │ ├── Benchmark.png
│ │ ├── Class.png
│ │ ├── HighPriority.png
│ │ ├── LowPriority.png
│ │ ├── OpenProject.png
│ │ ├── ResultSet.png
│ │ ├── RunIcon.png
│ │ ├── SplitHorizontal.png
│ │ ├── StatusError.png
│ │ ├── StatusFlag.png
│ │ ├── StatusIgnored.png
│ │ ├── StatusMessage.png
│ │ ├── StatusNote.png
│ │ ├── StatusRunning.png
│ │ ├── StatusSuccess.png
│ │ ├── StatusUnknown.png
│ │ ├── StatusWarning.png
│ │ ├── StopIcon.png
│ │ ├── Test.png
│ │ ├── TestSet.png
│ │ ├── TreeOnly.png
│ │ └── WordWrap.png
│ ├── TestDomain
│ │ ├── AssemblyScanTask.cs
│ │ ├── IPropertyChanged.cs
│ │ ├── ITask.cs
│ │ ├── TaskBase.cs
│ │ └── UnitTestTask.cs
│ ├── Utils
│ │ ├── AppDomainStarter.cs
│ │ ├── BaseDictionary.cs
│ │ ├── RecycleBin.cs
│ │ ├── ViewModelOf.cs
│ │ ├── WeakKeyComparer.cs
│ │ ├── WeakKeyDictionary.cs
│ │ └── WeakReference.cs
│ ├── View
│ │ ├── RowView.cs
│ │ ├── TestingForm.Designer.cs
│ │ ├── TestingForm.cs
│ │ ├── TestingForm.resx
│ │ └── TreeViewAdvModel.cs
│ ├── ViewModel
│ │ ├── DisplaySettingsVM.cs
│ │ ├── FilterVM.cs
│ │ ├── RowVM.cs
│ │ └── TreeVM.cs
│ └── app.config
├── Readme.md
└── Tests
│ ├── Collections
│ ├── ALists
│ │ ├── AListBaseTests.cs
│ │ ├── AListTestHelpersBase.cs
│ │ ├── AListTests.cs
│ │ ├── BDictionaryTests.cs
│ │ ├── BListTests.cs
│ │ ├── BMultiMapTests.cs
│ │ └── SparseAListTests.cs
│ ├── DequeTests.cs
│ ├── DictionaryTests.cs
│ ├── HeapTests.cs
│ ├── InternalDArrayTests.cs
│ ├── ListCollectionTests.cs
│ ├── ListRangeTests.cs
│ ├── ListTests.cs
│ ├── MapTests.cs
│ ├── ReadOnlyDictionaryTests.cs
│ ├── SetTests.cs
│ ├── TypeDictionaryWithBaseTypeLookupsTests.cs
│ └── VLists
│ │ ├── FVListTests.cs
│ │ ├── FWListTests.cs
│ │ ├── VListTests.cs
│ │ └── WListTests.cs
│ ├── Essentials
│ ├── BaisTests.cs
│ ├── CollectionWithChangeEventsTests.cs
│ ├── DictionaryWithChangeEventsTests.cs
│ ├── DictionaryWrapperTests.cs
│ ├── Either.cs
│ ├── ExtensionsTests.cs
│ ├── GTests.cs
│ ├── HashTagsTests.cs
│ ├── ListExtTests.cs
│ ├── ListWithChangeEventsTests.cs
│ ├── ListWrapperTests.cs
│ ├── LocalizeTests.cs
│ ├── PrintHelpersTests.cs
│ ├── SliceTests.cs
│ ├── SymbolTests.cs
│ ├── ThreadExTests.cs
│ └── UStringTests.cs
│ ├── LoycCore.Tests.csproj
│ ├── LoycCore.Tests.net45.csproj
│ ├── Math
│ ├── LineMathTests.cs
│ ├── MathExTests.cs
│ └── PointMathTests.cs
│ ├── OpenSourceKey.snk
│ ├── Program.cs
│ ├── Syntax
│ ├── IndentTokenGeneratorTests.cs
│ ├── IndexPositionMapperTests.cs
│ ├── LNodePrinterHelperTests.cs
│ ├── LNodeRangeMapperTests.cs
│ ├── LNodeTests.cs
│ ├── Les2LexerTests.cs
│ ├── Les2ParserTests.cs
│ ├── Les2PrinterAndParserTests.cs
│ ├── Les2PrinterTests.cs
│ ├── Les3LexerTests.cs
│ ├── Les3ParserTests.cs
│ ├── Les3PrinterAndParserTests.cs
│ ├── Les3PrinterTests.cs
│ ├── LexerSourceTest.ecs
│ ├── LexerSourceTest.out.cs
│ ├── LiteralHandlerTableTests.cs
│ ├── MiscTests.cs
│ ├── ParseHelperTests.cs
│ ├── ParserSourceTest.ecs
│ ├── ParserSourceTest.out.cs
│ ├── StandardLiteralHandlersTests.cs
│ ├── StandardTriviaInjectorTests.cs
│ ├── StreamCharSourceTests.cs
│ ├── TokenTests.cs
│ └── TokensToTreeTests.cs
│ ├── TestHelpers.cs
│ └── Utilities
│ ├── AListSummaryTrackerTests.cs
│ ├── GoInterfaceTests.cs
│ ├── IntSetTests.cs
│ ├── TagsInWListTests.cs
│ └── UGTests.cs
├── Doc
├── OldDocs
│ ├── EC# for normal people.txt
│ ├── EC#.cs
│ ├── EC#2.cs
│ └── Set benchmark results.csv
├── Please see docs on ecsharp.net
└── VeryOldDocs
│ ├── 50features.html
│ ├── Help File Project.shfb
│ ├── design-ov.html
│ ├── extensions-ov.html
│ ├── loyc-intro.html
│ ├── notes.txt
│ ├── onep.html
│ ├── readme.txt
│ ├── symbol-resolution.html
│ ├── syntax-ov.html
│ ├── syntax-ov2.html
│ └── thanks.html
├── Lib
├── ICSharpCode.TextEditor.dll
├── protobuf-net.dll
├── protobuf-net.pdb
└── protobuf-net.xml
├── License.txt
├── Loyc.all.sln
├── Loyc.netfx.sln
├── Loyc.netstd.sln
├── Main
├── Ecs
│ ├── EcsCodeSymbols.cs
│ ├── EcsFacts.cs
│ ├── EcsPrecedence.cs
│ ├── EcsValidators.cs
│ ├── Loyc.Ecs.csproj
│ ├── Loyc.Ecs.net4x.csproj
│ ├── OpenSourceKey.snk
│ ├── Parser
│ │ ├── EcsLanguageService.cs
│ │ ├── EcsLexer.cs
│ │ ├── EcsLexerGrammar.les
│ │ ├── EcsLexerGrammar.out.cs
│ │ ├── EcsLiteralHandlers.cs
│ │ ├── EcsParser.cs
│ │ ├── EcsParserGrammar.les
│ │ ├── EcsParserGrammar.out.cs
│ │ ├── EcsPreprocessor.cs
│ │ ├── EcsTriviaInjector.cs
│ │ └── TokenType.cs
│ ├── Printer
│ │ ├── EcsNodePrinter--expressions.cs
│ │ ├── EcsNodePrinter--statements.cs
│ │ ├── EcsNodePrinter.cs
│ │ └── EcsNodePrinterWriter.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Tests
│ │ ├── AmbiguityTests.cs
│ │ ├── BugsAndCornerCases.cs
│ │ ├── ECSharpFeatureTests.cs
│ │ ├── EcsLexerTests.cs
│ │ ├── EcsParserTests.cs
│ │ ├── EcsPrinterAndParserTests.cs
│ │ ├── EcsPrinterTests.cs
│ │ ├── EcsValidatorTests.cs
│ │ ├── LinqTests.cs
│ │ ├── PlainCSharpTests.cs
│ │ ├── PrinterFocusedTests.cs
│ │ ├── ToDoTests.cs
│ │ └── TriviaTests.cs
├── ICSharpCode.TextEditor
│ ├── .gitignore
│ ├── ICSharpCode.TextEditor.sln
│ ├── Project
│ │ ├── Article1.cd
│ │ ├── Article2.cd
│ │ ├── Configuration
│ │ │ ├── AssemblyInfo.cs
│ │ │ └── GlobalAssemblyInfo.cs
│ │ ├── ICSharpCode.TextEditor.cd
│ │ ├── ICSharpCode.TextEditor.csproj
│ │ ├── ICSharpCode.TextEditor.dll.nuspec
│ │ ├── ICSharpCode.TextEditor.sln
│ │ ├── Resources
│ │ │ ├── ASPX.xshd
│ │ │ ├── BAT-Mode.xshd
│ │ │ ├── Boo.xshd
│ │ │ ├── CPP-Mode.xshd
│ │ │ ├── CSharp-Mode.xshd
│ │ │ ├── Coco-Mode.xshd
│ │ │ ├── HTML-Mode.xshd
│ │ │ ├── ICSharpCode.TextEditor.snk
│ │ │ ├── Java-Mode.xshd
│ │ │ ├── JavaScript-Mode.xshd
│ │ │ ├── Mode.xsd
│ │ │ ├── PHP-Mode.xshd
│ │ │ ├── Patch-Mode.xshd
│ │ │ ├── Python-Mode.xshd
│ │ │ ├── RightArrow.cur
│ │ │ ├── SyntaxModes.xml
│ │ │ ├── Tex-Mode.xshd
│ │ │ ├── TextEditorControl.bmp
│ │ │ ├── VBNET-Mode.xshd
│ │ │ └── XML-Mode.xshd
│ │ └── Src
│ │ │ ├── Actions
│ │ │ ├── BookmarkActions.cs
│ │ │ ├── CaretActions.cs
│ │ │ ├── ClipBoardActions.cs
│ │ │ ├── FoldActions.cs
│ │ │ ├── FormatActions.cs
│ │ │ ├── HomeEndActions.cs
│ │ │ ├── IEditAction.cs
│ │ │ ├── MiscActions.cs
│ │ │ └── SelectionActions.cs
│ │ │ ├── Document
│ │ │ ├── AbstractSegment.cs
│ │ │ ├── BookmarkManager
│ │ │ │ ├── Bookmark.cs
│ │ │ │ ├── BookmarkEventHandler.cs
│ │ │ │ ├── BookmarkManager.cs
│ │ │ │ └── BookmarkManagerMemento.cs
│ │ │ ├── DefaultDocument.cs
│ │ │ ├── DefaultTextEditorProperties.cs
│ │ │ ├── DocumentEventArgs.cs
│ │ │ ├── DocumentFactory.cs
│ │ │ ├── FoldingStrategy
│ │ │ │ ├── FoldMarker.cs
│ │ │ │ ├── FoldingManager.cs
│ │ │ │ ├── IFoldingStrategy.cs
│ │ │ │ └── IndentFoldingStrategy.cs
│ │ │ ├── FormattingStrategy
│ │ │ │ ├── DefaultFormattingStrategy.cs
│ │ │ │ └── IFormattingStrategy.cs
│ │ │ ├── HighlightingStrategy
│ │ │ │ ├── DefaultHighlightingStrategy.cs
│ │ │ │ ├── FontContainer.cs
│ │ │ │ ├── HighlightBackground.cs
│ │ │ │ ├── HighlightColor.cs
│ │ │ │ ├── HighlightInfo.cs
│ │ │ │ ├── HighlightRuleSet.cs
│ │ │ │ ├── HighlightingColorNotFoundException.cs
│ │ │ │ ├── HighlightingDefinitionInvalidException.cs
│ │ │ │ ├── HighlightingDefinitionParser.cs
│ │ │ │ ├── HighlightingManager.cs
│ │ │ │ ├── HighlightingStrategyFactory.cs
│ │ │ │ ├── IHighlightingStrategy.cs
│ │ │ │ ├── NextMarker.cs
│ │ │ │ ├── PrevMarker.cs
│ │ │ │ ├── Span.cs
│ │ │ │ ├── SpanStack.cs
│ │ │ │ ├── SyntaxModes
│ │ │ │ │ ├── FileSyntaxModeProvider.cs
│ │ │ │ │ ├── ISyntaxModeFileProvider.cs
│ │ │ │ │ ├── ResourceSyntaxModeProvider.cs
│ │ │ │ │ └── SyntaxMode.cs
│ │ │ │ └── TextWord.cs
│ │ │ ├── IDocument.cs
│ │ │ ├── ISegment.cs
│ │ │ ├── ITextEditorProperties.cs
│ │ │ ├── LineManager
│ │ │ │ ├── DeferredEventList.cs
│ │ │ │ ├── LineManager.cs
│ │ │ │ ├── LineManagerEventArgs.cs
│ │ │ │ ├── LineSegment.cs
│ │ │ │ └── LineSegmentTree.cs
│ │ │ ├── MarkerStrategy
│ │ │ │ ├── MarkerStrategy.cs
│ │ │ │ └── TextMarker.cs
│ │ │ ├── Selection
│ │ │ │ ├── ColumnRange.cs
│ │ │ │ ├── DefaultSelection.cs
│ │ │ │ ├── ISelection.cs
│ │ │ │ └── SelectionManager.cs
│ │ │ ├── TextAnchor.cs
│ │ │ ├── TextBufferStrategy
│ │ │ │ ├── GapTextBufferStrategy.cs
│ │ │ │ ├── ITextBufferStrategy.cs
│ │ │ │ └── StringTextBufferStrategy.cs
│ │ │ ├── TextLocation.cs
│ │ │ └── TextUtilities.cs
│ │ │ ├── Gui
│ │ │ ├── AbstractMargin.cs
│ │ │ ├── BracketHighlighter.cs
│ │ │ ├── BrushRegistry.cs
│ │ │ ├── Caret.cs
│ │ │ ├── CompletionWindow
│ │ │ │ ├── AbstractCompletionWindow.cs
│ │ │ │ ├── CodeCompletionListView.cs
│ │ │ │ ├── CodeCompletionWindow.cs
│ │ │ │ ├── DeclarationViewWindow.cs
│ │ │ │ ├── ICompletionData.cs
│ │ │ │ └── ICompletionDataProvider.cs
│ │ │ ├── DrawableLine.cs
│ │ │ ├── FoldMargin.cs
│ │ │ ├── GutterMargin.cs
│ │ │ ├── HRuler.cs
│ │ │ ├── IconBarMargin.cs
│ │ │ ├── Ime.cs
│ │ │ ├── InsightWindow
│ │ │ │ ├── IInsightDataProvider.cs
│ │ │ │ └── InsightWindow.cs
│ │ │ ├── TextArea.cs
│ │ │ ├── TextAreaClipboardHandler.cs
│ │ │ ├── TextAreaControl.cs
│ │ │ ├── TextAreaDragDropHandler.cs
│ │ │ ├── TextAreaMouseHandler.cs
│ │ │ ├── TextAreaUpdate.cs
│ │ │ ├── TextEditorControl.cs
│ │ │ ├── TextEditorControlBase.cs
│ │ │ ├── TextView.cs
│ │ │ └── ToolTipRequestEventArgs.cs
│ │ │ ├── Undo
│ │ │ ├── IUndoableOperation.cs
│ │ │ ├── UndoQueue.cs
│ │ │ ├── UndoStack.cs
│ │ │ ├── UndoableDelete.cs
│ │ │ ├── UndoableInsert.cs
│ │ │ └── UndoableReplace.cs
│ │ │ └── Util
│ │ │ ├── AugmentableRedBlackTree.cs
│ │ │ ├── CheckedList.cs
│ │ │ ├── FileReader.cs
│ │ │ ├── LoggingService.cs
│ │ │ ├── LookupTable.cs
│ │ │ ├── MouseWheelHandler.cs
│ │ │ ├── RedBlackTreeIterator.cs
│ │ │ ├── RtfWriter.cs
│ │ │ ├── TextUtility.cs
│ │ │ ├── TipPainter.cs
│ │ │ ├── TipPainterTools.cs
│ │ │ ├── TipSection.cs
│ │ │ ├── TipSpacer.cs
│ │ │ ├── TipSplitter.cs
│ │ │ ├── TipText.cs
│ │ │ └── WeakCollection.cs
│ └── Test
│ │ ├── AssemblyInfo.cs
│ │ ├── BlockCommentTests.cs
│ │ ├── DocumentTests.cs
│ │ ├── FoldingManagerTests.cs
│ │ ├── ICSharpCode.TextEditor.Tests.csproj
│ │ ├── TextMarkerTests.cs
│ │ └── packages.config
├── LLLPG.nuspec
├── LLLPG
│ ├── App.config
│ ├── CodeGenHelpers
│ │ ├── CodeGenHelperBase.cs
│ │ ├── GeneralCodeGenHelper.cs
│ │ ├── IPGCodeGenHelper.cs
│ │ ├── IntStreamCodeGenHelper.cs
│ │ └── PGIntSet.cs
│ ├── CoreEngine
│ │ ├── AnalysisVisitors.cs
│ │ ├── GenerateCodeVisitor.cs
│ │ ├── IPGTerminalSet.cs
│ │ ├── KthSet.cs
│ │ ├── LLParserGenerator.cs
│ │ └── PredictionTree.cs
│ ├── LLLPG.csproj
│ ├── LLLPG.net4x.csproj
│ ├── LLLPG.png
│ ├── OpenSourceKey.snk
│ ├── ParsersAndMacros
│ │ ├── AntlrStyleParserGrammar.ecs
│ │ ├── AntlrStyleParserGrammar.out.cs
│ │ ├── AutoValueSaverVisitor.cs
│ │ ├── Macros.cs
│ │ ├── StageOneParser.cs
│ │ ├── StageOneParserGrammar.ecs
│ │ ├── StageOneParserGrammar.out.cs
│ │ └── StageTwoParser.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── RuleAndPreds
│ │ ├── PredVisitor.cs
│ │ ├── Predicates.cs
│ │ └── Rule.cs
│ └── Tests
│ │ ├── LlpgAutoValueSaverVisitorTests.cs
│ │ ├── LlpgBugsAndSlugs.cs
│ │ ├── LlpgCoreTests.cs
│ │ ├── LlpgGeneralTests.cs
│ │ ├── LlpgGeneralTestsBase.cs
│ │ ├── LlpgParserTests.cs
│ │ └── LlpgTestLargerExamples.cs
├── LeMP-Tool.nuspec
├── LeMP.StdMacros
│ ├── CSharpForwardPipeArrow.cs
│ ├── CSharpX.To.OlderVersions
│ │ ├── CSharp6Macros.cs
│ │ └── CSharp7Macros.cs
│ ├── DefineMacro.cs
│ ├── LeMP.StdMacros.csproj
│ ├── LeMP.StdMacros.net4x.csproj
│ ├── OpenSourceKey.snk
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── ReplaceMacro.cs
│ ├── StandardMacros.cs
│ ├── StaticMatchCodeMacro.cs
│ ├── UnrollMacro.cs
│ ├── ecs
│ │ ├── AddLineDirectivesMacro.cs
│ │ ├── AlgebraicDataType.ecs
│ │ ├── AlgebraicDataType.out.cs
│ │ ├── AssertMacro.ecs
│ │ ├── AssertMacro.out.cs
│ │ ├── BackingFieldMacro.cs
│ │ ├── CodeQuoteMacro.cs
│ │ ├── CompileTimeMacro.cs
│ │ ├── ContractsMacro.ecs
│ │ ├── ContractsMacro.out.cs
│ │ ├── DeconstructMacro.cs
│ │ ├── ForwardingMacro.cs
│ │ ├── InRange.ecs
│ │ ├── InRange.out.cs
│ │ ├── Literals.ecs
│ │ ├── Literals.out.cs
│ │ ├── MatchCode.ecs
│ │ ├── MatchCode.out.cs
│ │ ├── OnFinallyThrowCatch.cs
│ │ ├── OnReturn.ecs
│ │ ├── OnReturn.out.cs
│ │ ├── SaveAndRestoreMacro.ecs
│ │ ├── SaveAndRestoreMacro.out.cs
│ │ ├── SetOrCreateMemberMacro.cs
│ │ ├── StandardMacros.cs
│ │ ├── ThisConstructorMacro.cs
│ │ ├── UseSequenceExpressions.ecs
│ │ ├── UseSequenceExpressions.out.cs
│ │ ├── UseSymbolsMacro.cs
│ │ ├── UserDefinedMacroMacro.ecs
│ │ ├── UserDefinedMacroMacro.out.cs
│ │ ├── UsingMultiMacro.ecs
│ │ ├── UsingMultiMacro.out.cs
│ │ ├── WithMacro.cs
│ │ └── deprecated
│ │ │ ├── InRange.ecs
│ │ │ ├── InRange.out.cs
│ │ │ ├── MatchMacro.ecs
│ │ │ └── MatchMacro.out.cs
│ ├── lesX.to.ecs
│ │ ├── les2.to.ecs.Macros.cs
│ │ ├── les3.to.ecs.Macros.cs
│ │ └── les3.to.ecs.Macros.ecs
│ └── packages.config
├── LeMP.nuspec
├── LeMP
│ ├── App.config
│ ├── BuiltinMacros.cs
│ ├── Compiler.cs
│ ├── DotnetToolSettings.xml
│ ├── EC#.ico
│ ├── EC#.pdn
│ ├── LeMP.csproj
│ ├── LeMP.net4x.csproj
│ ├── MacroProcessor.cs
│ ├── MacroProcessorTask.cs
│ ├── OpenSourceKey.snk
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Tests
│ │ ├── CompilerTests.cs
│ │ ├── LiteralTests.cs
│ │ ├── MacroProcessorTests.cs
│ │ ├── MacroTesterBase.cs
│ │ ├── PreludeMacroTests_Les2.cs
│ │ ├── PreludeMacroTests_Les3.cs
│ │ ├── SmallerMacroTests.cs
│ │ ├── TestAlgebraicDataTypes.cs
│ │ ├── TestCodeContractMacros.cs
│ │ ├── TestCodeQuoteMacro.cs
│ │ ├── TestCompileTimeMacros.cs
│ │ ├── TestMacroCombinations.cs
│ │ ├── TestMatchCodeMacro.cs
│ │ ├── TestMatchMacro.cs
│ │ ├── TestOnFinallyReturnThrowMacros.cs
│ │ ├── TestReplaceAndDefineMacros.cs
│ │ ├── TestSequenceExpressionMacro.cs
│ │ ├── TestSetOrCreateMemberMacro.cs
│ │ ├── TestStaticDeconstructMacro.cs
│ │ ├── TestStaticMatchCodeMacro.cs
│ │ ├── TestUnrollMacro.cs
│ │ ├── TestUseSymbolsMacro.cs
│ │ └── TestUserDefinedMacroMacro.cs
├── LeMPDemo
│ ├── App.config
│ ├── EC#.ico
│ ├── FindAndReplaceForm.Designer.cs
│ ├── FindAndReplaceForm.cs
│ ├── FindAndReplaceForm.resx
│ ├── InputBox.cs
│ ├── LeMPDemo.net4x.csproj
│ ├── LempDemoForm.Designer.cs
│ ├── LempDemoForm.cs
│ ├── LempDemoForm.resx
│ ├── LempDemoPanel.Designer.cs
│ ├── LempDemoPanel.cs
│ ├── LempDemoPanel.resx
│ └── Program.cs
├── Loyc.Ecs.nuspec
└── Tests
│ ├── App.config
│ ├── PlayPen.ecs
│ ├── PlayPen.out.cs
│ ├── Program.cs
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── Samples.ecs
│ ├── Samples.out.cs
│ ├── Samples2.cs
│ ├── Tests.csproj
│ └── Tests.net4x.csproj
├── Readme.md
├── UpdateLibLeMPAndReinstall.bat
├── Visual Studio Integration
├── Example.les
├── Example.samplelang
├── LoycForVS2022
│ ├── LeMP_VisualStudio.csproj
│ ├── License.txt
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── SFG
│ │ ├── CustomToolBase.cs
│ │ └── LoycCustomTools.cs
│ ├── SyntaxHighlights
│ │ ├── BackgroundAnalyzerForVS.cs
│ │ ├── BraceMatchingTagger.cs
│ │ ├── EcsSyntaxForVS.cs
│ │ ├── Les2SyntaxForVs.cs
│ │ ├── Les3SyntaxForVS.cs
│ │ ├── SampleLanguage.cs
│ │ ├── SyntaxAnalyzerForVS.cs
│ │ ├── SyntaxClassifierForVS.cs
│ │ ├── TextSnapshotAsSourceFile.cs
│ │ └── VSBuffer.cs
│ ├── app.config
│ ├── packages.config
│ └── source.extension.vsixmanifest
├── Visual Studio Integration 2022.sln
├── notepad++userDefinedLang_les.xml
└── notepad++userDefinedLang_les_dark.xml
└── appveyor.yml
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.{cs,ecs,tt}]
2 | end_of_line = lf
3 | indent_style = tab
4 | charset = utf-8
5 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Normalize line endings of *.cs (text=auto is supposed to mean "use LFs")
2 | *.cs text=auto eol=lf
3 | # Normalize line endings of *.ecs (eol=lf is supposed to mean "store LFs in working directory")
4 | *.ecs text=auto eol=lf
5 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: csharp
2 | solution: Loyc.netstd.sln
3 | install:
4 | # Restore NuGet packages first
5 | - nuget restore Loyc.netstd.sln
6 | script:
7 | # Build the Loyc libraries in release mode, for all possible configurations.
8 | - xbuild /p:Configuration=Release Loyc.netstd.sln
9 |
10 | # Unfortunately, test set 8 (LLLPG) sometimes fails due to nondeterminism.
11 | - mono Bin/Release/netstandard2.0/Tests.exe 1
12 | - mono Bin/Release/netstandard2.0/Tests.exe 2
13 | - mono Bin/Release/netstandard2.0/Tests.exe 3
14 | - mono Bin/Release/netstandard2.0/Tests.exe 4
15 | - mono Bin/Release/netstandard2.0/Tests.exe 5
16 | - mono Bin/Release/netstandard2.0/Tests.exe 6
17 | - mono Bin/Release/netstandard2.0/Tests.exe 7
18 |
--------------------------------------------------------------------------------
/Core/AssemblyVersion.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | [assembly: AssemblyCopyright("Copyright ©2019. Licence: LGPL")]
4 |
5 | // Version information for an assembly consists of the following four values:
6 | //
7 | // Major Version
8 | // Minor Version
9 | // Build Number
10 | // Revision
11 | //
12 | // You can specify all the values or you can default the Build and Revision Numbers
13 | // by using '.*' - but you shouldn't, because it will cause a simple "Rebuild All"
14 | // command to change the version number which, I guess, produces an incompatible
15 | // assembly in the presence of strong names (strong naming prevents two assemblies
16 | // from linking together without an exact match.)
17 | [assembly: AssemblyVersion("30.1.3")]
18 | [assembly: AssemblyFileVersion("30.1.3")]
19 |
--------------------------------------------------------------------------------
/Core/Lib/Aga.Controls.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Lib/Aga.Controls.dll
--------------------------------------------------------------------------------
/Core/Lib/UpdateControls.Forms.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Lib/UpdateControls.Forms.dll
--------------------------------------------------------------------------------
/Core/Lib/UpdateControls.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Lib/UpdateControls.dll
--------------------------------------------------------------------------------
/Core/Loyc.Collections.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Loyc.Collections
5 | $version$
6 | David Piepgrass
7 | David Piepgrass
8 | http://core.loyc.net
9 |
10 | Readme.md
11 | false
12 | Defines a number of sophisticated data structures.
13 | Loyc.Collections is a library of sophisticated data structures that implement standard .NET collection interfaces. It includes ALists, VLists, hash tree types (Set<T>, MSet<T>, Map<K,V> and MMap<K,V>), and min/max heaps.
14 | See http://core.loyc.net/version-history
15 | Copyright 2020
16 | Loyc Core Collections Extension-Methods Dictionary Trees AList BList DList VList Cache Sparse-List Hash-Trees
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Core/Loyc.Collections/Loyc.Collections.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0
4 | ..\Bin\$(Configuration)\
5 | 1591, 1573, 0419
6 | true
7 | OpenSourceKey.snk
8 | false
9 |
10 |
11 | true
12 | ..\Bin\$(Configuration)\$(TargetFramework)\Loyc.Collections.xml
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Core/Loyc.Collections/OpenSourceKey.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Loyc.Collections/OpenSourceKey.snk
--------------------------------------------------------------------------------
/Core/Loyc.Collections/Other/ArrayOf4.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Diagnostics;
6 |
7 | namespace Loyc.Collections
8 | {
9 | class ArrayOf4
10 | {
11 | T t0, t1, t2, t3;
12 |
13 | T A { get { return t0; } set { t0 = value; } }
14 | T B { get { return t1; } set { t1 = value; } }
15 | T C { get { return t2; } set { t2 = value; } }
16 | T D { get { return t3; } set { t3 = value; } }
17 |
18 | public T this[int index]
19 | {
20 | get {
21 | Debug.Assert((uint)index < (uint)4);
22 | if (index < 2)
23 | return index > 0 ? t1 : t0;
24 | else
25 | return index == 2 ? t2 : t3;
26 | }
27 | set {
28 | Debug.Assert((uint)index < (uint)4);
29 | if (index < 2) {
30 | if (index == 0)
31 | t0 = value;
32 | else
33 | t1 = value;
34 | } else {
35 | if (index == 2)
36 | t2 = value;
37 | else
38 | t3 = value;
39 | }
40 | }
41 | }
42 | public T Insert(int index, T item)
43 | {
44 | T popped = t3;
45 | t3 = t2;
46 | if (index < 2) {
47 | t2 = t1;
48 | if (index == 0)
49 | t0 = item;
50 | else
51 | t1 = item;
52 | return popped;
53 | } else {
54 | if (index == 2)
55 | t2 = item;
56 | else
57 | t3 = item;
58 | return popped;
59 | }
60 | }
61 | public void RemoveAt(int index, T newFourth)
62 | {
63 | if (index < 2)
64 | {
65 | if (index == 0)
66 | t0 = t1;
67 | t1 = t2;
68 | }
69 | if (index == 2)
70 | t2 = t3;
71 | t3 = newFourth;
72 | }
73 | public T First
74 | {
75 | get { return t0; }
76 | set { t0 = value; }
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/Core/Loyc.Collections/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Loyc.Collections")]
9 | [assembly: AssemblyDescription("A library of data structures including ALists, VLists, and my favorite, the hash tree types Set, MSet, Map and MMap. "+
10 | "To learn more visit http://core.loyc.net/collections")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("David Piepgrass")]
13 | [assembly: AssemblyProduct("Loyc.Collections")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("d8c0cb64-7255-4d54-b246-cf2653d4164a")]
24 |
25 | //[assembly: InternalsVisibleTo("LoycCore.Tests")] is not allowed in a signed assembly
26 | [assembly: InternalsVisibleTo("LoycCore.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100adec5c8e52098b94dc60b34ac0916d307eec23b2c285a0beeb7168174fc1f6a71dcae43c88904e2907a12f66861de8d8f130c4f7b57cff0aea92ed06b50d96c63cea2ee19ec5d35a2946ddef3f35f0fbd3ec3a358b46fd05c82837c49d91694c1926935dc83e2a28c1ff077e4d8a5f679f1edb1c8a692aa2913d753ea05f4fba")]
27 |
28 |
--------------------------------------------------------------------------------
/Core/Loyc.Collections/VLists/Diagrams/ChangingPList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Loyc.Collections/VLists/Diagrams/ChangingPList.png
--------------------------------------------------------------------------------
/Core/Loyc.Collections/VLists/Diagrams/IdealVList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Loyc.Collections/VLists/Diagrams/IdealVList.png
--------------------------------------------------------------------------------
/Core/Loyc.Collections/VLists/Diagrams/LinkedList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Loyc.Collections/VLists/Diagrams/LinkedList.png
--------------------------------------------------------------------------------
/Core/Loyc.Collections/VLists/Diagrams/PathologicalVList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Loyc.Collections/VLists/Diagrams/PathologicalVList.png
--------------------------------------------------------------------------------
/Core/Loyc.Collections/VLists/Diagrams/VListSharing1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Loyc.Collections/VLists/Diagrams/VListSharing1.png
--------------------------------------------------------------------------------
/Core/Loyc.Collections/VLists/Diagrams/VListSharing2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Loyc.Collections/VLists/Diagrams/VListSharing2.png
--------------------------------------------------------------------------------
/Core/Loyc.Collections/VLists/Diagrams/WList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Loyc.Collections/VLists/Diagrams/WList.png
--------------------------------------------------------------------------------
/Core/Loyc.Collections/VLists/Diagrams/WListImmutification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Loyc.Collections/VLists/Diagrams/WListImmutification.png
--------------------------------------------------------------------------------
/Core/Loyc.Collections/VLists/Diagrams/WListRemutification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qwertie/ecsharp/9fc22ca0ba73c4c2b73ad70b4017f2c254d701ee/Core/Loyc.Collections/VLists/Diagrams/WListRemutification.png
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/Adapters/DictionaryAsSink.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Loyc.Collections
8 | {
9 | partial class DictionaryExt
10 | {
11 | /// Adapts a dictionary to the interface.
12 | public static IDictionarySink AsSink(this IDictionary dict) => new DictionaryAsSink>(dict);
13 | }
14 |
15 | /// Helps implement extension method .
16 | public class DictionaryAsSink : CollectionAsSink, Dict>, IDictionarySink where Dict : IDictionary
17 | {
18 | public DictionaryAsSink(Dict dict) : base(dict) { }
19 |
20 | public V this[K key] { set => _obj[key] = value; }
21 |
22 | public void Add(K key, V value) => _obj.Add(key, value);
23 |
24 | public bool Remove(K key) => _obj.Remove(key);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/Adapters/ListAsSink.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Loyc.Collections
8 | {
9 | partial class ListExt
10 | {
11 | /// Adapts a list to the interface.
12 | public static IListSink AsSink(this IList list) => new ListAsSink>(list);
13 | public static ICollectionSink AsSink(this ICollection list) => new CollectionAsSink>(list);
14 | }
15 |
16 | /// Helps implement extension method .
17 | public class CollectionAsSink : WrapperBase, ICollectionSink where List : ICollection
18 | {
19 | public CollectionAsSink(List list) : base(list) { }
20 |
21 | public void Add(T item) => _obj.Add(item);
22 |
23 | public void Clear() => _obj.Clear();
24 |
25 | public bool Remove(T item) => _obj.Remove(item);
26 | }
27 |
28 | /// Helps implement extension method .
29 | public class ListAsSink : CollectionAsSink, IListSink where List : IList
30 | {
31 | public ListAsSink(List list) : base(list) { }
32 |
33 | public T this[int index] { set => _obj[index] = value; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/Adapters/ReverseBinumerator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Loyc.Collections
7 | {
8 | /// Adapter: a that swaps the MoveNext() and MovePrev() methods.
9 | public struct ReverseBinumerator : IBinumerator
10 | {
11 | IBinumerator _e;
12 | public ReverseBinumerator(IBinumerator realEnumerator)
13 | {
14 | _e = realEnumerator;
15 | }
16 | public bool MovePrev()
17 | {
18 | return _e.MoveNext();
19 | }
20 | public bool MoveNext()
21 | {
22 | return _e.MovePrev();
23 | }
24 | public T Current
25 | {
26 | get { return _e.Current; }
27 | }
28 | void IDisposable.Dispose() { _e.Dispose(); }
29 | object System.Collections.IEnumerator.Current { get { return _e.Current; } }
30 | public void Reset() { _e.Reset(); }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/Adapters/ReversedListSource.cs:
--------------------------------------------------------------------------------
1 | using Loyc.Collections.Impl;
2 | /*
3 | * Created by SharpDevelop.
4 | * User: Pook
5 | * Date: 4/10/2011
6 | * Time: 9:06 AM
7 | *
8 | * To change this template use Tools | Options | Coding | Edit Standard Headers.
9 | */
10 | using System;
11 | using System.Collections.Generic;
12 |
13 | namespace Loyc.Collections
14 | {
15 | /// Adapter: reversed view of returned
16 | /// from .
17 | [Serializable]
18 | public class ReversedListSource : ListSourceBase
19 | {
20 | IListSource _list;
21 | public ReversedListSource(IListSource list) { _list = list; }
22 |
23 | public IListSource OriginalList { get { return _list; } }
24 |
25 | public new T this[int index]
26 | {
27 | get { return _list[_list.Count - 1 - index]; }
28 | }
29 | public sealed override T TryGet(int index, out bool fail)
30 | {
31 | return _list.TryGet(_list.Count - 1 - index, out fail);
32 | }
33 | public sealed override int Count
34 | {
35 | get { return _list.Count; }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/BaseClasses/CollectionWrapper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Loyc.Collections.Impl
9 | {
10 | /// A simple base class that helps you use the decorator pattern on a collection.
11 | /// By default, all it does is forward every method to the underlying collection
12 | /// (including GetHashCode, Equals and ToString). You can change its behavior by
13 | /// overriding methods.
14 | /// This could be used, for example, to help you implement a collection
15 | /// that needs to take some kind of action whenever the collection is modified.
16 | ///
17 | ///
18 | public class CollectionWrapper : WrapperBase, ICollection where TCollection : ICollection
19 | {
20 | public CollectionWrapper(TCollection collection) : base(collection) { }
21 |
22 | protected TCollection Collection => _obj;
23 |
24 | public virtual void Add(T item) => _obj.Add(item);
25 | public virtual void Clear() => _obj.Clear();
26 | public virtual bool Remove(T item) => _obj.Remove(item);
27 |
28 | public bool IsEmpty => Count == 0;
29 | public virtual int Count => _obj.Count;
30 | public virtual bool IsReadOnly => _obj.IsReadOnly;
31 | public virtual bool Contains(T item) => _obj.Contains(item);
32 | public virtual void CopyTo(T[] array, int arrayIndex) => _obj.CopyTo(array, arrayIndex);
33 | public virtual IEnumerator GetEnumerator() => _obj.GetEnumerator();
34 | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/BaseClasses/EnumeratorBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Loyc.Collections
7 | {
8 | /// Base class to help you implement the standard IEnumerator{T}
9 | /// interface. All you have to do is override MoveNext() and, when successful,
10 | /// set the Current property.
11 | public abstract class EnumeratorBase : IEnumerator
12 | {
13 | public abstract bool MoveNext();
14 | private T _current;
15 | public T Current
16 | {
17 | get { return _current; }
18 | protected set { _current = value; }
19 | }
20 | public void Dispose()
21 | {
22 | }
23 | object System.Collections.IEnumerator.Current
24 | {
25 | get { return Current; }
26 | }
27 | public void Reset()
28 | {
29 | throw new NotSupportedException();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/BaseClasses/ListWrapper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Loyc.Collections;
7 |
8 | namespace Loyc.Collections.Impl
9 | {
10 | /// A simple base class that to helps you implement a "smart" collection.
11 | /// By default, all it does is forward every method to the underlying collection
12 | /// (including GetHashCode, Equals and ToString). You can change its behavior by
13 | /// overriding methods.
14 | /// This could be used, for example, to help you implement a collection
15 | /// that needs to take some kind of action whenever the collection is modified.
16 | ///
17 | public abstract class ListWrapper : CollectionWrapper, IListAndListSource where TList : IList
18 | {
19 | public ListWrapper(TList wrappedObject) : base(wrappedObject) { }
20 |
21 | public virtual T this[int index]
22 | {
23 | get => _obj[index];
24 | set => _obj[index] = value;
25 | }
26 |
27 | public virtual void Insert(int index, T item) => _obj.Insert(index, item);
28 | public virtual void RemoveAt(int index) => _obj.RemoveAt(index);
29 |
30 | public virtual int IndexOf(T item) => _obj.IndexOf(item);
31 | public virtual IListSource Slice(int start, int count = int.MaxValue) => new ListSlice(_obj, start, count);
32 | public virtual T TryGet(int index, out bool fail) => (fail = (uint)index >= (uint)_obj.Count) ? default(T) : _obj[index];
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/ExtensionMethods/ICollectionExt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Loyc.Collections.MutableListExtensionMethods
8 | {
9 | /// Extension methods for .
10 | public static class ICollectionExt
11 | {
12 | /// Adds data to a set (set.Add(value) for all values in a sequence.)
13 | public static void AddRange(this ICollection set, IEnumerable list)
14 | {
15 | foreach (var item in list)
16 | set.Add(item);
17 | }
18 |
19 | /// Removes data from a set (set.Remove(value) for all values in a sequence.)
20 | /// The number of items removed (that had been present in the set).
21 | public static int RemoveRange(this ICollection set, IEnumerable list)
22 | {
23 | int removed = 0;
24 | foreach (var item in list)
25 | if (set.Remove(item))
26 | removed++;
27 | return removed;
28 | }
29 |
30 | /// Maps a list to an array of the same length.
31 | public static R[] SelectArray(this ICollection input, Func selector)
32 | {
33 | if (input == null)
34 | return null;
35 | R[] result = new R[input.Count];
36 | var e = input.GetEnumerator();
37 | for (int i = 0; i < result.Length; i++)
38 | {
39 | e.MoveNext();
40 | result[i] = selector(e.Current);
41 | }
42 | return result;
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/ExtensionMethods/IPush, IPop.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Loyc.Collections
8 | {
9 | public static partial class IPopExt
10 | {
11 | public static T Pop(this ITryPop c)
12 | {
13 | bool isEmpty;
14 | T next = c.TryPop(out isEmpty);
15 | if (isEmpty)
16 | throw new EmptySequenceException("The {0} is empty".Localized(MemoizedTypeName.Get(c.GetType())));
17 | return next;
18 | }
19 | public static T Peek(this ITryPop c)
20 | {
21 | bool isEmpty;
22 | T next = c.TryPeek(out isEmpty);
23 | if (isEmpty)
24 | throw new EmptySequenceException("The {0} is empty".Localized(MemoizedTypeName.Get(c.GetType())));
25 | return next;
26 | }
27 | [Obsolete("Please call a different overload. The return type on this method should be Maybe in the future.")]
28 | public static T TryPop(this ITryPop c)
29 | {
30 | bool isEmpty;
31 | return c.TryPop(out isEmpty);
32 | }
33 | [Obsolete("Please call a different overload. The return type on this method should be Maybe in the future.")]
34 | public static T TryPeek(this ITryPop c)
35 | {
36 | bool isEmpty;
37 | return c.TryPeek(out isEmpty);
38 | }
39 | public static T TryPop(this ITryPop c, T defaultValue)
40 | {
41 | bool isEmpty;
42 | T value = c.TryPop(out isEmpty);
43 | return isEmpty ? defaultValue : value;
44 | }
45 | public static T TryPeek(this ITryPop c, T defaultValue)
46 | {
47 | bool isEmpty;
48 | T value = c.TryPeek(out isEmpty);
49 | return isEmpty ? defaultValue : value;
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/HelperClasses/EmptyArray.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Loyc.Collections
7 | {
8 | /// lets you avoid allocating an empty array on the heap.
9 | public class EmptyArray
10 | {
11 | public static readonly T[] Value = new T[0];
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/HelperClasses/EmptyEnumerator.cs:
--------------------------------------------------------------------------------
1 | // This file is part of the Loyc project. Licence: LGPL
2 | using System;
3 | using System.Collections;
4 | using System.Collections.Generic;
5 |
6 | namespace Loyc.Collections
7 | {
8 | /// Helper class: an empty enumerator.
9 | [Serializable]
10 | public class EmptyEnumerator : IEnumerator, IEnumerator
11 | {
12 | public static readonly IEnumerator Value = new EmptyEnumerator();
13 |
14 | public T Current { get { return default(T); } }
15 | object IEnumerator.Current { get { return this.Current; } }
16 | public void Dispose() { }
17 | public bool MoveNext() { return false; }
18 | public void Reset() { }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/HelperClasses/EmptyList.cs:
--------------------------------------------------------------------------------
1 | // This file is part of the Loyc project. Licence: LGPL
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Loyc.Collections
7 | {
8 | /// Helper class: is a read-only empty list.
9 | /// It is a boxed copy of ListExt.Repeat(default(T), 0).
10 | [Serializable]
11 | public static class EmptyList
12 | {
13 | public static readonly IListAndListSource Value = new Repeated(default(T), 0);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/HelperClasses/RangeEnumerator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Loyc;
6 |
7 | namespace Loyc.Collections
8 | {
9 | /// Helper struct: enumerates through a forward range ().
10 | ///
11 | [Obsolete("Not in use. If you are using this, please leave an issue at https://github.com/qwertie/ecsharp/ to have the deprecation cancelled.")]
12 | public struct RangeEnumerator : IEnumerator
13 | {
14 | IFRange _range;
15 | T _current;
16 | public RangeEnumerator(IFRange range) { _range = range.Clone(); _current = default(T); }
17 |
18 | public bool MoveNext() { bool empty; _current = _range.PopFirst(out empty); return !empty; }
19 | public T Current { get { return _current; } }
20 |
21 | object System.Collections.IEnumerator.Current { get { return Current; } }
22 | void IDisposable.Dispose() { }
23 | void System.Collections.IEnumerator.Reset() { throw new NotSupportedException(); }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/HelperClasses/ReverseComparer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Loyc.Collections
7 | {
8 | /// Reverses the order used by an IComparer object.
9 | public struct ReverseComparer : IComparer
10 | {
11 | IComparer _comparer;
12 | public ReverseComparer(IComparer comparer)
13 | {
14 | _comparer = comparer;
15 | }
16 | public int Compare(T x, T y)
17 | {
18 | return _comparer.Compare(y, x);
19 | }
20 | }
21 |
22 | /// Reverses the order used by an IComparer object.
23 | public struct ReverseComparer : IComparer where TComparer : IComparer
24 | {
25 | TComparer _comparer;
26 | public ReverseComparer(TComparer comparer)
27 | {
28 | _comparer = comparer;
29 | }
30 | public int Compare(T x, T y)
31 | {
32 | return _comparer.Compare(y, x);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Collections/HelperClasses/SelectCollection.ecs:
--------------------------------------------------------------------------------
1 | using Loyc.Collections.Impl;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 |
6 | namespace Loyc.Collections
7 | {
8 | define GenerateSelectClass($SelectCollection, $ICollection)
9 | {
10 | /// Helper class for .
11 | public class $SelectCollection
12 | : ReadOnlyCollectionBase where ListT : $ICollection
13 | {
14 | public this(protected ListT _list, protected Func _selector) {
15 | if (_list == null || _selector == null)
16 | throw new ArgumentNullException();
17 | }
18 |
19 | public sealed override IEnumerator GetEnumerator()
20 | {
21 | return Enumerable.Select(_list, _selector).GetEnumerator();
22 | }
23 | public sealed override int Count
24 | {
25 | get { return _list.Count; }
26 | }
27 | }
28 | }
29 |
30 | GenerateSelectClass(SelectCollection, ICollection);
31 |
32 | GenerateSelectClass(SelectReadOnlyCollection, IReadOnlyCollection);
33 | }
34 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/Compatibility/WeakReference.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Runtime.Serialization;
6 |
7 | namespace Loyc
8 | {
9 | /// The new type in .NET 4.5 removes
10 | /// the Target and IsAlive properties. These extension methods
11 | /// restore that traditional functionality, making it easier to transition
12 | /// from the old WeakReference to the new one.
13 | public static class WeakReferenceExt
14 | {
15 | public static T Target(this WeakReference r) where T:class
16 | {
17 | T t;
18 | r.TryGetTarget(out t);
19 | return t;
20 | }
21 | public static bool IsAlive(this WeakReference r) where T : class
22 | {
23 | T _;
24 | return r.TryGetTarget(out _);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/MessageSinks/LogException.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Miscellaneous small items related to message sinks
3 | //
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 |
9 | namespace Loyc
10 | {
11 | /// An exception that includes a "context" object as part of a
12 | /// structure, typically used to indicate where an
13 | /// error occurred.
14 | public class LogException : Exception
15 | {
16 | public LogException(object context, string format, params object[] args) : this(Severity.Error, context, format, args) {}
17 | public LogException(Severity severity, object context, string format, params object[] args) : this(new LogMessage(severity, context, format, args)) {}
18 | public LogException(LogMessage msg) {
19 | Msg = msg;
20 | try {
21 | Data["Severity"] = msg.Severity;
22 | // Disabled because members of the Data dictionary must be serializable,
23 | // but msg.Context might not be. We could convert to string, but is it
24 | // worth the performance cost? Loyc code isn't really using Data anyway.
25 | //Data["Context"] = msg.Context;
26 | } catch { }
27 | }
28 |
29 | /// Contains additional information about the error that occurred.
30 | public LogMessage Msg { get; private set; }
31 |
32 | public override string Message
33 | {
34 | get { return Msg.Formatted; }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Core/Loyc.Essentials/MessageSinks/LogMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Loyc.Collections;
7 |
8 | namespace Loyc
9 | {
10 | /// Holds an argument list compatible with
11 | /// .
12 | /// Typically used with .
13 | public struct LogMessage : ILocation, ILogMessage
14 | {
15 | public LogMessage(Severity type, object context, string format, object arg0, object arg1 = null)
16 | : this (type, context, format, new object[2] { arg0, arg1 }) {}
17 | public LogMessage(Severity type, object context, string format)
18 | : this (type, context, format, EmptyArray