mirror of
				https://github.com/GayPizzaSpecifications/pork.git
				synced 2025-11-04 09:59:39 +00:00 
			
		
		
		
	Fix some overqualifications due to IDE renaming.
This commit is contained in:
		@ -2,12 +2,13 @@ package gay.pizza.pork.tool
 | 
			
		||||
 | 
			
		||||
import gay.pizza.pork.frontend.ContentSource
 | 
			
		||||
import gay.pizza.pork.frontend.FsContentSource
 | 
			
		||||
import gay.pizza.pork.parser.CharSource
 | 
			
		||||
import gay.pizza.pork.parser.StringCharSource
 | 
			
		||||
import java.nio.file.Path
 | 
			
		||||
import kotlin.io.path.readText
 | 
			
		||||
 | 
			
		||||
class FileTool(val path: Path) : Tool() {
 | 
			
		||||
  override fun createCharSource(): gay.pizza.pork.parser.CharSource = StringCharSource(path.readText())
 | 
			
		||||
  override fun createCharSource(): CharSource = StringCharSource(path.readText())
 | 
			
		||||
  override fun createContentSource(): ContentSource = FsContentSource(path.parent)
 | 
			
		||||
  override fun rootFilePath(): String = path.fileName.toString()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -3,12 +3,13 @@ package gay.pizza.pork.tool
 | 
			
		||||
import com.github.ajalt.clikt.core.CliktCommand
 | 
			
		||||
import com.github.ajalt.clikt.parameters.arguments.argument
 | 
			
		||||
import com.github.ajalt.clikt.parameters.types.path
 | 
			
		||||
import gay.pizza.pork.parser.AnsiHighlightScheme
 | 
			
		||||
 | 
			
		||||
class HighlightCommand : CliktCommand(help = "Syntax Highlighter", name = "highlight") {
 | 
			
		||||
  val path by argument("file").path(mustExist = true, canBeDir = false)
 | 
			
		||||
 | 
			
		||||
  override fun run() {
 | 
			
		||||
    val tool = FileTool(path)
 | 
			
		||||
    print(tool.highlight(gay.pizza.pork.parser.AnsiHighlightScheme()).joinToString(""))
 | 
			
		||||
    print(tool.highlight(AnsiHighlightScheme()).joinToString(""))
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user