From 8c40fc8d9e5c74d3519228e9c7fe4562c2c57530 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 11 Nov 2013 11:57:01 +0900 Subject: [PATCH] add square bracket notation --- src/parse.y | 7 ++++++- src/scan.l | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parse.y b/src/parse.y index 47f59434..3280ab6b 100644 --- a/src/parse.y +++ b/src/parse.y @@ -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 tINT tBOOLEAN %token 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 ; diff --git a/src/scan.l b/src/scan.l index e326fa9e..94294f62 100644 --- a/src/scan.l +++ b/src/scan.l @@ -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;