-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add .frm and .cls extensions to VB6 #6155
Conversation
No samples for .vb6 found on GitHub
In response to requested change: github-linguist#6124 (comment)
Removing frx since it's a binary data file instead of code.
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.
Why are you removing the samples/VBA/cApplication.cls
sample? We don't remove samples if we can avoid it.
samples/Visual Basic 6.0/frmMain.frm
is massive. Please replace it with a smaller sample.
I also recommend adding two distinct samples for each of these extensions to help the classifier in the event things slip through the heuristics.
Because this sample is a VB6 sample (based on the heuristics this PR introduced). My understanding is that in the PR #4725, where this sample was added, the intention was to put VBA and VB6 under the same language "VBA/VB6", but when it changed to just VBA, the sample for VB6 was left there by mistake. And the reason why I didn't add it to the VB6 samples is because I couldn't find its origin on GitHub and I wanted to add a sample from a popular project such as hijackthis.
Sure. Will do.
Sounds good. Should I add back cApplication.cls as a VB6 sample or should I add another one instead to avoid confusion? |
Regarding the |
Cool. In that case, please move it rather than remove it. We've already approved its inclusion so there's no need to find the source etc. You can still add another if it'll help the classifier which is falling on this extension. |
The Classifier test didn't succeed with 100%, but it's already better: .cls (5/6) .frm (4/4) Considering that the heuristics should be pretty reliable, can this suffice? |
It needs to. Try removing the sample or adding another sample. |
Alright, I've switched the problematic sample with another one from the same project. Now, all the tests are passing and I updated the PR description at the top with the correct samples. |
Apply regex simplification suggested by @Alhadis Co-authored-by: John Gardner <gardnerjohng@gmail.com>
Following up on discussions in issue #5824, I'm proposing to add .frm and .cls as extensions for VB6 with heuristics to distinguish it from VBA.
Description
The heuristics added to distinguish VBA from VB6 were suggested by @XusinboyBekchanov :
frm
![image](https://user-images.githubusercontent.com/31558169/199896060-4139aba4-783a-4877-9ce5-b7df97a2af8a.png)
![image](https://user-images.githubusercontent.com/31558169/199896405-0b779160-8ba9-484c-9fd1-f021eebdf521.png)
VBA:
VB6:
cls
![image](https://user-images.githubusercontent.com/31558169/199896529-d14c1d27-cd78-4902-9a07-e7687145e85b.png)
VB6 :
VBA : If the pattern above doesn't match, we default to VBA.
The key of these are based on the way the VB6 and VBA IDEs encode information at the top of the file when exporting the forms or class module as text files. From what I know, there isn't really a good reason for developers to alter this information as this could cause issues when trying to import back the text file into their IDE. Hence, those differences should be sufficiently reliable to distinguish between VBA and VB6.
PS : Due to the way I pulled changes from master, this pull request appears to contain more commits that it really does. Commits before 2d3547 can be ignored.
Checklist:
VB6
https://github.com/raw/dragokas/hijackthis/devel/src/frmMain.frmVBA