Language: 2.2 Spec Missing Reference to Rule `libraryDefinition`

Created on 9 Jan 2020  路  5Comments  路  Source: dart-lang/language

Source Document: https://dart.dev/guides/language/specifications/DartLangSpec-v2.2.pdf
Page: 166

There is a definition for the rule libraryDefinition but it isn't referenced anywhere so it isn't defined where these rules can appear.

bug

All 5 comments

Thanks for reporting this! However, <libraryDefinition> is a non-terminal that derives a library, that is, this is the top level non-terminal (also known as the 'start symbol' of the grammar), so it's a quite typical situation that such a non-terminal doesn't occur on any right hand sides in the grammar. There is one more start symbol, <partDeclaration>, and it also doesn't occur on any right-hand sides. So I'll close this issue noting that it is actually specified as intended.

PS: Note that the bleeding edge specification is a better place to look for the current rules: https://spec.dart.dev/DartLangSpecDraft.pdf, https://github.com/dart-lang/language/blob/master/specification/dartLangSpec.tex.

Thanks, can I ask how is it defined as a "top level non-terminal"?

That was never described explicitly, but it's a reasonable thing to have. I created https://github.com/dart-lang/language/pull/773 to fix that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

har79 picture har79  路  5Comments

ShivamArora picture ShivamArora  路  3Comments

leafpetersen picture leafpetersen  路  3Comments

creativecreatorormaybenot picture creativecreatorormaybenot  路  3Comments

panthe picture panthe  路  4Comments