Skip to content

Conversation

@nickswalker
Copy link
Contributor

Add a pattern for Answer Set Programming.

Description

Answer Set Programming (#7184) was patternless, leading to false positives on LibrePCB .lp files (which don't appear popular enough for inclusion themselves). Now, it now matches files containing specific ASP directives (#include, #const, etc.). Because some ASP files won't have directives, it also looks for rules defined with :-, or lines simply containing "facts" (foo(x). or atom. or edge(2, 4).).

Added an additional ASP sample tohB.lp from Potassco's clingo repo (MIT licensed) to exercise the patterns.

Checklist:

  • I am fixing a misclassified language
    • I have included a new sample for the misclassified language:
      • Sample source(s):
      • Sample license(s): MIT
    • I have included a change to the heuristics to distinguish my language from others using the same extension.

@nickswalker nickswalker requested a review from a team as a code owner December 24, 2025 07:50
Answer Set Programming was patternless, leading to many false positives. Now, it now matches files containing specific ASP directives (`#include`, `#const`, etc.). Additionally, it looks for rules defined with `:-`.
Added an ASP sample `tohB.lp` from Potassco's clingo repo (MIT licensed). Lacks `#` directives, so serves to make sure second pattern works
@nickswalker nickswalker force-pushed the improve-lp-asp-patterns branch from 9dacd44 to 0590503 Compare December 24, 2025 07:51
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.

Additionally, we need tests for all heuristics.

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.

LGTM. Thanks.

Important

The changes in this PR will not appear on GitHub until the next release has been made and deployed. See here for more details.

@lildude lildude enabled auto-merge January 8, 2026 17:22
@lildude lildude added this pull request to the merge queue Jan 8, 2026
Merged via the queue into github-linguist:main with commit 48db2b9 Jan 8, 2026
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