diff --git a/apps/lib/json_native/lexer/scanner.hako b/apps/lib/json_native/lexer/scanner.hako index a2cc0760..4c9ed3f6 100644 --- a/apps/lib/json_native/lexer/scanner.hako +++ b/apps/lib/json_native/lexer/scanner.hako @@ -294,7 +294,7 @@ box JsonScanner { read_string_literal() { local start_pos = me.position // Save starting position to _tmp_pos so that substring/range checks - // do not depend on a previous reader’s value (PHI-safe, loop-safe). + // do not depend on a previous reader's value (PHI-safe, loop-safe). // Other high-level readers (read_number/read_identifier) already // initialize _tmp_pos; string literal must do the same. me._tmp_pos = me.position diff --git a/lang/src/llvm_ir/LAYER_GUARD.hako b/lang/src/llvm_ir/LAYER_GUARD.hako index 576105e3..d8351cb9 100644 --- a/lang/src/llvm_ir/LAYER_GUARD.hako +++ b/lang/src/llvm_ir/LAYER_GUARD.hako @@ -1,6 +1,6 @@ // LAYER_GUARD — このフォルダは「IR 構築のみ」を担当します // 禁止: リンク/実行/Extern 直接呼び出し/ファイルI/O の実装 -// 許可: 型・モジュール・関数・基本ブロック・命令の“形”の生成 +// 許可: 型・モジュール・関数・基本ブロック・命令の"形"の生成 static box LLVM_IR_LAYER_GUARD { name(){ return "llvm_ir" } diff --git a/tools/hako_check/rules/rule_dead_static_box.hako b/tools/hako_check/rules/rule_dead_static_box.hako index 2b11b6b7..26b18e7a 100644 --- a/tools/hako_check/rules/rule_dead_static_box.hako +++ b/tools/hako_check/rules/rule_dead_static_box.hako @@ -2,9 +2,23 @@ // Detect static boxes that are never referenced from any code path. // Excludes Main box (entry point) and boxes referenced in calls. -using selfhost.shared.common.string_helpers as Str - static box RuleDeadStaticBoxBox { + // Local int_to_str helper (avoids using alias issues) + _itoa(n) { + local v = 0 + n + if v == 0 { return "0" } + local out = "" + local digits = "0123456789" + local tmp = "" + loop (v > 0) { + local d = v % 10 + tmp = digits.substring(d, d+1) + tmp + v = v / 10 + } + out = tmp + return out + } + method apply_ir(ir, path, out) { local boxes = ir.get("boxes") if boxes == null { return 0 } @@ -56,7 +70,7 @@ static box RuleDeadStaticBoxBox { // Line precision: prefer span_line from AST intake if present local line = box_info.get("span_line") if line == null { line = 1 } - out.push("[HC012] dead static box (never referenced): " + name + " :: path:" + Str.int_to_str(line)) + out.push("[HC012] dead static box (never referenced): " + name + " :: path:" + me._itoa(line)) } bi = bi + 1 diff --git a/tools/hako_check/rules/rule_non_ascii_quotes.hako b/tools/hako_check/rules/rule_non_ascii_quotes.hako index 0d9fd270..369bf68a 100644 --- a/tools/hako_check/rules/rule_non_ascii_quotes.hako +++ b/tools/hako_check/rules/rule_non_ascii_quotes.hako @@ -1,5 +1,5 @@ // HC017: Non-ASCII Quotes detection -// Detects fancy quotes like “ ” ‘ ’ and reports their locations. +// Detects fancy quotes like " " ' ' and reports their locations. static box RuleNonAsciiQuotesBox { apply(text, path, out) { if text == null { return 0 } @@ -17,10 +17,10 @@ static box RuleNonAsciiQuotesBox { _has_fancy_quote(s) { if s == null { return 0 } // Check for common fancy quotes: U+201C/U+201D/U+2018/U+2019 - if s.indexOf("“") >= 0 { return 1 } - if s.indexOf("”") >= 0 { return 1 } - if s.indexOf("‘") >= 0 { return 1 } - if s.indexOf("’") >= 0 { return 1 } + if s.indexOf(""") >= 0 { return 1 } + if s.indexOf(""") >= 0 { return 1 } + if s.indexOf("'") >= 0 { return 1 } + if s.indexOf("'") >= 0 { return 1 } return 0 } _split_lines(s) { local arr=new ArrayBox(); if s==null {return arr} local n=s.length(); local last=0; local i=0; loop(i