Skip to content

Scheme strings not highlighted inside define #7

@dcecile

Description

@dcecile

GitHub uses this TextMate bundle for Scheme highlighting, and in the following code, the string is not highlighted:

(define (x) "test")

In general, any expressions directly in the body of (define (...) ...) should get highlighted the same as in the body of (begin ...):

(begin
  ; Comment
  "string"
  'symbol
  ' symbol
  #t
  #f
  1234
  -1234.0e1234
  0x09AF
  0b010101
  #\space
  #\x0A
  #\a
  '())

(define (x)
  ; Comment
  "string"
  'symbol
  ' symbol
  #t
  #f
  1234
  -1234.0e1234
  0x09AF
  0b010101
  #\space
  #\x0A
  #\a
  '())

On the TextMate manual page for language grammars, the following snippet is suggested for parentheses nesting:

{  begin = '\('; end = '\)'; patterns = (
      { include = "$self"; }
   );
}

This Scheme syntax grammar does not currently include $self for the body of (define (...) ...), but it instead includes an incomplete list of expression types: #comment, #sexp, and #illegal (#string is missing). By changing this to simply $self, these kinds of problems can be avoided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions