bartavelle / language-puppet

A library to work with Puppet manifests, test them and eventually replace everything ruby.
BSD 3-Clause "New" or "Revised" License
51 stars 8 forks source link

Datatype parsing error in puppetlabs-postgresql #227

Closed PierreR closed 6 years ago

PierreR commented 6 years ago

The parser is failing on this line .

with:

x puppet.foreman.dev: ./modules/postgresql/manifests/server/grant.pp:73:9:
unexpected 'P'
expecting '}'
 at # SourcePos {sourceName = "./modules/postgresql/manifests/server/database_grant.pp", sourceLine = Pos 10, sourceColumn = Pos 31}

I guess this is such a case ...

PierreR commented 6 years ago

PS: the parser will also fail before that error in this line

bartavelle commented 6 years ago

Now there can be arbitrary expressions in data type declarations? How nice :(

PierreR commented 6 years ago

For the second error, I can easily fork the module and remove the assert_type line. The first one looks more like a bug.

bartavelle commented 6 years ago

Ideally both should be supported.

bartavelle commented 6 years ago

The Pattern failure is yet another puppet-ism :( According to the docs there should be a list of regular expressions, but apparently this is accepted :/

bartavelle commented 6 years ago

They do the right thing at line 5 anyway. This is really annoying.

bartavelle commented 6 years ago

I just pushed a dirty fix, that I did not test. Hopefully it will work.

PierreR commented 6 years ago

It is working nicely so far. Thanks !