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
  • #315
Closed
Open
Issue created May 07, 2014 by Administrator@rootContributor

Repeat groups are dropped when transcribing if non-scalar is empty

Created by: natefaubion

macro test {
  rule { { $($name ($args (,) ...)) ... } } => {
    $(function $name ($args (,) ...) {}) ...
  }
}

test {
  foo(a, b)
  bar()
}
function foo(a, b) {
}

You'll notice bar is dropped completely. This is because of patterns.hasMatch and if (allHaveMatch) { ... } in patterns.transcribe. The repeater is empty (so the pattern succeeds), but hasMatch does not consider an empty match set a success when transcribing. Since the allHaveMatch guard only handles the success case, entire repeat groups can be dropped silently. I suppose hasMatch should be smarter.

Assignee
Assign to
Time tracking