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

View File

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