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

Splitting off matches into their own file? #7

Open
mpentler opened this issue Dec 22, 2017 · 2 comments
Open

Splitting off matches into their own file? #7

mpentler opened this issue Dec 22, 2017 · 2 comments

Comments

@mpentler
Copy link
Contributor

I've been wondering if it's possible to improve this at all:

const BINARY_MATCHES: [(&str, &str);24] = [ // Global array, so needs an explicit length

I hate that we have to keep track of how much is in there for the global array. I think the only reason I did it was to put it into another file, so they need to be globals for it to work.

Instead we could maybe put the matches into a separate file in another format and parse it, and count the lines to see how many there are when defining the array. Easier to keep track of then.

What do you think?

@bartnv
Copy link
Owner

bartnv commented Dec 23, 2017

Yeah, having those binary matches defined in a separate configuration file would certainly be preferable. They're tuples of a normal string and a raw string. Not sure how you can read text from a file and have it interpreted as a raw string (with the \x replacements executed). That's the only hard part. The two strings could just be tab-separated on the same line.

@mpentler
Copy link
Contributor Author

What, have them separated so you could read one part as a normal and one as a raw?

Or you could do it as YAML? Easier to parse then.

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