mirror of https://gitlab.com/basile.b/dexed.git
remove useless scope STC from libdexed-d local decls
This commit is contained in:
parent
48f1506165
commit
69b31bd261
|
@ -34,11 +34,11 @@ export extern(C) FpcArray!char* listSymbols(const(char)* src, bool deep)
|
|||
errors ~= construct!(AstError)(cast(ErrorType) err, message, line, col);
|
||||
}
|
||||
|
||||
scope LexerConfig config;
|
||||
scope RollbackAllocator rba;
|
||||
scope StringCache sCache = StringCache(StringCache.defaultBucketCount);
|
||||
LexerConfig config;
|
||||
RollbackAllocator rba;
|
||||
StringCache sCache = StringCache(StringCache.defaultBucketCount);
|
||||
|
||||
scope mod = src[0 .. src.strlen]
|
||||
auto mod = src[0 .. src.strlen]
|
||||
.getTokensForParser(config, &sCache)
|
||||
.parseModule("", &rba, &handleErrors);
|
||||
|
||||
|
|
|
@ -10,20 +10,26 @@ import
|
|||
|
||||
export extern(C) FpcArray!(char)* todoItems(const(char)* joinedFiles)
|
||||
{
|
||||
scope Appender!(char[]) stream;
|
||||
scope LexerConfig config = LexerConfig("", StringBehavior.source);
|
||||
scope StringCache cache = StringCache(4096);
|
||||
Appender!(char[]) stream;
|
||||
LexerConfig config = LexerConfig("", StringBehavior.source);
|
||||
StringCache cache = StringCache(4096);
|
||||
stream.reserve(32);
|
||||
stream.put("object TTodoItems\ritems=<");
|
||||
foreach (fname; joinedFilesToFiles(joinedFiles))
|
||||
{
|
||||
stream.reserve(256);
|
||||
scope source = cast(ubyte[]) std.file.read(fname);
|
||||
auto source = cast(ubyte[]) std.file.read(fname);
|
||||
DLexer(source, config, &cache)
|
||||
.filter!(a => a.type == tok!"comment")
|
||||
.each!(t => analyze(t, fname, stream));
|
||||
destroy(source);
|
||||
}
|
||||
stream.put(">end");
|
||||
scope (exit)
|
||||
{
|
||||
destroy(stream);
|
||||
destroy(cache);
|
||||
}
|
||||
return (FpcArray!char).fromArray(stream.data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue