Skip to content

Commit

Permalink
[values][primitives] Update primitive calls inline with latest changes [
Browse files Browse the repository at this point in the history
  • Loading branch information
cipriancraciun committed Jun 9, 2018
1 parent 06ab9f5 commit fd8609e
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 84 deletions.
42 changes: 21 additions & 21 deletions sources/primitives_arrays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ pub fn array_primitive_0_evaluate (primitive : ArrayPrimitive0, _evaluator : &mu
match primitive {

ArrayPrimitive0::ArrayBuild =>
return array_empty () .into_0 (),
return array_empty (None) .into_0 (),

ArrayPrimitive0::ArrayAppend =>
return array_empty () .into_0 (),
return array_empty (None) .into_0 (),

}
}
Expand All @@ -261,19 +261,19 @@ pub fn array_primitive_1_evaluate (primitive : ArrayPrimitive1, input_1 : &Value
return array_length (input_1) .into_0 (),

ArrayPrimitive1::ArrayClone =>
return array_clone (input_1),
return array_clone (input_1, None),

ArrayPrimitive1::ArrayCloneReverse =>
return array_reverse (input_1),
return array_reverse (input_1, None),

ArrayPrimitive1::ArrayMake =>
return array_make (try! (try_as_number_integer_ref! (input_1) .try_to_usize ()), None),
return array_make (try! (try_as_number_integer_ref! (input_1) .try_to_usize ()), None, None),

ArrayPrimitive1::ArrayBuild =>
return array_build_1 (input_1) .into_0 (),
return array_build_1 (input_1, None) .into_0 (),

ArrayPrimitive1::ArrayAppend =>
return array_clone (input_1),
return array_clone (input_1, None),

#[ cfg ( feature = "vonuvoli_values_mutable" ) ]
ArrayPrimitive1::ArrayFill =>
Expand All @@ -287,7 +287,7 @@ pub fn array_primitive_1_evaluate (primitive : ArrayPrimitive1, input_1 : &Value
return array_range_to_list (input_1, None, None, None),

ArrayPrimitive1::ListToArray =>
return list_range_to_array (input_1, None, None),
return list_range_to_array (input_1, None, None, None),

#[ cfg ( feature = "vonuvoli_values_mutable" ) ]
ArrayPrimitive1::ArrayToImmutable =>
Expand Down Expand Up @@ -319,13 +319,13 @@ pub fn array_primitive_2_evaluate (primitive : ArrayPrimitive2, input_1 : &Value
return array_at (input_1, try! (try_as_number_integer_ref! (input_2) .try_to_usize ())),

ArrayPrimitive2::ArrayMake =>
return array_make (try! (try_as_number_integer_ref! (input_1) .try_to_usize ()), Some (input_2)),
return array_make (try! (try_as_number_integer_ref! (input_1) .try_to_usize ()), Some (input_2), None),

ArrayPrimitive2::ArrayBuild =>
return array_build_2 (input_1, input_2) .into_0 (),
return array_build_2 (input_1, input_2, None) .into_0 (),

ArrayPrimitive2::ArrayAppend =>
return array_append_2 (input_1, input_2),
return array_append_2 (input_1, input_2, None),

#[ cfg ( feature = "vonuvoli_values_mutable" ) ]
ArrayPrimitive2::ArrayFill =>
Expand All @@ -340,7 +340,7 @@ pub fn array_primitive_2_evaluate (primitive : ArrayPrimitive2, input_1 : &Value
return array_extend_range (input_1, None, input_2, None, None) .into_0 (),

ArrayPrimitive2::ArrayRangeClone =>
return array_clone_range (input_1, Some (input_2), None),
return array_clone_range (input_1, Some (input_2), None, None),

#[ cfg ( feature = "vonuvoli_values_mutable" ) ]
ArrayPrimitive2::ArrayRangeReverse =>
Expand All @@ -350,7 +350,7 @@ pub fn array_primitive_2_evaluate (primitive : ArrayPrimitive2, input_1 : &Value
return array_range_to_list (input_1, Some (input_2), None, None),

ArrayPrimitive2::ListRangeToArray =>
return list_range_to_array (input_1, Some (input_2), None),
return list_range_to_array (input_1, Some (input_2), None, None),

#[ cfg ( feature = "vonuvoli_values_mutable" ) ]
ArrayPrimitive2::ArrayPush =>
Expand Down Expand Up @@ -379,10 +379,10 @@ pub fn array_primitive_3_evaluate (primitive : ArrayPrimitive3, input_1 : &Value
return array_at_set (input_1, try! (try_as_number_integer_ref! (input_2) .try_to_usize ()), input_3),

ArrayPrimitive3::ArrayBuild =>
return array_build_3 (input_1, input_2, input_3) .into_0 (),
return array_build_3 (input_1, input_2, input_3, None) .into_0 (),

ArrayPrimitive3::ArrayAppend =>
return array_append_3 (input_1, input_2, input_3),
return array_append_3 (input_1, input_2, input_3, None),

#[ cfg ( feature = "vonuvoli_values_mutable" ) ]
ArrayPrimitive3::ArrayRangeFill =>
Expand All @@ -397,7 +397,7 @@ pub fn array_primitive_3_evaluate (primitive : ArrayPrimitive3, input_1 : &Value
return array_extend_range (input_1, None, input_2, Some (input_3), None) .into_0 (),

ArrayPrimitive3::ArrayRangeClone =>
return array_clone_range (input_1, Some (input_2), Some (input_3)),
return array_clone_range (input_1, Some (input_2), Some (input_3), None),

#[ cfg ( feature = "vonuvoli_values_mutable" ) ]
ArrayPrimitive3::ArrayRangeReverse =>
Expand All @@ -407,7 +407,7 @@ pub fn array_primitive_3_evaluate (primitive : ArrayPrimitive3, input_1 : &Value
return array_range_to_list (input_1, Some (input_2), Some (input_3), None),

ArrayPrimitive3::ListRangeToArray =>
return list_range_to_array (input_1, Some (input_2), Some (input_3)),
return list_range_to_array (input_1, Some (input_2), Some (input_3), None),

#[ cfg ( feature = "vonuvoli_values_mutable" ) ]
ArrayPrimitive3::ArrayInsertAt =>
Expand All @@ -432,10 +432,10 @@ pub fn array_primitive_4_evaluate (primitive : ArrayPrimitive4, input_1 : &Value
match primitive {

ArrayPrimitive4::ArrayBuild =>
return array_build_4 (input_1, input_2, input_3, input_4) .into_0 (),
return array_build_4 (input_1, input_2, input_3, input_4, None) .into_0 (),

ArrayPrimitive4::ArrayAppend =>
return array_append_4 (input_1, input_2, input_3, input_4),
return array_append_4 (input_1, input_2, input_3, input_4, None),

#[ cfg ( feature = "vonuvoli_values_mutable" ) ]
ArrayPrimitive4::ArrayRangeFill =>
Expand Down Expand Up @@ -478,10 +478,10 @@ pub fn array_primitive_n_evaluate (primitive : ArrayPrimitiveN, inputs : &[impl
match primitive {

ArrayPrimitiveN::ArrayBuild =>
return array_build_n (inputs) .into_0 (),
return array_build_n (inputs, None) .into_0 (),

ArrayPrimitiveN::ArrayAppend =>
return array_append_n (inputs),
return array_append_n (inputs, None),

}
}
Expand Down
38 changes: 19 additions & 19 deletions sources/primitives_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ pub fn bytes_primitive_1_evaluate (primitive : BytesPrimitive1, input_1 : &Value

#[ cfg ( feature = "vonuvoli_values_array" ) ]
BytesPrimitive1::BytesToArray =>
return bytes_range_to_array (input_1, None, None),
return bytes_range_to_array (input_1, None, None, None),

#[ cfg ( feature = "vonuvoli_values_array" ) ]
BytesPrimitive1::ArrayToBytes =>
Expand Down Expand Up @@ -384,7 +384,7 @@ pub fn bytes_primitive_2_evaluate (primitive : BytesPrimitive2, input_1 : &Value

#[ cfg ( feature = "vonuvoli_values_array" ) ]
BytesPrimitive2::BytesRangeToArray =>
return bytes_range_to_array (input_1, Some (input_2), None),
return bytes_range_to_array (input_1, Some (input_2), None, None),

#[ cfg ( feature = "vonuvoli_values_array" ) ]
BytesPrimitive2::ArrayRangeToBytes =>
Expand All @@ -400,71 +400,71 @@ pub fn bytes_primitive_2_evaluate (primitive : BytesPrimitive2, input_1 : &Value

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchExtractAllAsList =>
return bytes_regex_match_extract_all (input_1, input_2, false),
return bytes_regex_match_extract_all (input_1, input_2, false, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchExtractAllAsArray =>
return bytes_regex_match_extract_all (input_1, input_2, true),
return bytes_regex_match_extract_all (input_1, input_2, true, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchPositionFirst =>
return bytes_regex_match_position_first (input_1, input_2),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchPositionAllAsList =>
return bytes_regex_match_position_all (input_1, input_2, false),
return bytes_regex_match_position_all (input_1, input_2, false, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchPositionAllAsArray =>
return bytes_regex_match_position_all (input_1, input_2, true),
return bytes_regex_match_position_all (input_1, input_2, true, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesExtractFirstAsList =>
return bytes_regex_match_captures_extract_first (input_1, input_2, false, false, false),
return bytes_regex_match_captures_extract_first (input_1, input_2, false, false, false, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesExtractFirstAsAssoc =>
return bytes_regex_match_captures_extract_first (input_1, input_2, false, true, true),
return bytes_regex_match_captures_extract_first (input_1, input_2, false, true, true, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesExtractFirstAsArray =>
return bytes_regex_match_captures_extract_first (input_1, input_2, true, false, false),
return bytes_regex_match_captures_extract_first (input_1, input_2, true, false, false, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesExtractAllAsList =>
return bytes_regex_match_captures_extract_all (input_1, input_2, false, false, false),
return bytes_regex_match_captures_extract_all (input_1, input_2, false, false, false, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesExtractAllAsAssoc =>
return bytes_regex_match_captures_extract_all (input_1, input_2, false, true, true),
return bytes_regex_match_captures_extract_all (input_1, input_2, false, true, true, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesExtractAllAsArray =>
return bytes_regex_match_captures_extract_all (input_1, input_2, true, false, false),
return bytes_regex_match_captures_extract_all (input_1, input_2, true, false, false, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesPositionFirstAsList =>
return bytes_regex_match_captures_position_first (input_1, input_2, false, false, false),
return bytes_regex_match_captures_position_first (input_1, input_2, false, false, false, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesPositionFirstAsAssoc =>
return bytes_regex_match_captures_position_first (input_1, input_2, false, true, true),
return bytes_regex_match_captures_position_first (input_1, input_2, false, true, true, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesPositionFirstAsArray =>
return bytes_regex_match_captures_position_first (input_1, input_2, true, false, false),
return bytes_regex_match_captures_position_first (input_1, input_2, true, false, false, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesPositionAllAsList =>
return bytes_regex_match_captures_position_all (input_1, input_2, false, false, false),
return bytes_regex_match_captures_position_all (input_1, input_2, false, false, false, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesPositionAllAsAssoc =>
return bytes_regex_match_captures_position_all (input_1, input_2, false, true, true),
return bytes_regex_match_captures_position_all (input_1, input_2, false, true, true, None),

#[ cfg ( feature = "vonuvoli_builtins_regex" ) ]
BytesPrimitive2::BytesRegexMatchCapturesPositionAllAsArray =>
return bytes_regex_match_captures_position_all (input_1, input_2, true, false, false),
return bytes_regex_match_captures_position_all (input_1, input_2, true, false, false, None),

}
}
Expand Down Expand Up @@ -509,7 +509,7 @@ pub fn bytes_primitive_3_evaluate (primitive : BytesPrimitive3, input_1 : &Value

#[ cfg ( feature = "vonuvoli_values_array" ) ]
BytesPrimitive3::BytesRangeToArray =>
return bytes_range_to_array (input_1, Some (input_2), Some (input_3)),
return bytes_range_to_array (input_1, Some (input_2), Some (input_3), None),

#[ cfg ( feature = "vonuvoli_values_array" ) ]
BytesPrimitive3::ArrayRangeToBytes =>
Expand Down
32 changes: 16 additions & 16 deletions sources/primitives_filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,10 @@ pub fn filesystem_primitive_1_evaluate (primitive : FileSystemPrimitive1, input_
return filesystem_mountpoint_is (input_1, true) .into_0 (),

FileSystemPrimitive1::DirectoryListAsList =>
return filesystem_directory_list (input_1, false, false, false, true, true, false),
return filesystem_directory_list (input_1, false, false, false, true, true, false, None),

FileSystemPrimitive1::DirectoryListAsArray =>
return filesystem_directory_list (input_1, false, false, false, true, true, true),
return filesystem_directory_list (input_1, false, false, false, true, true, true, None),

FileSystemPrimitive1::MetadataResolve =>
return filesystem_metadata_resolve (input_1, true),
Expand Down Expand Up @@ -488,7 +488,7 @@ pub fn filesystem_primitive_1_evaluate (primitive : FileSystemPrimitive1, input_
return filesystem_path_join (&[input_1], true) .into_0 (),

FileSystemPrimitive1::PathSplit =>
return filesystem_path_split (input_1, false) .into_0 (),
return filesystem_path_split (input_1, false, None) .into_0 (),

FileSystemPrimitive1::PathName =>
return filesystem_path_name (input_1) .into_0 (),
Expand All @@ -503,7 +503,7 @@ pub fn filesystem_primitive_1_evaluate (primitive : FileSystemPrimitive1, input_
return filesystem_path_name_join (&[input_1]) .into_0 (),

FileSystemPrimitive1::PathNameSplit =>
return filesystem_path_name_split (input_1, false) .into_0 (),
return filesystem_path_name_split (input_1, false, None) .into_0 (),

#[ cfg ( feature = "vonuvoli_values_string" ) ]
FileSystemPrimitive1::PathToString =>
Expand Down Expand Up @@ -556,16 +556,16 @@ pub fn filesystem_primitive_2_evaluate (primitive : FileSystemPrimitive2, input_
return filesystem_mountpoint_is (input_1, try! (boolean_coerce (input_2))) .into_0 (),

FileSystemPrimitive2::DirectoryListAsList =>
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), false, false, true, true, false),
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), false, false, true, true, false, None),

FileSystemPrimitive2::DirectoryListAsArray =>
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), false, false, true, true, true),
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), false, false, true, true, true, None),

FileSystemPrimitive2::PathJoin =>
return filesystem_path_join (&[input_1, input_2], true) .into_0 (),

FileSystemPrimitive2::PathSplit =>
return filesystem_path_split (input_1, try! (boolean_coerce (input_2))) .into_0 (),
return filesystem_path_split (input_1, try! (boolean_coerce (input_2)), None) .into_0 (),

FileSystemPrimitive2::PathHasPrefix =>
return filesystem_path_has_prefix (input_1, input_2) .into_0 (),
Expand All @@ -577,7 +577,7 @@ pub fn filesystem_primitive_2_evaluate (primitive : FileSystemPrimitive2, input_
return filesystem_path_name_join (&[input_1, input_2]) .into_0 (),

FileSystemPrimitive2::PathNameSplit =>
return filesystem_path_name_split (input_1, try! (boolean_coerce (input_2))) .into_0 (),
return filesystem_path_name_split (input_1, try! (boolean_coerce (input_2)), None) .into_0 (),

FileSystemPrimitive2::MetadataResolve =>
return filesystem_metadata_resolve (input_1, try! (boolean_coerce (input_2))),
Expand Down Expand Up @@ -679,10 +679,10 @@ pub fn filesystem_primitive_3_evaluate (primitive : FileSystemPrimitive3, input_
match primitive {

FileSystemPrimitive3::DirectoryListAsList =>
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), false, true, true, false),
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), false, true, true, false, None),

FileSystemPrimitive3::DirectoryListAsArray =>
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), false, true, true, true),
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), false, true, true, true, None),

FileSystemPrimitive3::DirectoryListFold =>
return filesystem_directory_fold (input_1, input_2, input_3, false, false, false, true, evaluator),
Expand Down Expand Up @@ -718,10 +718,10 @@ pub fn filesystem_primitive_4_evaluate (primitive : FileSystemPrimitive4, input_
match primitive {

FileSystemPrimitive4::DirectoryListAsList =>
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), try! (boolean_coerce (input_4)), true, true, false),
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), try! (boolean_coerce (input_4)), true, true, false, None),

FileSystemPrimitive4::DirectoryListAsArray =>
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), try! (boolean_coerce (input_4)), true, true, true),
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), try! (boolean_coerce (input_4)), true, true, true, None),

FileSystemPrimitive4::DirectoryListFold =>
return filesystem_directory_fold (input_1, input_2, input_3, try! (boolean_coerce (input_4)), false, false, true, evaluator),
Expand All @@ -746,10 +746,10 @@ pub fn filesystem_primitive_5_evaluate (primitive : FileSystemPrimitive5, input_
match primitive {

FileSystemPrimitive5::DirectoryListAsList =>
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), try! (boolean_coerce (input_4)), try! (boolean_coerce (input_5)), true, false),
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), try! (boolean_coerce (input_4)), try! (boolean_coerce (input_5)), true, false, None),

FileSystemPrimitive5::DirectoryListAsArray =>
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), try! (boolean_coerce (input_4)), try! (boolean_coerce (input_5)), true, true),
return filesystem_directory_list (input_1, try! (boolean_coerce (input_2)), try! (boolean_coerce (input_3)), try! (boolean_coerce (input_4)), try! (boolean_coerce (input_5)), true, true, None),

FileSystemPrimitive5::DirectoryListFold =>
return filesystem_directory_fold (input_1, input_2, input_3, try! (boolean_coerce (input_4)), try! (boolean_coerce (input_5)), false, true, evaluator),
Expand All @@ -776,15 +776,15 @@ pub fn filesystem_primitive_n_evaluate (primitive : FileSystemPrimitiveN, inputs
FileSystemPrimitiveN::DirectoryListAsList =>
match inputs.len () {
6 =>
return filesystem_directory_list (inputs[0].as_ref (), try! (boolean_coerce (inputs[1].as_ref ())), try! (boolean_coerce (inputs[2].as_ref ())), try! (boolean_coerce (inputs[3].as_ref ())), try! (boolean_coerce (inputs[4].as_ref ())), try! (boolean_coerce (inputs[5].as_ref ())), false),
return filesystem_directory_list (inputs[0].as_ref (), try! (boolean_coerce (inputs[1].as_ref ())), try! (boolean_coerce (inputs[2].as_ref ())), try! (boolean_coerce (inputs[3].as_ref ())), try! (boolean_coerce (inputs[4].as_ref ())), try! (boolean_coerce (inputs[5].as_ref ())), false, None),
_ =>
fail! (0xecd0caf3),
},

FileSystemPrimitiveN::DirectoryListAsArray =>
match inputs.len () {
6 =>
return filesystem_directory_list (inputs[0].as_ref (), try! (boolean_coerce (inputs[1].as_ref ())), try! (boolean_coerce (inputs[2].as_ref ())), try! (boolean_coerce (inputs[3].as_ref ())), try! (boolean_coerce (inputs[4].as_ref ())), try! (boolean_coerce (inputs[5].as_ref ())), true),
return filesystem_directory_list (inputs[0].as_ref (), try! (boolean_coerce (inputs[1].as_ref ())), try! (boolean_coerce (inputs[2].as_ref ())), try! (boolean_coerce (inputs[3].as_ref ())), try! (boolean_coerce (inputs[4].as_ref ())), try! (boolean_coerce (inputs[5].as_ref ())), true, None),
_ =>
fail! (0x33a0d15b),
},
Expand Down
Loading

0 comments on commit fd8609e

Please sign in to comment.