Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
reserve square brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
nyuichi committed Jan 26, 2015
1 parent 684cbc5 commit f965798
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions extlib/benz/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,7 @@ read_blob(pic_state *pic, struct pic_port *port, int c)
static pic_value
read_pair(pic_state *pic, struct pic_port *port, int c)
{
const int tOPEN = c;
const int tCLOSE = (c == '(') ? ')' : ']';
static const int tCLOSE = ')';
pic_value car, cdr;

retry:
Expand Down Expand Up @@ -564,7 +563,7 @@ read_pair(pic_state *pic, struct pic_port *port, int c)
goto retry;
}

cdr = read_pair(pic, port, tOPEN);
cdr = read_pair(pic, port, '(');
return pic_cons(pic, car, cdr);
}
}
Expand All @@ -586,7 +585,7 @@ read_label_set(pic_state *pic, struct pic_port *port, int i)
int c;

switch ((c = skip(port, ' '))) {
case '(': case '[':
case '(':
{
pic_value tmp;

Expand Down Expand Up @@ -749,7 +748,6 @@ reader_table_init(struct pic_reader *reader)
reader->table['+'] = read_plus;
reader->table['-'] = read_minus;
reader->table['('] = read_pair;
reader->table['['] = read_pair;
reader->table['#'] = read_dispatch;

/* read number */
Expand Down

0 comments on commit f965798

Please sign in to comment.