Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Fix Coq text analysis keywords #112

Merged
merged 1 commit into from
Feb 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions lexers/c/coq.go
@@ -1,15 +1,12 @@
package c

import (
"regexp"
"strings"

. "github.com/alecthomas/chroma" // nolint
"github.com/alecthomas/chroma/lexers/internal"
)

var coqAnalyzerQedCommandRe = regexp.MustCompile(`[qQ]ed`)

// Coq lexer.
var Coq = internal.Register(MustNewLexer(
&Config{
Expand Down Expand Up @@ -66,8 +63,7 @@ var Coq = internal.Register(MustNewLexer(
},
},
).SetAnalyser(func(text string) float32 {
if coqAnalyzerQedCommandRe.MatchString(text) &&
strings.Contains(text, "tauto") {
if strings.Contains(text, "Qed") && strings.Contains(text, "Proof") {
return 1.0
}

Expand Down