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

Allow parsing of incomplete rules #45

Closed
metthal opened this issue Dec 11, 2019 · 2 comments
Closed

Allow parsing of incomplete rules #45

metthal opened this issue Dec 11, 2019 · 2 comments

Comments

@metthal
Copy link
Member

metthal commented Dec 11, 2019

It would be nice to parse rules also in some kind of IncompleteRules mode which would ignore that some symbols might be missing from symbol tables. This would allow us to for example autoformat rules even without any includes which refer to other rules that are not part of the autoformatted rule.

For example let's say I have

rule abc {
    condition:
        xyz
}

xyz is not defined here but it might come from some include later therefore we'll just parse it silently and ignore it.

@metthal
Copy link
Member Author

metthal commented Apr 14, 2020

This should also allow us to obtain token stream from the parsed YARA file whenever there's a syntax error. For example let's say I have

rule abc {

This is not valid YARA but I can obtain token stream and by looking at the stream in reverse, I can infer that the next token should be meta and advise it to the user.

This one is more critical than the original use-case in the original post.

@metthal
Copy link
Member Author

metthal commented Oct 16, 2020

Another possible feature of this should be to ignore includes of files it can't find.

@metthal metthal added this to To do in Planning Oct 20, 2020
@TadeasKucera TadeasKucera moved this from To do to In progress in Planning May 18, 2021
@TadeasKucera TadeasKucera moved this from In progress to Review in progress in Planning May 20, 2021
@metthal metthal moved this from Review in progress to Done in Planning Jun 2, 2021
@metthal metthal closed this as completed Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants