Skip to content

Commit

Permalink
get things working with latest ruby-2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
w7cook committed Dec 17, 2014
1 parent 13e251f commit 43ab87f
Show file tree
Hide file tree
Showing 18 changed files with 522 additions and 196 deletions.
3 changes: 2 additions & 1 deletion notes.txt
Expand Up @@ -3,4 +3,5 @@
* If you don't specify the spine fields (!) correctly, then the object may not be written out completely
and will fail on load


* parsing ("foo" manyvalued:P)* does not work, but manyvalued:("foo" P)* does!
Gives bad error message (crash)
3 changes: 2 additions & 1 deletion src/core/diagram/code/construct.rb
Expand Up @@ -17,6 +17,7 @@ module EvalStencil
include Evalexprstencil::EvalExprStencil

def eval_Stencil(obj)
@indent = 0
factory = Factory::SchemaFactory.new(Load::load('diagram.schema'))
res = factory.Stencil(obj.title, obj.root)
env = {}
Expand Down Expand Up @@ -52,7 +53,7 @@ def eval_?(obj)
factory = @D[:factory]
res = factory[type.name]
type.fields.each do |f|
if f.type.name=="Expr" # and res.schema_class.fields[f.name].type.name!="Expr"
if f.type.name == "Expr" # and res.schema_class.fields[f.name].type.name != "Expr"
if obj[f.name].nil?
res[f.name] = nil
elsif !f.many
Expand Down
2 changes: 1 addition & 1 deletion src/core/expr/models/impl.grammar
Expand Up @@ -31,5 +31,5 @@ EBlock_nocurly ::= [EBlock] (fundefs:EFunDef+@/ /)? body:NLCommand*@/

EFunCall ::= [EFunCall] fun:EUnOp . "(". params:Expr* @(.",") .")" lambda:ELambda

ELambda ::= [ELambda] "{" ("|" formals:Formal+ @"," "|")? / body:EBlock_nocurly / "}"
ELambda ::= [ELambda] "{" ("|". formals:Formal+ @(.",") ."|")? /> body:EBlock_nocurly "}" /<

2 changes: 1 addition & 1 deletion src/core/lang/code/convert.rb
Expand Up @@ -655,7 +655,7 @@ def on_massign(lvalue, rvalue)
def on_method_add_arg(call, args)
if args
#puts "CALL #{call} #{args}"
args.normal.each do |arg|
args.normal.flatten.each do |arg|
call.args << arg
end
raise "ARG PROBLEM" if args.rest && call.rest || args.block && call.block
Expand Down
12 changes: 8 additions & 4 deletions src/core/schema/code/factory.rb
Expand Up @@ -522,10 +522,14 @@ def check(mobj)
if mobj.nil? then
raise "Cannot assign nil to non-optional field '#{@field.owner.name}.#{@field.name}'"
end
if !Schema::subclass?(mobj.schema_class, @field.type) then
puts "TEST FOUND #{mobj.schema_class} EXPECTED #{@field.type}"
raise "Invalid value for #{@field.owner.name}.#{@field.name}:#{@field.type.name} found [#{mobj}]"
end
begin
if !Schema::subclass?(mobj.schema_class, @field.type) then
puts "TEST FOUND #{mobj.schema_class} EXPECTED #{@field.type}"
raise "Invalid value for #{@field.owner.name}.#{@field.name}:#{@field.type.name} found [#{mobj}]"
end
rescue
raise "Invalid value for #{@field.owner.name}.#{@field.name}:#{@field.type.name} found [#{mobj}]"
end
if mobj._graph_id != @owner._graph_id then
raise "Inserting object #{mobj} into the wrong model"
end
Expand Down

0 comments on commit 43ab87f

Please sign in to comment.