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
  • Merge requests
  • !325

Add named pattern and escape groups

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/natefaubion/named-patt-groups into master May 18, 2014
  • Overview 1
  • Commits 2
  • Pipelines 0
  • Changes 6

Created by: natefaubion

This adds a new form to the pattern language for named groups. Where normal groups use the $(...) and $[...] forms, named groups use the $foo:(...) and $foo:[...] forms. The full syntax matched will be bound to the name. Additionally, if you decide to use names within the group, they will be concatenated with the group name, so $foo:($bar) will bind to $foo$bar in the template.

This addition also simplifies the implementation for identity rules, as now an identity rule is equivalent to rule { $id:(...) } => { $id }.

loadPattern was also refactored to return a pattern object directly instead of having syntaxCase and macroclass do it themselves in an extra step.

Fixes #319 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/natefaubion/named-patt-groups