equal
deleted
inserted
replaced
303 datatype markup = Markup | MarkupEnv | Verbatim; |
303 datatype markup = Markup | MarkupEnv | Verbatim; |
304 |
304 |
305 local |
305 local |
306 |
306 |
307 val space_proper = |
307 val space_proper = |
308 Scan.one T.is_blank -- Scan.any T.is_comment -- Scan.one T.is_proper; |
308 Scan.one T.is_blank -- Scan.many T.is_comment -- Scan.one T.is_proper; |
309 |
309 |
310 val is_improper = not o (T.is_proper orf T.is_begin_ignore orf T.is_end_ignore); |
310 val is_improper = not o (T.is_proper orf T.is_begin_ignore orf T.is_end_ignore); |
311 val improper = Scan.any is_improper; |
311 val improper = Scan.many is_improper; |
312 val improper_end = Scan.repeat (Scan.unless space_proper (Scan.one is_improper)); |
312 val improper_end = Scan.repeat (Scan.unless space_proper (Scan.one is_improper)); |
313 val blank_end = Scan.repeat (Scan.unless space_proper (Scan.one T.is_blank)); |
313 val blank_end = Scan.repeat (Scan.unless space_proper (Scan.one T.is_blank)); |
314 |
314 |
315 val opt_newline = Scan.option (Scan.one T.is_newline); |
315 val opt_newline = Scan.option (Scan.one T.is_newline); |
316 |
316 |
373 fn (_, (BasicToken x, _)) => #2 T.stopper x | _ => false); |
373 fn (_, (BasicToken x, _)) => #2 T.stopper x | _ => false); |
374 |
374 |
375 val cmd = Scan.one (is_some o fst); |
375 val cmd = Scan.one (is_some o fst); |
376 val non_cmd = Scan.one (is_none o fst andf not o #2 stopper) >> #2; |
376 val non_cmd = Scan.one (is_none o fst andf not o #2 stopper) >> #2; |
377 |
377 |
378 val comments = Scan.any (comment_token o fst o snd); |
378 val comments = Scan.many (comment_token o fst o snd); |
379 val blank = Scan.one (blank_token o fst o snd); |
379 val blank = Scan.one (blank_token o fst o snd); |
380 val newline = Scan.one (newline_token o fst o snd); |
380 val newline = Scan.one (newline_token o fst o snd); |
381 val before_cmd = |
381 val before_cmd = |
382 Scan.option (newline -- comments) -- |
382 Scan.option (newline -- comments) -- |
383 Scan.option (newline -- comments) -- |
383 Scan.option (newline -- comments) -- |