Skip to content
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

"pattern clashes with a previous instruction pattern" error #13

Closed
ProxyPlayerHD opened this issue Jun 16, 2019 · 4 comments
Closed

"pattern clashes with a previous instruction pattern" error #13

ProxyPlayerHD opened this issue Jun 16, 2019 · 4 comments

Comments

@ProxyPlayerHD
Copy link

I'm stupid again and cannot see why this error occours.

https://pastebin.com/0zQz353f

it says that with line 131, if i remove that it will say the same thing for the instruction below. and so on. if i remove all "REG <- REG" instructions it throws out that error again for line 205

@hlorenzi
Copy link
Owner

This one looks like another annoying limitation of the current implementation of tokendefs...
It seems a revamp of that system is highly called for!

Basically, it doesn't allow you to have an instruction with any plaintext tokens that also happen to be valid tokendefs in another instruction, at the same position. So your {dest:REG} instructions will clash with your REG <- REG instructions, and also your {jmp:J} instruction at the end will clash with the plaintext JMP, JP, and CALL instructions at the start.

For now, I think your best bet would be adding some tokens to disambiguate them, like using LD! A, B for example.

@ProxyPlayerHD
Copy link
Author

what if i make all of them plain text. i mean it would be annoying since then i would need to manually write down all ~200 Instructions but then it couldn't clash anymore, right?

@hlorenzi
Copy link
Owner

I was able to do a quick fix for this! It's in master and in the web version, but not yet in a release.

It should now allow what you're trying to do, but watch out for the order of definitions: in your case, you should put the REG <- REG instructions before the {dest:REG} ones.

The rule of thumb now actually works as intended: you should generally define instructions with fixed patterns before the ones with parameters.

@ProxyPlayerHD
Copy link
Author

thanks for that!

greta i could help improve the program.

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

No branches or pull requests

2 participants