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

Commit

Permalink
Merge pull request #112 from wakatime/fix/coq-lexer-text-analysis
Browse files Browse the repository at this point in the history
Fix Coq text analysis keywords
  • Loading branch information
gandarez committed Feb 12, 2021
2 parents 6abe583 + 1cd7048 commit ed848d1
Showing 1 changed file with 1 addition and 5 deletions.
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

0 comments on commit ed848d1

Please sign in to comment.