This reverts commit
f071e095a2a8f76dd78becfa103b952af68e148d.
The reason why the underscores are needed in the first place is because
we want to make sure sequences and variants to not have clash between
fields called e.g. "stream" and the dynamic scope
"stream.event.header.". Therefore, we need to keep the leading
underscores as part of the internal identifier representation.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
fprintf(pos->fp, " ");
if (pos->print_names)
fprintf(pos->fp, "%s = ",
- g_quark_to_string(definition->name));
+ rem_(g_quark_to_string(definition->name)));
}
if (elem->id == CTF_TYPE_INTEGER) {
fprintf(pos->fp, " ");
if (pos->print_names)
fprintf(pos->fp, "%s = ",
- g_quark_to_string(definition->name));
+ rem_(g_quark_to_string(definition->name)));
field_nr_saved = pos->field_nr;
pos->field_nr = 0;
fprintf(pos->fp, " ");
if (pos->print_names)
fprintf(pos->fp, "%s = ",
- g_quark_to_string(definition->name));
+ rem_(g_quark_to_string(definition->name)));
fprintf(pos->fp, "%g", float_definition->value);
return 0;
fprintf(pos->fp, " ");
if (pos->print_names)
fprintf(pos->fp, "%s = ",
- g_quark_to_string(definition->name));
+ rem_(g_quark_to_string(definition->name)));
if (pos->string
&& (integer_declaration->encoding == CTF_STRING_ASCII
fprintf(pos->fp, " ");
if (pos->print_names)
fprintf(pos->fp, "%s = ",
- g_quark_to_string(definition->name));
+ rem_(g_quark_to_string(definition->name)));
}
if (elem->id == CTF_TYPE_INTEGER) {
fprintf(pos->fp, " ");
if (pos->print_names)
fprintf(pos->fp, "%s = ",
- g_quark_to_string(definition->name));
+ rem_(g_quark_to_string(definition->name)));
fprintf(pos->fp, "\"%s\"", string_definition->value);
return 0;
fprintf(pos->fp, " ");
if (pos->print_names && definition->name != 0)
fprintf(pos->fp, "%s = ",
- g_quark_to_string(definition->name));
+ rem_(g_quark_to_string(definition->name)));
if (pos->print_names || len > 1)
fprintf(pos->fp, "{");
}
fprintf(pos->fp, " ");
if (pos->print_names)
fprintf(pos->fp, "%s = ",
- g_quark_to_string(definition->name));
+ rem_(g_quark_to_string(definition->name)));
fprintf(pos->fp, "{");
}
pos->depth++;
__attribute__((unused));
static int input (yyscan_t yyscanner) __attribute__((unused));
-static inline
-const char *rem_(const char *str)
-{
- if (str[0] == '_')
- return &str[1];
- else
- return str;
-}
-
%}
%x comment_ml comment_sl string_lit char_const
[1-9]{DIGIT}*{INTEGER_SUFFIX}? setstring(yyextra, yylval, yytext); return DECIMAL_CONSTANT;
0{OCTALDIGIT}*{INTEGER_SUFFIX}? setstring(yyextra, yylval, yytext); return OCTAL_CONSTANT;
0[xX]{HEXDIGIT}+{INTEGER_SUFFIX}? setstring(yyextra, yylval, yytext); return HEXADECIMAL_CONSTANT;
-{IDENTIFIER} printf_debug("<IDENTIFIER %s>\n", yytext); setstring(yyextra, yylval, rem_(yytext)); if (is_type(yyextra, yytext)) return ID_TYPE; else return IDENTIFIER;
+{IDENTIFIER} printf_debug("<IDENTIFIER %s>\n", yytext); setstring(yyextra, yylval, yytext); if (is_type(yyextra, yytext)) return ID_TYPE; else return IDENTIFIER;
[ \t\n]+ ; /* ignore */
. return ERROR;
%%
*/
int print_field(struct definition *definition);
+static inline
+const char *rem_(const char *str)
+{
+ if (str[0] == '_')
+ return &str[1];
+ else
+ return str;
+}
+
#endif /* _BABELTRACE_CTF_TEXT_TYPES_H */