Commit Graph

14 Commits

Author SHA1 Message Date
Ryan Nowak f191cc62a2 Get rid of locations on Tokens. 2016-12-28 18:22:06 -08:00
N. Taylor Mullen 88d99b06b3 Skip Razor.Evolution tests on Linux and Mac.
- Source ranges currently aren't normalized when they're input into the system. Due to how we serialize pieces of the code this breaks cross plat because of newline differences.
- This is a temporary work around to get the build passing cross plat.
2016-12-19 15:03:32 -08:00
N. Taylor Mullen 5d4c4e1ccf Add Razor runtime code generation.
- Added TabSize,IsIndentingWithTabs and NamespaceImports to the RazorParser options. These are replacements for the existing RazorEngineHost abstraction.
- Added RazorParserOptions consumption pattern to more than just the parsing phase.
- Added a ChecksumIRNode to ensure Debugging can work.
- Updated tests to to react to new Checksum and Namespace nodes in the IR tree.
2016-12-14 11:18:30 -08:00
N. Taylor Mullen 2db4985c21 Modify functions, section and inherits to use extensible directives.
- Removed existing type names used to track `@functions`, `@section` and `@inherits`.
- Updated parsing logic to reflect existing directive behaviors.
- Added additional IR and syntax tree pass in order to fulfill the default directive expectations.
- Updated tests to to expect new extensible directives parse structure.

#894
2016-12-14 11:12:40 -08:00
Ryan Nowak 853c28e568 Add integration testing
This change adds a basic framework for doing baselined integration tests.
This is very similar to what we do elsewhere with generated files and
tests that read them from resources.

What's here now is the support to do this kind of baselining with IR in a
pretty readable serialization format.

This is a building block and the intent is that we'd do something similar
in the future for syntax nodes and C# source.

Looking at the code of the tests in particular, we'll also build the
ability to capture the documents at key points (such as before/after a
targeted phase) and then verify them in the same manner.
2016-12-06 11:25:04 -08:00
Ryan Nowak 9cefcdd450 Add legacy dependencies of C# lowering 2016-12-04 23:30:34 -08:00
Ryan Nowak 03549bb542 Add end-to-end support for extensible directives
This change adds a way to actually configure the RazorEngine to use
extensible directives (previously buried behind legacy API). As part of
this feature adds the RazorParserOptions class to encapsulate anything
else that becomes a parser options (ahem taghelpers).

Now we have a pattern for this when we get there.

Options are propagated as part of the RazorSyntaxTree for
testability/sanity and this was actually responsible for the bulk of the
changes.

Also added some extension methods for adding directives to the
IRazorEngineBuilder and an end to end integration test.
2016-12-03 18:44:54 -08:00
N. Taylor Mullen 518378f499 Add extensible directive abstractions
- Based generic directive implementation off of descriptors.
- Added parsing logic to consume descriptors and parse content that's expected.
- Added parsing errors to automagically detect unexpected directive pieces.
- Updated visitor implementations to understand the directive bits.
- Added a builder abstraction to easily create descriptors. Had to maintain the ability to manually construct a descriptor to enable convenient serialization/deserialization.
- Added tests/comparers to verify correctness of parsing.

#853
2016-11-23 19:56:40 -08:00
N. Taylor Mullen cf7489e600 Port WhiteSpaceRewriter and ConditionalAttributeCollapser.
- Add an `HtmlNodeOptimizationPass` that does all of the `RazorSyntaxTreeRewriting` that legacy used to achieve outside of `TagHelper`s.
- Add tests for `HtmlNodeOptimizationPass` to verify it's executing appropriate bits.

#849
2016-11-22 12:04:31 -08:00
N. Taylor Mullen 6c8ef157b4 Add TagHelper binding abstractions.
- Added a TagHelperFeature to hold TagHelper specific pieces that can be replaced.
- Built a syntax tree pass that applies the ported TagHelper bits.
- Updated tests that expected different RazorEngine defaults.
- Added new tests to verify binder pass.
2016-11-21 11:04:42 -08:00
N. Taylor Mullen 26a1cf3cff Port existing TagHelper infrastructure.
- Modified how tests are run to reflect our new test infrastructure.
- Added TagHelper assertion bits.
- Moved all classes to the Evolution.Legacy namespace.
- Copied Test.Sources bits to the Evolution.Test project.

#845
2016-11-21 11:01:10 -08:00
N. Taylor Mullen 51fb0c993b Add indexability to the RazorSourceDocument.
- Removed the `CreateReader` API in favor of a `CopyTo`, `Length`, `[index]` and `Encoding`.
- Updated existing APIs to react to the change.
- Added tests.
2016-11-21 10:58:09 -08:00
Ryan Nowak 49d3574677 Make tests public - xUnit requires this 2016-11-16 14:06:01 -08:00
N. Taylor Mullen d06e5b6002 Add legacy parser 2016-11-16 14:06:00 -08:00