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
  • !216

Refactor letstx

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/natefaubion/letstx-rw into master Jan 26, 2014
  • Overview 11
  • Commits 1
  • Pipelines 0
  • Changes 3

Created by: natefaubion

Fixes #215 (closed)

This is a complete rewrite of letstx that handles all sorts of edge cases. The primary problem with the previous letstx was that it immediately called return which means it couldn't be used in branches or loops. This rewrite avoids withSyntax and syntaxCase completely, and has a much simpler expansion. It mimics how let scope works, and can shadow pattern vars within an inner block without it affecting the outer pattern scope. The rewrite also has a nice consequence of allowing you to load multiple tokens into a pattern var without having to use a repeater, which is far more intuitive. Loading repeaters is still supported though for when you need it.

withSyntax should be considered deprecated, and will likely be removed with the 0.5.0 bump.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/natefaubion/letstx-rw