Add README, .gitignore, and clean up build artifacts

- Added comprehensive README with usage instructions
- Added .gitignore to prevent build artifacts from being committed
- Removed target/ directories and duplicate WASM files
- Cleaned up parser binaries and test files
This commit is contained in:
2025-09-11 11:27:27 -04:00
parent 74f44fa77e
commit a2442f53ea
238 changed files with 85 additions and 713 deletions

60
README.md Normal file
View File

@@ -0,0 +1,60 @@
# tree-sitter-hack-assembly
A [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammar for Hack Assembly language as used in the [nand2tetris](https://www.nand2tetris.org/) course.
## Supported File Types
- `.asm` - Hack Assembly source files
## Features
- **Syntax highlighting** for A-instructions, C-instructions, and labels
- **Code navigation** with outline support for symbols and jumps
- **Bracket matching** for all syntax elements
- **Integration** with Zed editor and other Tree-sitter compatible editors
## Usage
This grammar is designed to work with the [nand2tetris-zed](https://github.com/soconnor0919/nand2tetris-zed) extension for Zed editor, providing complete language support for the nand2tetris course.
## Grammar Details
- **Language**: Hack Assembly
- **Scope**: `source.hack_assembly`
- **File Types**: `.asm`
- **Node Types**: `a_instruction`, `c_instruction`, `label_declaration`, `symbol`, `constant`
## Development
### Building
```bash
# Generate parser
tree-sitter generate
# Build parser
tree-sitter build
# Test grammar
tree-sitter test
```
### Testing
```bash
# Run tests
tree-sitter test
# Parse a file
tree-sitter parse example.asm
```
## License
MIT License - see [LICENSE](LICENSE) file for details.
## Related
- [nand2tetris-zed](https://github.com/soconnor0919/nand2tetris-zed) - Complete Zed extension
- [nand2tetris.org](https://www.nand2tetris.org/) - Course website
- [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) - Parser generator