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)
module Ast;
module Ast {
// ---------------------------------------------------------------------------
// SourceLocation (inline for convenience)
+1 -1
View File
@@ -1,6 +1,6 @@
// c_backend.bux — C transpiler backend (ported from c_backend.nim)
// Generates C code from the HIR.
module CBackend;
module CBackend {
// ---------------------------------------------------------------------------
// Type → C type name
+1 -1
View File
@@ -1,6 +1,6 @@
// cli.bux — CLI driver for the Bux self-hosting compiler
// Wires together: Lexer → Parser → Sema → HirLower → CBackend
module Cli;
module Cli {
extern func PrintLine(s: String);
extern func Print(s: String);
+1 -1
View File
@@ -1,5 +1,5 @@
// hir.bux — HIR (High-level Intermediate Representation) node types
module Hir;
module Hir {
// HIR node kinds
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)
// Transforms the typed AST into a lower-level IR suitable for code generation.
module HirLower;
module HirLower {
// ---------------------------------------------------------------------------
// Lowering context
+1 -1
View File
@@ -1,6 +1,6 @@
// lexer.bux — Lexer state machine (ported from lexer.nim)
// Tokenizes Bux source into a stream of tokens.
module Lexer;
module Lexer {
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
module Main;
module Main {
// Forward declaration from Cli module
func Cli_Run(args: *String, argCount: int) -> int;
+1 -1
View File
@@ -1,6 +1,6 @@
// manifest.bux — Manifest parser for bux.toml files
// Parses package metadata: name, version, type, build output.
module Manifest;
module Manifest {
// ---------------------------------------------------------------------------
// Manifest struct
+1 -1
View File
@@ -1,6 +1,6 @@
// parser.bux — Recursive descent parser (ported from parser.nim)
// Parses Bux source tokens into an AST.
module Parser;
module Parser {
extern func bux_strlen(s: String) -> uint;
+1 -1
View File
@@ -1,5 +1,5 @@
// scope.bux — Symbol table with parent-chain lookup
module Scope;
module Scope {
// Symbol kinds
const skVar: int = 0;
+1 -1
View File
@@ -1,6 +1,6 @@
// sema.bux — Semantic analysis (type checker, ported from sema.nim)
// Validates types, resolves identifiers, checks function calls.
module Sema;
module Sema {
// ---------------------------------------------------------------------------
// Sema context
+1 -1
View File
@@ -1,5 +1,5 @@
// source_location.bux — Source position tracking
module SourceLocation;
module SourceLocation {
struct SourceLocation {
line: uint32,
+1 -1
View File
@@ -1,5 +1,5 @@
// token.bux — Token kinds and helpers
module Token;
module Token {
// ---------------------------------------------------------------------------
// TokenKind enum
+1 -1
View File
@@ -1,5 +1,5 @@
// types.bux — Type system definitions and factories
module Types;
module Types {
// ---------------------------------------------------------------------------
// TypeKind constants