atom / language-puppet

Puppet package for Atom
Other
36 stars 31 forks source link

Allows variables starting with underscores #34

Closed petems closed 8 years ago

winstliu commented 8 years ago

One more question: Does Puppet allow variables such as $_woo__?

petems commented 8 years ago

@50Wliu Yep, that's valid

$_woo__='hello'
notice($_woo__)

Notice: Scope(Class[main]): hello
winstliu commented 8 years ago

Can variables not start with uppercase letters?

petems commented 8 years ago

In Puppet 4, the official regex as given by the parser: Error: Illegal variable name, The given name 'Woo' does not conform to the naming rule /^((::)?[a-z]\w*)*((::)?[a-z_]\w*)$/ at /Users/petersouter/echo.pp:1:1

In older puppet its possible but linters will complain,

winstliu commented 8 years ago

Wow, that's pretty awesome how it gives you the regex right in the error message. Just waiting on Travis now... :watch: :sleeping: