Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ object Properties {
/** Specifies an index, e.g., for a parameter or argument. Explicit parameters are numbered from 1 to N, while index 0
* is reserved for implicit self / this parameter.
*/
val Index = flatgraph.SinglePropertyKey[Int](kind = 26, name = "INDEX", default = -1: Int)
val Index = flatgraph.SinglePropertyKey[Int](kind = 26, name = "INDEX", default = -2: Int)

/** The static types a TYPE_DECL inherits from. This property is matched against the FULL_NAME of TYPE nodes and thus
* it is required to have at least one TYPE node for each TYPE_FULL_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object PropertyDefaults {
val Filename = "<empty>"
val FullName = "<empty>"
val GenericSignature = "<empty>"
val Index = -1: Int
val Index = -2: Int
val IsExternal = false
val IsVariadic = false
val Key = "<empty>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ object Accessors {
nodeKind = node.nodeKind,
propertyKind = 26,
seq = node.seq(),
default = -1: Int
default = -2: Int
)
}
final class AccessPropertyInheritsFromTypeFullName(val node: nodes.StoredNode) extends AnyVal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ trait MethodParameterInBase
val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName;
if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName)
if (("<empty>": String) != this.evaluationStrategy) res.put("EVALUATION_STRATEGY", this.evaluationStrategy)
if ((-1: Int) != this.index) res.put("INDEX", this.index)
if ((-2: Int) != this.index) res.put("INDEX", this.index)
if ((false: Boolean) != this.isVariadic) res.put("IS_VARIADIC", this.isVariadic)
this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) }
if (("<empty>": String) != this.name) res.put("NAME", this.name)
Expand Down Expand Up @@ -72,7 +72,7 @@ object MethodParameterIn {
* passed by value, that is, a copy is made, 3) `BY_SHARING` the parameter is a pointer/reference and it is shared with
* the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made.
*
* ▸ Index (Int); Cardinality `one` (mandatory with default value `-1`); Specifies an index, e.g., for a parameter or
* ▸ Index (Int); Cardinality `one` (mandatory with default value `-2`); Specifies an index, e.g., for a parameter or
* argument. Explicit parameters are numbered from 1 to N, while index 0 is reserved for implicit self / this
* parameter.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ trait MethodParameterOutBase
if (("<empty>": String) != this.code) res.put("CODE", this.code)
this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) }
if (("<empty>": String) != this.evaluationStrategy) res.put("EVALUATION_STRATEGY", this.evaluationStrategy)
if ((-1: Int) != this.index) res.put("INDEX", this.index)
if ((-2: Int) != this.index) res.put("INDEX", this.index)
if ((false: Boolean) != this.isVariadic) res.put("IS_VARIADIC", this.isVariadic)
this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) }
if (("<empty>": String) != this.name) res.put("NAME", this.name)
Expand Down Expand Up @@ -58,7 +58,7 @@ object MethodParameterOut {
* passed by value, that is, a copy is made, 3) `BY_SHARING` the parameter is a pointer/reference and it is shared with
* the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made.
*
* ▸ Index (Int); Cardinality `one` (mandatory with default value `-1`); Specifies an index, e.g., for a parameter or
* ▸ Index (Int); Cardinality `one` (mandatory with default value `-2`); Specifies an index, e.g., for a parameter or
* argument. Explicit parameters are numbered from 1 to N, while index 0 is reserved for implicit self / this
* parameter.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2399,7 +2399,7 @@ class NewMethodParameterIn
var columnNumber: Option[Int] = None
var dynamicTypeHintFullName: IndexedSeq[String] = ArraySeq.empty
var evaluationStrategy: String = "<empty>": String
var index: Int = -1: Int
var index: Int = -2: Int
var isVariadic: Boolean = false: Boolean
var lineNumber: Option[Int] = None
var name: String = "<empty>": String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2314,7 +2314,7 @@ class NewMethodParameterOut
var code: String = "<empty>": String
var columnNumber: Option[Int] = None
var evaluationStrategy: String = "<empty>": String
var index: Int = -1: Int
var index: Int = -2: Int
var isVariadic: Boolean = false: Boolean
var lineNumber: Option[Int] = None
var name: String = "<empty>": String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ object Base extends SchemaBase {
| self / this parameter.
|""".stripMargin
)
.mandatory(PropertyDefaults.Int)
// We use a default value that is different from -1 because some code working with parameters and return
// values represent them in a single number plane where -1 encodes the return value and we do not want
// the "value unset" default value to collide with that.
.mandatory(-2)
.protoId(ProtoIds.Index)

val name = builder
Expand Down
Loading