diff --git a/.gitignore b/.gitignore
index 6433528..2dc4afa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,312 @@
-*.suo
-*.user
-_ReSharper.*
-bin
-obj
-*.bak
-*.sln.cache
-*.nupkg
-*.dotCover
-packages
+## VS Code
+
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+
+## Mac
+
+.DS_Store
+
+## Visual Studio
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+**/Properties/launchSettings.json
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Typescript v1 declaration files
+typings/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush
+.cr/
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..0067a02
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,28 @@
+{
+ // Use IntelliSense to find out which attributes exist for C# debugging
+ // Use hover for the description of the existing attributes
+ // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": ".NET Core Launch (console)",
+ "type": "coreclr",
+ "request": "launch",
+ "preLaunchTask": "build",
+ // If you have changed target frameworks, make sure to update the program path.
+ "program": "${workspaceRoot}/test/Nustache.Compilation.Tests/bin/Debug/netcoreapp2.0/Nustache.Compilation.Tests.dll",
+ "args": [],
+ "cwd": "${workspaceRoot}/test/Nustache.Compilation.Tests",
+ // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
+ "console": "internalConsole",
+ "stopAtEntry": false,
+ "internalConsoleOptions": "openOnSessionStart"
+ },
+ {
+ "name": ".NET Core Attach",
+ "type": "coreclr",
+ "request": "attach",
+ "processId": "${command:pickProcess}"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 0000000..d948c47
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,16 @@
+{
+ "version": "0.1.0",
+ "command": "dotnet",
+ "isShellCommand": true,
+ "args": [],
+ "tasks": [
+ {
+ "taskName": "build",
+ "args": [
+ "${workspaceRoot}/test/Nustache.Compilation.Tests/Nustache.Compilation.Tests.csproj"
+ ],
+ "isBuildCommand": true,
+ "problemMatcher": "$msCompile"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/NuGet.exe b/NuGet.exe
deleted file mode 100644
index c296edf..0000000
Binary files a/NuGet.exe and /dev/null differ
diff --git a/Nustache.Compilation.Tests/Nustache.Compilation.Tests.csproj b/Nustache.Compilation.Tests/Nustache.Compilation.Tests.csproj
deleted file mode 100644
index da65814..0000000
--- a/Nustache.Compilation.Tests/Nustache.Compilation.Tests.csproj
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {4EC98A3B-4112-4CF0-81BC-D471F6192203}
- Library
- Properties
- Nustache.Compilation.Tests
- Nustache.Compilation.Tests
- v4.0
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- ..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll
-
-
- ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll
- False
-
-
- ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll
- False
-
-
- ..\packages\NUnit.2.6.2\lib\nunit.framework.dll
-
-
-
-
-
-
-
-
-
-
-
- ..\Lib\JsonClassGenerator\Xamasoft.JsonClassGenerator.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {be490269-abd0-4fce-802d-6b9acf147e66}
- Nustache.Compilation
-
-
- {3a725cd9-6024-441f-84b5-4226d78352c5}
- Nustache.Core
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Nustache.Compilation.Tests/Properties/AssemblyInfo.cs b/Nustache.Compilation.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index 63faf61..0000000
--- a/Nustache.Compilation.Tests/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Nustache.Compilation.Tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("Nustache.Compilation.Tests")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("ca4b994a-d98d-402b-928b-bb3a34741dcf")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Nustache.Compilation.Tests/packages.config b/Nustache.Compilation.Tests/packages.config
deleted file mode 100644
index cc02b62..0000000
--- a/Nustache.Compilation.Tests/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/Nustache.Compilation/Nustache.Compilation.csproj b/Nustache.Compilation/Nustache.Compilation.csproj
deleted file mode 100644
index a7cb275..0000000
--- a/Nustache.Compilation/Nustache.Compilation.csproj
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {BE490269-ABD0-4FCE-802D-6B9ACF147E66}
- Library
- Properties
- Nustache.Compilation
- Nustache.Compilation
- v4.0
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- ..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {3a725cd9-6024-441f-84b5-4226d78352c5}
- Nustache.Core
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Nustache.Compilation/Nustache.Compilation.nuspec b/Nustache.Compilation/Nustache.Compilation.nuspec
deleted file mode 100644
index 60cac6e..0000000
--- a/Nustache.Compilation/Nustache.Compilation.nuspec
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
- Nustache.Compilation
- $version$
- Jason Diamond
- Jason Diamond
- https://raw.github.com/jdiamond/Nustache/master/LICENSE.txt
- https://github.com/jdiamond/Nustache
- false
- $description$
- Template Mustache
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Nustache.Compilation/Properties/AssemblyInfo.cs b/Nustache.Compilation/Properties/AssemblyInfo.cs
deleted file mode 100644
index ce3a1b7..0000000
--- a/Nustache.Compilation/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Nustache.Compilation")]
-[assembly: AssemblyDescription("Compliation for Logic-less templates for .NET")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Jason Diamond")]
-[assembly: AssemblyProduct("Nustache.Compilation")]
-[assembly: AssemblyCopyright("Copyright © 2010-2013")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("fdab367d-e849-45ce-aabc-61539d019986")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.14.0.0")]
-[assembly: AssemblyFileVersion("1.14.0.0")]
diff --git a/Nustache.Compilation/packages.config b/Nustache.Compilation/packages.config
deleted file mode 100644
index a7ac88a..0000000
--- a/Nustache.Compilation/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/Nustache.Core.Tests/Nustache.Core.Tests.csproj b/Nustache.Core.Tests/Nustache.Core.Tests.csproj
deleted file mode 100644
index 3798e72..0000000
--- a/Nustache.Core.Tests/Nustache.Core.Tests.csproj
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.30729
- 2.0
- {872BE5F3-E52A-45C8-BEEB-1A9540F24153}
- Library
- Properties
- Nustache.Core.Tests
- Nustache.Core.Tests
- v4.0
- 512
-
-
- 3.5
-
-
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- AllRules.ruleset
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- AllRules.ruleset
-
-
-
- ..\packages\DynamicExpresso.Core.1.3.0.0\lib\net40\DynamicExpresso.Core.dll
-
-
- False
- ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll
-
-
- ..\packages\Newtonsoft.Json.6.0.8\lib\net40\Newtonsoft.Json.dll
-
-
- False
- ..\packages\NUnit.2.6.2\lib\nunit.framework.dll
-
-
-
- 3.5
-
-
-
-
-
-
- ..\packages\YamlDotNet.Core.2.1.1\lib\net35\YamlDotNet.Core.dll
-
-
- ..\packages\YamlDotNet.RepresentationModel.2.1.1\lib\net35\YamlDotNet.RepresentationModel.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {3A725CD9-6024-441F-84B5-4226D78352C5}
- Nustache.Core
-
-
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- true
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Nustache.Core.Tests/Properties/AssemblyInfo.cs b/Nustache.Core.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index b786e8d..0000000
--- a/Nustache.Core.Tests/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Nustache.Tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Nustache.Tests")]
-[assembly: AssemblyCopyright("Copyright © 2010")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("b9e6a98e-a90b-4bb7-b689-8f8414b3eac0")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Nustache.Core.Tests/RenderContext_Behaviour_Support.cs b/Nustache.Core.Tests/RenderContext_Behaviour_Support.cs
deleted file mode 100644
index 49f0c99..0000000
--- a/Nustache.Core.Tests/RenderContext_Behaviour_Support.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using NUnit.Framework;
-
-namespace Nustache.Core.Tests
-{
- [TestFixture]
- public class RenderContext_Behaviour_Support
- {
- [Test, ExpectedException(ExpectedException = typeof(NustacheDataContextMissException),
- ExpectedMessage = "Path : . is undefined, RaiseExceptionOnDataContextMiss : true.")]
- public void It_throws_an_exception_when_array_is_null_and_the_render_context_behaviour_throw_on_miss_is_true()
- {
- Render.StringToString("before{{#.}}{{.}}{{/.}}after", null , new RenderContextBehaviour{ RaiseExceptionOnDataContextMiss = true});
- }
-
- [Test, ExpectedException(ExpectedException = typeof(NustacheEmptyStringException),
- ExpectedMessage = "Path : foo is an empty string, RaiseExceptionOnEmptyStringValue : true.")]
- public void It_throws_an_exception_when_the_data_is_an_empty_string_and_the_render_context_behaviour_throw_on_empty_string_is_true()
- {
- Render.StringToString("before{{foo}}after", new{ foo = string.Empty}, new RenderContextBehaviour { RaiseExceptionOnEmptyStringValue = true });
- }
-
- [Test, ExpectedException(ExpectedException = typeof(NustacheDataContextMissException),
- ExpectedMessage = "Path : foo is undefined, RaiseExceptionOnDataContextMiss : true.")]
- public void It_throws_an_exception_when_there_is_no_data_and_the_render_context_behaviour_throw_on_miss_is_true()
- {
- Render.StringToString("before{{foo}}after", null, new RenderContextBehaviour { RaiseExceptionOnDataContextMiss = true });
- }
-
- [Test, ExpectedException(ExpectedException = typeof(NustacheDataContextMissException),
- ExpectedMessage = "Path : foo.bar is undefined, RaiseExceptionOnDataContextMiss : true.")]
- public void It_throws_an_exception_when_there_is_no_nested_data_and_the_render_context_behaviour_throw_on_miss_is_true()
- {
- Render.StringToString("before{{foo.bar}}after", new { foo = new { } }, new RenderContextBehaviour { RaiseExceptionOnDataContextMiss = true });
- }
-
- [Test, ExpectedException(ExpectedException = typeof(NustacheEmptyStringException),
- ExpectedMessage = "Path : foo is an empty string, RaiseExceptionOnEmptyStringValue : true.")]
- public void It_throws_an_exception_when_section_is_mapped_to_empty_string_and_the_render_context_behaviour_throw_on_empty_string_is_true()
- {
- Render.StringToString("before{{#foo}}FOO{{/foo}}after", new { foo = string.Empty }, new RenderContextBehaviour { RaiseExceptionOnEmptyStringValue = true });
- }
-
- [Test, ExpectedException(ExpectedException = typeof(NustacheDataContextMissException),
- ExpectedMessage = "Path : foo is undefined, RaiseExceptionOnDataContextMiss : true.")]
- public void It_throws_an_exception_when_section_is_mapped_to_null_and_the_render_context_behaviour_throw_on_miss_is_true()
- {
- Render.StringToString("before{{#foo}}FOO{{/foo}}after", new { foo = (string)null }, new RenderContextBehaviour { RaiseExceptionOnDataContextMiss = true });
- }
-
- [Test]
- public void It_does_not_throw_an_exception_when_there_is_no_data_and_the_render_context_behaviour_throw_on_miss_is_false()
- {
- var result = Render.StringToString("before{{foo}}after", null, new RenderContextBehaviour { RaiseExceptionOnDataContextMiss = false });
- Assert.AreEqual("beforeafter", result);
- }
-
- [Test]
- public void Use_custom_encoder()
- {
- var result = Render.StringToString("before{{foo}}after", new {foo = string.Empty},
- new RenderContextBehaviour {HtmlEncoder = text => "middle"});
- Assert.AreEqual("beforemiddleafter", result);
- }
- }
-}
\ No newline at end of file
diff --git a/Nustache.Core.Tests/packages.config b/Nustache.Core.Tests/packages.config
deleted file mode 100644
index 2be0db1..0000000
--- a/Nustache.Core.Tests/packages.config
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Nustache.Core/Nustache.Core.csproj b/Nustache.Core/Nustache.Core.csproj
deleted file mode 100644
index a9fbd31..0000000
--- a/Nustache.Core/Nustache.Core.csproj
+++ /dev/null
@@ -1,118 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.21022
- 2.0
- {3A725CD9-6024-441F-84B5-4226D78352C5}
- Library
- Properties
- Nustache.Core
- Nustache.Core
- v2.0
- 512
-
-
- 3.5
-
-
-
-
- true
- full
- false
- bin\Debug\
- TRACE;DEBUG
- prompt
- 4
- AllRules.ruleset
-
-
- pdbonly
- true
- bin\Release\
-
-
- prompt
- 4
- AllRules.ruleset
-
-
- true
-
-
- Nustache.snk
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- true
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Nustache.Core/Nustache.Core.nuspec b/Nustache.Core/Nustache.Core.nuspec
deleted file mode 100644
index 92eb794..0000000
--- a/Nustache.Core/Nustache.Core.nuspec
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- Nustache
- $version$
- Jason Diamond
- Jason Diamond
- https://raw.github.com/jdiamond/Nustache/master/LICENSE.txt
- https://github.com/jdiamond/Nustache
- false
- $description$
- Template Mustache
-
-
diff --git a/Nustache.Core/Nustache.snk b/Nustache.Core/Nustache.snk
deleted file mode 100644
index b6ca4da..0000000
Binary files a/Nustache.Core/Nustache.snk and /dev/null differ
diff --git a/Nustache.Core/Part.cs b/Nustache.Core/Part.cs
deleted file mode 100644
index 72f116b..0000000
--- a/Nustache.Core/Part.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-namespace Nustache.Core
-{
- public abstract class Part
- {
- public abstract void Render(RenderContext context);
-
- public abstract string Source();
-
- public void Accept(PartVisitor visitor)
- {
- try
- {
- visitor.GetType().GetMethod("Visit", new Type[] { this.GetType() })
- .Invoke(visitor, new object[] { this });
- }
- catch (System.Reflection.TargetInvocationException ex)
- {
- throw ex.InnerException;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Nustache.Core/Properties/AssemblyInfo.cs b/Nustache.Core/Properties/AssemblyInfo.cs
deleted file mode 100644
index 657f286..0000000
--- a/Nustache.Core/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Nustache.Core")]
-[assembly: AssemblyDescription("Logic-less templates for .NET")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Jason Diamond")]
-[assembly: AssemblyProduct("Nustache.Core")]
-[assembly: AssemblyCopyright("Copyright © 2010-2013")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("b46f7bcb-706d-4fa6-ae0f-d4903e3ed446")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.14.0.0")]
-[assembly: AssemblyFileVersion("1.14.0.0")]
diff --git a/Nustache.sln b/Nustache.sln
index c1f342e..62945c8 100644
--- a/Nustache.sln
+++ b/Nustache.sln
@@ -1,64 +1,88 @@
-
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.31101.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9D6A76C1-E840-4BB4-AAA6-CA39BECEAF21}"
- ProjectSection(SolutionItems) = preProject
- HISTORY.txt = HISTORY.txt
- LICENSE.txt = LICENSE.txt
- README.md = README.md
- TODO.txt = TODO.txt
- EndProjectSection
+# Visual Studio 15
+VisualStudioVersion = 15.0.26730.16
+MinimumVisualStudioVersion = 15.0.26124.0
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{76C5E5A3-2661-4CA6-A6FE-D19CC021F1B5}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nustache.Core", "Nustache.Core\Nustache.Core.csproj", "{3A725CD9-6024-441F-84B5-4226D78352C5}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{BA50F8DA-2151-437E-BFB9-BB5F93438D29}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nustache", "nustache\nustache.csproj", "{F0F3CFC9-0028-46D4-8481-9FE0310D5F83}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nustache.Core.Tests", "test\Nustache.Core.Tests\Nustache.Core.Tests.csproj", "{A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nustache.Core.Tests", "Nustache.Core.Tests\Nustache.Core.Tests.csproj", "{872BE5F3-E52A-45C8-BEEB-1A9540F24153}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nustache.Core", "src\Nustache.Core\Nustache.Core.csproj", "{45530025-DF85-4F1F-80B8-DD770B059D69}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nustache.Mvc3.Example", "Nustache.Mvc3.Example\Nustache.Mvc3.Example.csproj", "{326AEAC1-FBCD-4FB2-8141-20F873CFF68F}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nustache.Compilation", "src\Nustache.Compilation\Nustache.Compilation.csproj", "{C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nustache.Mvc3", "Nustache.Mvc3\Nustache.Mvc3.csproj", "{BB62330D-3604-40EB-9B76-39CE36F1AD6F}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nustache.Compilation", "Nustache.Compilation\Nustache.Compilation.csproj", "{BE490269-ABD0-4FCE-802D-6B9ACF147E66}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nustache.Compilation.Tests", "Nustache.Compilation.Tests\Nustache.Compilation.Tests.csproj", "{4EC98A3B-4112-4CF0-81BC-D471F6192203}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nustache.Compilation.Tests", "test\Nustache.Compilation.Tests\Nustache.Compilation.Tests.csproj", "{308CD32C-EFEE-421B-ACC2-47E3A0E501CB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {3A725CD9-6024-441F-84B5-4226D78352C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3A725CD9-6024-441F-84B5-4226D78352C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3A725CD9-6024-441F-84B5-4226D78352C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3A725CD9-6024-441F-84B5-4226D78352C5}.Release|Any CPU.Build.0 = Release|Any CPU
- {F0F3CFC9-0028-46D4-8481-9FE0310D5F83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F0F3CFC9-0028-46D4-8481-9FE0310D5F83}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F0F3CFC9-0028-46D4-8481-9FE0310D5F83}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F0F3CFC9-0028-46D4-8481-9FE0310D5F83}.Release|Any CPU.Build.0 = Release|Any CPU
- {872BE5F3-E52A-45C8-BEEB-1A9540F24153}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {872BE5F3-E52A-45C8-BEEB-1A9540F24153}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {872BE5F3-E52A-45C8-BEEB-1A9540F24153}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {872BE5F3-E52A-45C8-BEEB-1A9540F24153}.Release|Any CPU.Build.0 = Release|Any CPU
- {326AEAC1-FBCD-4FB2-8141-20F873CFF68F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {326AEAC1-FBCD-4FB2-8141-20F873CFF68F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BB62330D-3604-40EB-9B76-39CE36F1AD6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BB62330D-3604-40EB-9B76-39CE36F1AD6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BB62330D-3604-40EB-9B76-39CE36F1AD6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BB62330D-3604-40EB-9B76-39CE36F1AD6F}.Release|Any CPU.Build.0 = Release|Any CPU
- {BE490269-ABD0-4FCE-802D-6B9ACF147E66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BE490269-ABD0-4FCE-802D-6B9ACF147E66}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BE490269-ABD0-4FCE-802D-6B9ACF147E66}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BE490269-ABD0-4FCE-802D-6B9ACF147E66}.Release|Any CPU.Build.0 = Release|Any CPU
- {4EC98A3B-4112-4CF0-81BC-D471F6192203}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4EC98A3B-4112-4CF0-81BC-D471F6192203}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4EC98A3B-4112-4CF0-81BC-D471F6192203}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4EC98A3B-4112-4CF0-81BC-D471F6192203}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Debug|x64.Build.0 = Debug|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Debug|x86.Build.0 = Debug|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Release|x64.ActiveCfg = Release|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Release|x64.Build.0 = Release|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Release|x86.ActiveCfg = Release|Any CPU
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F}.Release|x86.Build.0 = Release|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Debug|x64.Build.0 = Debug|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Debug|x86.Build.0 = Debug|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Release|Any CPU.Build.0 = Release|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Release|x64.ActiveCfg = Release|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Release|x64.Build.0 = Release|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Release|x86.ActiveCfg = Release|Any CPU
+ {45530025-DF85-4F1F-80B8-DD770B059D69}.Release|x86.Build.0 = Release|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Debug|x64.Build.0 = Debug|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Debug|x86.Build.0 = Debug|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Release|x64.ActiveCfg = Release|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Release|x64.Build.0 = Release|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Release|x86.ActiveCfg = Release|Any CPU
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A}.Release|x86.Build.0 = Release|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Debug|x64.Build.0 = Debug|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Debug|x86.Build.0 = Debug|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Release|x64.ActiveCfg = Release|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Release|x64.Build.0 = Release|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Release|x86.ActiveCfg = Release|Any CPU
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {A4B7FF44-D2D4-49C1-AE9E-36E390C6E63F} = {BA50F8DA-2151-437E-BFB9-BB5F93438D29}
+ {45530025-DF85-4F1F-80B8-DD770B059D69} = {76C5E5A3-2661-4CA6-A6FE-D19CC021F1B5}
+ {C1F51C39-E811-4D32-AE0D-E1C7FB5BC43A} = {76C5E5A3-2661-4CA6-A6FE-D19CC021F1B5}
+ {308CD32C-EFEE-421B-ACC2-47E3A0E501CB} = {BA50F8DA-2151-437E-BFB9-BB5F93438D29}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {33DFFA70-8EB7-4FF7-946E-CF749CCFF612}
+ EndGlobalSection
EndGlobal
diff --git a/lib/DynamicExpresso.Core.1.4.0-netstandard-alpha1.nupkg b/lib/DynamicExpresso.Core.1.4.0-netstandard-alpha1.nupkg
new file mode 100644
index 0000000..13c0a70
Binary files /dev/null and b/lib/DynamicExpresso.Core.1.4.0-netstandard-alpha1.nupkg differ
diff --git a/nuget.config b/nuget.config
new file mode 100644
index 0000000..b5865b7
--- /dev/null
+++ b/nuget.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/pack.cmd b/pack.cmd
deleted file mode 100644
index f237be0..0000000
--- a/pack.cmd
+++ /dev/null
@@ -1,5 +0,0 @@
-set opts=-Prop Configuration=Release -Build -OutputDirectory .
-
-nuget pack Nustache.Core\Nustache.Core.csproj %opts%
-nuget pack Nustache.Mvc3\Nustache.Mvc3.csproj %opts%
-
diff --git a/pack.ps1 b/pack.ps1
new file mode 100644
index 0000000..f5cc585
--- /dev/null
+++ b/pack.ps1
@@ -0,0 +1,10 @@
+Param(
+ [string] $Configuration='Release',
+ [string] $VersionPrefix='1.17.0',
+ [string] $VersionSuffix='alpha1'
+)
+
+$dotnet = Get-Command 'dotnet'
+
+& $dotnet restore /p:VersionPrefix=$VersionPrefix /p:VersionSuffix=$VersionSuffix
+& $dotnet pack /p:Configuration=Release /p:VersionPrefix=$VersionPrefix /p:VersionSuffix=$VersionSuffix -o $PWD\out
diff --git a/src/NuGet.props b/src/NuGet.props
new file mode 100644
index 0000000..fdadb14
--- /dev/null
+++ b/src/NuGet.props
@@ -0,0 +1,9 @@
+
+
+
+ Jason Diamond
+ https://raw.github.com/jdiamond/Nustache/master/LICENSE.txt
+ https://github.com/jdiamond/Nustache
+ Template;Mustache
+
+
diff --git a/Nustache.Compilation/CompilationException.cs b/src/Nustache.Compilation/CompilationException.cs
similarity index 100%
rename from Nustache.Compilation/CompilationException.cs
rename to src/Nustache.Compilation/CompilationException.cs
diff --git a/Nustache.Compilation/CompileContext.cs b/src/Nustache.Compilation/CompileContext.cs
similarity index 100%
rename from Nustache.Compilation/CompileContext.cs
rename to src/Nustache.Compilation/CompileContext.cs
diff --git a/Nustache.Compilation/CompilePartVisitor.cs b/src/Nustache.Compilation/CompilePartVisitor.cs
similarity index 100%
rename from Nustache.Compilation/CompilePartVisitor.cs
rename to src/Nustache.Compilation/CompilePartVisitor.cs
diff --git a/Nustache.Compilation/CompiledValueGetterVisitor.cs b/src/Nustache.Compilation/CompiledValueGetterVisitor.cs
similarity index 100%
rename from Nustache.Compilation/CompiledValueGetterVisitor.cs
rename to src/Nustache.Compilation/CompiledValueGetterVisitor.cs
diff --git a/Nustache.Compilation/CompoundExpression.cs b/src/Nustache.Compilation/CompoundExpression.cs
similarity index 100%
rename from Nustache.Compilation/CompoundExpression.cs
rename to src/Nustache.Compilation/CompoundExpression.cs
diff --git a/src/Nustache.Compilation/Nustache.Compilation.csproj b/src/Nustache.Compilation/Nustache.Compilation.csproj
new file mode 100644
index 0000000..92f5897
--- /dev/null
+++ b/src/Nustache.Compilation/Nustache.Compilation.csproj
@@ -0,0 +1,12 @@
+
+
+
+ netstandard2.0
+
+
+
+
+
+
+
+
diff --git a/Nustache.Compilation/TemplateCompiler.cs b/src/Nustache.Compilation/TemplateCompiler.cs
similarity index 100%
rename from Nustache.Compilation/TemplateCompiler.cs
rename to src/Nustache.Compilation/TemplateCompiler.cs
diff --git a/Nustache.Core/Block.cs b/src/Nustache.Core/Block.cs
similarity index 96%
rename from Nustache.Core/Block.cs
rename to src/Nustache.Core/Block.cs
index 3cb04ef..cd420b9 100644
--- a/Nustache.Core/Block.cs
+++ b/src/Nustache.Core/Block.cs
@@ -1,100 +1,100 @@
-
-using System;
-using System.IO;
-
-namespace Nustache.Core
-{
- public class Block : Section
- {
- public Block(string name, params Part[] parts)
- : base(name)
- {
- Load(parts);
- }
-
- public override void Render(RenderContext context)
- {
- var value = context.GetValue(Name);
-
- var lambda = CheckValueIsDelegateOrLambda(value);
-
- if (lambda != null)
- {
- var lambdaResult = lambda(InnerSource()).ToString();
- using(TextReader sr = new StringReader(lambdaResult))
- {
- var template = new Template();
- template.StartDelimiter = context.ActiveStartDelimiter;
- template.EndDelimiter = context.ActiveEndDelimiter;
-
- template.Load(sr);
- context.Enter(template);
- template.Render(context);
- context.Exit();
- }
-
- return;
- }
-
- var helper = value as HelperProxy;
-
- if (helper != null)
- {
- helper(data =>
- {
- context.Enter(this);
- context.Push(data);
-
- RenderParts(context);
-
- context.Pop();
- context.Exit();
- }, data =>
- {
- if (Inverse != null)
- {
- context.Enter(Inverse);
- context.Push(data);
-
- Inverse.RenderParts(context);
-
- context.Pop();
- context.Exit();
- }
- });
-
- return;
- }
-
- foreach (var item in context.GetValues(Name))
- {
- context.Enter(this);
- context.Push(item);
-
- base.Render(context);
-
- context.Pop();
- context.Exit();
- }
- }
-
- public Lambda CheckValueIsDelegateOrLambda(object value)
- {
- var lambda = value as Lambda;
- if (lambda != null) return lambda;
-
- if (value is Delegate && !(value is HelperProxy))
- {
- var delegateValue = (Delegate)value;
- return (Lambda)((body) => (object)delegateValue.DynamicInvoke(body));
- }
-
- return null;
- }
-
- public override string ToString()
- {
- return string.Format("Block(\"{0}\")", Name);
- }
- }
+
+using System;
+using System.IO;
+
+namespace Nustache.Core
+{
+ public class Block : Section
+ {
+ public Block(string name, params Part[] parts)
+ : base(name)
+ {
+ Load(parts);
+ }
+
+ public override void Render(RenderContext context)
+ {
+ var value = context.GetValue(Name);
+
+ var lambda = CheckValueIsDelegateOrLambda(value);
+
+ if (lambda != null)
+ {
+ var lambdaResult = lambda(InnerSource()).ToString();
+ using(TextReader sr = new StringReader(lambdaResult))
+ {
+ var template = new Template();
+ template.StartDelimiter = context.ActiveStartDelimiter;
+ template.EndDelimiter = context.ActiveEndDelimiter;
+
+ template.Load(sr);
+ context.Enter(template);
+ template.Render(context);
+ context.Exit();
+ }
+
+ return;
+ }
+
+ var helper = value as HelperProxy;
+
+ if (helper != null)
+ {
+ helper(data =>
+ {
+ context.Enter(this);
+ context.Push(data);
+
+ RenderParts(context);
+
+ context.Pop();
+ context.Exit();
+ }, data =>
+ {
+ if (Inverse != null)
+ {
+ context.Enter(Inverse);
+ context.Push(data);
+
+ Inverse.RenderParts(context);
+
+ context.Pop();
+ context.Exit();
+ }
+ });
+
+ return;
+ }
+
+ foreach (var item in context.GetValues(Name))
+ {
+ context.Enter(this);
+ context.Push(item);
+
+ base.Render(context);
+
+ context.Pop();
+ context.Exit();
+ }
+ }
+
+ public Lambda CheckValueIsDelegateOrLambda(object value)
+ {
+ var lambda = value as Lambda;
+ if (lambda != null) return lambda;
+
+ if (value is Delegate && !(value is HelperProxy))
+ {
+ var delegateValue = (Delegate)value;
+ return (Lambda)((body) => (object)delegateValue.DynamicInvoke(body));
+ }
+
+ return null;
+ }
+
+ public override string ToString()
+ {
+ return string.Format("Block(\"{0}\")", Name);
+ }
+ }
}
\ No newline at end of file
diff --git a/Nustache.Core/Encoders.cs b/src/Nustache.Core/Encoders.cs
similarity index 97%
rename from Nustache.Core/Encoders.cs
rename to src/Nustache.Core/Encoders.cs
index 6ca0579..692c641 100644
--- a/Nustache.Core/Encoders.cs
+++ b/src/Nustache.Core/Encoders.cs
@@ -1,74 +1,74 @@
-using System.Globalization;
-using System.Text;
-
-namespace Nustache.Core
-{
- // We can't reference System.Web in Client Profile environments so this
- // class contains a simple encoder, but it can be swapped out with
- // HttpUtility.HtmlEncode when used in non-Client Profile environments
- // (like when using Nustache in an MVC application).
- public static class Encoders
- {
- public delegate string HtmlEncoder(string text);
-
- public static HtmlEncoder HtmlEncode { get; set; }
-
- static Encoders()
- {
- HtmlEncode = DefaultHtmlEncode;
- }
-
- // Used with permission from http://www.west-wind.com/weblog/posts/2009/Feb/05/Html-and-Uri-String-Encoding-without-SystemWeb
- public static string DefaultHtmlEncode(string text)
- {
- if (text == null)
- {
- return null;
- }
-
- var sb = new StringBuilder(text.Length);
-
- var len = text.Length;
-
- for (var i = 0; i < len; i++)
- {
- switch (text[i])
- {
- case '<':
- sb.Append("<");
- break;
- case '>':
- sb.Append(">");
- break;
- case '"':
- sb.Append(""");
- break;
- case '&':
- sb.Append("&");
- break;
- default:
- var ch = text[i];
- if (ch > 159)
- {
- sb.Append("");
- if (char.IsHighSurrogate(ch) && (i + 1) < len) {
- // convert surrogates to their decimal value
- sb.Append(char.ConvertToUtf32(ch, text[i+1]));
- i++;
- } else {
- sb.Append(((int)ch).ToString(CultureInfo.InvariantCulture));
- }
- sb.Append(";");
- }
- else
- {
- sb.Append(text[i]);
- }
- break;
- }
- }
-
- return sb.ToString();
- }
- }
+using System.Globalization;
+using System.Text;
+
+namespace Nustache.Core
+{
+ // We can't reference System.Web in Client Profile environments so this
+ // class contains a simple encoder, but it can be swapped out with
+ // HttpUtility.HtmlEncode when used in non-Client Profile environments
+ // (like when using Nustache in an MVC application).
+ public static class Encoders
+ {
+ public delegate string HtmlEncoder(string text);
+
+ public static HtmlEncoder HtmlEncode { get; set; }
+
+ static Encoders()
+ {
+ HtmlEncode = DefaultHtmlEncode;
+ }
+
+ // Used with permission from http://www.west-wind.com/weblog/posts/2009/Feb/05/Html-and-Uri-String-Encoding-without-SystemWeb
+ public static string DefaultHtmlEncode(string text)
+ {
+ if (text == null)
+ {
+ return null;
+ }
+
+ var sb = new StringBuilder(text.Length);
+
+ var len = text.Length;
+
+ for (var i = 0; i < len; i++)
+ {
+ switch (text[i])
+ {
+ case '<':
+ sb.Append("<");
+ break;
+ case '>':
+ sb.Append(">");
+ break;
+ case '"':
+ sb.Append(""");
+ break;
+ case '&':
+ sb.Append("&");
+ break;
+ default:
+ var ch = text[i];
+ if (ch > 159)
+ {
+ sb.Append("");
+ if (char.IsHighSurrogate(ch) && (i + 1) < len) {
+ // convert surrogates to their decimal value
+ sb.Append(char.ConvertToUtf32(ch, text[i+1]));
+ i++;
+ } else {
+ sb.Append(((int)ch).ToString(CultureInfo.InvariantCulture));
+ }
+ sb.Append(";");
+ }
+ else
+ {
+ sb.Append(text[i]);
+ }
+ break;
+ }
+ }
+
+ return sb.ToString();
+ }
+ }
}
\ No newline at end of file
diff --git a/Nustache.Core/EndSection.cs b/src/Nustache.Core/EndSection.cs
similarity index 95%
rename from Nustache.Core/EndSection.cs
rename to src/Nustache.Core/EndSection.cs
index d7e6e95..3f57384 100644
--- a/Nustache.Core/EndSection.cs
+++ b/src/Nustache.Core/EndSection.cs
@@ -1,38 +1,38 @@
-using System;
-
-namespace Nustache.Core
-{
- public class EndSection : Part
- {
- private readonly string _name;
-
- public EndSection(string name)
- {
- if (name == null)
- {
- throw new ArgumentNullException("name");
- }
-
- _name = name;
- }
-
- public string Name
- {
- get { return _name; }
- }
-
- public override void Render(RenderContext context)
- {
- }
-
- public override string Source()
- {
- return "";
- }
-
- public override string ToString()
- {
- return string.Format("EndSection(\"{0}\")", _name);
- }
- }
+using System;
+
+namespace Nustache.Core
+{
+ public class EndSection : Part
+ {
+ private readonly string _name;
+
+ public EndSection(string name)
+ {
+ if (name == null)
+ {
+ throw new ArgumentNullException("name");
+ }
+
+ _name = name;
+ }
+
+ public string Name
+ {
+ get { return _name; }
+ }
+
+ public override void Render(RenderContext context)
+ {
+ }
+
+ public override string Source()
+ {
+ return "";
+ }
+
+ public override string ToString()
+ {
+ return string.Format("EndSection(\"{0}\")", _name);
+ }
+ }
}
\ No newline at end of file
diff --git a/Nustache.Core/FileSystemTemplateLocator.cs b/src/Nustache.Core/FileSystemTemplateLocator.cs
similarity index 96%
rename from Nustache.Core/FileSystemTemplateLocator.cs
rename to src/Nustache.Core/FileSystemTemplateLocator.cs
index 6401440..e2989b6 100644
--- a/Nustache.Core/FileSystemTemplateLocator.cs
+++ b/src/Nustache.Core/FileSystemTemplateLocator.cs
@@ -1,36 +1,36 @@
-using System.IO;
-
-namespace Nustache.Core
-{
- public class FileSystemTemplateLocator
- {
- private readonly string _extension;
- private readonly string[] _directories;
-
- public FileSystemTemplateLocator(string extension, params string[] directories)
- {
- _extension = extension;
- _directories = directories;
- }
-
- public Template GetTemplate(string name)
- {
- foreach (var directory in _directories)
- {
- var path = Path.Combine(directory, name + _extension);
-
- if (File.Exists(path))
- {
- var text = File.ReadAllText(path);
- var reader = new StringReader(text);
- var template = new Template();
- template.Load(reader);
-
- return template;
- }
- }
-
- return null;
- }
- }
+using System.IO;
+
+namespace Nustache.Core
+{
+ public class FileSystemTemplateLocator
+ {
+ private readonly string _extension;
+ private readonly string[] _directories;
+
+ public FileSystemTemplateLocator(string extension, params string[] directories)
+ {
+ _extension = extension;
+ _directories = directories;
+ }
+
+ public Template GetTemplate(string name)
+ {
+ foreach (var directory in _directories)
+ {
+ var path = Path.Combine(directory, name + _extension);
+
+ if (File.Exists(path))
+ {
+ var text = File.ReadAllText(path);
+ var reader = new StringReader(text);
+ var template = new Template();
+ template.Load(reader);
+
+ return template;
+ }
+ }
+
+ return null;
+ }
+ }
}
\ No newline at end of file
diff --git a/Nustache.Core/GenericDictionaryUtil.cs b/src/Nustache.Core/GenericDictionaryUtil.cs
similarity index 95%
rename from Nustache.Core/GenericDictionaryUtil.cs
rename to src/Nustache.Core/GenericDictionaryUtil.cs
index 1cb851c..cbab045 100644
--- a/Nustache.Core/GenericDictionaryUtil.cs
+++ b/src/Nustache.Core/GenericDictionaryUtil.cs
@@ -1,39 +1,39 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Nustache.Core
-{
-
- public static class GenericIDictionaryUtil
- {
- private static readonly Type OpenIDictionaryType = typeof(IDictionary<,>);
-
- public static bool IsInstanceOfGenericIDictionary(object value)
- {
- if (value == null)
- {
- throw new ArgumentNullException();
- }
- var objType = value.GetType();
-
- bool isGenericIDictionaryType = ImplementsGenericIDictionary(objType);
-
- return isGenericIDictionaryType;
- }
-
- private static bool ImplementsGenericIDictionary(Type type)
- {
- return (type.FindInterfaces(IsGenericIDictionary, null).Length > 0);
- }
-
- private static bool IsGenericIDictionary(Type type, object searchCrit)
- {
- return (type.Name == OpenIDictionaryType.Name)
- && type.IsGenericType
- && type.GetGenericTypeDefinition() == OpenIDictionaryType;
- }
- }
-
-
-}
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Nustache.Core
+{
+
+ public static class GenericIDictionaryUtil
+ {
+ private static readonly Type OpenIDictionaryType = typeof(IDictionary<,>);
+
+ public static bool IsInstanceOfGenericIDictionary(object value)
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+ var objType = value.GetType();
+
+ bool isGenericIDictionaryType = ImplementsGenericIDictionary(objType);
+
+ return isGenericIDictionaryType;
+ }
+
+ private static bool ImplementsGenericIDictionary(Type type)
+ {
+ return (type.FindInterfaces(IsGenericIDictionary, null).Length > 0);
+ }
+
+ private static bool IsGenericIDictionary(Type type, object searchCrit)
+ {
+ return (type.Name == OpenIDictionaryType.Name)
+ && type.IsGenericType
+ && type.GetGenericTypeDefinition() == OpenIDictionaryType;
+ }
+ }
+
+
+}
diff --git a/Nustache.Core/Helpers.cs b/src/Nustache.Core/Helpers.cs
similarity index 100%
rename from Nustache.Core/Helpers.cs
rename to src/Nustache.Core/Helpers.cs
diff --git a/Nustache.Core/InvertedBlock.cs b/src/Nustache.Core/InvertedBlock.cs
similarity index 100%
rename from Nustache.Core/InvertedBlock.cs
rename to src/Nustache.Core/InvertedBlock.cs
diff --git a/Nustache.Core/JValueIdentifier.cs b/src/Nustache.Core/JValueIdentifier.cs
similarity index 94%
rename from Nustache.Core/JValueIdentifier.cs
rename to src/Nustache.Core/JValueIdentifier.cs
index 8777c50..626e175 100644
--- a/Nustache.Core/JValueIdentifier.cs
+++ b/src/Nustache.Core/JValueIdentifier.cs
@@ -52,15 +52,19 @@ public static object GetValue(object jValue)
}
if (typeOfValue == "Integer") // JTokenType.Integer
- {
+ {
return GetValue(jValueType, jValue);
}
if (typeOfValue == "Float") // JTokenType.Float
- {
+ {
return GetValue(jValueType, jValue);
}
+ if (typeOfValue == "Date") // JTokenType.Date
+ {
+ return GetValue(jValueType, jValue);
+ }
return null;
}
diff --git a/Nustache.Core/LiteralText.cs b/src/Nustache.Core/LiteralText.cs
similarity index 95%
rename from Nustache.Core/LiteralText.cs
rename to src/Nustache.Core/LiteralText.cs
index 9842c30..9ec984f 100644
--- a/Nustache.Core/LiteralText.cs
+++ b/src/Nustache.Core/LiteralText.cs
@@ -1,36 +1,36 @@
-using System;
-
-namespace Nustache.Core
-{
- public class LiteralText : Part
- {
- private readonly string _text;
-
- public LiteralText(string text)
- {
- if (text == null)
- {
- throw new ArgumentNullException("text");
- }
-
- _text = text;
- }
-
- public string Text { get { return _text; } }
-
- public override void Render(RenderContext context)
- {
- context.WriteLiteral(_text);
- }
-
- public override string Source()
- {
- return _text;
- }
-
- public override string ToString()
- {
- return string.Format("LiteralText(\"{0}\")", _text);
- }
- }
+using System;
+
+namespace Nustache.Core
+{
+ public class LiteralText : Part
+ {
+ private readonly string _text;
+
+ public LiteralText(string text)
+ {
+ if (text == null)
+ {
+ throw new ArgumentNullException("text");
+ }
+
+ _text = text;
+ }
+
+ public string Text { get { return _text; } }
+
+ public override void Render(RenderContext context)
+ {
+ context.WriteLiteral(_text);
+ }
+
+ public override string Source()
+ {
+ return _text;
+ }
+
+ public override string ToString()
+ {
+ return string.Format("LiteralText(\"{0}\")", _text);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Nustache.Core/Nustache.Core.csproj b/src/Nustache.Core/Nustache.Core.csproj
new file mode 100644
index 0000000..482ea29
--- /dev/null
+++ b/src/Nustache.Core/Nustache.Core.csproj
@@ -0,0 +1,12 @@
+
+
+
+ netstandard2.0
+
+
+
+
+
+
+
+
diff --git a/Nustache.Core/NustacheDataContextMissException.cs b/src/Nustache.Core/NustacheDataContextMissException.cs
similarity index 100%
rename from Nustache.Core/NustacheDataContextMissException.cs
rename to src/Nustache.Core/NustacheDataContextMissException.cs
diff --git a/Nustache.Core/NustacheEmptyStringException.cs b/src/Nustache.Core/NustacheEmptyStringException.cs
similarity index 100%
rename from Nustache.Core/NustacheEmptyStringException.cs
rename to src/Nustache.Core/NustacheEmptyStringException.cs
diff --git a/Nustache.Core/NustacheException.cs b/src/Nustache.Core/NustacheException.cs
similarity index 94%
rename from Nustache.Core/NustacheException.cs
rename to src/Nustache.Core/NustacheException.cs
index 5d9b08a..c21fc71 100644
--- a/Nustache.Core/NustacheException.cs
+++ b/src/Nustache.Core/NustacheException.cs
@@ -1,13 +1,13 @@
-using System;
-
-namespace Nustache.Core
-{
- [Serializable]
- public class NustacheException : Exception
- {
- public NustacheException(string message)
- : base(message)
- {
- }
- }
+using System;
+
+namespace Nustache.Core
+{
+ [Serializable]
+ public class NustacheException : Exception
+ {
+ public NustacheException(string message)
+ : base(message)
+ {
+ }
+ }
}
\ No newline at end of file
diff --git a/Nustache.Core/Parser.cs b/src/Nustache.Core/Parser.cs
similarity index 96%
rename from Nustache.Core/Parser.cs
rename to src/Nustache.Core/Parser.cs
index 9d4632c..eb5eb62 100644
--- a/Nustache.Core/Parser.cs
+++ b/src/Nustache.Core/Parser.cs
@@ -1,67 +1,67 @@
-using System;
-using System.Collections.Generic;
-
-namespace Nustache.Core
-{
- public class Parser
- {
- public void Parse(Section section, IEnumerable parts)
- {
- if (section == null)
- throw new ArgumentNullException("section");
-
- var sectionStack = new Stack();
- sectionStack.Push(section);
-
- foreach (var part in parts)
- {
- section.Add(part);
-
- if (part is Section)
- {
- var newSection = (Section)part;
-
- if (newSection.Name == "else")
- {
- section.Inverse = newSection;
- newSection.Inverse = section;
- section = newSection;
- }
- else
- {
- sectionStack.Push(section);
- section = newSection;
- }
- }
- else if (part is EndSection)
- {
- var endSection = (EndSection)part;
-
- if (section.Name == "else")
- {
- section = section.Inverse;
- }
-
- if (sectionStack.Count == 1)
- {
- throw new NustacheException(
- string.Format(
- "End section {0} does not match any start section!",
- endSection.Name));
- }
-
- if (endSection.Name.Split()[0].Trim() != section.Name.Split()[0].Trim())
- {
- throw new NustacheException(
- string.Format(
- "End section {0} does not match start section {1}!",
- endSection.Name,
- section.Name));
- }
-
- section = sectionStack.Pop();
- }
- }
- }
- }
+using System;
+using System.Collections.Generic;
+
+namespace Nustache.Core
+{
+ public class Parser
+ {
+ public void Parse(Section section, IEnumerable parts)
+ {
+ if (section == null)
+ throw new ArgumentNullException("section");
+
+ var sectionStack = new Stack();
+ sectionStack.Push(section);
+
+ foreach (var part in parts)
+ {
+ section.Add(part);
+
+ if (part is Section)
+ {
+ var newSection = (Section)part;
+
+ if (newSection.Name == "else")
+ {
+ section.Inverse = newSection;
+ newSection.Inverse = section;
+ section = newSection;
+ }
+ else
+ {
+ sectionStack.Push(section);
+ section = newSection;
+ }
+ }
+ else if (part is EndSection)
+ {
+ var endSection = (EndSection)part;
+
+ if (section.Name == "else")
+ {
+ section = section.Inverse;
+ }
+
+ if (sectionStack.Count == 1)
+ {
+ throw new NustacheException(
+ string.Format(
+ "End section {0} does not match any start section!",
+ endSection.Name));
+ }
+
+ if (endSection.Name.Split()[0].Trim() != section.Name.Split()[0].Trim())
+ {
+ throw new NustacheException(
+ string.Format(
+ "End section {0} does not match start section {1}!",
+ endSection.Name,
+ section.Name));
+ }
+
+ section = sectionStack.Pop();
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Nustache.Core/Part.cs b/src/Nustache.Core/Part.cs
new file mode 100644
index 0000000..fef2869
--- /dev/null
+++ b/src/Nustache.Core/Part.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Reflection;
+using System.Runtime.ExceptionServices;
+
+namespace Nustache.Core
+{
+ public abstract class Part
+ {
+ public abstract void Render(RenderContext context);
+
+ public abstract string Source();
+
+ public void Accept(PartVisitor visitor)
+ {
+ try
+ {
+ Type partType = GetType();
+ Type visitorType = visitor.GetType();
+ MethodInfo visitMethod = visitorType.GetMethod("Visit",
+ bindingAttr: BindingFlags.Instance | BindingFlags.Public,
+ binder: null,
+ types: new Type[] { partType },
+ modifiers: null
+ );
+ if (visitMethod == null)
+ throw new MissingMemberException($"Visitor of type '{visitorType.FullName}' does not have a Visit method taking a single parameter of type '{partType.FullName}'.");
+
+ visitMethod.Invoke(visitor, new object[] { this });
+ }
+ catch (TargetInvocationException invokeFailed)
+ {
+ ExceptionDispatchInfo.Capture(invokeFailed.InnerException).Throw();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Nustache.Core/PartVisitor.cs b/src/Nustache.Core/PartVisitor.cs
similarity index 96%
rename from Nustache.Core/PartVisitor.cs
rename to src/Nustache.Core/PartVisitor.cs
index 9203f0a..89fdf9a 100644
--- a/Nustache.Core/PartVisitor.cs
+++ b/src/Nustache.Core/PartVisitor.cs
@@ -1,14 +1,14 @@
-
-namespace Nustache.Core
-{
- public interface PartVisitor
- {
- void Visit(Section section);
- void Visit(Block block);
- void Visit(LiteralText literal);
- void Visit(EndSection endSections);
- void Visit(InvertedBlock invertedBlock);
- void Visit(TemplateInclude include);
- void Visit(VariableReference variable);
- }
-}
+
+namespace Nustache.Core
+{
+ public interface PartVisitor
+ {
+ void Visit(Section section);
+ void Visit(Block block);
+ void Visit(LiteralText literal);
+ void Visit(EndSection endSections);
+ void Visit(InvertedBlock invertedBlock);
+ void Visit(TemplateInclude include);
+ void Visit(VariableReference variable);
+ }
+}
diff --git a/Nustache.Core/Render.cs b/src/Nustache.Core/Render.cs
similarity index 97%
rename from Nustache.Core/Render.cs
rename to src/Nustache.Core/Render.cs
index e85e03f..5fa234f 100644
--- a/Nustache.Core/Render.cs
+++ b/src/Nustache.Core/Render.cs
@@ -1,99 +1,99 @@
-using System.IO;
-
-namespace Nustache.Core
-{
- public static class Render
- {
- public static string StringToString(string template, object data, RenderContextBehaviour renderContextBehaviour = null)
- {
- var renderBehaviour = renderContextBehaviour ??
- RenderContextBehaviour.GetDefaultRenderContextBehaviour();
-
- return StringToString(template, data, null, renderBehaviour);
- }
-
- public static string StringToString(string template, object data, TemplateLocator templateLocator, RenderContextBehaviour renderContextBehaviour = null)
- {
- var reader = new StringReader(template);
- var writer = new StringWriter();
-
- var renderBehaviour = renderContextBehaviour ??
- RenderContextBehaviour.GetDefaultRenderContextBehaviour();
-
- Template(reader, data, writer, templateLocator, renderBehaviour);
- return writer.GetStringBuilder().ToString();
- }
-
- public static string FileToString(string templatePath, object data, RenderContextBehaviour renderContextBehaviour = null)
- {
- var template = File.ReadAllText(templatePath);
- var templateLocator = GetTemplateLocator(templatePath);
-
- var renderBehaviour = renderContextBehaviour ??
- RenderContextBehaviour.GetDefaultRenderContextBehaviour();
-
- return StringToString(template, data, templateLocator.GetTemplate, renderBehaviour);
- }
-
- public static void StringToFile(string template, object data, string outputPath, RenderContextBehaviour renderContextBehaviour = null)
- {
- var renderBehaviour = renderContextBehaviour ??
- RenderContextBehaviour.GetDefaultRenderContextBehaviour();
-
- StringToFile(template, data, outputPath, null, renderBehaviour);
- }
-
- public static void StringToFile(string template, object data, string outputPath, TemplateLocator templateLocator, RenderContextBehaviour renderContextBehaviour = null)
- {
- var reader = new StringReader(template);
-
- var renderBehaviour = renderContextBehaviour ??
- RenderContextBehaviour.GetDefaultRenderContextBehaviour();
-
- using (var writer = File.CreateText(outputPath))
- {
- Template(reader, data, writer, templateLocator, renderBehaviour);
- }
- }
-
- public static void FileToFile(string templatePath, object data, string outputPath, RenderContextBehaviour renderContextBehaviour = null)
- {
- var reader = new StringReader(File.ReadAllText(templatePath));
- var templateLocator = GetTemplateLocator(templatePath);
-
- var renderBehaviour = renderContextBehaviour ??
- RenderContextBehaviour.GetDefaultRenderContextBehaviour();
-
- using (var writer = File.CreateText(outputPath))
- {
- Template(reader, data, writer, templateLocator.GetTemplate, renderBehaviour);
- }
- }
-
- public static void Template(TextReader reader, object data, TextWriter writer, RenderContextBehaviour renderContextBehaviour = null)
- {
- var renderBehaviour = renderContextBehaviour ??
- RenderContextBehaviour.GetDefaultRenderContextBehaviour();
-
- Template(reader, data, writer, null, renderBehaviour);
- }
-
- public static void Template(TextReader reader, object data, TextWriter writer, TemplateLocator templateLocator, RenderContextBehaviour renderContextBehaviour = null)
- {
- var template = new Template();
- template.Load(reader);
-
- var renderBehaviour = renderContextBehaviour ??
- RenderContextBehaviour.GetDefaultRenderContextBehaviour();
-
- template.Render(data, writer, templateLocator, renderBehaviour);
- }
-
- private static FileSystemTemplateLocator GetTemplateLocator(string templatePath)
- {
- string dir = Path.GetDirectoryName(templatePath);
- string ext = Path.GetExtension(templatePath);
- return new FileSystemTemplateLocator(ext, dir);
- }
- }
+using System.IO;
+
+namespace Nustache.Core
+{
+ public static class Render
+ {
+ public static string StringToString(string template, object data, RenderContextBehaviour renderContextBehaviour = null)
+ {
+ var renderBehaviour = renderContextBehaviour ??
+ RenderContextBehaviour.GetDefaultRenderContextBehaviour();
+
+ return StringToString(template, data, null, renderBehaviour);
+ }
+
+ public static string StringToString(string template, object data, TemplateLocator templateLocator, RenderContextBehaviour renderContextBehaviour = null)
+ {
+ var reader = new StringReader(template);
+ var writer = new StringWriter();
+
+ var renderBehaviour = renderContextBehaviour ??
+ RenderContextBehaviour.GetDefaultRenderContextBehaviour();
+
+ Template(reader, data, writer, templateLocator, renderBehaviour);
+ return writer.GetStringBuilder().ToString();
+ }
+
+ public static string FileToString(string templatePath, object data, RenderContextBehaviour renderContextBehaviour = null)
+ {
+ var template = File.ReadAllText(templatePath);
+ var templateLocator = GetTemplateLocator(templatePath);
+
+ var renderBehaviour = renderContextBehaviour ??
+ RenderContextBehaviour.GetDefaultRenderContextBehaviour();
+
+ return StringToString(template, data, templateLocator.GetTemplate, renderBehaviour);
+ }
+
+ public static void StringToFile(string template, object data, string outputPath, RenderContextBehaviour renderContextBehaviour = null)
+ {
+ var renderBehaviour = renderContextBehaviour ??
+ RenderContextBehaviour.GetDefaultRenderContextBehaviour();
+
+ StringToFile(template, data, outputPath, null, renderBehaviour);
+ }
+
+ public static void StringToFile(string template, object data, string outputPath, TemplateLocator templateLocator, RenderContextBehaviour renderContextBehaviour = null)
+ {
+ var reader = new StringReader(template);
+
+ var renderBehaviour = renderContextBehaviour ??
+ RenderContextBehaviour.GetDefaultRenderContextBehaviour();
+
+ using (var writer = File.CreateText(outputPath))
+ {
+ Template(reader, data, writer, templateLocator, renderBehaviour);
+ }
+ }
+
+ public static void FileToFile(string templatePath, object data, string outputPath, RenderContextBehaviour renderContextBehaviour = null)
+ {
+ var reader = new StringReader(File.ReadAllText(templatePath));
+ var templateLocator = GetTemplateLocator(templatePath);
+
+ var renderBehaviour = renderContextBehaviour ??
+ RenderContextBehaviour.GetDefaultRenderContextBehaviour();
+
+ using (var writer = File.CreateText(outputPath))
+ {
+ Template(reader, data, writer, templateLocator.GetTemplate, renderBehaviour);
+ }
+ }
+
+ public static void Template(TextReader reader, object data, TextWriter writer, RenderContextBehaviour renderContextBehaviour = null)
+ {
+ var renderBehaviour = renderContextBehaviour ??
+ RenderContextBehaviour.GetDefaultRenderContextBehaviour();
+
+ Template(reader, data, writer, null, renderBehaviour);
+ }
+
+ public static void Template(TextReader reader, object data, TextWriter writer, TemplateLocator templateLocator, RenderContextBehaviour renderContextBehaviour = null)
+ {
+ var template = new Template();
+ template.Load(reader);
+
+ var renderBehaviour = renderContextBehaviour ??
+ RenderContextBehaviour.GetDefaultRenderContextBehaviour();
+
+ template.Render(data, writer, templateLocator, renderBehaviour);
+ }
+
+ private static FileSystemTemplateLocator GetTemplateLocator(string templatePath)
+ {
+ string dir = Path.GetDirectoryName(templatePath);
+ string ext = Path.GetExtension(templatePath);
+ return new FileSystemTemplateLocator(ext, dir);
+ }
+ }
}
\ No newline at end of file
diff --git a/Nustache.Core/RenderContext.cs b/src/Nustache.Core/RenderContext.cs
similarity index 96%
rename from Nustache.Core/RenderContext.cs
rename to src/Nustache.Core/RenderContext.cs
index 0b314a7..d33083c 100644
--- a/Nustache.Core/RenderContext.cs
+++ b/src/Nustache.Core/RenderContext.cs
@@ -1,353 +1,359 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Data;
-using System.IO;
-using System.Text.RegularExpressions;
-using System.Xml;
-
-namespace Nustache.Core
-{
- public delegate Template TemplateLocator(string name);
-
- public delegate TResult Lambda();
- public delegate TResult Lambda(T arg);
-
- public delegate string RenderFunc(RenderContext context);
-
- public class RenderContext
- {
- private const int IncludeLimit = 1024;
- private readonly Stack _sectionStack = new Stack();
- private readonly Stack