Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/tsdoc",
"comment": "Add new meanings to DeclarationReference and fix some parsing bugs",
"type": "patch"
}
],
"packageName": "@microsoft/tsdoc",
"email": "ron.buckton@microsoft.com"
}
46 changes: 19 additions & 27 deletions tsdoc/src/beta/DeclarationReference.grammarkdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ LineTerminator::
MeaningKeyword: one of
`class` // SymbolFlags.Class
`interface` // SymbolFlags.Interface
`typealias` // SymbolFlags.TypeAlias
`type` // SymbolFlags.TypeAlias
`enum` // SymbolFlags.Enum
`namespace` // SymbolFlags.Module
`function` // SymbolFlags.Function
`variable` // SymbolFlags.Variable
`var` // SymbolFlags.Variable
`constructor` // SymbolFlags.Constructor
`member` // SymbolFlags.ClassMember
`member` // SymbolFlags.ClassMember | SymbolFlags.EnumMember
`event` //
`enummember` // SymbolFlags.EnumMember
`signature` // SymbolFlags.Signature
`type` // Any complex type
`call` // SymbolFlags.Signature (for __call)
`new` // SymbolFlags.Signature (for __new)
`index` // SymbolFlags.Signature (for __index)
`complex` // Any complex type

Punctuator:: one of
`{` `}` `(` `)` `[` `]` `!` `.` `#` `~` `:` `,`
Expand Down Expand Up @@ -108,24 +109,14 @@ CodePoint::

Component::
String
ComponentAtoms
ComponentCharacters
`[` DeclarationReference `]`

ComponentAtoms::
ComponentAtom ComponentAtoms?
ComponentCharacters::
ComponentCharacter ComponentCharacters?

ComponentAtom::
ComponentCharacter::
SourceCharacter but not one of `"` or Punctuator or FutureReservedPunctuator or WhiteSpace or LineTerminator
BracketedComponent

BracketedComponent::
`[` BracketedAtoms `]`

BracketedAtoms::
BracketedAtom BracketedAtoms?

BracketedAtom::
String
ComponentAtom

//
// Syntactic Grammar
Expand All @@ -134,7 +125,7 @@ BracketedAtom::
// NOTE: The following grammar is incorrect as |SymbolReference| and |ModuleSource| have an
// ambiguous parse. The correct solution is to use a cover grammar to parse
// |SymbolReference| until we hit a `!` and then reinterpret the grammar.
Uid:
DeclarationReference:
[empty]
SymbolReference // Shorthand reference to symbol
ModuleSource `!` // Reference to a module
Expand All @@ -147,13 +138,14 @@ ModuleSource:
Component

SymbolReference:
Components Meaning?
ComponentPath Meaning?
Meaning

Components:
ComponentPath:
Component
Components `.` Component // Navigate via 'exports' of |Components|
Components `#` Component // Navigate via 'members' of |Components|
Components `~` Component // Navigate via 'locals' of |Components|
ComponentPath `.` Component // Navigate via 'exports' of |ComponentPath|
ComponentPath `#` Component // Navigate via 'members' of |ComponentPath|
ComponentPath `~` Component // Navigate via 'locals' of |ComponentPath|

Meaning:
`:` MeaningKeyword // Indicates the meaning of a symbol (i.e. ':class')
Expand Down
Loading