All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.dingyi222666.monarch.languages.LanguagePowershell.kt Maven / Gradle / Ivy

The newest version!
package io.github.dingyi222666.monarch.languages

import io.github.dingyi222666.monarch.common.*
 import io.github.dingyi222666.monarch.loader.dsl.*
import io.github.dingyi222666.monarch.types.IMonarchLanguage

public val PowershellLanguage: IMonarchLanguage by lazy {
  buildMonarchLanguage {
    tokenPostfix = ".ps1"
    ignoreCase = true
    defaultToken = ""
    brackets {
      bracket("{","}","delimiter.curly")
      bracket("[","]","delimiter.square")
      bracket("(",")","delimiter.parenthesis")
    }
    keywords("begin", "break", "catch", "class", "continue", "data", "define", "do", "dynamicparam",
        "else", "elseif", "end", "exit", "filter", "finally", "for", "foreach", "from", "function",
        "if", "in", "param", "process", "return", "switch", "throw", "trap", "try", "until",
        "using", "var", "while", "workflow", "parallel", "sequence", "inlinescript",
        "configuration")
    "helpKeywords" and
        "SYNOPSIS|DESCRIPTION|PARAMETER|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|ROLE|FUNCTIONALITY|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP"
    symbols("[=>".action("comment").state("@pop")
        "(\\.)(@helpKeywords)(?!\\w)".action {
          token = "comment.keyword.${'$'}2"
        }
        "[\\.#]".token("comment")
      }
    }
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy