empty: src: "" tem: null numbers: src: "id > 45 and (3 > -id or 3+3)" tem: "((node.zip>45) and ((3>-node.zip) or (3+3)))" global_method: src: "now.strftime('%Y')" tem: "Time.now.strftime(\"%Y\")" dynamic_string: src: "now.strftime(\"#{name}\")" tem: "Time.now.strftime(\"#{node.name}\")" dynamic_string_again: src: "now.strftime(\"#{name}\")" tem: "Time.now.strftime(\"#{node.name}\")" symbol: src: ":foobar" sxp: 's(:lit, :foobar)' hash_access: src: "dictionary[:key]" tem: "get_dict[:key]" rewrite_variables: src: "!prev.ancestor?(main) && !node.ancestor?(main)" tem: "(not previous.ancestor?(@node) and not node.ancestor?(@node))" method_can_return_nil: src: "spouse.name" tem: "(node.spouse ? node.spouse.name : nil)" method_on_method_can_return_nil: src: "spouse.name == 'yo'" tem: "(node.spouse ? (node.spouse.name==\"yo\") : nil)" res: "" nil_greater_then: src: "spouse.id > 1" tem: "(node.spouse ? (node.spouse.zip>1) : nil)" nil_ternary_op: src: "spouse ? 'foo' : 'bar'" tem: "node.spouse ? \"foo\" : \"bar\"" res: 'bar' nested_ternary_op: src: "spouse.name == 'Adam' ? 'man' : 'not a man'" tem: "(node.spouse ? (node.spouse.name==\"Adam\") : nil) ? \"man\" : \"not a man\"" res: "not a man" method_on_method: src: "project.name.to_s" tem: "node.project.name.to_s" res: 'project' comp_ternary_op: src: "1 > 2 ? 'foo' : 'bar'" tem: "(1>2) ? \"foo\" : \"bar\"" res: "bar" method_ternary_op: src: "id > 2 ? 'foo' : 'bar'" tem: "(node.zip>2) ? \"foo\" : \"bar\"" res: "foo" method_argument_can_be_nil: src: "vowel_count(spouse.name)" tem: "(node.spouse ? vowel_count(node.spouse.name) : nil)" multi_arg_method_argument_can_be_nil: src: "log_info(spouse, 'foobar')" tem: "(node.spouse ? log_info(node.spouse, \"foobar\") : nil)" multi_arg_method_arguments_can_be_nil: src: "log_info(husband, spouse.name)" tem: "((node.husband && node.spouse) ? log_info(node.husband, node.spouse.name) : nil)" multi_arg_method_arguments_can_be_nil_same_condition: src: "log_info(spouse, spouse.name)" tem: "(node.spouse ? log_info(node.spouse, node.spouse.name) : nil)" literal_argument_for_method: src: "vowel_count('ruby')" res: "2" safe_method_defined_as_symbol: src: "foo" tem: "contextual_foo" optional_arguments: src: "width(:mode => 'pv')" tem: "node.width({:mode => \"pv\"})" res: "mode: pv, type: none" optional_arguments: src: "width" tem: "node.width" res: "mode: none, type: none" optional_arguments_string: src: "width('nice' => 1 == 1)" tem: "node.width({\"nice\" => (1==1)})" res: "nice!" module_method: src: "maze" tem: "node.mazette" res: "Mazette !" regexp: src: "maze.gsub(/ette/,'o')" tem: "node.mazette.gsub(/ette/, \"o\")" res: "Mazo !" instance_variable: src: "@foo.maze" tem: "node.mazette" res: "Mazette !" prepend_arg: src: "prepend_test(4)" tem: "add(10, 4)" res: "14" safe_property: src: "dog_name" tem: "node.prop['dog_name']" res: "Biscotte" match_on_subclass: src: "log_info(sub, 'hello')" tem: "log_info(sub, \"hello\")" optional_argument_subclass: src: "width(:mode => str)" tem: "node.width({:mode => str})"