Skip to content

Commit 0740122

Browse files
Fix build
1 parent eb198fe commit 0740122

1 file changed

Lines changed: 57 additions & 50 deletions

File tree

test/tester.d

Lines changed: 57 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -313,56 +313,63 @@ void testArbitraryASTs()
313313
parser.messageDelegate = &msgDelegate;
314314
parser.allocator = &rba;
315315

316-
parser.tokens = getTokensForParser("struct S {}", config, &cache);
317-
assert(parser.parseCompileCondition() is null);
318-
assert(errors == ["`version`, `debug`, or `static` expected (found token `struct`)"]);
319-
errors = null;
320-
321-
parser = new Parser();
322-
parser.messageDelegate = &msgDelegate;
323-
parser.allocator = &rba;
324-
parser.tokens = getTokensForParser("~", config, &cache);
325-
assert(parser.parseDestructor() is null);
326-
assert(errors == ["`this` expected instead of EOF"]);
327-
errors = null;
328-
329-
parser = new Parser();
330-
parser.messageDelegate = &msgDelegate;
331-
parser.allocator = &rba;
332-
parser.tokens = getTokensForParser("for (x; y; z) {}", config, &cache);
333-
assert(parser.parseForeach() is null);
334-
assert(errors == ["`foreach` or `foreach_reverse` expected (found token `for`)"]);
335-
errors = null;
336-
337-
parser = new Parser();
338-
parser.messageDelegate = &msgDelegate;
339-
parser.allocator = &rba;
340-
parser.tokens = getTokensForParser("version =", config, &cache);
341-
assert(parser.parseVersionSpecification() is null);
342-
assert(errors == ["Identifier or integer literal expected (found EOF)"]);
343-
errors = null;
344-
345-
parser = new Parser();
346-
parser.messageDelegate = &msgDelegate;
347-
parser.allocator = &rba;
348-
parser.importC = false;
349-
parser.tokens = getTokensForParser("extern(C) { int normal = 1; int true = 1; }", config, &cache);
350-
assert(parser.parseAttribute() !is null);
351-
auto b = parser.parseBlockStatement();
352-
assert(b !is null);
353-
assert(b.declarationsAndStatements.declarationsAndStatements.length == 1);
354-
errors = null;
355-
356-
parser = new Parser();
357-
parser.messageDelegate = &msgDelegate;
358-
parser.allocator = &rba;
359-
parser.importC = true;
360-
parser.tokens = getTokensForParser("extern(C) { int normal = 1; int true = 1; }", config, &cache);
361-
assert(parser.parseAttribute() !is null);
362-
auto b = parser.parseBlockStatement();
363-
assert(b !is null);
364-
assert(b.declarationsAndStatements.declarationsAndStatements.length == 2);
365-
errors = null;
316+
{
317+
parser.tokens = getTokensForParser("struct S {}", config, &cache);
318+
assert(parser.parseCompileCondition() is null);
319+
assert(errors == ["`version`, `debug`, or `static` expected (found token `struct`)"]);
320+
errors = null;
321+
}
322+
{
323+
parser = new Parser();
324+
parser.messageDelegate = &msgDelegate;
325+
parser.allocator = &rba;
326+
parser.tokens = getTokensForParser("~", config, &cache);
327+
assert(parser.parseDestructor() is null);
328+
assert(errors == ["`this` expected instead of EOF"]);
329+
errors = null;
330+
}
331+
{
332+
parser = new Parser();
333+
parser.messageDelegate = &msgDelegate;
334+
parser.allocator = &rba;
335+
parser.tokens = getTokensForParser("for (x; y; z) {}", config, &cache);
336+
assert(parser.parseForeach() is null);
337+
assert(errors == ["`foreach` or `foreach_reverse` expected (found token `for`)"]);
338+
errors = null;
339+
}
340+
{
341+
parser = new Parser();
342+
parser.messageDelegate = &msgDelegate;
343+
parser.allocator = &rba;
344+
parser.tokens = getTokensForParser("version =", config, &cache);
345+
assert(parser.parseVersionSpecification() is null);
346+
assert(errors == ["Identifier or integer literal expected (found EOF)"]);
347+
errors = null;
348+
}
349+
{
350+
parser = new Parser();
351+
parser.messageDelegate = &msgDelegate;
352+
parser.allocator = &rba;
353+
parser.importC = false;
354+
parser.tokens = getTokensForParser("extern(C) { int normal = 1; int true = 1; }", config, &cache);
355+
assert(parser.parseAttribute() !is null);
356+
auto b = parser.parseBlockStatement();
357+
assert(b !is null);
358+
assert(b.declarationsAndStatements.declarationsAndStatements.length == 1);
359+
errors = null;
360+
}
361+
{
362+
parser = new Parser();
363+
parser.messageDelegate = &msgDelegate;
364+
parser.allocator = &rba;
365+
parser.importC = true;
366+
parser.tokens = getTokensForParser("extern(C) { int normal = 1; int true = 1; }", config, &cache);
367+
assert(parser.parseAttribute() !is null);
368+
auto b = parser.parseBlockStatement();
369+
assert(b !is null);
370+
assert(b.declarationsAndStatements.declarationsAndStatements.length == 2);
371+
errors = null;
372+
}
366373

367374
}
368375

0 commit comments

Comments
 (0)