kotlinx/ast

Why column is called row?

Opened this issue · 0 comments

Why column is called row? It appears in what astInfoOrNull returns.

Is it some slang/peculiarity in among parser writers? Or some typo? Or maybe I am mistaken about how English works?

I expected lines and columns, not lines and rows. And would expect row to be synonym of line, not of column.


BTW, #21 seems implemented and looks like it can be closed


wider explanation if above is unclear

With

private fun Ast.root(): Ast? {
    var returned: Ast? = null
    this.summary(false).onSuccess { returned = it.firstOrNull() }
    return returned
}

one may extract line and column with following code

private fun Ast.humanReadableDescription(): String {
    val current = this.root() ?: return "NULL"
    return "${current.astInfoOrNull!!.start.line}  ${current.astInfoOrNull!!.start.row}"
}

(I know that I can also use description - but that is not allowing me to format things like I want, in this case it is intended as the first step toward clear matching with parsed text)

I have just one question - why column is called row?