File: lang-info.rkt

package info (click to toggle)
racket-mode 20250711~git.8a80578-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,024 kB
  • sloc: lisp: 17,215; makefile: 106
file content (30 lines) | stat: -rw-r--r-- 819 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
;; Copyright (c) 2020-2023 by Greg Hendershott.
;; SPDX-License-Identifier: GPL-3.0-or-later

#lang racket/base

(provide (struct-out lang-info)
         lang-info-grouping-position-is-racket?)

;; This is its own file really just so that hash-lang.bridge.rkt can
;; require it normally and not need to do more dynamic-requires.

(struct lang-info
  (module-language
   lexer
   paren-matches
   quote-matches
   grouping-position
   line-indenter
   range-indenter
   submit-predicate
   comment-delimiters)
  #:transparent #:authentic)

(define racket-grouping-position
  (with-handlers ([exn:fail? (λ _ #f)])
    (dynamic-require 'syntax-color/racket-navigation 'racket-grouping-position)))

(define (lang-info-grouping-position-is-racket? li)
  (equal? (lang-info-grouping-position li) racket-grouping-position))