-
Notifications
You must be signed in to change notification settings - Fork 15
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
Changed include to support wildcards #346
base: develop
Are you sure you want to change the base?
Conversation
ParseDirectives for the last param should always be a table. Even if it just has a single item. I think having string/table isn't nice behaviour. |
|
||
local preprocs_type = type( preprocs ) | ||
if preprocs_type == "string" then --1 specified preproc | ||
local func = directives[ preprocs ] or SF.Preprocessor.directives[ preprocs ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of code blocks like this switching on type. As suggested, keep it as nil or a table. Try and optimise this to a single block, make use of ternary for nil checks etc.
ParseDirectives has been made into a single block. |
@EpicG Would this break anything you're working on? I remember us chatting about remaking the ParseDirectives to refactor it properly for chaining directive checking. |
Was testing this a bit and came up with a few things: You can't have more than two of the same statement, |
Those are not the same statement, one is singular one is plural |
I meant when you have two of the same directive, they are going to be overwritten in the directives table. |
Ohhhh I see now. gotcha. Will fix that asap. |
… ok and err value
I felt like the changes to ParseDirectives should be bundled with this commit, feel free to tell me otherwise.