8 Commits

Author SHA1 Message Date
Myrausman
444ab190b1 restructured codebase
Signed-off-by: Myrausman <maira.usman5703@gmail.com>
2024-11-07 17:57:26 +05:00
Tim Hutt
359a94356d
Enable Pylint in CI and fix its errors (#311)
* Remove wildcard imports

Use explicit imports rather than wildcards. This is more maintainable.

* Enable Pylint in CI and fix its errors

The main fixes were:

* Specify encoding for all file opens. By default it depends on environment variables which is bad.
* Use `with` to open files. Otherwise they don't necessarily get closed.

There were also a few minor things like using `enumerate`, not using objects as default arguments, etc. In some cases I slightly refactored the code.
2024-11-05 06:32:12 -08:00
Aditya Mohan
8c459ce55d
Add Unit Tests for shared_utils.py (#309)
* Added test cases for shared_utils

Signed-off-by: Aditya Mohan <coding.traxicon16@gmail.com>

* Added definition for logging an error shared_utils.py

Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>

* Pre-commit fixes for shared_utils.py

Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>

* pyright fixes for test.py

Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>

* Minor changes to shared_utils.py

Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>

* Updated test.py

Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>

---------

Signed-off-by: Aditya Mohan <coding.traxicon16@gmail.com>
Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>
Co-authored-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>
2024-11-03 20:52:15 -08:00
Tim Hutt
284a5fa0f7 Add static type hints
This makes the code easier to understand and navigate, and also detected a few of bugs:

1. Missing brackets on e.upper. (Fixed)
2. Not strictly related to types, but a lot of the regexes were not raw strings and therefore contained invalid escape sequences. Python prints a warning about these in recent versions. (Fixed)
3. Expression in `process_pseudo_instructions()` that is always false. (Not fixed)
4. Missing definition of `log_and_exit()`. (Fixed)

This is validated via pre-commit in CI.
2024-10-31 11:42:41 +00:00
IIITM-Jay
d57a94cf8e clean up codes for refactoring parsing logic 2024-10-25 01:43:58 +05:30
IIITM-Jay
41fc44b695 removed walrus operator 2024-10-09 20:50:59 +05:30
IIITM-Jay
88e98091df Optimized and modularized method for Instruction Dictionary 2024-09-25 22:46:56 +05:30
IIITM-Jay
1b0ef5d896 Refactored and Optimized Logic:: Parser Logic, Latex Based Output & Shared Modules 2024-09-17 00:53:00 +05:30