Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S sweet-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • sweet-js
  • sweet-core
  • Issues
  • #717
Closed
Open
Issue created Jun 02, 2017 by Gabe Johnson@gabejohnsonContributor

Cannot use rest/spread operator in syntax template for all valid expressions

As noted #715

import { fromPunctuator } from 'sweet.js/helpers' for syntax;

syntax $$ = (ctx) => {
  var dummy = #`dummy`.get(0);
  return #`${fromPunctuator(dummy, '...')}${ctx}`;
};

function foo(args){}
foo( $$ [0] );

fails with Error: expecting a , punctuator [ 0 ], but

function foo(args){}
foo( ... [0] );

is fine.

Same with

let [$$ x] = [1]; // Error: unexpected token __x__

but this is fine

let x = [$$ [0]];

This may be related to #716. Hopefully it'll come out in the wash.

Assignee
Assign to
Time tracking