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
  • #259
Closed
Open
Issue created Feb 19, 2014 by Administrator@rootContributor

Can't transcribe a repeater that contains delims more than once.

Created by: natefaubion

macro test {
  rule { ($foo ...) } => {
    var a = $foo ...;
    var b = $foo ...;
  }
}

test([1, 2, 3])
TypeError: Cannot read property 'inner' of undefined

This is because the same delim reference gets spit out twice. When expandTermTreeToFinal gets around to it the second time around, the inner tokens are already mutated into terms. It throws the error when calling expose (which obviously does not work with terms).

This could probably be fixed on either the expandTermTreeToFinal by not mutating, or on the transcribe side by deep cloning. I think the transcribe side would be simpler, but maybe there are more bugs lurking by mutating in expandTermTreeToFinal?

Assignee
Assign to
Time tracking