Permalink
Browse files

Recognize lambda arguments in Scheme

Fixes #1078
  • Loading branch information...
isagalaev committed Feb 16, 2016
1 parent 8832abe commit 197f82a73d30f5ca4c3046d0dd3d840c46d8be00
Showing with 21 additions and 9 deletions.
  1. +19 −9 src/languages/scheme.js
  2. +1 −0 test/markup/scheme/lambda.expect.txt
  3. +1 −0 test/markup/scheme/lambda.txt
@@ -104,20 +104,30 @@ function(hljs) {
relevance: 0
};
var NAME = {
className: 'name',
begin: SCHEME_IDENT_RE,
lexemes: SCHEME_IDENT_RE,
keywords: BUILTINS
};
var LAMBDA = {
begin: /lambda/, endsWithParent: true, returnBegin: true,
contains: [
NAME,
{
begin: /\(/, end: /\)/, endsParent: true,
contains: [IDENT],
}
]
};
var LIST = {
variants: [
{ begin: '\\(', end: '\\)' },
{ begin: '\\[', end: '\\]' }
],
contains: [
{
className: 'name',
begin: SCHEME_IDENT_RE,
lexemes: SCHEME_IDENT_RE,
keywords: BUILTINS
},
BODY
]
contains: [LAMBDA, NAME, BODY]
};
BODY.contains = [LITERAL, NUMBER, STRING, IDENT, QUOTED_IDENT, LIST].concat(COMMENT_MODES);
@@ -0,0 +1 @@
(<span class="hljs-name"><span class="hljs-builtin-name">lambda</span></span> (x y z) (<span class="hljs-name"><span class="hljs-builtin-name">+</span></span> y z))
@@ -0,0 +1 @@
(lambda (x y z) (+ y z))

0 comments on commit 197f82a

Please sign in to comment.