Skip to content

Commit

Permalink
feat: Update SemanticAstNode.toString to return value/line/column ins…
Browse files Browse the repository at this point in the history
…tead of tokenValue/tokenLine/tokenColumn for easier debugging
  • Loading branch information
felipebz committed Jun 11, 2024
1 parent 88152d8 commit 5ef627a
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,17 @@ class SemanticAstNode(type: AstNodeType, name: String, token: Token?) : AstNode(
get() = tokens.joinToString(" ") { it.originalValue }

override fun toString(): String {
return super.toString() + if (plSqlDatatype !is UnknownDatatype) {
" datatype=$plSqlDatatype"
} else {
""
return buildString {
append(name)
if (tokenOrNull != null) {
append(" value='").append(token.value).append("'")
append(" line=").append(token.line)
append(" column=").append(token.column)
}
if (plSqlDatatype !is UnknownDatatype) {
append(" datatype=")
append(plSqlDatatype)
}
}
}
}

0 comments on commit 5ef627a

Please sign in to comment.