Skip to content

Commit 35c6277

Browse files
committed
Try to use a Uri with the SourceFile
1 parent 9326a3a commit 35c6277

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/src/mustachio/parser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MustachioParser {
2020
/// The index of the character currently being parsed.
2121
int _index = 0;
2222

23-
MustachioParser(this.template, String url)
23+
MustachioParser(this.template, Uri url)
2424
: _templateLength = template.length,
2525
_sourceFile = SourceFile.fromString(template, url: url);
2626

lib/src/mustachio/renderer_base.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Template {
8989
// 2) In the case of a reference from a top-level template, user code has
9090
// called [Template.parse], and the user is responsible for handling the
9191
// exception.
92-
var ast = MustachioParser(file.readAsStringSync(), file.path).parse();
92+
var ast = MustachioParser(file.readAsStringSync(), file.toUri()).parse();
9393
var nodeQueue = Queue.of(ast);
9494
var partials = <String, File>{};
9595

test/mustachio/parser_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:dartdoc/src/mustachio/parser.dart';
22
import 'package:test/test.dart';
33

4-
const _filePath = 'file:///foo.dart';
4+
final _filePath = Uri.parse('file:///foo.dart');
55

66
void main() {
77
test('parses an empty template', () {

0 commit comments

Comments
 (0)