feat(pbs): support quoted project imports and installed authoring contracts
This commit is contained in:
@@ -234,10 +234,27 @@ Imports target modules, never files.
|
||||
ImportDecl ::= 'import' ( ModuleRef | '{' ImportList '}' 'from' ModuleRef ) ';'
|
||||
ImportList ::= ImportItem (',' ImportItem)*
|
||||
ImportItem ::= Identifier ('as' Identifier)?
|
||||
ModuleRef ::= '@' Identifier ':' ModulePath
|
||||
ModuleRef ::= '@' ProjectName ':' ModulePath
|
||||
ProjectName ::= Identifier | StringLiteral
|
||||
ModulePath ::= Identifier ('/' Identifier)*
|
||||
```
|
||||
|
||||
`StringLiteral` here is the ordinary double-quoted string from section 4, with
|
||||
only the existing `\\`, `\"`, `\n`, `\r` and `\t` escapes. Text blocks and
|
||||
expressions are not project names. The decoded value must be nonblank and
|
||||
identifies the exact manifest project name; delimiters do not become identity.
|
||||
|
||||
```pbs
|
||||
import { Inventory } from @"zelda-1":inventory;
|
||||
import { Collision } from @"physics-2d":collision;
|
||||
```
|
||||
|
||||
This alternative applies to both module and named imports. Existing identifier
|
||||
imports remain valid. Quoting is limited to the project segment: module paths
|
||||
retain identifier segments. Unquoted `@zelda-1:inventory` is malformed; use
|
||||
`@"zelda-1":inventory`. Quoting does not create a universal current-project alias.
|
||||
See specification 5 for exact identity and reserved-space resolution.
|
||||
|
||||
### 6.1.1 Attributes
|
||||
|
||||
Attributes are bracketed compile-time metadata forms.
|
||||
|
||||
Reference in New Issue
Block a user