Skip to content

Commit

Permalink
Fix doc:vm:html task to not fail if yaml file missing
Browse files Browse the repository at this point in the history
  • Loading branch information
agardiner committed Jan 29, 2008
1 parent 3904ff2 commit 0557113
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Rakefile
Expand Up @@ -975,11 +975,12 @@ namespace "doc" do
OpCode::Info.op_codes.each do |op| OpCode::Info.op_codes.each do |op|
html = "doc/vm/op_codes/#{op}.html" html = "doc/vm/op_codes/#{op}.html"
yaml = "doc/vm/op_codes/#{op}.yaml" yaml = "doc/vm/op_codes/#{op}.yaml"
file html => yaml do file html do
cd 'doc/vm' do cd 'doc/vm' do
ruby "gen_op_code_html.rb #{op}" ruby "gen_op_code_html.rb #{op}"
end end
end end
file html => yaml if File.exists?("doc/vm/op_codes/#{op}.yaml")


task "html" => html task "html" => html
end end
Expand Down
4 changes: 2 additions & 2 deletions doc/vm/op_code_info.rb
Expand Up @@ -47,8 +47,8 @@ def initialize(mnemonic)
def args def args
fmt = (@yaml['format'] || @mnemonic.to_s).split(' ') fmt = (@yaml['format'] || @mnemonic.to_s).split(' ')
fmt.shift fmt.shift
fmt <<= @opcode.args[0] if fmt.size == 0 && arg_count >= 1 fmt <<= @op_code.args[0] if fmt.size == 0 && arg_count >= 1
fmt <<= @opcode.args[1] if fmt.size == 1 && arg_count == 2 fmt <<= @op_code.args[1] if fmt.size == 1 && arg_count == 2
fmt fmt
end end


Expand Down

0 comments on commit 0557113

Please sign in to comment.