Line-oriented document structure, e.g. for fold handling.
*/
package isabelle
object Line_Structure { val init: Line_Structure = Line_Structure()
}
sealedcaseclass Line_Structure(
improper: Boolean = true,
blank: Boolean = true,
command: Boolean = false,
depth: Int = 0,
span_depth: Int = 0,
after_span_depth: Int = 0,
element_depth: Int = 0
) { def update(keywords: Keyword.Keywords, tokens: List[Token]): Line_Structure = { val improper1 = tokens.forall(tok => !tok.is_proper) val blank1 = tokens.forall(_.is_space) val command1 = tokens.exists(_.is_begin_or_command)
val command_depth =
tokens.iterator.filter(_.is_proper).nextOption() match { case Some(tok) => if (keywords.is_command(tok, Keyword.close_structure))
Some(after_span_depth - 1) else None case None => None
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.