Major additions and improvements across the Bob language ecosystem: Core Language Features: - Add comprehensive dictionary support with full CRUD operations - Implement built-in functions: keys(), values(), has() for dictionaries - Add string multiplication operator (string * number) - Enhance error reporting with detailed context and call stacks - Add ternary operator support (condition ? true_expr : false_expr) - Implement do-while loops with break/continue support - Add array increment/decrement operators (++, --) - Add cross-type comparison operators with proper type coercion - Implement toInt() function for float-to-integer conversion - Add float array index auto-truncation (like JavaScript/Lua) Code Quality & Linter Fixes: - Remove all "using namespace std;" statements (best practice) - Add proper std:: prefixes throughout codebase - Fix const correctness in helper functions - Resolve class/struct declaration mismatches - Fix sign comparison warnings in array indexing - Remove unused lambda captures in built-in functions - Fix brace initialization warnings in parser Documentation & Tooling: - Significantly expand BOB_LANGUAGE_REFERENCE.md with new features - Update VS Code extension with enhanced syntax highlighting - Add comprehensive code snippets for new language features - Update version information and package metadata Test Suite: - Add extensive dictionary functionality tests - Add tests for new operators and built-in functions - Add comprehensive copy behavior tests (by value vs by reference) - Add performance and edge case testing Architecture Improvements: - Enhance Value system with proper move semantics - Improve memory management with shared_ptr for complex types - Add trampoline-based tail call optimization - Implement proper error context propagation This represents a major milestone in Bob language development with production-ready dictionary support, comprehensive testing, and significantly improved code quality.
108 lines
3.7 KiB
Markdown
108 lines
3.7 KiB
Markdown
# Bob Language Extension v0.4.0
|
|
|
|
## What's New
|
|
|
|
### ✨ New Features Added
|
|
|
|
#### **Dictionary Support**
|
|
- **Dictionary literals**: `{"key": "value", "number": 42}`
|
|
- **Dictionary indexing**: `dict{"key"}` (returns `none` for missing keys)
|
|
- **Dictionary assignment**: `dict{"key"} = value`
|
|
- **Nested dictionaries**: `{"user": {"name": "Bob", "age": 30}}`
|
|
- **Mixed type values**: Any type can be stored as dictionary values
|
|
|
|
#### **Dictionary Built-in Functions**
|
|
- `keys(dict)` - Returns array of all keys
|
|
- `values(dict)` - Returns array of all values
|
|
- `has(dict, key)` - Returns boolean if key exists
|
|
|
|
#### **Dictionary Code Snippets**
|
|
- `dict` - Create dictionary literal
|
|
- `dictaccess` - Access dictionary value
|
|
- `dictassign` - Assign to dictionary key
|
|
- `keys`, `values`, `has` - Built-in function snippets
|
|
|
|
### 🎨 Syntax Highlighting Improvements
|
|
- Dictionary literal syntax highlighting
|
|
- Dictionary indexing syntax support
|
|
- Built-in function highlighting for `keys`, `values`, `has`
|
|
|
|
### 📝 Documentation Updates
|
|
- Complete dictionary documentation with examples
|
|
- Dictionary built-in functions documentation
|
|
- Updated language reference with dictionary section
|
|
- Array and dictionary built-in functions documentation
|
|
|
|
---
|
|
|
|
## Previous Version (v0.3.0)
|
|
|
|
### ✨ New Features Added
|
|
|
|
#### **Enhanced Array Support**
|
|
- **Auto-truncating float indices**: `array[3.14]` → `array[3]` (like JavaScript/Lua)
|
|
- **Increment/decrement on array elements**: `array[0]++`, `++array[1]`
|
|
- **Improved array operations**: Better error handling and bounds checking
|
|
|
|
#### **New Built-in Functions**
|
|
- `toInt()` - convert floats to integers (truncates decimals)
|
|
- Enhanced error reporting for all built-in functions
|
|
|
|
#### **Increment/Decrement Operators**
|
|
- **Prefix increment**: `++x`
|
|
- **Postfix increment**: `x++`
|
|
- **Prefix decrement**: `--x`
|
|
- **Postfix decrement**: `x--`
|
|
- **Works on variables and array elements**
|
|
|
|
#### **Cross-Type Comparisons**
|
|
- **Equality operators** (`==`, `!=`) work with any types
|
|
- **Comparison operators** (`>`, `<`, `>=`, `<=`) only work with numbers
|
|
- **Clear error messages** for type mismatches
|
|
|
|
#### **Compound Assignment Operators**
|
|
- **Enhanced error reporting** with correct operator names
|
|
- **Consistent behavior** across all compound operators
|
|
- **Better type checking** before operations
|
|
|
|
#### **New Code Snippets**
|
|
- `toint` - Convert float to integer
|
|
- `compound` - Compound assignment operators
|
|
- `inc` - Increment variable
|
|
- `dec` - Decrement variable
|
|
- `arrayinc` - Increment array element
|
|
- `arraydec` - Decrement array element
|
|
- `crosscomp` - Cross-type comparison
|
|
- `floatindex` - Array access with float index
|
|
|
|
### 🎨 Syntax Highlighting Improvements
|
|
- Support for `toInt()` built-in function
|
|
- Enhanced operator recognition for increment/decrement
|
|
- Better array indexing syntax support
|
|
|
|
### 📝 Documentation Updates
|
|
- Comprehensive array documentation with auto-truncation examples
|
|
- New built-in function documentation (`toInt`, enhanced error reporting)
|
|
- Cross-type comparison behavior documentation
|
|
- Increment/decrement operator documentation
|
|
- Compound assignment operator documentation
|
|
|
|
### 🐛 Bug Fixes
|
|
- **Fixed array printing** - arrays no longer show as "unknown"
|
|
- **Enhanced error reporting** - all errors now use the error reporter system
|
|
- **Improved type checking** - better error messages for type mismatches
|
|
- **Memory management** - better cleanup of unused functions and arrays
|
|
|
|
## Installation
|
|
|
|
To create the VSIX package:
|
|
1. Install Node.js and npm
|
|
2. Run `npm install -g vsce`
|
|
3. Run `./package-vsix.sh`
|
|
|
|
The extension will be packaged as `bob-language-0.4.0.vsix`
|
|
|
|
## Compatibility
|
|
- VS Code 1.60.0+
|
|
- Cursor (VS Code compatible)
|
|
- All platforms (Windows, macOS, Linux) |