Fixing #544 -- there is now an --ignoreimport option for commit hooks.

git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2302 980ebf18-57e1-0310-9a29-db15c13687c0
This commit is contained in:
luke 2007-03-19 01:19:09 +00:00
Родитель a212ea748f
Коммит a2a9d93fd3
5 изменённых файлов: 510 добавлений и 429 удалений

Просмотреть файл

@ -1,4 +1,9 @@
0.22.2 (grover)
Added 'ignoreimport' setting for use in commit hooks. This causes the
parser to ignore import statements so a single file can be parse-checked. (#544)
Import statements can now specify multiple comma-separated arguments.
Definitions now support both 'name' and 'title', just like any other
resource type. (#539)

Просмотреть файл

@ -111,7 +111,10 @@ module Puppet
@oldlibdir = value
$: << value
end
}
},
:ignoreimport => [false, "A parameter that can be used in commit
hooks, since it enables you to parse-check a single file rather
than requiring that all files exist."]
)
# Define the config default.

Просмотреть файл

@ -447,54 +447,18 @@ selectlhand: name
result = ast AST::Default, :value => val[0]
}
import: IMPORT quotedtext {
# importing files
# yuk, i hate keywords
# we'll probably have to have some kind of search path eventually
# but for now, just use a path relative to the file doing the importing
dir = @lexer.file.sub(%r{[^/]+$},'').sub(/\/$/, '')
if dir == ""
dir = "."
end
result = ast AST::ASTArray
# These are only used for importing, and we don't interpolate there.
qtexts: quotedtext { result = [val[0].value] }
| qtexts COMMA quotedtext {
results = val[0] << val[2].value
}
# We can't interpolate at this point since we don't have any
# scopes set up. Warn the user if they use a variable reference
pat = val[1].value
if pat.index("$")
Puppet.warning(
"The import of #{pat} contains a variable reference;" +
" variables are not interpolated for imports " +
"in file #{@lexer.file} at line #{@lexer.line}"
)
end
files = Puppet::Module::find_manifests(pat, dir)
if files.size == 0
raise Puppet::ImportError.new("No file(s) found for import " +
"of '#{pat}'")
import: IMPORT qtexts {
val[1].each do |file|
import(file)
end
files.each { |file|
parser = Puppet::Parser::Parser.new(interp)
parser.files = self.files
Puppet.debug("importing '%s'" % file)
unless file =~ /^#{File::SEPARATOR}/
file = File.join(dir, file)
end
begin
parser.file = file
rescue Puppet::ImportError
Puppet.warning(
"Importing %s would result in an import loop" %
File.join(dir, file)
)
next
end
# This will normally add code to the 'main' class.
parser.parse
}
result = AST::ASTArray.new(:children => [])
}
# Disable definition inheritance for now. 8/27/06, luke
@ -712,6 +676,61 @@ def file=(file)
end
end
# Import our files.
def import(file)
if Puppet[:ignoreimport]
return AST::ASTArray.new(:children => [])
end
# use a path relative to the file doing the importing
if @lexer.file
dir = @lexer.file.sub(%r{[^/]+$},'').sub(/\/$/, '')
else
dir = "."
end
if dir == ""
dir = "."
end
result = ast AST::ASTArray
# We can't interpolate at this point since we don't have any
# scopes set up. Warn the user if they use a variable reference
pat = file
if pat.index("$")
Puppet.warning(
"The import of #{pat} contains a variable reference;" +
" variables are not interpolated for imports " +
"in file #{@lexer.file} at line #{@lexer.line}"
)
end
files = Puppet::Module::find_manifests(pat, dir)
if files.size == 0
raise Puppet::ImportError.new("No file(s) found for import " +
"of '#{pat}'")
end
files.collect { |file|
parser = Puppet::Parser::Parser.new(interp)
parser.files = self.files
Puppet.debug("importing '%s'" % file)
unless file =~ /^#{File::SEPARATOR}/
file = File.join(dir, file)
end
begin
parser.file = file
rescue Puppet::ImportError
Puppet.warning(
"Importing %s would result in an import loop" %
File.join(dir, file)
)
next
end
# This will normally add code to the 'main' class.
parser.parse
}
end
def initialize(interpreter)
@interp = interpreter
initvars()

Просмотреть файл

@ -29,7 +29,7 @@ module Puppet
class Parser < Racc::Parser
module_eval <<'..end grammar.ra modeval..id83a5f213ec', 'grammar.ra', 639
module_eval <<'..end grammar.ra modeval..id729500608d', 'grammar.ra', 603
require 'puppet/parser/functions'
attr_reader :file, :interp
@ -106,6 +106,61 @@ def file=(file)
end
end
# Import our files.
def import(file)
if Puppet[:ignoreimport]
return AST::ASTArray.new(:children => [])
end
# use a path relative to the file doing the importing
if @lexer.file
dir = @lexer.file.sub(%r{[^/]+$},'').sub(/\/$/, '')
else
dir = "."
end
if dir == ""
dir = "."
end
result = ast AST::ASTArray
# We can't interpolate at this point since we don't have any
# scopes set up. Warn the user if they use a variable reference
pat = file
if pat.index("$")
Puppet.warning(
"The import of #{pat} contains a variable reference;" +
" variables are not interpolated for imports " +
"in file #{@lexer.file} at line #{@lexer.line}"
)
end
files = Puppet::Module::find_manifests(pat, dir)
if files.size == 0
raise Puppet::ImportError.new("No file(s) found for import " +
"of '#{pat}'")
end
files.collect { |file|
parser = Puppet::Parser::Parser.new(interp)
parser.files = self.files
Puppet.debug("importing '%s'" % file)
unless file =~ /^#{File::SEPARATOR}/
file = File.join(dir, file)
end
begin
parser.file = file
rescue Puppet::ImportError
Puppet.warning(
"Importing %s would result in an import loop" %
File.join(dir, file)
)
next
end
# This will normally add code to the 'main' class.
parser.parse
}
end
def initialize(interpreter)
@interp = interpreter
initvars()
@ -199,7 +254,7 @@ end
# $Id$
..end grammar.ra modeval..id83a5f213ec
..end grammar.ra modeval..id729500608d
##### racc 1.4.5 generates ###
@ -323,103 +378,105 @@ racc_reduce_table = [
1, 105, :_reduce_none,
1, 105, :_reduce_none,
1, 105, :_reduce_118,
2, 61, :_reduce_119,
6, 63, :_reduce_120,
5, 63, :_reduce_121,
6, 64, :_reduce_122,
5, 64, :_reduce_123,
6, 65, :_reduce_124,
5, 65, :_reduce_125,
1, 109, :_reduce_119,
3, 109, :_reduce_120,
2, 61, :_reduce_121,
6, 63, :_reduce_122,
5, 63, :_reduce_123,
6, 64, :_reduce_124,
5, 64, :_reduce_125,
6, 65, :_reduce_126,
5, 65, :_reduce_127,
1, 75, :_reduce_none,
1, 75, :_reduce_none,
1, 111, :_reduce_none,
3, 111, :_reduce_129,
1, 113, :_reduce_none,
1, 113, :_reduce_none,
1, 113, :_reduce_none,
0, 53, :_reduce_133,
0, 114, :_reduce_134,
1, 109, :_reduce_none,
3, 109, :_reduce_136,
3, 109, :_reduce_137,
1, 115, :_reduce_none,
3, 115, :_reduce_139,
3, 116, :_reduce_140,
1, 116, :_reduce_141,
3, 116, :_reduce_142,
1, 116, :_reduce_143,
1, 112, :_reduce_none,
2, 112, :_reduce_145,
3, 112, :_reduce_131,
1, 114, :_reduce_none,
1, 114, :_reduce_none,
1, 114, :_reduce_none,
0, 53, :_reduce_135,
0, 115, :_reduce_136,
1, 110, :_reduce_none,
2, 110, :_reduce_147,
1, 117, :_reduce_none,
1, 117, :_reduce_none,
3, 110, :_reduce_138,
3, 110, :_reduce_139,
1, 116, :_reduce_none,
3, 116, :_reduce_141,
3, 117, :_reduce_142,
1, 117, :_reduce_143,
3, 117, :_reduce_144,
1, 117, :_reduce_145,
1, 113, :_reduce_none,
2, 113, :_reduce_147,
1, 111, :_reduce_none,
2, 111, :_reduce_149,
1, 118, :_reduce_none,
1, 118, :_reduce_none,
1, 72, :_reduce_152,
3, 93, :_reduce_153,
2, 93, :_reduce_154,
1, 119, :_reduce_none,
1, 119, :_reduce_none,
1, 72, :_reduce_154,
3, 93, :_reduce_155,
2, 93, :_reduce_156,
1, 97, :_reduce_none,
1, 97, :_reduce_none,
0, 79, :_reduce_none,
1, 79, :_reduce_158 ]
1, 79, :_reduce_160 ]
racc_reduce_n = 159
racc_reduce_n = 161
racc_shift_n = 260
racc_shift_n = 263
racc_action_table = [
49, 51, 53, 41, -126, 51, 53, 51, 53, 51,
53, 186, 49, 95, 58, 230, 58, 63, 51, 53,
46, 43, 58, 33, 115, 168, 154, 106, 229, -113,
4, 45, 115, 74, 161, 45, 55, 45, 92, 45,
97, 188, 55, 47, 97, 44, 190, 47, 45, 47,
37, 47, 65, 69, 151, 152, 75, 63, 51, 53,
33, 109, 186, 63, 51, 53, 112, 4, 79, 63,
51, 53, 80, 74, 214, 63, 51, 53, 193, 74,
156, 63, 51, 53, 38, 74, 185, 39, 45, 155,
188, 74, 65, 69, 45, 190, 75, 74, 65, 69,
45, 195, 75, -113, 65, 69, 45, -112, 75, 185,
65, 69, 45, -115, 75, 96, 65, 69, 165, 244,
75, 63, 51, 53, -114, 202, 45, 63, 51, 53,
197, 97, -112, 63, 51, 53, -113, 74, 183, 63,
51, 53, 116, 74, 111, 63, 51, 53, -116, 74,
151, 152, 45, 51, 53, 74, 65, 69, 45, 49,
75, 138, 65, 69, 45, 79, 75, 49, 65, 69,
45, -115, 75, 115, 65, 69, 45, 215, 75, 238,
65, 172, 221, 110, 75, 63, 51, 53, 33, 220,
18, 63, 51, 53, 109, 4, -114, 37, 51, 53,
15, 74, 21, 25, 222, 1, 5, 138, 8, 120,
13, 79, 17, 138, 26, 225, 45, 4, 237, 226,
65, 69, 45, 159, 75, 228, 65, 135, 45, 18,
75, 38, 65, 172, 39, 145, 75, 231, 147, 15,
158, 21, 25, 96, 1, 5, 80, 8, 18, 13,
233, 17, 120, 26, 45, 235, 4, -117, 15, 97,
21, 25, 259, 1, 5, 90, 8, 87, 13, 185,
17, 96, 26, 18, 157, 4, -112, 33, 151, 152,
142, 250, 45, 15, 4, 21, 25, 97, 1, 5,
96, 8, 18, 13, -115, 17, -114, 26, 51, 53,
4, 45, 15, -117, 21, 25, 97, 1, 5, 240,
8, 86, 13, 138, 17, 117, 26, 245, 255, 4,
51, 53, 164, 148, 219, 83, 165, 167, 45, 18,
122, 141, 65, 172, 81, 138, 75, 51, 53, 15,
185, 21, 25, 252, 1, 5, 253, 8, 120, 13,
45, 17, 138, 26, 65, 172, 4, 258, 75, -158,
124, 120, 32, 227, nil, nil, nil, 45, 18, nil,
nil, 65, 172, nil, nil, 75, 212, nil, 15, nil,
49, 51, 53, 41, -128, 51, 53, 51, 53, 51,
53, 188, 58, 96, 49, 110, 58, 63, 51, 53,
46, 43, 58, 33, 116, 170, 156, 107, 217, 88,
4, 45, 163, 74, 116, 45, 55, 45, 93, 45,
98, 191, 55, 47, 98, 44, 192, 47, 45, 47,
36, 47, 65, 69, 153, 154, 75, 63, 51, 53,
33, 233, 187, 63, 51, 53, 113, 4, 79, 63,
51, 53, 80, 74, 232, 63, 51, 53, 187, 74,
158, 63, 51, 53, 38, 74, 196, 39, 45, 157,
191, 74, 65, 69, 45, 192, 75, 74, 65, 69,
45, 187, 75, 198, 65, 69, 45, -113, 75, -112,
65, 69, 45, 185, 75, 97, 65, 69, 51, 53,
75, 63, 51, 53, -115, 205, 45, 63, 51, 53,
-114, 98, 200, 63, 51, 53, -112, 74, -113, 63,
51, 53, 117, 74, -115, 63, 51, 53, 112, 74,
153, 154, 45, 167, 247, 74, 65, 69, 45, -116,
75, 140, 65, 69, 45, 49, 75, 79, 65, 69,
45, 49, 75, -114, 65, 69, 45, 116, 75, 241,
65, 174, 33, 218, 75, 63, 51, 53, 224, 4,
18, 63, 51, 53, 111, 223, 110, 36, 51, 53,
15, 74, 21, 25, 79, 1, 5, 140, 8, 225,
13, 121, 17, 140, 26, 161, 45, 4, 240, 228,
65, 69, 45, 160, 75, 230, 65, 137, 45, 18,
75, 38, 65, 174, 39, 147, 75, 234, 148, 15,
231, 21, 25, 97, 1, 5, -117, 8, 18, 13,
80, 17, 236, 26, 45, 121, 4, 238, 15, 98,
21, 25, 262, 1, 5, 118, 8, 91, 13, 188,
17, 97, 26, 18, 166, 4, -113, 33, 167, 169,
144, 253, 45, 15, 4, 21, 25, 98, 1, 5,
97, 8, 18, 13, -112, 17, -115, 26, 51, 53,
4, 45, 15, -114, 21, 25, 98, 1, 5, -117,
8, 243, 13, 140, 17, 87, 26, 150, 258, 4,
51, 53, 159, 248, 222, 123, 153, 154, 45, 18,
51, 53, 65, 174, 84, 140, 75, 51, 53, 15,
143, 21, 25, 121, 1, 5, 81, 8, 187, 13,
45, 17, 140, 26, 65, 174, 4, 261, 75, 255,
256, 126, -160, 121, 124, 32, 229, 45, 18, nil,
nil, 65, 174, nil, nil, 75, 215, nil, 15, nil,
21, 25, nil, 1, 5, nil, 8, 18, 13, nil,
17, nil, 26, 51, 53, 4, nil, 15, nil, 21,
25, nil, 1, 5, nil, 8, nil, 13, 138, 17,
25, nil, 1, 5, nil, 8, nil, 13, 140, 17,
nil, 26, nil, nil, 4, 51, 53, 51, 53, nil,
175, nil, nil, 45, nil, nil, nil, 65, 172, nil,
138, 75, 138, 200, nil, nil, nil, nil, nil, nil,
177, nil, nil, 45, nil, nil, nil, 65, 174, nil,
140, 75, 140, 203, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, 18, 45, nil, 45, nil, 65,
172, 65, 172, 75, 15, 75, 21, 25, 198, 1,
174, 65, 174, 75, 15, 75, 21, 25, 201, 1,
5, nil, 8, nil, 13, nil, 17, nil, 26, 18,
nil, 4, nil, 51, 53, nil, nil, nil, nil, 15,
nil, 21, 25, nil, 1, 5, nil, 8, 138, 13,
nil, 21, 25, nil, 1, 5, nil, 8, 140, 13,
nil, 17, nil, 26, nil, nil, 4, nil, nil, nil,
18, nil, nil, 45, nil, nil, nil, 65, 172, nil,
18, nil, nil, 45, nil, nil, nil, 65, 174, nil,
15, 75, 21, 25, nil, 1, 5, nil, 8, 18,
13, nil, 17, nil, 26, nil, nil, 4, nil, 15,
nil, 21, 25, nil, 1, 5, nil, 8, 18, 13,
@ -430,213 +487,199 @@ racc_action_table = [
nil, 26, nil, nil, 4 ]
racc_action_check = [
13, 13, 13, 9, 13, 115, 115, 46, 46, 109,
109, 135, 69, 35, 110, 191, 13, 17, 17, 17,
13, 11, 46, 9, 135, 115, 100, 46, 191, 205,
9, 13, 69, 17, 110, 115, 13, 46, 35, 109,
115, 230, 46, 13, 109, 11, 230, 115, 17, 46,
8, 109, 17, 17, 100, 100, 17, 49, 49, 49,
25, 169, 120, 63, 63, 63, 63, 25, 18, 15,
15, 15, 18, 49, 169, 166, 166, 166, 126, 63,
104, 79, 79, 79, 8, 15, 129, 8, 49, 104,
124, 166, 49, 49, 63, 124, 49, 79, 63, 63,
15, 130, 63, 131, 15, 15, 166, 134, 15, 119,
166, 166, 79, 136, 166, 43, 79, 79, 217, 217,
79, 186, 186, 186, 137, 150, 43, 228, 228, 228,
140, 43, 68, 226, 226, 226, 64, 186, 118, 32,
32, 32, 70, 228, 62, 197, 197, 197, 61, 226,
150, 150, 186, 21, 21, 32, 186, 186, 228, 161,
186, 197, 228, 228, 226, 58, 228, 55, 226, 226,
32, 72, 226, 172, 32, 32, 197, 174, 32, 201,
197, 197, 181, 52, 197, 215, 215, 215, 5, 181,
201, 87, 87, 87, 50, 5, 73, 95, 221, 221,
201, 215, 201, 201, 184, 201, 201, 87, 201, 185,
201, 74, 201, 221, 201, 187, 215, 201, 199, 188,
215, 215, 87, 108, 215, 190, 87, 87, 221, 199,
87, 95, 221, 221, 95, 92, 221, 193, 92, 199,
107, 199, 199, 153, 199, 199, 41, 199, 193, 199,
194, 199, 195, 199, 153, 196, 199, 77, 193, 153,
193, 193, 257, 193, 193, 34, 193, 27, 193, 123,
193, 96, 193, 257, 105, 193, 207, 90, 105, 105,
90, 232, 96, 257, 90, 257, 257, 96, 257, 257,
44, 257, 232, 257, 208, 257, 209, 257, 243, 243,
257, 44, 232, 210, 232, 232, 44, 232, 232, 212,
232, 26, 232, 243, 232, 78, 232, 220, 245, 232,
179, 179, 114, 93, 179, 22, 114, 114, 243, 245,
81, 89, 243, 243, 20, 179, 243, 175, 175, 245,
234, 245, 245, 240, 245, 245, 242, 245, 80, 245,
179, 245, 175, 245, 179, 179, 245, 256, 179, 244,
85, 83, 1, 189, nil, nil, nil, 175, 256, nil,
nil, 175, 175, nil, nil, 175, 163, nil, 256, nil,
256, 256, nil, 256, 256, nil, 256, 163, 256, nil,
256, nil, 256, 117, 117, 256, nil, 163, nil, 163,
163, nil, 163, 163, nil, 163, nil, 163, 117, 163,
nil, 163, nil, nil, 163, 155, 155, 116, 116, nil,
116, nil, nil, 117, nil, nil, nil, 117, 117, nil,
155, 117, 116, 148, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, 148, 155, nil, 116, nil, 155,
155, 116, 116, 155, 148, 116, 148, 148, 141, 148,
148, nil, 148, nil, 148, nil, 148, nil, 148, 141,
nil, 148, nil, 156, 156, nil, nil, nil, nil, 141,
nil, 141, 141, nil, 141, 141, nil, 141, 156, 141,
nil, 141, nil, 141, nil, nil, 141, nil, nil, nil,
111, nil, nil, 156, nil, nil, nil, 156, 156, nil,
111, 156, 111, 111, nil, 111, 111, nil, 111, 252,
111, nil, 111, nil, 111, nil, nil, 111, nil, 252,
nil, 252, 252, nil, 252, 252, nil, 252, 24, 252,
nil, 252, nil, 252, nil, nil, 252, nil, 24, nil,
13, 13, 13, 9, 13, 116, 116, 46, 46, 110,
110, 137, 111, 35, 69, 171, 13, 17, 17, 17,
13, 11, 46, 9, 137, 116, 101, 46, 171, 27,
9, 13, 111, 17, 69, 116, 13, 46, 35, 110,
116, 126, 46, 13, 110, 11, 126, 116, 17, 46,
8, 110, 17, 17, 101, 101, 17, 49, 49, 49,
25, 194, 125, 63, 63, 63, 63, 25, 18, 15,
15, 15, 18, 49, 194, 168, 168, 168, 120, 63,
105, 79, 79, 79, 8, 15, 127, 8, 49, 105,
233, 168, 49, 49, 63, 233, 49, 79, 63, 63,
15, 131, 63, 132, 15, 15, 168, 133, 15, 136,
168, 168, 79, 119, 168, 44, 79, 79, 21, 21,
79, 188, 188, 188, 138, 152, 44, 230, 230, 230,
139, 44, 142, 229, 229, 229, 68, 188, 64, 32,
32, 32, 70, 230, 72, 200, 200, 200, 62, 229,
152, 152, 188, 220, 220, 32, 188, 188, 230, 61,
188, 200, 230, 230, 229, 163, 230, 58, 229, 229,
32, 55, 229, 73, 32, 32, 200, 174, 32, 204,
200, 200, 5, 176, 200, 218, 218, 218, 183, 5,
204, 88, 88, 88, 52, 183, 50, 96, 224, 224,
204, 218, 204, 204, 74, 204, 204, 88, 204, 186,
204, 187, 204, 224, 204, 109, 218, 204, 202, 190,
218, 218, 88, 108, 218, 192, 88, 88, 224, 202,
88, 96, 224, 224, 96, 93, 224, 196, 93, 202,
193, 202, 202, 155, 202, 202, 77, 202, 196, 202,
41, 202, 197, 202, 155, 198, 202, 199, 196, 155,
196, 196, 260, 196, 196, 78, 196, 34, 196, 121,
196, 97, 196, 260, 115, 196, 208, 91, 115, 115,
91, 235, 97, 260, 91, 260, 260, 97, 260, 260,
43, 260, 235, 260, 210, 260, 211, 260, 246, 246,
260, 43, 235, 212, 235, 235, 43, 235, 235, 213,
235, 215, 235, 246, 235, 26, 235, 94, 248, 235,
181, 181, 106, 223, 181, 81, 106, 106, 246, 248,
124, 124, 246, 246, 22, 181, 246, 177, 177, 248,
90, 248, 248, 80, 248, 248, 20, 248, 237, 248,
181, 248, 177, 248, 181, 181, 248, 259, 181, 243,
245, 86, 247, 84, 83, 1, 191, 177, 259, nil,
nil, 177, 177, nil, nil, 177, 165, nil, 259, nil,
259, 259, nil, 259, 259, nil, 259, 165, 259, nil,
259, nil, 259, 118, 118, 259, nil, 165, nil, 165,
165, nil, 165, 165, nil, 165, nil, 165, 118, 165,
nil, 165, nil, nil, 165, 157, 157, 117, 117, nil,
117, nil, nil, 118, nil, nil, nil, 118, 118, nil,
157, 118, 117, 150, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, 150, 157, nil, 117, nil, 157,
157, 117, 117, 157, 150, 117, 150, 150, 143, 150,
150, nil, 150, nil, 150, nil, 150, nil, 150, 143,
nil, 150, nil, 158, 158, nil, nil, nil, nil, 143,
nil, 143, 143, nil, 143, 143, nil, 143, 158, 143,
nil, 143, nil, 143, nil, nil, 143, nil, nil, nil,
112, nil, nil, 158, nil, nil, nil, 158, 158, nil,
112, 158, 112, 112, nil, 112, 112, nil, 112, 255,
112, nil, 112, nil, 112, nil, nil, 112, nil, 255,
nil, 255, 255, nil, 255, 255, nil, 255, 24, 255,
nil, 255, nil, 255, nil, nil, 255, nil, 24, nil,
24, 24, nil, 24, 24, nil, 24, 0, 24, nil,
24, nil, 24, nil, nil, 24, nil, 0, nil, 0,
0, nil, 0, 0, nil, 0, nil, 0, nil, 0,
nil, 0, nil, nil, 0 ]
racc_action_pointer = [
539, 349, nil, nil, nil, 150, nil, nil, 46, -15,
539, 352, nil, nil, nil, 144, nil, nil, 46, -15,
nil, 2, nil, -2, nil, 67, nil, 15, 66, nil,
334, 150, 319, nil, 520, 22, 269, 261, nil, nil,
nil, nil, 137, nil, 230, 3, nil, nil, nil, nil,
nil, 240, nil, 93, 268, nil, 4, nil, nil, 55,
184, nil, 173, nil, nil, 165, nil, nil, 163, nil,
nil, 127, 138, 61, 115, nil, nil, nil, 111, 10,
121, nil, 150, 175, 209, nil, nil, 236, 309, 79,
310, 330, nil, 323, nil, 338, nil, 189, nil, 325,
239, nil, 197, 317, nil, 193, 249, nil, nil, nil,
6, nil, nil, nil, 65, 230, nil, 217, 218, 6,
-4, 482, nil, nil, 317, 2, 414, 390, 133, 99,
53, nil, nil, 259, 57, nil, 72, nil, nil, 76,
84, 82, nil, nil, 86, 2, 92, 103, nil, nil,
91, 451, nil, nil, nil, nil, nil, nil, 426, nil,
102, nil, nil, 221, nil, 412, 470, nil, nil, nil,
nil, 157, nil, 369, nil, nil, 73, nil, nil, 51,
nil, nil, 151, nil, 168, 334, nil, nil, nil, 317,
nil, 172, nil, nil, 197, 171, 119, 208, 206, 340,
212, 5, nil, 230, 243, 214, 248, 143, nil, 211,
nil, 172, nil, nil, nil, 8, nil, 255, 273, 275,
282, nil, 280, nil, nil, 183, nil, 109, nil, nil,
311, 195, nil, nil, nil, nil, 131, nil, 125, nil,
8, nil, 274, nil, 330, nil, nil, nil, nil, nil,
337, nil, 339, 295, 352, 311, nil, nil, nil, nil,
nil, nil, 501, nil, nil, nil, 350, 255, nil, nil ]
346, 115, 328, nil, 520, 22, 273, 23, nil, nil,
nil, nil, 137, nil, 232, 3, nil, nil, nil, nil,
nil, 244, nil, 268, 93, nil, 4, nil, nil, 55,
186, nil, 184, nil, nil, 169, nil, nil, 165, nil,
nil, 138, 142, 61, 117, nil, nil, nil, 115, 12,
121, nil, 123, 152, 202, nil, nil, 225, 259, 79,
305, 325, nil, 354, 325, nil, 339, nil, 189, nil,
334, 239, nil, 197, 311, nil, 193, 249, nil, nil,
nil, 6, nil, nil, nil, 65, 278, nil, 200, 210,
6, -6, 482, nil, nil, 269, 2, 414, 390, 108,
68, 260, nil, nil, 327, 52, 8, 80, nil, nil,
nil, 91, 86, 86, nil, nil, 88, 2, 103, 109,
nil, nil, 93, 451, nil, nil, nil, nil, nil, nil,
426, nil, 102, nil, nil, 221, nil, 412, 470, nil,
nil, nil, nil, 163, nil, 369, nil, nil, 73, nil,
nil, 5, nil, nil, 155, nil, 174, 334, nil, nil,
nil, 317, nil, 178, nil, nil, 202, 173, 119, nil,
212, 353, 212, 217, 51, nil, 230, 245, 217, 250,
143, nil, 211, nil, 172, nil, nil, nil, 255, nil,
273, 275, 282, 288, nil, 282, nil, nil, 183, nil,
144, nil, nil, 317, 195, nil, nil, nil, nil, 131,
125, nil, nil, 57, nil, 274, nil, 338, nil, nil,
nil, nil, nil, 353, nil, 353, 295, 355, 311, nil,
nil, nil, nil, nil, nil, 501, nil, nil, nil, 350,
255, nil, nil ]
racc_action_default = [
-133, -159, -16, -5, -127, -159, -6, -7, -159, -159,
-8, -159, -9, -39, -10, -159, -11, -159, -38, -12,
-159, -159, -159, -13, -1, -159, -35, -159, -14, -2,
-15, -3, -159, -126, -133, -133, -128, -131, -130, -132,
-34, -159, -37, -133, -133, -152, -159, -27, -19, -159,
-20, -90, -21, -91, -22, -58, -24, -25, -159, -26,
-28, -87, -159, -159, -81, -92, -83, -85, -80, -58,
-159, -98, -84, -79, -59, -118, -86, -82, -159, -159,
-67, -159, -119, -67, -4, -133, -36, -67, -66, -159,
-159, -146, -159, -159, -144, -159, -133, -58, -52, -51,
-159, -43, -45, -42, -159, -159, -18, -159, -159, -159,
-159, -159, -154, -71, -159, -159, -159, -159, -159, -157,
-159, -68, 260, -157, -134, -135, -159, -116, -54, -157,
-159, -62, -63, -65, -61, -58, -64, -60, -59, -117,
-56, -159, -151, -147, -150, -148, -145, -149, -159, -129,
-159, -48, -47, -159, -41, -159, -159, -40, -17, -93,
-23, -159, -29, -159, -153, -155, -159, -156, -89, -159,
-113, -112, -58, -115, -159, -159, -114, -106, -107, -159,
-100, -159, -104, -94, -159, -158, -159, -159, -143, -159,
-141, -159, -138, -159, -159, -67, -159, -57, -123, -159,
-125, -159, -46, -44, -49, -75, -77, -74, -78, -73,
-76, -50, -96, -72, -88, -159, -109, -157, -101, -99,
-159, -159, -32, -69, -70, -33, -159, -136, -159, -137,
-159, -121, -159, -31, -157, -30, -55, -122, -124, -95,
-159, -111, -159, -159, -156, -159, -105, -142, -140, -139,
-120, -53, -159, -108, -110, -103, -159, -159, -102, -97 ]
-135, -161, -16, -5, -129, -161, -6, -7, -161, -161,
-8, -161, -9, -39, -10, -161, -11, -161, -38, -12,
-161, -161, -161, -13, -1, -161, -35, -161, -14, -2,
-15, -3, -161, -128, -135, -135, -133, -130, -132, -134,
-34, -161, -37, -135, -135, -154, -161, -27, -19, -161,
-20, -90, -21, -91, -22, -58, -24, -25, -161, -26,
-28, -87, -161, -161, -81, -92, -83, -85, -80, -58,
-161, -98, -84, -79, -59, -118, -86, -82, -161, -161,
-67, -161, -119, -121, -67, -4, -135, -36, -67, -66,
-161, -161, -148, -161, -161, -146, -161, -135, -58, -52,
-51, -161, -43, -45, -42, -161, -161, -18, -161, -161,
-161, -161, -161, -156, -71, -161, -161, -161, -161, -161,
-159, -161, -68, 263, -161, -159, -136, -161, -137, -116,
-54, -159, -161, -62, -63, -65, -61, -58, -64, -60,
-59, -117, -56, -161, -153, -152, -149, -150, -151, -147,
-161, -131, -161, -48, -47, -161, -41, -161, -161, -40,
-17, -93, -23, -161, -29, -161, -155, -157, -161, -158,
-89, -161, -113, -112, -58, -115, -161, -161, -114, -106,
-107, -161, -100, -161, -104, -94, -161, -160, -161, -120,
-161, -145, -143, -161, -161, -140, -161, -161, -67, -161,
-57, -125, -161, -127, -161, -46, -44, -49, -75, -77,
-74, -78, -73, -76, -50, -96, -72, -88, -161, -109,
-159, -101, -99, -161, -161, -32, -69, -70, -33, -161,
-161, -138, -139, -161, -123, -161, -31, -159, -30, -55,
-124, -126, -95, -161, -111, -161, -161, -158, -161, -105,
-144, -142, -141, -122, -53, -161, -108, -110, -103, -161,
-161, -102, -97 ]
racc_goto_table = [
24, 84, 59, 36, 71, 166, 78, 178, 180, 128,
82, 57, 60, 132, 76, 133, 76, 48, 192, 20,
184, 88, 204, 211, 187, 29, 114, 34, 127, 223,
194, 76, 203, 42, 62, 59, 239, 179, 108, 100,
105, 99, 99, 196, 57, 60, 119, 85, 76, 123,
107, 140, 113, 129, 177, 160, 56, 127, 127, 91,
94, 217, 76, 126, 89, 35, 216, 93, 118, 169,
218, 189, 191, 40, 174, 182, 137, 146, 76, 143,
nil, 206, 206, nil, nil, 136, 98, 98, nil, 56,
149, nil, 150, nil, 99, nil, 127, 127, 59, nil,
nil, nil, 139, nil, 59, 176, 176, 57, 243, 162,
125, 163, 144, 57, 173, 173, 127, nil, 242, 236,
127, nil, nil, 132, 249, 133, nil, nil, nil, nil,
134, 139, 139, 174, 254, 251, nil, 182, 127, 98,
84, 199, nil, nil, 209, 209, nil, nil, 201, nil,
nil, 99, 56, 208, 208, 213, nil, nil, 56, 171,
171, 234, 127, nil, 176, 76, nil, nil, 176, nil,
210, 210, nil, 173, nil, 224, 84, 173, 84, 246,
nil, nil, nil, nil, 127, 76, 137, nil, nil, nil,
139, 131, nil, 232, 139, 136, 98, nil, 207, 207,
nil, 174, nil, nil, 241, nil, nil, nil, nil, 84,
176, nil, 139, nil, 76, 247, nil, 248, 171, 173,
170, 170, 171, nil, nil, 76, nil, 76, nil, nil,
nil, nil, 176, 84, 84, nil, 139, nil, nil, nil,
134, 173, nil, nil, nil, 256, nil, nil, nil, nil,
nil, nil, 257, nil, nil, nil, nil, nil, 139, 205,
205, nil, nil, nil, 171, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, 170,
nil, nil, nil, 170, nil, nil, 171, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
nil, 131, nil, nil, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, 170, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, 170 ]
24, 85, 59, 60, 37, 76, 180, 76, 135, 120,
82, 182, 57, 125, 71, 20, 78, 131, 195, 176,
184, 115, 76, 186, 130, 129, 48, 56, 190, 207,
214, 89, 226, 168, 197, 59, 60, 101, 106, 76,
206, 42, 100, 100, 62, 57, 242, 181, 109, 199,
142, 179, 141, 76, 129, 129, 162, 99, 99, 108,
56, 220, 114, 29, 83, 34, 219, 127, 90, 76,
35, 94, 171, 193, 221, 194, 40, 139, 119, 176,
149, 141, 141, 184, 146, 86, nil, 138, nil, nil,
134, 152, 151, nil, 129, 129, 100, 92, 95, 59,
nil, 164, 136, nil, 133, 59, 178, 178, nil, 57,
nil, 99, 165, 189, 129, 57, 175, 175, 129, nil,
135, 213, 213, 245, 56, 252, 249, 237, nil, nil,
56, 173, 173, 172, 172, 257, 239, 129, 246, nil,
254, 141, 85, 202, nil, 141, 212, 212, 176, 128,
204, 145, nil, nil, 100, nil, 211, 211, 76, 209,
209, 129, nil, nil, 141, nil, 178, 216, nil, 99,
178, 210, 210, 208, 208, nil, 175, nil, 76, 85,
175, 85, nil, 129, nil, nil, nil, 227, 141, 139,
nil, 173, nil, 172, nil, 173, 235, 172, nil, 138,
nil, nil, 134, nil, nil, nil, nil, nil, 76, nil,
141, nil, 85, 178, 136, nil, 133, 244, nil, 76,
76, nil, nil, 175, nil, nil, nil, nil, 250, 251,
nil, nil, nil, nil, nil, 178, 85, 85, 173, nil,
172, nil, nil, nil, nil, 175, nil, nil, 259, nil,
nil, nil, nil, nil, nil, 260, nil, nil, nil, nil,
173, nil, 172 ]
racc_goto_check = [
2, 4, 23, 63, 44, 47, 44, 57, 53, 39,
23, 22, 24, 42, 24, 43, 24, 17, 66, 1,
29, 44, 38, 38, 29, 3, 46, 25, 49, 45,
29, 24, 34, 32, 50, 23, 51, 52, 44, 33,
33, 22, 22, 27, 22, 24, 28, 25, 24, 28,
17, 26, 44, 28, 56, 20, 21, 49, 49, 3,
3, 58, 24, 59, 60, 61, 57, 62, 44, 18,
53, 64, 65, 5, 55, 55, 23, 67, 24, 68,
nil, 42, 42, nil, nil, 22, 21, 21, nil, 21,
63, nil, 33, nil, 22, nil, 49, 49, 23, nil,
nil, nil, 48, nil, 23, 23, 23, 22, 47, 24,
3, 2, 25, 22, 22, 22, 49, nil, 29, 39,
49, nil, nil, 42, 66, 43, nil, nil, nil, nil,
21, 48, 48, 55, 57, 29, nil, 55, 49, 21,
4, 2, nil, nil, 23, 23, nil, nil, 2, nil,
nil, 22, 21, 22, 22, 44, nil, nil, 21, 21,
21, 28, 49, nil, 23, 24, nil, nil, 23, nil,
48, 48, nil, 22, nil, 44, 4, 22, 4, 55,
nil, nil, nil, nil, 49, 24, 23, nil, nil, nil,
48, 41, nil, 2, 48, 22, 21, nil, 21, 21,
nil, 55, nil, nil, 44, nil, nil, nil, nil, 4,
23, nil, 48, nil, 24, 44, nil, 44, 21, 22,
41, 41, 21, nil, nil, 24, nil, 24, nil, nil,
nil, nil, 23, 4, 4, nil, 48, nil, nil, nil,
21, 22, nil, nil, nil, 2, nil, nil, nil, nil,
nil, nil, 2, nil, nil, nil, nil, nil, 48, 41,
41, nil, nil, nil, 21, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, 41,
nil, nil, nil, 41, nil, nil, 21, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
nil, 41, nil, nil, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, 41, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, 41 ]
2, 4, 23, 24, 64, 24, 57, 24, 43, 28,
23, 53, 22, 28, 44, 1, 44, 28, 67, 55,
55, 46, 24, 29, 39, 49, 17, 21, 29, 38,
38, 44, 45, 47, 29, 23, 24, 33, 33, 24,
34, 32, 22, 22, 50, 22, 51, 52, 44, 27,
26, 56, 48, 24, 49, 49, 20, 21, 21, 17,
21, 58, 44, 3, 59, 25, 57, 60, 61, 24,
62, 63, 18, 65, 53, 66, 5, 23, 44, 55,
68, 48, 48, 55, 69, 25, nil, 22, nil, nil,
42, 33, 64, nil, 49, 49, 22, 3, 3, 23,
nil, 24, 21, nil, 41, 23, 23, 23, nil, 22,
nil, 21, 2, 23, 49, 22, 22, 22, 49, nil,
43, 48, 48, 29, 21, 67, 55, 28, nil, nil,
21, 21, 21, 41, 41, 57, 39, 49, 47, nil,
29, 48, 4, 2, nil, 48, 23, 23, 55, 3,
2, 25, nil, nil, 22, nil, 22, 22, 24, 42,
42, 49, nil, nil, 48, nil, 23, 44, nil, 21,
23, 21, 21, 41, 41, nil, 22, nil, 24, 4,
22, 4, nil, 49, nil, nil, nil, 44, 48, 23,
nil, 21, nil, 41, nil, 21, 2, 41, nil, 22,
nil, nil, 42, nil, nil, nil, nil, nil, 24, nil,
48, nil, 4, 23, 21, nil, 41, 44, nil, 24,
24, nil, nil, 22, nil, nil, nil, nil, 44, 44,
nil, nil, nil, nil, nil, 23, 4, 4, 21, nil,
41, nil, nil, nil, nil, 22, nil, nil, 2, nil,
nil, nil, nil, nil, nil, 2, nil, nil, nil, nil,
21, nil, 41 ]
racc_goto_pointer = [
nil, 19, 0, 25, -23, 64, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, 4, -46, nil,
-54, 43, -2, -11, -1, 22, -36, -97, -34, -99,
nil, nil, 22, -4, -121, nil, nil, nil, -133, -78,
nil, 104, -74, -72, -11, -156, -37, -109, 15, -59,
19, -176, -80, -109, nil, -42, -62, -109, -114, -22,
30, 57, 32, -5, -53, -52, -106, -15, -11 ]
nil, 15, 0, 63, -23, 67, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, 13, -44, nil,
-54, 14, -1, -11, -10, 60, -38, -93, -71, -97,
nil, nil, 30, -6, -115, nil, nil, nil, -128, -64,
nil, 16, 2, -80, -1, -155, -42, -82, -36, -63,
29, -169, -71, -107, nil, -98, -66, -111, -116, 43,
-19, 34, 62, 36, -4, -53, -51, -108, -13, -7 ]
racc_goto_default = [
nil, nil, nil, 103, 31, 3, 6, 7, 10, 12,
nil, nil, nil, 104, 31, 3, 6, 7, 10, 12,
14, 16, 19, 23, 28, 30, 2, nil, 50, 52,
54, 68, 72, 73, 22, 27, nil, nil, nil, nil,
9, 11, nil, nil, 101, 153, 102, 104, nil, nil,
130, 64, 66, 67, nil, 121, nil, nil, 77, 61,
nil, nil, nil, nil, 181, 70, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil ]
9, 11, nil, nil, 102, 155, 103, 105, nil, nil,
132, 64, 66, 67, nil, 122, nil, nil, 77, 61,
nil, nil, nil, nil, 183, 70, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ]
racc_token_table = {
false => 0,
@ -820,6 +863,7 @@ Racc_token_to_s_table = [
'svalues',
'selectval',
'sintvalues',
'qtexts',
'argumentlist',
'classparent',
'hostnames',
@ -1496,61 +1540,33 @@ module_eval <<'.,.,', 'grammar.ra', 448
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 498
module_eval <<'.,.,', 'grammar.ra', 450
def _reduce_119( val, _values, result )
# importing files
# yuk, i hate keywords
# we'll probably have to have some kind of search path eventually
# but for now, just use a path relative to the file doing the importing
dir = @lexer.file.sub(%r{[^/]+$},'').sub(/\/$/, '')
if dir == ""
dir = "."
end
result = ast AST::ASTArray
# We can't interpolate at this point since we don't have any
# scopes set up. Warn the user if they use a variable reference
pat = val[1].value
if pat.index("$")
Puppet.warning(
"The import of #{pat} contains a variable reference;" +
" variables are not interpolated for imports " +
"in file #{@lexer.file} at line #{@lexer.line}"
)
end
files = Puppet::Module::find_manifests(pat, dir)
if files.size == 0
raise Puppet::ImportError.new("No file(s) found for import " +
"of '#{pat}'")
end
files.each { |file|
parser = Puppet::Parser::Parser.new(interp)
parser.files = self.files
Puppet.debug("importing '%s'" % file)
unless file =~ /^#{File::SEPARATOR}/
file = File.join(dir, file)
end
begin
parser.file = file
rescue Puppet::ImportError
Puppet.warning(
"Importing %s would result in an import loop" %
File.join(dir, file)
)
next
end
# This will normally add code to the 'main' class.
parser.parse
}
result = [val[0].value]
result
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 508
module_eval <<'.,.,', 'grammar.ra', 454
def _reduce_120( val, _values, result )
results = val[0] << val[2].value
result
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 462
def _reduce_121( val, _values, result )
val[1].each do |file|
import(file)
end
result = AST::ASTArray.new(:children => [])
result
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 472
def _reduce_122( val, _values, result )
interp.newdefine fqname(val[1]), :arguments => val[2], :code => val[4]
@lexer.indefine = false
result = nil
@ -1560,8 +1576,8 @@ module_eval <<'.,.,', 'grammar.ra', 508
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 512
def _reduce_121( val, _values, result )
module_eval <<'.,.,', 'grammar.ra', 476
def _reduce_123( val, _values, result )
interp.newdefine fqname(val[1]), :arguments => val[2]
@lexer.indefine = false
result = nil
@ -1569,8 +1585,8 @@ module_eval <<'.,.,', 'grammar.ra', 512
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 520
def _reduce_122( val, _values, result )
module_eval <<'.,.,', 'grammar.ra', 484
def _reduce_124( val, _values, result )
# Our class gets defined in the parent namespace, not our own.
@lexer.namepop
interp.newclass fqname(val[1]), :code => val[4], :parent => val[2]
@ -1579,8 +1595,8 @@ module_eval <<'.,.,', 'grammar.ra', 520
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 525
def _reduce_123( val, _values, result )
module_eval <<'.,.,', 'grammar.ra', 489
def _reduce_125( val, _values, result )
# Our class gets defined in the parent namespace, not our own.
@lexer.namepop
interp.newclass fqname(val[1]), :parent => val[2]
@ -1589,30 +1605,30 @@ module_eval <<'.,.,', 'grammar.ra', 525
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 530
def _reduce_124( val, _values, result )
module_eval <<'.,.,', 'grammar.ra', 494
def _reduce_126( val, _values, result )
interp.newnode val[1], :parent => val[2], :code => val[4]
result = nil
result
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 533
def _reduce_125( val, _values, result )
module_eval <<'.,.,', 'grammar.ra', 497
def _reduce_127( val, _values, result )
interp.newnode val[1], :parent => val[2]
result = nil
result
end
.,.,
# reduce 126 omitted
# reduce 127 omitted
# reduce 128 omitted
module_eval <<'.,.,', 'grammar.ra', 545
def _reduce_129( val, _values, result )
# reduce 129 omitted
# reduce 130 omitted
module_eval <<'.,.,', 'grammar.ra', 509
def _reduce_131( val, _values, result )
result = val[0]
result = [result] unless result.is_a?(Array)
result << val[2]
@ -1620,47 +1636,47 @@ module_eval <<'.,.,', 'grammar.ra', 545
end
.,.,
# reduce 130 omitted
# reduce 131 omitted
# reduce 132 omitted
module_eval <<'.,.,', 'grammar.ra', 553
def _reduce_133( val, _values, result )
# reduce 133 omitted
# reduce 134 omitted
module_eval <<'.,.,', 'grammar.ra', 517
def _reduce_135( val, _values, result )
result = nil
result
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 557
def _reduce_134( val, _values, result )
module_eval <<'.,.,', 'grammar.ra', 521
def _reduce_136( val, _values, result )
result = ast AST::ASTArray, :children => []
result
end
.,.,
# reduce 135 omitted
# reduce 137 omitted
module_eval <<'.,.,', 'grammar.ra', 562
def _reduce_136( val, _values, result )
module_eval <<'.,.,', 'grammar.ra', 526
def _reduce_138( val, _values, result )
result = nil
result
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 566
def _reduce_137( val, _values, result )
module_eval <<'.,.,', 'grammar.ra', 530
def _reduce_139( val, _values, result )
result = val[1]
result = [result] unless result[0].is_a?(Array)
result
end
.,.,
# reduce 138 omitted
# reduce 140 omitted
module_eval <<'.,.,', 'grammar.ra', 573
def _reduce_139( val, _values, result )
module_eval <<'.,.,', 'grammar.ra', 537
def _reduce_141( val, _values, result )
result = val[0]
result = [result] unless result[0].is_a?(Array)
result << val[2]
@ -1668,48 +1684,39 @@ module_eval <<'.,.,', 'grammar.ra', 573
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 578
def _reduce_140( val, _values, result )
Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
result = [val[0], val[2]]
result
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 582
def _reduce_141( val, _values, result )
Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
result = [val[0]]
result
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 584
module_eval <<'.,.,', 'grammar.ra', 542
def _reduce_142( val, _values, result )
Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
result = [val[0], val[2]]
result
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 586
module_eval <<'.,.,', 'grammar.ra', 546
def _reduce_143( val, _values, result )
Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
result = [val[0]]
result
end
.,.,
# reduce 144 omitted
module_eval <<'.,.,', 'grammar.ra', 548
def _reduce_144( val, _values, result )
result = [val[0], val[2]]
result
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 591
module_eval <<'.,.,', 'grammar.ra', 550
def _reduce_145( val, _values, result )
result = val[1]
result = [val[0]]
result
end
.,.,
# reduce 146 omitted
module_eval <<'.,.,', 'grammar.ra', 596
module_eval <<'.,.,', 'grammar.ra', 555
def _reduce_147( val, _values, result )
result = val[1]
result
@ -1718,21 +1725,30 @@ module_eval <<'.,.,', 'grammar.ra', 596
# reduce 148 omitted
# reduce 149 omitted
module_eval <<'.,.,', 'grammar.ra', 560
def _reduce_149( val, _values, result )
result = val[1]
result
end
.,.,
# reduce 150 omitted
# reduce 151 omitted
module_eval <<'.,.,', 'grammar.ra', 603
def _reduce_152( val, _values, result )
# reduce 152 omitted
# reduce 153 omitted
module_eval <<'.,.,', 'grammar.ra', 567
def _reduce_154( val, _values, result )
result = ast AST::Variable, :value => val[0]
result
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 611
def _reduce_153( val, _values, result )
module_eval <<'.,.,', 'grammar.ra', 575
def _reduce_155( val, _values, result )
if val[1].instance_of?(AST::ASTArray)
result = val[1]
else
@ -1742,21 +1758,21 @@ module_eval <<'.,.,', 'grammar.ra', 611
end
.,.,
module_eval <<'.,.,', 'grammar.ra', 613
def _reduce_154( val, _values, result )
module_eval <<'.,.,', 'grammar.ra', 577
def _reduce_156( val, _values, result )
result = ast AST::ASTArray
result
end
.,.,
# reduce 155 omitted
# reduce 156 omitted
# reduce 157 omitted
module_eval <<'.,.,', 'grammar.ra', 618
def _reduce_158( val, _values, result )
# reduce 158 omitted
# reduce 159 omitted
module_eval <<'.,.,', 'grammar.ra', 582
def _reduce_160( val, _values, result )
result = nil
result
end

Просмотреть файл

@ -702,6 +702,44 @@ file { "/tmp/yayness":
end
end
# #544
def test_ignoreimports
parser = mkparser
assert(! Puppet[:ignoreimport], ":ignoreimport defaulted to true")
assert_raise(Puppet::ParseError, "Did not fail on missing import") do
parser.parse("import 'nosuchfile'")
end
assert_nothing_raised("could not set :ignoreimport") do
Puppet[:ignoreimport] = true
end
assert_nothing_raised("Parser did not follow :ignoreimports") do
parser.parse("import 'nosuchfile'")
end
end
def test_multiple_imports_on_one_line
one = tempfile
two = tempfile
base = tempfile
File.open(one, "w") { |f| f.puts "$var = value" }
File.open(two, "w") { |f| f.puts "$var = value" }
File.open(base, "w") { |f| f.puts "import '#{one}', '#{two}'" }
parser = mkparser
parser.file = base
# Importing is logged at debug time.
Puppet::Util::Log.level = :debug
assert_nothing_raised("Parser could not import multiple files at once") do
parser.parse
end
[one, two].each do |file|
assert(@logs.detect { |l| l.message =~ /importing '#{file}'/},
"did not import %s" % file)
end
end
end
# $Id$