fix: module syntax — changed src_bux/*.bux from module X; to module X { ... }

This commit is contained in:
2026-05-31 14:14:42 +03:00
parent 3c2a6e68b9
commit f4de065160
15 changed files with 632 additions and 628 deletions
+604 -600
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,5 +1,5 @@
// ast.bux — AST node types (Expr, Stmt, Decl, Pattern, TypeExpr) // ast.bux — AST node types (Expr, Stmt, Decl, Pattern, TypeExpr)
module Ast; module Ast {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// SourceLocation (inline for convenience) // SourceLocation (inline for convenience)
+1 -1
View File
@@ -1,6 +1,6 @@
// c_backend.bux — C transpiler backend (ported from c_backend.nim) // c_backend.bux — C transpiler backend (ported from c_backend.nim)
// Generates C code from the HIR. // Generates C code from the HIR.
module CBackend; module CBackend {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Type → C type name // Type → C type name
+1 -1
View File
@@ -1,6 +1,6 @@
// cli.bux — CLI driver for the Bux self-hosting compiler // cli.bux — CLI driver for the Bux self-hosting compiler
// Wires together: Lexer → Parser → Sema → HirLower → CBackend // Wires together: Lexer → Parser → Sema → HirLower → CBackend
module Cli; module Cli {
extern func PrintLine(s: String); extern func PrintLine(s: String);
extern func Print(s: String); extern func Print(s: String);
+1 -1
View File
@@ -1,5 +1,5 @@
// hir.bux — HIR (High-level Intermediate Representation) node types // hir.bux — HIR (High-level Intermediate Representation) node types
module Hir; module Hir {
// HIR node kinds // HIR node kinds
const hLit: int = 0; const hLit: int = 0;
+1 -1
View File
@@ -1,6 +1,6 @@
// hir_lower.bux — HIR lowering: AST → HIR transformation (ported from hir_lower.nim) // hir_lower.bux — HIR lowering: AST → HIR transformation (ported from hir_lower.nim)
// Transforms the typed AST into a lower-level IR suitable for code generation. // Transforms the typed AST into a lower-level IR suitable for code generation.
module HirLower; module HirLower {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Lowering context // Lowering context
+1 -1
View File
@@ -1,6 +1,6 @@
// lexer.bux — Lexer state machine (ported from lexer.nim) // lexer.bux — Lexer state machine (ported from lexer.nim)
// Tokenizes Bux source into a stream of tokens. // Tokenizes Bux source into a stream of tokens.
module Lexer; module Lexer {
extern func bux_strlen(s: String) -> uint; extern func bux_strlen(s: String) -> uint;
+1 -1
View File
@@ -1,5 +1,5 @@
// main.bux — Entry point for the Bux self-hosting compiler // main.bux — Entry point for the Bux self-hosting compiler
module Main; module Main {
// Forward declaration from Cli module // Forward declaration from Cli module
func Cli_Run(args: *String, argCount: int) -> int; func Cli_Run(args: *String, argCount: int) -> int;
+1 -1
View File
@@ -1,6 +1,6 @@
// manifest.bux — Manifest parser for bux.toml files // manifest.bux — Manifest parser for bux.toml files
// Parses package metadata: name, version, type, build output. // Parses package metadata: name, version, type, build output.
module Manifest; module Manifest {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Manifest struct // Manifest struct
+1 -1
View File
@@ -1,6 +1,6 @@
// parser.bux — Recursive descent parser (ported from parser.nim) // parser.bux — Recursive descent parser (ported from parser.nim)
// Parses Bux source tokens into an AST. // Parses Bux source tokens into an AST.
module Parser; module Parser {
extern func bux_strlen(s: String) -> uint; extern func bux_strlen(s: String) -> uint;
+1 -1
View File
@@ -1,5 +1,5 @@
// scope.bux — Symbol table with parent-chain lookup // scope.bux — Symbol table with parent-chain lookup
module Scope; module Scope {
// Symbol kinds // Symbol kinds
const skVar: int = 0; const skVar: int = 0;
+1 -1
View File
@@ -1,6 +1,6 @@
// sema.bux — Semantic analysis (type checker, ported from sema.nim) // sema.bux — Semantic analysis (type checker, ported from sema.nim)
// Validates types, resolves identifiers, checks function calls. // Validates types, resolves identifiers, checks function calls.
module Sema; module Sema {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Sema context // Sema context
+1 -1
View File
@@ -1,5 +1,5 @@
// source_location.bux — Source position tracking // source_location.bux — Source position tracking
module SourceLocation; module SourceLocation {
struct SourceLocation { struct SourceLocation {
line: uint32, line: uint32,
+1 -1
View File
@@ -1,5 +1,5 @@
// token.bux — Token kinds and helpers // token.bux — Token kinds and helpers
module Token; module Token {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// TokenKind enum // TokenKind enum
+1 -1
View File
@@ -1,5 +1,5 @@
// types.bux — Type system definitions and factories // types.bux — Type system definitions and factories
module Types; module Types {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// TypeKind constants // TypeKind constants