Jira (PUP-9325) incorrect compiler error while

3 views
Skip to first unread message

Ben Ford (JIRA)

unread,
Nov 20, 2018, 3:44:02 PM11/20/18
to puppe...@googlegroups.com
Ben Ford created an issue
 
Puppet / Bug PUP-9325
incorrect compiler error while
Issue Type: Bug Bug
Assignee: Unassigned
Components: Compiler
Created: 2018/11/20 12:43 PM
Priority: Normal Normal
Reporter: Ben Ford

This manifest should not compile due to the site keyword, but instead it warns about class. This is super confusing to the end user.

✔ ~ (2.5.1@puppet)
12:39 $ cat init.pp
class site inherits ::site::params {
}
✔ ~ (2.5.1@puppet)
12:37 $ puppet parser validate init.pp
Error: Could not parse for environment production: 'class' keyword not allowed at this location (file: /Users/ben/tmp/init.pp, line: 1, column: 1)

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Ben Ford (JIRA)

unread,
Nov 20, 2018, 3:46:02 PM11/20/18
to puppe...@googlegroups.com
Ben Ford updated an issue
Change By: Ben Ford
[This manifest|https://github.com/nrvale0/puppet-site/blob/master/manifests/init.pp] should not compile due to the {{site}} keyword, but instead it warns about {{class}}. This is super confusing to the end user.

{code}
✔ ~ (2.5.1@puppet)
12:39 $ cat init.pp
class site inherits ::site::params {
}
✔ ~ (2.5.1@puppet)
12:37 $ puppet parser validate init.pp
Error: Could not parse for environment production: 'class' keyword not allowed at this location (file: /Users/ben/
tmp/
init.pp, line: 1, column: 1)
{code}

Henrik Lindberg (JIRA)

unread,
Nov 20, 2018, 5:43:02 PM11/20/18
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-9325
 
Re: incorrect compiler error while

Don't know what we can do about that - it is like writing class if or any other combination of class and a keyword - it is just nonsense to the parser. I understand that site may not be as well known as a keyword and therefore special. What is happening is that parser sees class and that there is no valid path forward with the grammar of puppet given the next token site (in this case) - It therefore gives up and says "I got as far as class, but there is no way that class keyword makes sense here".

Maybe it is enough to tweak the error message, but it will not be able to do anything special for site. And what could possibly be done with the error message depends on the exact circumstances under which the error in question is detected and reported - there maybe other situations - and the error message may be vague on purpose because it kind of does not know enough to say more.

Josh Cooper (JIRA)

unread,
Nov 26, 2018, 12:34:03 PM11/26/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Server

Josh Cooper (JIRA)

unread,
Nov 26, 2018, 12:34:03 PM11/26/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sub-team: Language

Henrik Lindberg (JIRA)

unread,
May 9, 2019, 9:11:03 AM5/9/19
to puppe...@googlegroups.com

Closing this as "app orchestration" syntax will be deprecated and removed - and thus site will no longer be a keyword.

Reply all
Reply to author
Forward
0 new messages