import { select,ident_part,from,__,_ } from '../../common/common.js';
// select.peggy:
selectStatement
= select _ colunm_clause:colunm_clause _ from _ table_name:table_name __ ';'{ return column_name=${colunm_clause}, table_name=${table_name}}
colunm_clause
= column_name
/ '*'
column_name
= name:ident_part* {return name.join("")}
这段代码,当引入的ident_part后有其他属性时就会报错。如果 name:ident_part {return name.join("")}就不会报错。
错误内容: Possible infinite loop when parsing (repetition used with an expression that may not consume any input);
// common.peggy
ident_part
= [A-Za-z0-9]
select
= 'select'i
from
= 'from'i
__ = whitespace*
_ = whitespace+
whitespace
= [ \t\r\n];