(:weight bold)
"Dict separators.")
-(sweep-defface
- type-error
- (:inherit font-lock-warning-face)
- (:foreground "orange")
- (:foreground "orange")
- "Type errors.")
-
-(sweep-defface
- instantiation-error
- (:inherit font-lock-warning-face)
- (:foreground "orange")
- (:foreground "orange")
- "Instantiation errors.")
-
(sweep-defface
file
(:inherit button)
(sweep-defface
error
(:inherit font-lock-warning-face)
- (:foreground "orange")
- (:foreground "orange")
+ (:background "orange")
+ (:background "orange")
"Unspecified errors.")
+(sweep-defface
+ type-error
+ (:inherit font-lock-warning-face)
+ (:background "orange")
+ (:background "orange")
+ "Type errors.")
+
+(sweep-defface
+ instantiation-error
+ (:inherit font-lock-warning-face)
+ (:background "orange")
+ (:background "orange")
+ "Instantiation errors.")
+
(sweep-defface
syntax-error
(:inherit error)
- (:foreground "orange")
- (:foreground "orange")
+ (:background "orange")
+ (:background "orange")
"Syntax errors.")
+(sweep-defface
+ around-syntax-error
+ (:inherit default)
+ (:inherit default)
+ (:inherit default)
+ "Text around a syntax error.")
+
+(sweep-defface
+ clause
+ (:inherit default)
+ (:inherit default)
+ (:inherit default)
+ "Predicate clauses.")
+
+(sweep-defface
+ grammar-rule
+ (:inherit default)
+ (:inherit default)
+ (:inherit default)
+ "DCG grammar rules.")
+
+(sweep-defface
+ term
+ (:inherit default)
+ (:inherit default)
+ (:inherit default)
+ "Top terms.")
+
+(sweep-defface
+ directive
+ (:inherit default)
+ (:inherit default)
+ (:inherit default)
+ "Directives.")
+
(sweep-defface
structured-comment
(:inherit font-lock-doc-face)
(`("goal",(rx "imported(") . ,_) (sweep-imported-face))
(`("goal",(rx "global(") . ,_) (sweep-global-face))
(`("goal",(rx "local(") . ,_) (sweep-local-face))
- (`("syntax_error" ,_message ,_eb ,_ee) (sweep-syntax-error-face))
+ (`("syntax_error" ,_message ,eb ,ee)
+ (with-silent-modifications
+ (put-text-property eb ee 'font-lock-face
+ (sweep-around-syntax-error-face)))
+ (sweep-syntax-error-face))
("unused_import" (sweep-unused-import-face))
("undefined_import" (sweep-undefined-import-face))
("html_attribute" (sweep-html-attribute-face))
("file_no_depend" (sweep-file-no-depend-face))
("nofile" (sweep-no-file-face))
("op_type" (sweep-op-type-face))
+ ("directive" (sweep-directive-face))
+ ("clause" (sweep-clause-face))
+ ("term" (sweep-term-face))
+ ("grammar_rule" (sweep-grammar-rule-face))
("method" (sweep-method-face))
("class" (sweep-class-face))))
asserta(sweep_source_time(Path, Time), Ref1),
xref_source(Path, []),
seek(Contents, 0, bof, _),
+ retractall(sweep_current_comment(_, _, _)),
prolog_colourise_stream(Contents,
Path,
- sweep_handle_query_color(1)),
+ sweep_handle_color(1)),
+ forall(sweep_current_comment(Kind, Start, Len),
+ ( atom_string(Kind, String),
+ user:sweep_funcall("sweep--colourise", [Start,Len,"comment"|String], _)
+ )),
erase(Ref0),
erase(Ref1).
set_stream(Contents, file_name(Path)),
seek(Contents, 0, bof, _),
findall(Op, xref_op(Path, Op), Ops),
+ retractall(sweep_current_comment(_, _, _)),
prolog_colourise_stream(Contents,
Path,
- sweep_handle_query_color(Offset),
- [operators(Ops)]).
+ sweep_handle_color(Offset),
+ [operators(Ops)]),
+ forall(sweep_current_comment(Kind, Start, Len),
+ ( atom_string(Kind, String),
+ user:sweep_funcall("sweep--colourise", [Start,Len,"comment"|String], _)
+ )).
sweep_documentation([Path, Functor, Arity], Docs) :-
atom_string(P, Path),
sweep_pack_install(PackName, []) :-
atom_string(Pack, PackName), pack_install(Pack, [silent(true), upgrade(true), interactive(false)]).
+sweep_handle_color(Offset, comment(Kind), Beg, Len) :-
+ !,
+ Start is Beg + Offset,
+ asserta(sweep_current_comment(Kind, Start, Len)).
+sweep_handle_color(Offset, Col, Beg, Len) :-
+ sweep_handle_query_color(Offset, Col, Beg, Len).
sweep_colourise_query([String|Offset], _) :-
prolog_colourise_query(String, module(sweep), sweep_handle_query_color(Offset)).