aboutsummaryrefslogtreecommitdiffstats
path: root/FMark/src
diff options
context:
space:
mode:
authorQieerb <qieerbushe7@gmail.com>2018-03-22 19:32:53 +0000
committerQieerb <qieerbushe7@gmail.com>2018-03-22 19:32:53 +0000
commitcc7e89378daf0a9c853c8c245e0b54bec6a8fb61 (patch)
tree215e5b06c161db050774395d18c5b022eea45583 /FMark/src
parentd12b05aa4443ba1d731e6c436d489cb6759c2942 (diff)
downloadFMark-cc7e89378daf0a9c853c8c245e0b54bec6a8fb61.tar.gz
FMark-cc7e89378daf0a9c853c8c245e0b54bec6a8fb61.zip
RefStyle can be anywhere in document
Diffstat (limited to 'FMark/src')
-rw-r--r--FMark/src/Common/TOCite/TOCite.fs30
1 files changed, 16 insertions, 14 deletions
diff --git a/FMark/src/Common/TOCite/TOCite.fs b/FMark/src/Common/TOCite/TOCite.fs
index 4eeefd5..119bd4c 100644
--- a/FMark/src/Common/TOCite/TOCite.fs
+++ b/FMark/src/Common/TOCite/TOCite.fs
@@ -103,20 +103,22 @@ let rec citeParse' style tocLst :ParsedObj list*Token list =
|> fun (x,y) -> x, t::y
| [] -> [], []
-let rec styleParse rLst tocLst =
- let stylify str =
- match str with
- | "Harvard" -> Some Harvard
- | "Chicago" -> Some Chicago
- | "IEEE" -> Some IEEE
- | _ -> None // use default
- match tocLst with
- | ENDLINE::PERCENT::PERCENT::LITERAL "RefStyle"::AgnoEqual tail ->
- match tail with
- | LITERAL lit::tl -> stylify lit, List.append rLst tl
- | _ -> styleParse (tocLst.Head::rLst) tocLst.Tail
- | a::tl -> styleParse (a::rLst) tl
- | [] -> None, rLst
+let styleParse rLst tocLst =
+ let rec styleParse' rLst tocLst =
+ let stylify str =
+ match str with
+ | "Harvard" -> Some Harvard
+ | "Chicago" -> Some Chicago
+ | "IEEE" -> Some IEEE
+ | _ -> None // use default
+ match tocLst with
+ | ENDLINE::PERCENT::PERCENT::LITERAL "RefStyle"::AgnoEqual tail ->
+ match tail with
+ | LITERAL lit::tl -> stylify lit, List.append (List.rev rLst) tl
+ | _ -> styleParse' (tocLst.Head::rLst) tocLst.Tail
+ | a::tl -> styleParse' (a::rLst) tl
+ | [] -> None, rLst
+ styleParse' rLst tocLst
//type change and sorting
// might change now that there are string IDs