This repository was archived by the owner on Aug 18, 2025. It is now read-only.
v0.3.1
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) { ... };
- Class definition:
-
Object Operations:
- Object creation:
new ClassName(args) - Field access:
obj.field thiskeyword:this.field = value
- Object creation:
-
Access Control:
public- Public accessprivate- Private accessprotected- Protected access
-
Type System Extensions:
- New
Type::Class(String)type - Custom class type declarations
- Complete type inference and checking
- New
Technical Implementation
- AST Extensions: Added
Class,Field,Method,Constructor,Visibilitystructs - Parser Enhancements: New
class_parser.rsmodule for full OOP syntax parsing - Interpreter Core: Added
Value::Object(ObjectInstance)type for object instantiation - Expression System: New
ObjectCreation,FieldAccess,Thisexpression types - Statement System: New
ClassDeclaration,FieldAssignmentstatement types
Test Files
test_oop_basic.cn- Basic OOP functionality teststest_oop_advanced.cn- Advanced OOP feature teststest_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
- 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)
- Interpreter main package (
Installation Steps
- Extract both packages
- Create a subfolder named
libraryin the interpreter's main directory - Copy all extracted library files (.dll or .so) into the newly created
libraryfolder
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
安装指南
下载步骤
- 下载适用于您操作系统的以下两个压缩包:
- 解释器本体压缩包(
codenothing-{OS}.zip) - 标准库(library)压缩包(
codenothing-all-libraries-{OS}-latest.tar.gz)
- 解释器本体压缩包(
安装步骤
- 解压两个压缩包
- 在解释器本体文件夹中创建子文件夹:
library - 将解压出的 library 文件(.dll 或 .so)全部复制到新建的
library文件夹中
使用说明
完成上述步骤后,您就可以开始使用 CodeNothing 编程