diff options
Diffstat (limited to 'src/lisp')
-rw-r--r-- | src/lisp/lex.rs | 4 | ||||
-rw-r--r-- | src/lisp/std.lisp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lisp/lex.rs b/src/lisp/lex.rs index 5d3030b..2088421 100644 --- a/src/lisp/lex.rs +++ b/src/lisp/lex.rs | |||
@@ -120,8 +120,8 @@ impl<'a> Lexer<'a> { | |||
120 | while let Some((ind, chr)) = chars.next() { | 120 | while let Some((ind, chr)) = chars.next() { |
121 | let low = self.cur_pos; | 121 | let low = self.cur_pos; |
122 | let res = match chr { | 122 | let res = match chr { |
123 | '(' => Ok((1, Token::LeftParen)), | 123 | '(' | '[' => Ok((1, Token::LeftParen)), |
124 | ')' => Ok((1, Token::RightParen)), | 124 | ')' | ']' => Ok((1, Token::RightParen)), |
125 | '\'' => Ok((1, Token::Quote)), | 125 | '\'' => Ok((1, Token::Quote)), |
126 | '`' => Ok((1, Token::BackQuote)), | 126 | '`' => Ok((1, Token::BackQuote)), |
127 | ',' => match chars.next() { | 127 | ',' => match chars.next() { |
diff --git a/src/lisp/std.lisp b/src/lisp/std.lisp index 97c3984..2a042a0 100644 --- a/src/lisp/std.lisp +++ b/src/lisp/std.lisp | |||
@@ -47,7 +47,7 @@ | |||
47 | (define (product ls) (fold 1 * ls)) | 47 | (define (product ls) (fold 1 * ls)) |
48 | 48 | ||
49 | (define (enumerate start stop step) | 49 | (define (enumerate start stop step) |
50 | (if (> start stop) | 50 | (if (>= start stop) |
51 | '() | 51 | '() |
52 | (cons start | 52 | (cons start |
53 | (enumerate (+ start step) stop step)))) | 53 | (enumerate (+ start step) stop step)))) |