Skip to content

Commit 906972c

Browse files
committed
ftdetect: Support #lang at-exp chains
Modifies the regular expression to ignore `at-exp` when present in the #lang statement, and use the next language in the chain. See documentation for #lang at-exp at https://docs.racket-lang.org/scribble/reader-internals.html#%28part._at-exp-lang%29
1 parent 32ad231 commit 906972c

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

ftdetect/racket.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let g:racket_hash_lang_regexp = '^#lang\s\+\([^][)(}{[:space:]]\+\)'
1+
let g:racket_hash_lang_regexp = '^#lang\s\+\%\(\<at-exp\>\s\+\)\?\([^][)(}{[:space:]]\+\)'
22
let g:racket_hash_lang_dict = get(g:, 'racket_hash_lang_dict',
33
\ {
44
\ 'racket/base': 'racket',

test/at-exp.rkt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#lang at-exp racket
2+
3+
(define (bar)
4+
"BAR")
5+
6+
(define (foo)
7+
(displayln @~a{Foo is a @(bar)}))
8+
9+
(foo)

0 commit comments

Comments
 (0)