# HG changeset patch # User Laurens Holst # Date 1644609938 -3600 # Fri Feb 11 21:05:38 2022 +0100 # Node ID 79df0c01f35dea73653a9ec1238808103b7002ef # Parent a422a00ecb6ef75149d42734c1036207212c4e1a SourceBuilder: Introduce another constructor with standard end terminators. diff --git a/src/main/java/nl/grauw/glass/SourceBuilder.java b/src/main/java/nl/grauw/glass/SourceBuilder.java --- a/src/main/java/nl/grauw/glass/SourceBuilder.java +++ b/src/main/java/nl/grauw/glass/SourceBuilder.java @@ -40,7 +40,11 @@ private static final List sourceFiles = new ArrayList(); public SourceBuilder(List includePaths) { - this(new GlobalScope(), END_TERMINATORS, includePaths); + this(new GlobalScope(), includePaths); + } + + private SourceBuilder(Scope scope, List includePaths) { + this(scope, END_TERMINATORS, includePaths); } private SourceBuilder(Scope scope, List terminators, List includePaths) { @@ -179,7 +183,7 @@ throw new AssemblyException("Include only accepts 1 argument."); if (!argument.is(Type.STRING)) throw new AssemblyException("A string literal is expected."); - SourceBuilder sourceBuilder = new SourceBuilder(source.getScope(), END_TERMINATORS, includePaths); + SourceBuilder sourceBuilder = new SourceBuilder(source.getScope(), includePaths); sourceBuilder.parseInclude(argument, sourceFile, once); return new Include(sourceBuilder.source); }