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

Implementation of Syntax-param in sweet.js

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/VimalKumarS/master into master Oct 16, 2014
  • Overview 15
  • Commits 17
  • Pipelines 0
  • Changes 9

Created by: VimalKumarS

Hello,

File updated - Parser.js / Pattern.js File added - Test1/Test2/test3.js and Debug-syntax.js Syntax param example

macro aif {
    case {
        $aif_name  
        ($cond ...) {$tru ...} else { $els ... }

    } => {
     SyntaxParameter(it, $cond ... , aif ,
        return #
      {
            (function () {
                 if ($cond ...) {
                    $tru ...
                } else {
                    $els ...
                }
            })

        })
    }
}



macro unless {
    case { 
      $unless_name 
      ($cond ...) { $body ...} } => {
 return #{
        while (true) {
            aif ($cond ...) {
                // `it` is correctly bound by `aif`
                console.log("loop finished at: " + it);
                            } else {
                $body ...
            }
        }}
    }
}

x=2
unless (x) {
    console.log(it)
}

Please review once, let me know if this break the current working, or if have any example that fails.

thanks Vimal

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/VimalKumarS/master