修复故事线独立情况下崩溃的bug
This commit is contained in:
parent
0b68468679
commit
adb6e326d2
|
@ -980,7 +980,7 @@ open System.IO
|
||||||
$"{a.Value.name()}&{b.name()}", b.address())
|
$"{a.Value.name()}&{b.name()}", b.address())
|
||||||
|
|
||||||
// 故事线之间的节点连线
|
// 故事线之间的节点连线
|
||||||
let towards_arrs = fragment_defs|> List.map(fun (_, defn) ->
|
let towards_prim = fragment_defs|> List.map(fun (_, defn) ->
|
||||||
let node_refs = defn.children() |> List.filter(fun v -> v:? AstImport.FragmentRef)
|
let node_refs = defn.children() |> List.filter(fun v -> v:? AstImport.FragmentRef)
|
||||||
|> List.map(fun v -> v:?> AstImport.FragmentRef)
|
|> List.map(fun v -> v:?> AstImport.FragmentRef)
|
||||||
|
|
||||||
|
@ -992,10 +992,14 @@ open System.IO
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|> List.reduce(fun al bl-> al @ bl)
|
|> List.reduce(fun al bl-> al @ bl)
|
||||||
|> List.reduce(fun a b -> a + b)
|
|
||||||
let all_arrows = arrows_decl + towards_arrs
|
|
||||||
|
|
||||||
|
|
||||||
|
let all_arrows =
|
||||||
|
if towards_prim.IsEmpty then
|
||||||
|
arrows_decl
|
||||||
|
else
|
||||||
|
let towards_arrs = towards_prim |> List.reduce(fun a b -> a + b)
|
||||||
|
arrows_decl + towards_arrs
|
||||||
|
|
||||||
$"""digraph node_relates{{
|
$"""digraph node_relates{{
|
||||||
rankdir=LR
|
rankdir=LR
|
||||||
label="{gname}"
|
label="{gname}"
|
||||||
|
@ -1087,17 +1091,25 @@ open System.IO
|
||||||
|> List.map(fun v -> v, (v.children()|> List.filter(fun v-> v:? AstImport.FragmentRef))) // 获取文章节点和他的引用线
|
|> List.map(fun v -> v, (v.children()|> List.filter(fun v-> v:? AstImport.FragmentRef))) // 获取文章节点和他的引用线
|
||||||
|> List.filter(fun (_, al)-> al.Length > 0)
|
|> List.filter(fun (_, al)-> al.Length > 0)
|
||||||
|
|
||||||
let refers = rst|> List.map(fun (a, refsa) ->
|
let refers_prim=
|
||||||
refsa|> List.map(fun refn ->
|
if not rst.IsEmpty then
|
||||||
let refx = refn :?> AstImport.FragmentRef
|
rst |> List.map(fun (a, refsa) ->
|
||||||
let target_name = $"""{refx.storyRef()}&{refx.sliceRef()}"""
|
refsa |> List.map(fun refn ->
|
||||||
let _, target_address = node_map|> List.filter(fun (a, _) -> a = target_name)|> List.item 0
|
let refx = refn :?> AstImport.FragmentRef
|
||||||
$"""node_{a.address()}--node_{target_address}
|
let target_name = $"""{refx.storyRef()}&{refx.sliceRef()}"""
|
||||||
"""
|
let _, target_address = node_map|> List.filter(fun (a, _) -> a = target_name)|> List.item 0
|
||||||
)
|
$"""node_{a.address()}--node_{target_address}
|
||||||
)
|
"""
|
||||||
|> List.reduce (fun a b -> a @ b)
|
)
|
||||||
|> List.reduce (fun a b -> a + b)
|
)
|
||||||
|
|> List.reduce (fun a b -> a @ b)
|
||||||
|
else []
|
||||||
|
|
||||||
|
let refers =
|
||||||
|
if refers_prim.IsEmpty then
|
||||||
|
""
|
||||||
|
else
|
||||||
|
refers_prim |> List.reduce (fun a b -> a + b)
|
||||||
|
|
||||||
$"""graph{{ label="{gname}" {clusters_desc} {refers} }}"""
|
$"""graph{{ label="{gname}" {clusters_desc} {refers} }}"""
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"AstConv": {
|
"AstConv": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"commandLineArgs": "--file \"E:/storyline.xast\" --format"
|
"commandLineArgs": "--file \"E:/storyline.xast\" --html \"E:/html\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue