Commit Graph

9 Commits

Author SHA1 Message Date
D. Ben Knoble 10d2b8797c swipl: style fix 2021-01-23 12:27:55 -05:00
Horacio Sanson 6a3d215571 prolog/swipl: simplify with @hsanson's suggestions
https://github.com/dense-analysis/ale/pull/3377#issuecomment-763628447
2021-01-20 12:07:26 -05:00
D. Ben Knoble 730222bcd8 fix blank line issue (???) 2020-11-30 13:51:15 -05:00
D. Ben Knoble 3410c1b1e2 prolog/swipl: add blank line after call
Though I do not see this specified or followed anywhere else
2020-10-01 13:18:34 -04:00
D. Ben Knoble e32d5fc03d prolog/swipl: address linter feedback
This actually caught a bug where I forgot to rename the function
2020-10-01 13:12:18 -04:00
D. Ben Knoble abe1440268 prolog/swipl: update error format for new version
A recent(?) update to swipl changed the error format from

  Warning: some.pl:2:
              Singleton variables: [Y]

to

  Warning: some.pl:2:
  Warning:    Singleton variables: [Y]

The old error handler doesn't report the correct line numbers and
messages on the old format.

I've chosen to add a function that covers the second case and detect it,
rather than rewrite the current function. This way, both versions should
be able to live together.

---

Example file that demonstrates the issue (some.pl above):
```
% vim: ft=prolog
ii(X, Y) :- X.
```

---
2020-10-01 12:49:53 -04:00
w0rp 883978ece9
#2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
w0rp 7a48750610
Complain about binary operators on the ends of lines 2019-02-10 11:43:48 +00:00
Takuya Fujiwara 34318aedf4 Add prolog swipl linter (#1979)
* add prolog/swipl linter

* use load_files/2 instead of read_term/2

Because it also checks some semantic warnings / errors
not only syntactic warnings / errors.

e.g.:
* singleton warning
* discontiguous warning
* ...

cf. http://www.swi-prolog.org/pldoc/doc_for?object=style_check/1

* support error messages with no line number

    :- module(module_name, [pred/0]).

causes

    ERROR: Exported procedure module_name:pred/0 is not defined

* add test for prolog/swipl handler

* cosmetic fixes

* detect timeout using SIGALRM

* rename g:prolog_swipl_goals to g:prolog_swipl_load

* write doc for prolog/swipl linter

* update toc and README

* fix ignore patterns
2018-10-26 17:29:17 +01:00