Dub
- Added `gogga` at version of at least `2.2.1` Source files - Now use `tlang.misc.logging` - Added new module for logging
This commit is contained in:
parent
ef78a15ae9
commit
bd8c3a00b2
2
dub.json
2
dub.json
|
@ -4,7 +4,7 @@
|
|||
],
|
||||
"copyright": "Copyright © 2021-2023, Tristan B. Kildaire",
|
||||
"dependencies": {
|
||||
"gogga": "~>0.1.0",
|
||||
"gogga": ">=2.2.1",
|
||||
"jcli": "0.25.0-beta.3",
|
||||
"niknaks": ">=0.9.8"
|
||||
},
|
||||
|
|
|
@ -14,7 +14,7 @@ import tlang.compiler.lexer.kinds.basic : BasicLexer;
|
|||
import tlang.compiler.lexer.core;
|
||||
import tlang.compiler.parsing.core : Parser;
|
||||
import tlang.compiler.typecheck.core : TypeChecker;
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
import tlang.compiler.core : Compiler, beginCompilation;
|
||||
import tlang.compiler.configuration : ConfigEntry;
|
||||
import std.conv : to;
|
||||
|
|
|
@ -8,7 +8,7 @@ import std.stdio;
|
|||
import std.file;
|
||||
import std.conv : to;
|
||||
import std.string : cmp;
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
import std.range : walkLength;
|
||||
import std.string : wrap;
|
||||
import std.process : spawnProcess, Pid, ProcessException, wait;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module tlang.compiler.core;
|
||||
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
import std.conv : to;
|
||||
import tlang.compiler.lexer.core;
|
||||
import tlang.compiler.lexer.kinds.basic : BasicLexer;
|
||||
|
|
|
@ -5,7 +5,7 @@ module tlang.compiler.lexer.kinds.basic;
|
|||
|
||||
import std.container.slist;
|
||||
import std.string : replace;
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
import std.conv : to;
|
||||
import std.ascii : isDigit, isAlpha, isWhite;
|
||||
import tlang.compiler.lexer.core;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module tlang.compiler.modman.modman;
|
||||
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
import std.file : isDir;
|
||||
import std.path : isAbsolute;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module tlang.compiler.parsing.core;
|
||||
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
import std.conv : to, ConvException;
|
||||
import std.string : isNumeric, cmp;
|
||||
import tlang.compiler.symbols.check;
|
||||
|
|
|
@ -11,7 +11,7 @@ import std.conv : to;
|
|||
import std.string : isNumeric, cmp;
|
||||
import std.algorithm.searching : canFind;
|
||||
import misc.utils;
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
|
||||
/**
|
||||
* All allowed symbols
|
||||
|
|
|
@ -5,7 +5,7 @@ import std.conv : to;
|
|||
import tlang.compiler.typecheck.dependency.core : Context;
|
||||
|
||||
// For debug printing
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
|
||||
// AST manipulation interfaces
|
||||
import tlang.compiler.symbols.mcro : MStatementSearchable, MStatementReplaceable, MCloneable;
|
||||
|
|
|
@ -7,7 +7,7 @@ module tlang.compiler.symbols.typing.builtins;
|
|||
|
||||
import tlang.compiler.symbols.typing.core;
|
||||
import std.string : cmp, indexOf, lastIndexOf;
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
import tlang.compiler.typecheck.core;
|
||||
import std.conv : to;
|
||||
import tlang.compiler.symbols.data : Container;
|
||||
|
|
|
@ -5,7 +5,7 @@ import tlang.compiler.symbols.data;
|
|||
import std.conv : to, ConvException;
|
||||
import std.string;
|
||||
import std.stdio;
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
import tlang.compiler.parsing.core;
|
||||
import tlang.compiler.typecheck.resolution;
|
||||
import tlang.compiler.typecheck.exceptions;
|
||||
|
|
|
@ -5,7 +5,7 @@ import tlang.compiler.symbols.data;
|
|||
import std.conv : to;
|
||||
import std.string;
|
||||
import std.stdio;
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
import tlang.compiler.parsing.core;
|
||||
import tlang.compiler.typecheck.resolution;
|
||||
import tlang.compiler.typecheck.exceptions;
|
||||
|
|
|
@ -6,7 +6,7 @@ import tlang.compiler.symbols.typing.core;
|
|||
import tlang.compiler.symbols.containers : Container;
|
||||
import tlang.compiler.symbols.mcro;
|
||||
import tlang.compiler.typecheck.core;
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
import std.conv : to;
|
||||
import tlang.compiler.configuration;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module tlang.compiler.typecheck.resolution;
|
||||
|
||||
import tlang.compiler.typecheck.core;
|
||||
import gogga;
|
||||
import tlang.misc.logging;
|
||||
import tlang.compiler.symbols.data;
|
||||
import std.string;
|
||||
import std.conv : to;
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
module tlang.misc.logging;
|
||||
|
||||
public enum DebugType
|
||||
{
|
||||
INFO,
|
||||
WARNING,
|
||||
ERROR
|
||||
}
|
||||
|
||||
|
||||
// TODO: setup static logger here
|
||||
import gogga;
|
||||
// TODO: May want gshared if it must be cross-thread module init
|
||||
// as we would have many static fields init'd per thread then
|
||||
// (would need a corresponding ghsraed field)
|
||||
|
||||
private GoggaLogger logger;
|
||||
static this()
|
||||
{
|
||||
logger = new GoggaLogger();
|
||||
}
|
||||
|
||||
// TODO: Change to actually use error, etc. directkly on GoggaLogger
|
||||
public void gprintln(messageT)(messageT message, DebugType debugType = DebugType.INFO)
|
||||
{
|
||||
if(debugType == DebugType.INFO)
|
||||
{
|
||||
logger.info(message);
|
||||
}
|
||||
else if(debugType == DebugType.WARNING)
|
||||
{
|
||||
logger.warn(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.error(message);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue