Commit c2374bb5 authored by John van Groningen's avatar John van Groningen

Merge branch 'remove-duplicate-code-in-graphcopy' into 'master'

Move common functions copy_to_string and copy_from_string to new module graph_copy

See merge request !5
parents 758939da 4b168a24
definition module dynamic_string
import StdDynamic
import graph_copy
dynamic_to_string :: !Dynamic -> *{#Char}
string_to_dynamic :: *{#Char} -> .Dynamic
copy_to_string :: !.a -> *{#Char}
copy_from_string :: !*{#Char} -> (.a,!Int)
......@@ -3,25 +3,7 @@ implementation module dynamic_string
import StdDynamic
import StdEnv
import code from "copy_graph_to_string_interface."
import code from "copy_graph_to_string."
import code from "copy_string_to_graph_interface."
import code from "copy_string_to_graph."
copy_to_string :: !.a -> *{#Char}
copy_to_string g = code {
.d 1 0
jsr _copy_graph_to_string
.o 1 0
}
copy_from_string :: !*{#Char} -> (.a,!Int)
copy_from_string g = code {
.d 1 0
jsr _copy_string_to_graph
.o 1 0
pushI 0
}
import graph_copy
dynamic_to_string :: !Dynamic -> *{#Char}
dynamic_to_string d
......
definition module graph_copy
copy_to_string :: !.a -> *{#Char}
copy_from_string :: !*{#Char} -> (.a,!Int)
implementation module graph_copy
import code from "copy_graph_to_string_interface."
import code from "copy_graph_to_string."
import code from "copy_string_to_graph_interface."
import code from "copy_string_to_graph."
copy_to_string :: !.a -> *{#Char}
copy_to_string g = code {
.d 1 0
jsr _copy_graph_to_string
.o 1 0
}
copy_from_string :: !*{#Char} -> (.a,!Int)
copy_from_string g = code {
.d 1 0
jsr _copy_string_to_graph
.o 1 0
pushI 0
}
......@@ -3,27 +3,9 @@ implementation module graph_copy_with_names;
import StdEnv;
import _SystemStrictLists;
import code from "copy_graph_to_string_interface.";
import code from "copy_graph_to_string.";
import code from "copy_string_to_graph_interface.";
import code from "copy_string_to_graph.";
import graph_copy;
import symbols_in_program;
copy_to_string :: !.a -> *{#Char};
copy_to_string g = code {
.d 1 0
jsr _copy_graph_to_string
.o 1 0
}
copy_from_string :: !*{#Char} -> (.a,!Int);
copy_from_string g = code {
.d 1 0
jsr _copy_string_to_graph
.o 1 0
pushI 0
}
get_D_from_string s i :== IF_INT_64_OR_32 (get_D_from_string_64 s i) (get_D_from_string_32 s i);
get_D_from_string_32 :: !{#Char} !Int -> Int;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment