This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Canonical list of reserved words ?


"Daniel P. Berrange" <berrange@redhat.com> writes:

> We've had fairly frequent bugs in QEMU where generated tapsets contain
> variables clashing with systemd reserved words. [...]

>             for name in e.args.names():
>                 # Append underscore to reserved keywords
>                 if name in ('limit', 'in', 'next', 'self', 'function'):
>                     name += '_'
>                 out('  %s = $arg%d;' % (name, i))
>                 i += 1

Right, that's inconvenient.  Maybe prefix with them all with "q"?
("self" isn't a keyword fwiw.)


> To avoid this proper in future I'm looking for a full list of all
> systemtap reserved words. I've looked at the docs but not found a
> clear list yet, so can someone point me int he right direction

I don't see it in the docs, but the parser source code fesses up
thusly:

% grep keywords.insert parse.cxx
      keywords.insert("probe");
      keywords.insert("global");
      keywords.insert("function");
      keywords.insert("if");
      keywords.insert("else");
      keywords.insert("for");
      keywords.insert("foreach");
      keywords.insert("in");
      keywords.insert("limit");
      keywords.insert("return");
      keywords.insert("delete");
      keywords.insert("while");
      keywords.insert("break");
      keywords.insert("continue");
      keywords.insert("next");
      keywords.insert("string");
      keywords.insert("long");
      keywords.insert("try");
      keywords.insert("catch");


- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]