Skip to content

Commit 2bf7a91

Browse files
committed
feat: add more primitives
1 parent 0c2ec06 commit 2bf7a91

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/main/kotlin/com/github/xepozz/php_opcodes_language/Primitives.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ enum class Primitives {
66
`false`,
77
int,
88
long,
9-
string,
109
double,
1110
float,
11+
string,
1212
`null`,
1313
array,
14-
global,
1514
`object`,
1615
resource,
16+
global,
17+
parent,
18+
exception,
1719
}

src/main/kotlin/com/github/xepozz/php_opcodes_language/language/reference/PHPOpReferenceContributor.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ class PHPOpReferenceContributor : PsiReferenceContributor() {
4242
PlatformPatterns.and(
4343
PlatformPatterns.psiElement(PHPOpParameter::class.java),
4444
PlatformPatterns.not(
45-
PlatformPatterns.psiElement(PHPOpParameter::class.java).withName(Opcodes.THIS.name)
45+
PlatformPatterns.psiElement(PHPOpParameter::class.java)
46+
.withName(
47+
Opcodes.THIS.name,
48+
*Primitives.entries
49+
.map { it.name }
50+
.toTypedArray(),
51+
)
4652
)
4753
),
4854
PlatformPatterns.psiElement(PHPOpParenParameter::class.java),

0 commit comments

Comments
 (0)