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
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.

1 participant