Skip to content

Commit 14731db

Browse files
committed
Make the CDDL naming more consistent
This introduces the following rules for naming in CDDL productions: * Any production associated with a module has a name starting with the name of a module and a `.` i.e. all names are `module.Foo`. * The first character of all productions, after the `.`, if any, is always uppercase. * The name of productions defining commands match the method name of the command exactly, except for the case of the character after the `.`. * The name of productions defining events match the method name of the event exactly, except for the case of the character after the `.`. * The name of productions defining "defined" types (i.e. those with their own subsection in a module) match the name of the type exactly. * The name of productions defining results (which are not "defined" types) use the name of the command production plus the suffix `Result` i.e. a command with method `module.foo` has a result production named `module.FooResult`. * The name of productions defining command or event parameters (which are not "defined" types) use the name of the command production plus the suffix `Parameters` i.e. a command with method `module.foo` has a parameters production named `module.FooParameters`. This is somewhat verbose as CDDL doesn't have the explicit concept of namespaces, so the full rule name including the module prefix has to be used everywhere. But it's also much more consistent than what we had before with some mixture of module-prefixed and unprefixed names. Currently this doesn't change productions that live outside modules. In the future we should move the Common Data Types section into the script module, and update the types accordingly. We also don't have a way to distinguish "private" productions that should only be used inside a specific module from "public" ones that are suitable for use across modules. We could consider making such a distinction if it will be helpful.
1 parent 7dd07b6 commit 14731db

File tree

1 file changed

+369
-340
lines changed

1 file changed

+369
-340
lines changed

0 commit comments

Comments
 (0)