Expand description
Lossless parser for Laravel Blade templates.
let parse = blade_syntax::parse("@if($user) Hi {{ $user->name }} @endif");
assert!(parse.errors().is_empty());
// The tree always reproduces the input exactly.
assert_eq!(parse.syntax().to_string(), "@if($user) Hi {{ $user->name }} @endif");Modules§
- debug
- Human-readable views of a syntax tree, for tests and debugging.
Structs§
- Parse
- The result of parsing: a syntax tree that always reproduces the input exactly, plus any problems found along the way.
- Parse
Error - A problem in the template, such as an unclosed echo or block.
- Text
Range - A range in text, represented as a pair of
TextSize. - Text
Size - A measure of text length. Also, equivalently, an index into text.
Enums§
- Blade
Language - Marker type that ties rowan’s generic tree to
SyntaxKind. - Syntax
Kind - Token kinds come first, then node kinds. The
u16value is what rowan stores.
Functions§
- parse
- Parses Blade source. Never fails: problems are reported in
Parse::errors.