From b17110db7c16da405fa0acd160bad78c02248995 Mon Sep 17 00:00:00 2001 From: bu Date: Thu, 4 Oct 2018 17:25:45 +0200 Subject: [PATCH] comment inside meta_args problem solved. --- Isa_DOF.thy | 14 ++++++---- examples/scholarly/IsaDofApplications.thy | 23 ++++++++++------- patches/thy_output.ML | 31 +++++------------------ 3 files changed, 30 insertions(+), 38 deletions(-) diff --git a/Isa_DOF.thy b/Isa_DOF.thy index fb92e40..b079664 100644 --- a/Isa_DOF.thy +++ b/Isa_DOF.thy @@ -686,21 +686,25 @@ fun meta_args_2_string thy ((((lab, _), cid_opt), attr_list) : meta_args_t) = val semi = Scan.option (Parse.$$$ ";"); val is_improper = not o (Token.is_proper orf Token.is_begin_ignore orf Token.is_end_ignore); -val improper = Scan.many is_improper; +val improper = Scan.many is_improper; (* parses white-space and comments *) val attribute = Parse.position Parse.const --| improper - -- Scan.optional (Parse.$$$ "=" --| improper |-- Parse.!!! Parse.term) "True" + -- Scan.optional (Parse.$$$ "=" --| improper |-- Parse.!!! Parse.term --| improper) "True" : ((string * Position.T) * string) parser; val attribute_upd : (((string * Position.T) * string) * string) parser = Parse.position Parse.const - -- (@{keyword "+="} || @{keyword ":="}) - -- Parse.!!! Parse.term; + --| improper + -- ((@{keyword "+="} --| improper) || (@{keyword ":="} --| improper)) + -- Parse.!!! Parse.term + --| improper + : (((string * Position.T) * string) * string) parser; val reference = Parse.position Parse.name + --| improper -- Scan.option (Parse.$$$ "::" -- improper |-- Parse.!!! (Parse.position Parse.name)); @@ -717,7 +721,7 @@ val attributes_upd = -- improper |-- (reference -- (Scan.optional(Parse.$$$ "," -- improper |-- (Parse.enum "," (improper |-- attribute_upd)))) [])) - --| Parse.$$$ "]" + --| Parse.$$$ "]" diff --git a/examples/scholarly/IsaDofApplications.thy b/examples/scholarly/IsaDofApplications.thy index 5cad9b8..dce6a50 100644 --- a/examples/scholarly/IsaDofApplications.thy +++ b/examples/scholarly/IsaDofApplications.thy @@ -4,24 +4,29 @@ theory IsaDofApplications begin (*>*) -title*[ -tit::title]\Using the Isabelle Ontology Framework\ +title* +[ +tit +:: +title] +\Using the Isabelle Ontology Framework\ subtitle*[stit::subtitle] + \Linking the Formal with the Informal\ -text*[adb::author, +text*[adb:: author, email="''a.brucker@sheffield.ac.uk''", orcid="''0000-0002-6355-1200''", affiliation="''The University of Sheffield, Sheffield, UK''"]\Achim D. Brucker\ text*[idir::author, - email="''idir.aitsadoune@centralesupelec.fr''", - affiliation="''CentraleSupelec, Paris, France''"]\Idir Ait-Sadoune\ + email = "''idir.aitsadoune@centralesupelec.fr''", + affiliation = "''CentraleSupelec, Paris, France''"]\Idir Ait-Sadoune\ text*[paolo::author, - email="''paolo.crisafulli@irt-systemx.fr''", - affiliation="''IRT-SystemX, Paris, France''"]\Paolo Crisafulli\ + email = "''paolo.crisafulli@irt-systemx.fr''", + affiliation= "''IRT-SystemX, Paris, France''"]\Paolo Crisafulli\ text*[bu::author, - email = "''wolff@lri.fr''", - affiliation="''Universit\\'e Paris-Sud, Paris, France''"]\Burkhart Wolff\ + email = "''wolff@lri.fr''", + affiliation = "''Universit\\'e Paris-Sud, Paris, France''"]\Burkhart Wolff\ text*[abs::abstract, diff --git a/patches/thy_output.ML b/patches/thy_output.ML index e5c8882..a503c19 100644 --- a/patches/thy_output.ML +++ b/patches/thy_output.ML @@ -408,23 +408,6 @@ val locale = Scan.option ((Parse.$$$ "(" -- improper -- Parse.$$$ "in") |-- Parse.!!! (improper |-- Parse.name --| (improper -- Parse.$$$ ")"))); -(* -val reference = - Parse.position Parse.name - -- Scan.option (Parse.$$$ "::" |-- Parse.!!! (Parse.position Parse.name)); - -val attribute = - Parse.position Parse.const - -- Scan.optional (Parse.$$$ "=" |-- Parse.!!! Parse.term) ""; - -val attributes = - (Parse.$$$ "[" - |-- (reference -- - (Scan.optional(Parse.$$$ "," |-- (Parse.enum "," attribute))) [])) - --| Parse.$$$ "]" - -fun convert_meta_args (NONE : ((((string * Position.T) * (string * Position.T) option) * ((string * Position.T) * string) list) option)) = "" -*) val meta_args_parser_hook = Unsynchronized.ref((fn thy => fn s => ("",s)): theory -> string parser) @@ -441,15 +424,15 @@ fun present_thy thy command_results toks = fun markup pred mk flag = Scan.peek (fn d => improper |-- - Parse.position (Scan.one (fn tok => - Token.is_command tok andalso pred keywords (Token.content_of tok))) -- + Parse.position (Scan.one (fn tok => Token.is_command tok andalso + pred keywords (Token.content_of tok))) -- Scan.repeat tag -- - Parse.!!!! - ( (!meta_args_parser_hook thy) - -- - ( (improper -- locale -- improper) + (improper |-- + (Parse.!!!! + ( (!meta_args_parser_hook thy) + -- ( (improper -- locale -- improper) |-- (Parse.document_source)) - --| improper_end) + --| improper_end))) >> (fn (((tok, pos'), tags), (meta_args,source)) => let val name = Token.content_of tok in (SOME (name, pos', tags), (mk (name, meta_args, source), (flag, d))) end));