Commit Graph

66 Commits

Author SHA1 Message Date
nullndvoid 85e3d443cc assembler: small misc updates, I am tired 2025-06-29 03:52:53 +01:00
nullndvoid 0528768947 fmt: ran 'cargo fmt'. 2025-06-29 01:43:31 +01:00
nullndvoid 21582f1297 tokeniser/syntax: (db varname: -> db varname) dropped colon, updated tests. 2025-06-29 00:22:10 +01:00
nullndvoid 6ceb35d439 tokeniser: bugfixes to comma handling, regexes
TODO: Verify output is as expected, perhaps I can dump to file and compare token stream with known valid one?

Will add some extra tests of course!
2025-06-29 00:11:36 +01:00
nullndvoid 8bb252e941 tokeniser: return TokeniserErrors where relevant.
The UnexpectedEndOfInput case is a little vague.
2025-06-28 23:35:55 +01:00
nullndvoid 5317988fdd assembler: SourceInfo doc comment added to self.module. 2025-06-28 23:14:30 +01:00
nullndvoid d15e00c272 tokeniser: refactor to store Module directly in Tokeniser
We hereby avoid making extra copies of the PathBuf.

- Also updated tests to match the new API
2025-06-28 23:13:44 +01:00
nullndvoid a65dca6c5c tokeniser: errors now print with SourceInfo if added 2025-06-28 23:11:24 +01:00
nullndvoid b8be1bd95f tokeniser: add some actual tokeniser errors
TODO: Return these lol
2025-06-28 23:05:07 +01:00
nullndvoid f42c6d4095 assembler: refactor error handling and use ModuleId::new constructor 2025-06-28 23:03:13 +01:00
nullndvoid eebea82c4a assembler: start tokenising multiline strings (WIP) 2025-06-26 17:42:48 +01:00
nullndvoid ed4fcc8495 assembler: enhance error handling and tokenization logic 2025-06-26 17:00:14 +01:00
nullndvoid 40f8b1d57b assembler: fix clippy warnings 2025-06-25 19:49:20 +01:00
nullndvoid 68e459f32b assembler: use common to match registers 2025-06-25 19:29:56 +01:00
nullndvoid d9807b5b36 assembler: update tokeniser to allow extra prefixes and separators (0xDEAD_BEEF) 2025-06-25 19:15:51 +01:00
nullndvoid 7cb7525484 assembler: remove some current dead code 2025-06-25 17:56:45 +01:00
nullndvoid 7565374d5b assembler: Tokeniser updates, Compiler Engine is back finally 2025-06-25 17:55:34 +01:00
nullndvoid 9b9e153500 assembler: wrap Module's with Arc and update Tokeniser (still WIP)
Implements complete tokenizer with Arc-wrapped modules

Enhances module handling by wrapping Module instances in Arc for thread-safe sharing across the assembler pipeline.

Implements full tokenization logic with pattern matching for all token types including labels, registers, immediates, directives, instructions, symbols, and strings.

Adds comma token support and proper EOF handling to complete the lexical analysis phase.

Generated AI slop commit message, may not be super accurate or it may be a bit too serious lol.
2025-06-25 17:35:03 +01:00
nullndvoid 27267e3daa assembler: use smart pointer for modules since sourceinfo gets copy 2025-06-25 17:03:48 +01:00
nullndvoid fb84a6d3c3 assembler: clippy lints, better error formatting
Adds regex dependency and enhances error handling system

Introduces comprehensive error type hierarchy with specific variants for parser, symbol, codegen, threading, and IO errors to improve error reporting and debugging capabilities.

Adds regex crate for pattern matching in tokenizer implementation with pre-compiled patterns for labels, registers, immediates, directives, instructions, and symbols.

Enhances source info functionality with context printing and error underlining similar to compiler diagnostics.

Implements better error conversions and threading error handling for lock failures and panics.
2025-06-25 16:50:17 +01:00
nullndvoid 4e5db58a84 assembler: start refactoring/rewriting tokeniser 2025-06-25 14:48:45 +01:00
nullndvoid 11a57eab51 assembler: apply clippy lints 2025-06-25 14:33:48 +01:00
nullndvoid 20a7d42adb assembler: we failing DSA with this one 2025-06-25 14:31:53 +01:00
nullndvoid 9232f2ccab assembler: great leap forwards (more like the Cultural Revolution) 2025-06-25 03:26:50 +01:00
nullndvoid ce76820b6d assembler: begin wrangling 2025-06-25 02:25:46 +01:00
nullndvoid f72f36cd47 assembler: save currently broken refactors, its simpler to wipe then rebuild the assembler 2025-06-25 02:19:00 +01:00
nullndvoid 11ba09ab43 assembler: broke everything, currently modularising 2025-06-24 23:19:20 +01:00
nullndvoid ebae99811b misc: get rid of some errors from Cargo lol 2025-06-24 22:10:55 +01:00
zxq5 77331f65ab idk, i refactored some stuff ig 2025-06-24 22:10:55 +01:00
zxq5 a55dfe616e finished refactor of emulator - started on loader (needs significant changes before functional in the way that I would like) 2025-06-24 22:09:55 +01:00
nullndvoid 00a28e7711 elf: will start using clap to parse assembler arguments for CLI
I am tired af for some reason
2025-06-23 21:30:48 +01:00
nullndvoid ed479ac146 assembler: purge unwrap and use more AssembleErrors 2025-06-23 19:39:49 +01:00
nullndvoid f432fe7665 misc: clippy lint fixes 2025-06-23 18:23:01 +01:00
zxq5 ddd0c27893 found a cause of a memory bug in emulator - fix is TODO (#6) - continued working on brainf interpreter. we really need better debugging tools tbh. 2025-06-23 00:31:09 +01:00
zxq5 2b777f55c7 Merge remote-tracking branch 'refs/remotes/origin/main' 2025-06-22 03:54:44 +01:00
zxq5 9c56258c48 assembler changes & brainf##k compiler lmao 2025-06-22 03:51:16 +01:00
nullndvoid bbf893290f misc: more clippy fixes, **switched to stable**
The switch was due to rust-analyzer bug on latest nightly, please use stable until [this bug](https://github.com/rust-lang/rust-analyzer/issues/20051) is fixed
2025-06-22 00:42:44 +01:00
nullndvoid 1907bbb200 misc: clippy fixes 2025-06-22 00:30:27 +01:00
zxq5 528ceddade refactor & fixed assembler path handling 2025-06-21 04:05:22 +01:00
zxq5 42c26d4184 added a create-project system to assembler, and fixed a couple of parsing bugs 2025-06-20 03:25:28 +01:00
zxq5 52e2306fca refactoring assembler 2025-06-19 23:28:53 +01:00
zxq5 5c83b49328 fixed some clippy warns 2025-06-19 18:50:57 +01:00
nullndvoid a48dfee777 misc: revert "purged .unwrap()"
Harry is an idiot @zxq5 is also an idiot

This reverts commit d4e538a2b3.
2025-06-19 17:01:04 +01:00
zxq5 d4e538a2b3 purged .unwrap() 2025-06-19 16:57:43 +01:00
nullndvoid 6f834025ed emulator: imports work relatively to file being assembled (set cwd) 2025-06-19 16:35:00 +01:00
nullndvoid 7bdeab58a1 merge zxq5 changes with mine lol 2025-06-19 15:53:55 +01:00
nullndvoid 81433dcbcd misc: apply clippy lints 2025-06-19 15:51:23 +01:00
zxq5 d5a690563b fixed some clippy errors 2025-06-19 15:44:42 +01:00
zxq5 e308362533 idk 2025-06-19 15:18:48 +01:00
zxq5 6b58a17f03 fixed a lot of bugs with the emulator, instruction set and assembler 2025-06-19 01:57:36 +01:00