src/Pure/Isar/outer_syntax.scala
changeset 40533 e38e80686ce5
parent 40459 913e545d9a9b
child 43411 0206466ee473
equal deleted inserted replaced
40532:f51c478ef85a 40533:e38e80686ce5
    16   protected val lexicon: Scan.Lexicon = Scan.Lexicon.empty
    16   protected val lexicon: Scan.Lexicon = Scan.Lexicon.empty
    17   lazy val completion: Completion = new Completion + symbols  // FIXME !?
    17   lazy val completion: Completion = new Completion + symbols  // FIXME !?
    18 
    18 
    19   def keyword_kind(name: String): Option[String] = keywords.get(name)
    19   def keyword_kind(name: String): Option[String] = keywords.get(name)
    20 
    20 
    21   def + (name: String, kind: String): Outer_Syntax =
    21   def + (name: String, kind: String, replace: String): Outer_Syntax =
    22   {
    22   {
    23     val new_keywords = keywords + (name -> kind)
    23     val new_keywords = keywords + (name -> kind)
    24     val new_lexicon = lexicon + name
    24     val new_lexicon = lexicon + name
    25     val new_completion = completion + name
    25     val new_completion = completion + (name, replace)
    26     new Outer_Syntax(symbols) {
    26     new Outer_Syntax(symbols) {
    27       override val lexicon = new_lexicon
    27       override val lexicon = new_lexicon
    28       override val keywords = new_keywords
    28       override val keywords = new_keywords
    29       override lazy val completion = new_completion
    29       override lazy val completion = new_completion
    30     }
    30     }
    31   }
    31   }
       
    32 
       
    33   def + (name: String, kind: String): Outer_Syntax = this + (name, kind, name)
    32 
    34 
    33   def + (name: String): Outer_Syntax = this + (name, Keyword.MINOR)
    35   def + (name: String): Outer_Syntax = this + (name, Keyword.MINOR)
    34 
    36 
    35   def is_command(name: String): Boolean =
    37   def is_command(name: String): Boolean =
    36     keyword_kind(name) match {
    38     keyword_kind(name) match {