dignifiedquire / dignifiedquire/pegjs-coffee-plugin

Variables from actions not hoisted

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
34
Forks
6
PR merge metrics
No merged PRs in 30d

Description

I have a snippet like

```
/ name:[\.a-zA-Z]+ flag:flag? params:mparams? {
name = name.join('')
if Formatter['=#{name}']
params = (params or []).join(',')
return "this['=#{name}'](#{params})"
else
caseName = name.charAt(0).toLowerCase() + name.slice(1)
return "this.stripHTML(this.item['#{name}'] || this.item['#{caseName}'] || '')"
}
```

This generates javascript code that re-declares "name" and thereby blanks out the value passed in from the match (it used to work before porting it to coffeescript)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.