You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been struglling for the whole day to parse comments. The basic syntax is the following:
COMMENT = { "//" ~ (!"\n" ~ ANY)* | "/" ~ (!"/" ~ ANY)* ~ "*/" }
// C/C++ field
struct_field = { type_ ~ name ~ ("=" ~ expression) ? ~ ";" ~ DUMMY_RULE? }
But I came accross two problems and don't know how to solve them:
Without DUMMY_RULE, the "struct_field" rule does not get the comment in its inner pairs. The comment go to the struct rule instead.
With DUMMY_RULE, "struct_field" captures comment on the following line too.
Is there are an easy way to avoid the two problems? Any help is appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have been struglling for the whole day to parse comments. The basic syntax is the following:
COMMENT = { "//" ~ (!"\n" ~ ANY)* | "/" ~ (!"/" ~ ANY)* ~ "*/" }
// C/C++ field
struct_field = { type_ ~ name ~ ("=" ~ expression) ? ~ ";" ~ DUMMY_RULE? }
But I came accross two problems and don't know how to solve them:
Is there are an easy way to avoid the two problems? Any help is appreciated.
Beta Was this translation helpful? Give feedback.
All reactions