cleanup(selfhost): remove 17 dead functions across 5 files
Remove unused helper functions, factories, accessors, and merge helpers: - c_backend.bux: CBE_Init, CBE_ClearDefers, CBE_EmitLine, CBE_Build, CBackend_Free - hir_lower.bux: Lcx_FreshName, Lcx_LowerType, HirLower_Free - lexer.bux: Lexer_Init, lexIsIdentKind, Lexer_TokenCount, Lexer_GetToken - parser.bux: parserIsBinaryOp, parserPrevious, parserMergeAddDecl, Parser_DiagCount, Parser_Free, Parser_MergeModules - sema.bux: Sema_TypeName None of these functions are referenced anywhere in src/.
This commit is contained in:
@@ -73,23 +73,6 @@ struct LexToken {
|
||||
column: uint32;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Init
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
func Lexer_Init(source: String) -> Lexer {
|
||||
let len: uint = bux_strlen(source);
|
||||
let tokBuf: *LexToken = bux_alloc(maxTokens as uint * sizeof(LexToken)) as *LexToken;
|
||||
let diagBuf: *LexerDiag = bux_alloc(maxDiags as uint * sizeof(LexerDiag)) as *LexerDiag;
|
||||
return Lexer {
|
||||
source: source, sourceLen: len as int,
|
||||
pos: 0, line: 1, column: 1,
|
||||
startLine: 0, startColumn: 0, startPos: 0,
|
||||
tokenCount: 0, tokens: tokBuf,
|
||||
diagCount: 0, diags: diagBuf
|
||||
};
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Core primitives
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -255,17 +238,6 @@ func lexSkipWhitespace(lex: *Lexer) {
|
||||
// Identifiers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
func lexIsIdentKind(tok: int) -> bool {
|
||||
return tok == tkFunc || tok == tkLet || tok == tkVar || tok == tkConst
|
||||
|| tok == tkType || tok == tkStruct || tok == tkEnum || tok == tkUnion
|
||||
|| tok == tkInterface || tok == tkExtend || tok == tkModule || tok == tkImport
|
||||
|| tok == tkPub || tok == tkExtern || tok == tkIf || tok == tkElse
|
||||
|| tok == tkWhile || tok == tkDo || tok == tkLoop || tok == tkFor
|
||||
|| tok == tkIn || tok == tkBreak || tok == tkContinue || tok == tkReturn
|
||||
|| tok == tkMatch || tok == tkAs || tok == tkIs || tok == tkNull
|
||||
|| tok == tkSelf || tok == tkSuper;
|
||||
}
|
||||
|
||||
func lexKeywordKind(text: String) -> int {
|
||||
if String_Eq(text, "true") { return tkBoolLiteral; }
|
||||
if String_Eq(text, "false") { return tkBoolLiteral; }
|
||||
@@ -801,18 +773,6 @@ func Lexer_Tokenize(source: String) -> *Lexer {
|
||||
return lex;
|
||||
}
|
||||
|
||||
func Lexer_TokenCount(lex: *Lexer) -> int {
|
||||
return lex.tokenCount;
|
||||
}
|
||||
|
||||
func Lexer_GetToken(lex: *Lexer, index: int) -> LexToken {
|
||||
if index >= 0 && index < lex.tokenCount {
|
||||
return lex.tokens[index];
|
||||
}
|
||||
var empty: LexToken = LexToken { kind: tkEndOfFile, text: "", line: 0, column: 0 };
|
||||
return empty;
|
||||
}
|
||||
|
||||
func Lexer_DiagCount(lex: *Lexer) -> int {
|
||||
return lex.diagCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user