Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why column is called row? #77

Open
matkoniecz opened this issue Jul 16, 2022 · 0 comments
Open

Why column is called row? #77

matkoniecz opened this issue Jul 16, 2022 · 0 comments

Comments

@matkoniecz
Copy link
Contributor

matkoniecz commented Jul 16, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant