Commit Graph

9 Commits

Author SHA1 Message Date
Ajay Bhargav Baaskaran ed9068cef4 Replace RazorError with RazorDiagnostics in public API 2017-02-17 15:44:37 -08:00
Ryan Nowak 242ea0ee3f Add parsing of includes and imports
Also adds the source document to the RazorSyntaxTree and does some cleanup
related to this. This lets us verify which tree goes to which document and
that seems important.

Added basic tests to verify that parsing happens, though it's not being
used for anything right now.
2017-01-13 11:25:20 -08:00
Ryan Nowak 0835de17ec Adds stronger verification for spans
This change ensures that spans are contiguous and that all source is part
of a span. This means that a character can't be 'lost' and not a member of
any span.

And guess what? We have a bug like that. So now a few tests are skipped
due to that bug.

Also made some changes to tests that construct invalid spans or spans
without correct locations as their expected input. This allows us to add
the above verification to all parser tests.
2016-12-28 21:56:35 -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 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 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
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