Skip to content

Fix classloader and parser handling for libraries, add tests #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

BlazingTwist
Copy link
Contributor

@BlazingTwist BlazingTwist commented Jan 24, 2025

I've found a good excuse to write an aya library and discovered some oversights in #111

  • StaticData no longer releases the classloader used to load libraries
    • this avoids a ClassNotFoundException when libraries have multiple classes (such as DataStorage in the example library)
  • NamedOpToken now no longer throws a ParserException for "undefined" namedOps
    • libraries could be loaded at any time, so a ParserException does not make sense anymore
    • instead, the opName is checked when the Instruction is executed
  • to verify that this actually works, an example library is compiled and imported during the maven test phase
    • (if you'd prefer, I can move the test/example library to /examples instead)

- resolves a ClassNotFoundException when libraries contain multiple classes
- resolves a ParserException when using libraries in the same file that imports them
- adds automated tests for compiling and using libraries
@nick-paul
Copy link
Collaborator

The ParserException was definitely an oversight on my end. The tests look great too. Thanks!

@nick-paul nick-paul merged commit 7cf27a5 into aya-lang:master Jan 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants