Skip to content

Instantly share code, notes, and snippets.

@astrolemonade
Forked from kubukoz/cursed.scala
Created November 9, 2022 12:00
Show Gist options
  • Save astrolemonade/86e748c727990681ec1550862353e3f7 to your computer and use it in GitHub Desktop.
Save astrolemonade/86e748c727990681ec1550862353e3f7 to your computer and use it in GitHub Desktop.
git conflicts parsing as Scala
object main extends App {
object <<<<<<< {
def HEAD(s: String) = this
}
implicit class StringOps(s: String) {
def =======(i: Int) = s
def >>>>>>>(i: Int) = i
}
val git1 = 42
val a = 10
println(
<<<<<<< HEAD
"qux"
=======
"bar"
>>>>>>> git1-a
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment