Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

v0.3.1

Choose a tag to compare

@HelloAIXIAOJI HelloAIXIAOJI released this 22 Jul 17:25
· 1022 commits to master since this release

CodeNothing Programming Language Interpreter v0.3.1 Changelog

[v0.3.1] - 2025-07-23

🎉 Major Update: Object-Oriented Programming (OOP) Support

New Features

  • Complete Class System:

    • Class definition: class ClassName { ... };
    • Field definition: public/private/protected fieldName : Type;
    • Method definition: public fn methodName() : ReturnType { ... };
    • Constructor: constructor(params) { ... };
  • Object Operations:

    • Object creation: new ClassName(args)
    • Field access: obj.field
    • this keyword: this.field = value
  • Access Control:

    • public - Public access
    • private - Private access
    • protected - Protected access
  • Type System Extensions:

    • New Type::Class(String) type
    • Custom class type declarations
    • Complete type inference and checking

Technical Implementation

  • AST Extensions: Added Class, Field, Method, Constructor, Visibility structs
  • Parser Enhancements: New class_parser.rs module for full OOP syntax parsing
  • Interpreter Core: Added Value::Object(ObjectInstance) type for object instantiation
  • Expression System: New ObjectCreation, FieldAccess, This expression types
  • Statement System: New ClassDeclaration, FieldAssignment statement types

Test Files

  • test_oop_basic.cn - Basic OOP functionality tests
  • test_oop_advanced.cn - Advanced OOP feature tests
  • test_oop_complex.cn - Complex multi-class interaction tests

Current Status

  • ✅ Class definition & parsing - Fully supported
  • ✅ Object creation - Fully supported
  • ✅ Field access - Fully supported
  • ⏳ Method invocation - Pending implementation
  • ⏳ Constructor execution - Pending implementation
  • ⏳ Inheritance system - Pending implementation

This marks a significant milestone in CodeNothing's evolution, transitioning from procedural to object-oriented programming!

Fixes

  • Rewrote lexer to properly handle:
    • Floating-point numbers
    • Method chaining (.)
    • Multi-character operators
  • Fixed parsing of variable.method() chaining (resolved "expected ';', got '.identifier'" error)
  • Fixed parsing of float literals like 0.2 (resolved "expected ')', got '.'" error)

CodeNothing 编程语言解释器 v0.3.1 更新日志

[v0.3.1] - 2025-07-23

🎉 重大更新:面向对象编程(OOP)支持

新增功能

  • 完整的类系统

    • 类定义语法:class ClassName { ... };
    • 字段定义:public/private/protected fieldName : Type;
    • 方法定义:public fn methodName() : ReturnType { ... };
    • 构造函数:constructor(params) { ... };
  • 对象操作

    • 对象创建:new ClassName(args)
    • 字段访问:obj.field
    • this关键字:this.field = value
  • 访问控制

    • public - 公共访问
    • private - 私有访问
    • protected - 保护访问
  • 类型系统扩展

    • 新增 Type::Class(String) 类型
    • 支持自定义类类型声明
    • 完整的类型推断和检查

技术实现

  • AST扩展:新增 Class, Field, Method, Constructor, Visibility 等结构体
  • 解析器增强:新增 class_parser.rs 模块,支持完整的OOP语法解析
  • 解释器核心:新增 Value::Object(ObjectInstance) 类型,支持对象实例化
  • 表达式系统:新增 ObjectCreation, FieldAccess, This 表达式类型
  • 语句系统:新增 ClassDeclaration, FieldAssignment 语句类型

测试文件

  • test_oop_basic.cn - 基础OOP功能测试
  • test_oop_advanced.cn - 高级OOP特性测试
  • test_oop_complex.cn - 复杂多类交互测试

当前状态

  • ✅ 类定义和解析 - 完全支持
  • ✅ 对象创建 - 完全支持
  • ✅ 字段访问 - 完全支持
  • ⏳ 方法调用 - 待实现
  • ⏳ 构造函数执行 - 待实现
  • ⏳ 继承系统 - 待实现

这是CodeNothing语言发展史上的一个重要里程碑,标志着从过程式编程向面向对象编程的重大跃进!

修复

  • 重写了词法分析器,以正确处理:
    • 浮点数
    • 链式调用(.
    • 多字符运算符
  • 修复了 variable.method() 形式的链式调用解析(解决了"期望 ';', 但得到了 '.identifier'"错误)
  • 修复了浮点数字面量(如 0.2)的解析(解决了"期望 ')', 但得到了 '.'"错误)

Full Changelog: CodeNothingCommunity/CodeNothing@v0.3.0...v0.3.1

Installation Guide

Download Steps

  1. Download the following two packages for your operating system:
    • Interpreter main package (codenothing-{OS}.zip
    • Standard library package (codenothing-all-libraries-{OS}-latest.tar.gz

Installation Steps

  1. Extract both packages
  2. Create a subfolder named library in the interpreter's main directory
  3. Copy all extracted library files (.dll or .so) into the newly created library folder

Usage

After completing the above steps, you can start using the CodeNothing programming language interpreter.

System Requirements

  • Windows/Linux operating system
  • Appropriate file extraction tools

安装指南

下载步骤

  1. 下载适用于您操作系统的以下两个压缩包:
    • 解释器本体压缩包(codenothing-{OS}.zip
    • 标准库(library)压缩包(codenothing-all-libraries-{OS}-latest.tar.gz

安装步骤

  1. 解压两个压缩包
  2. 在解释器本体文件夹中创建子文件夹:library
  3. 将解压出的 library 文件(.dll 或 .so)全部复制到新建的 library 文件夹中

使用说明

完成上述步骤后,您就可以开始使用 CodeNothing 编程