Skip to content

Commit

Permalink
Improve parse for module sources (#177)
Browse files Browse the repository at this point in the history
Improve parse for module sources
  • Loading branch information
octogonz authored Aug 7, 2019
2 parents 9555487 + c4bedf9 commit 21ca4d5
Show file tree
Hide file tree
Showing 4 changed files with 507 additions and 112 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/tsdoc",
"comment": "Improve DeclarationReference.parse for module sources",
"type": "patch"
}
],
"packageName": "@microsoft/tsdoc",
"email": "[email protected]"
}
19 changes: 13 additions & 6 deletions tsdoc/src/beta/DeclarationReference.grammarkdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Punctuator:: one of
`{` `}` `(` `)` `[` `]` `!` `.` `#` `~` `:` `,`

FutureReservedPunctuator:: one of
`{` `}`
`{` `}` `@`

NavigationPunctuator: one of
`.` // Navigate via 'exports' of symbol
Expand Down Expand Up @@ -107,6 +107,17 @@ Hex4Digits::
CodePoint::
> |HexDigits| but only if MV of |HexDigits| ≤ 0x10FFFF

// Represents the path for a module
ModuleSource::
String
ModuleSourceCharacters

ModuleSourceCharacters::
ModuleSourceCharacter ModuleSourceCharacters?

ModuleSourceCharacter::
SourceCharacter but not one of `"` or `!` or LineTerminator

Component::
String
ComponentCharacters
Expand All @@ -130,13 +141,9 @@ DeclarationReference:
SymbolReference // Shorthand reference to symbol
ModuleSource `!` // Reference to a module
ModuleSource `!` SymbolReference // Reference to an export of a module
ModuleSource `|` `~` SymbolReference // Reference to a local of a module
ModuleSource `!` `~` SymbolReference // Reference to a local of a module
`!` SymbolReference // Reference to global symbol

// Represents the path for a module
ModuleSource:
Component

SymbolReference:
ComponentPath Meaning?
Meaning
Expand Down
Loading

0 comments on commit 21ca4d5

Please sign in to comment.