On Thu, Nov 28, 2024 at 09:35:44PM +0800, Yang Jihong wrote:This indicates that integer expression is a subclass of constant expression, so integer is indented inside constant.
Support parsing of constant integer expression.
Signed-off-by: Yang Jihong <yangjihong@xxxxxxxxxxxxx>
---
tools/perf/util/parse-action.c | 52 ++++++++++++++++++++++++++++++++++
tools/perf/util/parse-action.h | 1 +
tools/perf/util/parse-action.l | 19 +++++++++++++
tools/perf/util/parse-action.y | 13 ++++++++-
4 files changed, 84 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/parse-action.c b/tools/perf/util/parse-action.c
index 391546bf3d73..3b10cf9f99b3 100644
--- a/tools/perf/util/parse-action.c
+++ b/tools/perf/util/parse-action.c
@@ -7,6 +7,7 @@
*
* Supported expressions:
* - constant:
+ * - integer
And now there are alignment differences and no : ?
Okay, will fix in next version.
*/
#include "util/debug.h"
@@ -118,7 +119,58 @@ void event_actions__free(void)
(void)event_actions__for_each_expr_safe(do_action_free, NULL, false);
}
+static int expr_const_int_new(struct evtact_expr *expr, void *data, int size)
+{
+ if (data == NULL ||
+ (size != sizeof(int)
+ && size != sizeof(long) && size != sizeof(long long))) {
&& should be at the end of the previous line, just like you did with the
|| at the end of the first line