angel strict

This commit is contained in:
Tobe O 2017-10-16 19:20:02 -04:00
parent 7c07ad3aa3
commit 4980e81d64
2 changed files with 11 additions and 5 deletions

View file

@ -13,7 +13,11 @@ import 'package:symbol_table/symbol_table.dart';
///
/// To apply additional transforms to parsed documents, provide a set of [patch] functions.
AngelConfigurer jael(Directory viewsDirectory,
{String fileExtension, bool cacheViews: false, Iterable<Patcher> patch, CodeBuffer createBuffer()}) {
{String fileExtension,
bool strictResolution: false,
bool cacheViews: false,
Iterable<Patcher> patch,
CodeBuffer createBuffer()}) {
var cache = <String, Document>{};
fileExtension ??= '.jl';
createBuffer ??= () => new CodeBuffer();
@ -33,7 +37,8 @@ AngelConfigurer jael(Directory viewsDirectory,
processed = doc;
try {
processed = await resolve(doc, viewsDirectory, patch: patch, onError: errors.add);
processed = await resolve(doc, viewsDirectory,
patch: patch, onError: errors.add);
} catch (_) {
// Ignore these errors, so that we can show syntax errors.
}
@ -48,7 +53,8 @@ AngelConfigurer jael(Directory viewsDirectory,
if (errors.isEmpty) {
try {
const Renderer().render(processed, buf, scope);
const Renderer().render(processed, buf, scope,
strictResolution: strictResolution == true);
return buf.toString();
} on JaelError catch (e) {
errors.add(e);

View file

@ -1,5 +1,5 @@
name: angel_jael
version: 1.0.0-alpha+1
version: 1.0.0-alpha+2
description: Angel support for the Jael templating engine.
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/jael/tree/master/jael