src/Pure/Isar/outer_parse.ML
changeset 7477 c7caea1ce78c
parent 7418 87c12d352bab
child 7930 220892918bd1
equal deleted inserted replaced
7476:85c8be727fdb 7477:c7caea1ce78c
    16   val keyword: token list -> string * token list
    16   val keyword: token list -> string * token list
    17   val short_ident: token list -> string * token list
    17   val short_ident: token list -> string * token list
    18   val long_ident: token list -> string * token list
    18   val long_ident: token list -> string * token list
    19   val sym_ident: token list -> string * token list
    19   val sym_ident: token list -> string * token list
    20   val term_var: token list -> string * token list
    20   val term_var: token list -> string * token list
    21   val text_var: token list -> string * token list
       
    22   val type_ident: token list -> string * token list
    21   val type_ident: token list -> string * token list
    23   val type_var: token list -> string * token list
    22   val type_var: token list -> string * token list
    24   val number: token list -> string * token list
    23   val number: token list -> string * token list
    25   val string: token list -> string * token list
    24   val string: token list -> string * token list
    26   val verbatim: token list -> string * token list
    25   val verbatim: token list -> string * token list
   119 val keyword = kind OuterLex.Keyword;
   118 val keyword = kind OuterLex.Keyword;
   120 val short_ident = kind OuterLex.Ident;
   119 val short_ident = kind OuterLex.Ident;
   121 val long_ident = kind OuterLex.LongIdent;
   120 val long_ident = kind OuterLex.LongIdent;
   122 val sym_ident = kind OuterLex.SymIdent;
   121 val sym_ident = kind OuterLex.SymIdent;
   123 val term_var = kind OuterLex.Var;
   122 val term_var = kind OuterLex.Var;
   124 val text_var = kind OuterLex.TextVar;
       
   125 val type_ident = kind OuterLex.TypeIdent;
   123 val type_ident = kind OuterLex.TypeIdent;
   126 val type_var = kind OuterLex.TypeVar;
   124 val type_var = kind OuterLex.TypeVar;
   127 val number = kind OuterLex.Nat;
   125 val number = kind OuterLex.Nat;
   128 val string = kind OuterLex.String;
   126 val string = kind OuterLex.String;
   129 val verbatim = kind OuterLex.Verbatim;
   127 val verbatim = kind OuterLex.Verbatim;
   220   name -- ($$$ "::" |-- !!! (typ -- opt_mixfix)) >> triple2;
   218   name -- ($$$ "::" |-- !!! (typ -- opt_mixfix)) >> triple2;
   221 
   219 
   222 
   220 
   223 (* terms *)
   221 (* terms *)
   224 
   222 
   225 val trm = short_ident || long_ident || sym_ident || term_var || text_var || number || string;
   223 val trm = short_ident || long_ident || sym_ident || term_var || number || string;
   226 
   224 
   227 val term = group "term" trm;
   225 val term = group "term" trm;
   228 val prop = group "proposition" trm;
   226 val prop = group "proposition" trm;
   229 
   227 
   230 
   228 
   243 
   241 
   244 fun keyword_symid is_symid = Scan.one (OuterLex.keyword_with is_symid) >> OuterLex.val_of;
   242 fun keyword_symid is_symid = Scan.one (OuterLex.keyword_with is_symid) >> OuterLex.val_of;
   245 
   243 
   246 fun atom_arg is_symid blk =
   244 fun atom_arg is_symid blk =
   247   group "argument"
   245   group "argument"
   248     (position (short_ident || long_ident || sym_ident || term_var || text_var ||
   246     (position (short_ident || long_ident || sym_ident || term_var ||
   249         type_ident || type_var || number) >> Args.ident ||
   247         type_ident || type_var || number) >> Args.ident ||
   250       position (keyword_symid is_symid) >> Args.keyword ||
   248       position (keyword_symid is_symid) >> Args.keyword ||
   251       position string >> Args.string ||
   249       position string >> Args.string ||
   252       position (if blk then $$$ "," else Scan.fail) >> Args.keyword);
   250       position (if blk then $$$ "," else Scan.fail) >> Args.keyword);
   253 
   251