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

Add QuickBASIC #7080

Merged
merged 9 commits into from
Nov 26, 2024
Merged

Add QuickBASIC #7080

merged 9 commits into from
Nov 26, 2024

Conversation

DecimalTurn
Copy link
Contributor

@DecimalTurn DecimalTurn commented Oct 6, 2024

Description

This PR adds QuickBASIC (QB) as a langauge for the .bas extension.

Note that there exists a modern version of QuickBASIC known as QB64 that is still compatible with Classic QB. Since Classic QB and QB64 haven't reached the popularity threshold by their own at the moment, I've kept them combined, but we could separate them in the future if popularity justifies it.

The grammar used is the one for QB64, since it is also compatible with Classic QB.

Regarding heuristics, due to the similarities between FreeBASIC and QuickBASIC, this PR improves FreeBASIC's heuristics as well as adding new rules for QuickBASIC to make sure they are distinguished properly. Note that heuristics for QuickBASIC should always appear after FreeBASIC to work correctly.

  • FreeBASIC:

    • The previous rule was improved by adding the pragma keyword.
    • DataType-Pointer declaration
    • Declaration with inverted order (dim as name1 DataType instead of dim name1 as DataType)
    • Return keyword without the presence of GOSUB. The keyword is not unique to FreeBASIC, but if there is no instances of GOSUB, it's automatically FreeBASIC. Note that a second entry was needed to implement this rule.
  • QuickBASIC:

    • See comments in named pattern for more details

Checklist:

@DecimalTurn
Copy link
Contributor Author

Related issue: #3216

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comment

lib/linguist/heuristics.yml Outdated Show resolved Hide resolved
@DecimalTurn
Copy link
Contributor Author

DecimalTurn commented Oct 8, 2024

@lildude due to the potential interactions between my 2 other open PRs, would it be OK if I rebase them onto one another such that this one is at the top (while still being separate PRs)? This would be better for testing while this PR is being worked on and it should avoid any conflicts at merge time.

@DecimalTurn
Copy link
Contributor Author

DecimalTurn commented Oct 16, 2024

Due to the similarities between QuickBASIC and FreeBASIC, I'm going to need to improve FreeBASIC's heuristics as well. I have a few improvements ready to be committed, but I should rebase on #7072 since it also make changes for FreeBASIC.

@lildude
Copy link
Member

lildude commented Oct 16, 2024

@lildude due to the potential interactions between my 2 other open PRs, would it be OK if I rebase them onto one another such that this one is at the top (while still being separate PRs)? This would be better for testing while this PR is being worked on and it should avoid any conflicts at merge time.

Possibly. I'm not sure how well it'll work with the merge queue that we use.

lildude
lildude previously approved these changes Nov 25, 2024
@lildude lildude added this pull request to the merge queue Nov 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Nov 25, 2024
@lildude
Copy link
Member

lildude commented Nov 25, 2024

Possibly. I'm not sure how well it'll work with the merge queue that we use.

Not well it seems. Can you please address the conflicts.

@DecimalTurn
Copy link
Contributor Author

Not well it seems. Can you please address the conflicts.

Done.

@lildude lildude added this pull request to the merge queue Nov 26, 2024
Merged via the queue into github-linguist:main with commit d713788 Nov 26, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants