add square bracket notation

This commit is contained in:
Yuichi Nishiwaki 2013-11-11 11:57:01 +09:00
parent 8b484b69d7
commit 8c40fc8d9e
2 changed files with 8 additions and 1 deletions

View File

@ -43,7 +43,7 @@ void yylex_destroy();
pic_value datum;
}
%token tLPAREN tRPAREN tDOT tVPAREN
%token tLPAREN tRPAREN tLBRACKET tRBRACKET tDOT tVPAREN
%token tQUOTE tQUASIQUOTE tUNQUOTE tUNQUOTE_SPLICING
%token <i> tINT tBOOLEAN
%token <f> tFLOAT
@ -135,6 +135,10 @@ list
{
$$ = $2;
}
| tLBRACKET list_data tRBRACKET
{
$$ = $2;
}
;
list_data
@ -191,6 +195,7 @@ abbrev
incomplete_datum
: tLPAREN incomplete_data
| tLBRACKET incomplete_data
| tVPAREN incomplete_data
| incomplete_abbrev
;

View File

@ -44,6 +44,8 @@ infnan "+inf.0"|"-inf.0"|"+nan.0"|"-nan.0"
"." return tDOT;
"(" return tLPAREN;
")" return tRPAREN;
"[" return tLBRACKET;
"]" return tRBRACKET;
"#(" return tVPAREN;
"'" return tQUOTE;
"`" return tQUASIQUOTE;