aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarie <arie@alleycat.cc>2021-06-28 12:19:27 +0200
committerarie <arie@alleycat.cc>2021-06-28 21:08:44 +0200
commit006fb92bcb85afe6bf404a794ddaefb9e0ad3c9c (patch)
tree536bba848769dccf12173643a9ec23218ceee701
parent536e4421a4465cffe2ddfc9b7e629cdd79d08ea7 (diff)
Rdf-turtle lib/parser.ml: Add a remark about parsers and how to improve them.
-rw-r--r--lib/turtle/parser.ml5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/turtle/parser.ml b/lib/turtle/parser.ml
index 81822cb..ab6f6a6 100644
--- a/lib/turtle/parser.ml
+++ b/lib/turtle/parser.ml
@@ -135,6 +135,11 @@ let predicate =
(* "\"That Seventies Show\"^^xsd:string" *)
(* Same thing for blank_node! *)
(* Note: this happens for a lot of parsers.. Not sure what the best solution is: to play with the order until it's right, or to make parsers more specific (e.g. fail when you encounter this or that character) *)
+(* Note: in terms of speed / efficiency, it's probably better to not use 'choice' or <|> too often. *)
+(* For example, one could use peek_char to check whether there's a '(', "_:", "\"" "<" *)
+(* But doesn't it already work a bit like that? Because those respective parsers: collection, *)
+(* bnodps, literal, blank_node etc, first check whether these chars are present. *)
+
let object_ collection bnodps =
choice [
(lift