Skip to content

Align parser with quotes and splices spec #15009

Open
@nicolasstucki

Description

@nicolasstucki

The current implementation of the parser allows more than is needed. These are vestiges from the first versions of the system. Most of them should already emit an error or warning stating that the new syntax should be used. Now we need to tighten the rules to make sure they all emit errors.

SimpleExpr ::=  ...
             |  Quoted
             |  Splice
             |  ...

Pattern    ::=  ...
             |  Quoted
             |  ...

Quotes

Quotes come in four flavors: quoted identifiers, quoted blocks, quoted blocks patterns and quoted type patterns.

Quoted ::= `'` alphaid                     // quoted identifier
         |  `'` `{` Block `}`              // quoted block
         |  `'` `[` Type `]` if  inPattern // quoted type pattern

Splices

Splices come in three flavors: spliced identifiers, spliced blocks and splice patterns.

Splice ::=  `$` alphaid         if  inQuoteBlock    // spliced identifier
         |  `$` `{` Block `}`   if !inQuotePattern  // spliced block
         |  `$` `{` Pattern `}` if  inQuotePattern  // splice pattern

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions