dastworx, stylefixes

This commit is contained in:
Basile Burg 2018-04-15 18:14:39 +02:00
parent 5aa6d32e7e
commit 41a4749b60
2 changed files with 103 additions and 109 deletions

View File

@ -71,101 +71,101 @@ ref const(bool[string]) badVersions()
private __gshared bool[string] _badVersions;
private static immutable predefinedVersions = [
"AArch64",
"AIX",
"all",
"Alpha",
"Alpha_HardFloat",
"Alpha_SoftFloat",
"Android",
"ARM",
"ARM_HardFloat",
"ARM_SoftFloat",
"ARM_SoftFP",
"ARM_Thumb",
"assert",
"BigEndian",
"BSD",
"CRuntime_Bionic",
"CRuntime_DigitalMars",
"CRuntime_Glibc",
"CRuntime_Microsoft",
"Cygwin",
"DigitalMars",
"DragonFlyBSD",
"D_Coverage",
"D_Ddoc",
"D_HardFloat",
"D_InlineAsm_X86",
"D_InlineAsm_X86_64",
"D_LP64",
"D_NoBoundsChecks",
"D_PIC",
"D_SIMD",
"D_SoftFloat",
"D_Version2",
"D_X32",
"ELFv1",
"ELFv2",
"Epiphany",
"FreeBSD",
"FreeStanding",
"GNU",
"Haiku",
"HPPA",
"HPPA64",
"Hurd",
"IA64",
"iOS",
"LDC",
"linux",
"LittleEndian",
"MinGW",
"MIPS32",
"MIPS64",
"MIPS_EABI",
"MIPS_HardFloat",
"MIPS_N32",
"MIPS_N64",
"MIPS_O32",
"MIPS_O64",
"MIPS_SoftFloat",
"NetBSD",
"none",
"NVPTX",
"NVPTX64",
"OpenBSD",
"OSX",
"PlayStation",
"PlayStation4",
"Posix",
"PPC",
"PPC64",
"PPC_HardFloat",
"PPC_SoftFloat",
"S390",
"S390X",
"SDC",
"SH",
"SH64",
"SkyOS",
"Solaris",
"SPARC",
"SPARC64",
"SPARC_HardFloat",
"SPARC_SoftFloat",
"SPARC_V8Plus",
"SystemZ",
"SysV3",
"SysV4",
"TVOS",
"unittest",
"WatchOS",
"Win32",
"Win64",
"Windows",
"X86",
"X86_64"
"AArch64",
"AIX",
"all",
"Alpha",
"Alpha_HardFloat",
"Alpha_SoftFloat",
"Android",
"ARM",
"ARM_HardFloat",
"ARM_SoftFloat",
"ARM_SoftFP",
"ARM_Thumb",
"assert",
"BigEndian",
"BSD",
"CRuntime_Bionic",
"CRuntime_DigitalMars",
"CRuntime_Glibc",
"CRuntime_Microsoft",
"Cygwin",
"DigitalMars",
"DragonFlyBSD",
"D_Coverage",
"D_Ddoc",
"D_HardFloat",
"D_InlineAsm_X86",
"D_InlineAsm_X86_64",
"D_LP64",
"D_NoBoundsChecks",
"D_PIC",
"D_SIMD",
"D_SoftFloat",
"D_Version2",
"D_X32",
"ELFv1",
"ELFv2",
"Epiphany",
"FreeBSD",
"FreeStanding",
"GNU",
"Haiku",
"HPPA",
"HPPA64",
"Hurd",
"IA64",
"iOS",
"LDC",
"linux",
"LittleEndian",
"MinGW",
"MIPS32",
"MIPS64",
"MIPS_EABI",
"MIPS_HardFloat",
"MIPS_N32",
"MIPS_N64",
"MIPS_O32",
"MIPS_O64",
"MIPS_SoftFloat",
"NetBSD",
"none",
"NVPTX",
"NVPTX64",
"OpenBSD",
"OSX",
"PlayStation",
"PlayStation4",
"Posix",
"PPC",
"PPC64",
"PPC_HardFloat",
"PPC_SoftFloat",
"S390",
"S390X",
"SDC",
"SH",
"SH64",
"SkyOS",
"Solaris",
"SPARC",
"SPARC64",
"SPARC_HardFloat",
"SPARC_SoftFloat",
"SPARC_V8Plus",
"SystemZ",
"SysV3",
"SysV4",
"TVOS",
"unittest",
"WatchOS",
"Win32",
"Win64",
"Windows",
"X86",
"X86_64"
];
private void fillBadVersions()
@ -397,7 +397,5 @@ T parseAndVisit(T : ASTVisitor)(const(char)[] source)
* This function prevents that.
*/
void ignoreErrors(string, size_t, size_t, string, bool)
{
// dont pollute output
}
{}

View File

@ -31,7 +31,7 @@ struct Launcher
__gshared @Argument("-l") int caretLine;
__gshared @Argument("-o") bool option1;
__gshared static Appender!(ubyte[]) source;
__gshared Appender!(ubyte[]) source;
__gshared string[] files;
// -o : deep visit the symbols
@ -55,25 +55,21 @@ struct Launcher
{
mixin(logCall);
static struct ErrorHandler
{
static Appender!(AstErrors) _errors;
Appender!(AstErrors) errors;
void handleErrors(string fname, size_t line, size_t col, string message, bool err)
{
_errors ~= construct!(AstError)(cast(ErrorType) err, message, line, col);
}
void handleErrors(string fname, size_t line, size_t col, string message, bool err)
{
errors ~= construct!(AstError)(cast(ErrorType) err, message, line, col);
}
ErrorHandler eh;
RollbackAllocator alloc;
StringCache cache = StringCache(StringCache.defaultBucketCount);
LexerConfig config = LexerConfig("", StringBehavior.source);
source.data
.getTokensForParser(config, &cache)
.parseModule("", &alloc, &eh.handleErrors)
.listSymbols(eh._errors.data, deepSymList);
.parseModule("", &alloc, &handleErrors)
.listSymbols(errors.data, deepSymList);
}
/// Writes the list of todo comments