Implement comprehensive diagnostic reporting system: - Add Diagnostic struct with severity levels and span-based error tracking - Add diagnostic rendering with source context and caret positioning - Replace ParseError with diagnostic collection in lexer and parser - Add LexResult and ParseResult types to carry diagnostics Enhance driver crate with frontend output: - Replace CompileResult with FrontendOutput containing diagnostics - Add has_errors() and render_diagnostics() methods - Add AstSummary for
19 lines
363 B
Plaintext
19 lines
363 B
Plaintext
struct AppConfig:
|
|
port: Int
|
|
service_name: String
|
|
|
|
fn build_message(name: String, port: Int) -> String:
|
|
if port > 0 && port < 65536:
|
|
return name
|
|
else:
|
|
return "invalid"
|
|
|
|
fn main() -> Int:
|
|
let config = build_message("backend-api", 8080)
|
|
let enabled = true || false
|
|
if enabled:
|
|
return 0
|
|
else:
|
|
return 1
|
|
|