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

Infix progress

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/natefaubion/infix into master Dec 14, 2013
  • Overview 30
  • Commits 20
  • Pipelines 0
  • Changes 6

Created by: natefaubion

This is an ongoing PR to track the progress of infix macros. Please chime in at any point. I've broken it down into goals that I'll periodically update so you can see how far along it is:

  • Refactor the macro macro to translate infix rules into infix cases.
  • Refactor syntaxCase to understand the infix form and matching semantics.
  • Add "reverse" support to the pattern matcher (return a shallow-reversed pattern tree)
  • Plumb together enforest and expandTermTree to keep track of previous syntax/terms.
  • Plumb the previous syntax/terms into the macro transformers.
  • Rewrite enforestVarStatement so we can lookbehind match on var assignment
  • Fix withSyntax which is broken for some reason
  • Fix for-let enforestation/hygiene
  • Test cases

For the time being, I'm using the following form for infix macros because it's the easiest to parse (anything before the bar is lookbehind, anything after is business as usual):

macro foo {
  rule infix { $lhs | $rhs } => { ... }
  case infix { $lhs | $name $rhs } => { ... }
}

Another proposed forms for infix cases:

macro foo {
  rule infix { $lhs | $rhs } => { ... }
  case infix { $lhs |$name| $rhs } => { ... }
}

And @disnet liked the haskelly:

macro foo {
  rule infix { $lhs | $rhs } => { ... }
  case infix { $lhs `$name` $rhs } => { ... }
}
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/natefaubion/infix