src/Pure/Thy/thy_header.ML
changeset 58999 ed09ae4ea2d8
parent 58932 5fd496c26e3b
child 59693 d96cb03caf9e
equal deleted inserted replaced
58998:6237574c705b 58999:ed09ae4ea2d8
    44 val headerN = "header";
    44 val headerN = "header";
    45 val chapterN = "chapter";
    45 val chapterN = "chapter";
    46 val sectionN = "section";
    46 val sectionN = "section";
    47 val subsectionN = "subsection";
    47 val subsectionN = "subsection";
    48 val subsubsectionN = "subsubsection";
    48 val subsubsectionN = "subsubsection";
       
    49 val textN = "text";
       
    50 val txtN = "txt";
       
    51 val text_rawN = "text_raw";
    49 
    52 
    50 val theoryN = "theory";
    53 val theoryN = "theory";
    51 val importsN = "imports";
    54 val importsN = "imports";
    52 val keywordsN = "keywords";
    55 val keywordsN = "keywords";
    53 val beginN = "begin";
    56 val beginN = "begin";
    63      ("==", NONE),
    66      ("==", NONE),
    64      ("and", NONE),
    67      ("and", NONE),
    65      (beginN, NONE),
    68      (beginN, NONE),
    66      (importsN, NONE),
    69      (importsN, NONE),
    67      (keywordsN, NONE),
    70      (keywordsN, NONE),
    68      (headerN, SOME ((Keyword.heading, []), [])),
    71      (headerN, SOME ((Keyword.document_heading, []), [])),
    69      (chapterN, SOME ((Keyword.heading, []), [])),
    72      (chapterN, SOME ((Keyword.document_heading, []), [])),
    70      (sectionN, SOME ((Keyword.heading, []), [])),
    73      (sectionN, SOME ((Keyword.document_heading, []), [])),
    71      (subsectionN, SOME ((Keyword.heading, []), [])),
    74      (subsectionN, SOME ((Keyword.document_heading, []), [])),
    72      (subsubsectionN, SOME ((Keyword.heading, []), [])),
    75      (subsubsectionN, SOME ((Keyword.document_heading, []), [])),
       
    76      (textN, SOME ((Keyword.document_body, []), [])),
       
    77      (txtN, SOME ((Keyword.document_body, []), [])),
       
    78      (text_rawN, SOME ((Keyword.document_raw, []), [])),
    73      (theoryN, SOME ((Keyword.thy_begin, []), ["theory"])),
    79      (theoryN, SOME ((Keyword.thy_begin, []), ["theory"])),
    74      ("ML_file", SOME ((Keyword.thy_load, []), ["ML"]))];
    80      ("ML_file", SOME ((Keyword.thy_load, []), ["ML"]))];
    75 
    81 
    76 
    82 
    77 (* theory data *)
    83 (* theory data *)
   136 val heading =
   142 val heading =
   137   (Parse.command headerN ||
   143   (Parse.command headerN ||
   138     Parse.command chapterN ||
   144     Parse.command chapterN ||
   139     Parse.command sectionN ||
   145     Parse.command sectionN ||
   140     Parse.command subsectionN ||
   146     Parse.command subsectionN ||
   141     Parse.command subsubsectionN) --
   147     Parse.command subsubsectionN ||
       
   148     Parse.command textN ||
       
   149     Parse.command txtN ||
       
   150     Parse.command text_rawN) --
   142   Parse.tags -- Parse.!!! Parse.document_source;
   151   Parse.tags -- Parse.!!! Parse.document_source;
   143 
   152 
   144 val header =
   153 val header =
   145   (Scan.repeat heading -- Parse.command theoryN -- Parse.tags) |-- Parse.!!! args;
   154   (Scan.repeat heading -- Parse.command theoryN -- Parse.tags) |-- Parse.!!! args;
   146 
   155