Skip to content

peggy使用import引入编译后的peggy文件时的报错 (Error when peggy uses import to introduce compiled peggy files) #548

@cy-biggray

Description

@cy-biggray

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];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions