mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 11:55:30 +00:00
Fixed crash problem with ast.
This commit is contained in:
parent
0e70fc94f8
commit
5a09846a15
4
peglib.h
4
peglib.h
@ -1958,14 +1958,14 @@ inline constexpr unsigned int operator "" _(const char* s, size_t) {
|
||||
struct Ast
|
||||
{
|
||||
Ast(const char* path, size_t line, size_t column, const char* name, const std::vector<std::shared_ptr<Ast>>& nodes)
|
||||
: path(path), line(line), column(column), name(name), original_name(name), is_token(false), nodes(nodes)
|
||||
: path(path ? path : ""), line(line), column(column), name(name), original_name(name), is_token(false), nodes(nodes)
|
||||
#ifdef PEGLIB_HAS_CONSTEXPR_SUPPORT
|
||||
, tag(str2tag(name)), original_tag(tag)
|
||||
#endif
|
||||
{}
|
||||
|
||||
Ast(const char* path, size_t line, size_t column, const char* name, const std::string& token)
|
||||
: path(path), line(line), column(column), name(name), original_name(name), is_token(true), token(token)
|
||||
: path(path ? path : ""), line(line), column(column), name(name), original_name(name), is_token(true), token(token)
|
||||
#ifdef PEGLIB_HAS_CONSTEXPR_SUPPORT
|
||||
, tag(str2tag(name)), original_tag(tag)
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user