Skip to content

Commit 3adac8d

Browse files
author
nathanielCherian
committed
Native Introspection Opcodes syntax highlighting
1 parent 8539420 commit 3adac8d

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

examples/next.cash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ contract P2PKH() {
44
function spend() {
55
// bytes2 left, bytes2 right = 0x123456.split(2);
66
// require(left == right);
7+
78
require(tx.outputs[0].value == tx.inputs[this.activeInputIndex].value - 1000);
89
}
910
}

syntaxes/cashscript.tmLanguage.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
},
6868
{
6969
"include": "#control-other"
70+
},
71+
{
72+
"include": "#control-this"
7073
}
7174
]
7275
},
@@ -92,7 +95,10 @@
9295
"match": "\\b(new)\\b",
9396
"name": "keyword.control.cashscript"
9497
},
95-
98+
"control-this": {
99+
"match": "\\b(this)\\b",
100+
"name": "variable.language.transaction.cashscript"
101+
},
96102
"constant": {
97103
"patterns": [
98104
{
@@ -176,7 +182,7 @@
176182
"global-variables": {
177183
"patterns": [
178184
{
179-
"match": "\\b(tx)(?:.(time|age|version|hashPrevouts|hashSequence|outpoint|bytecode|value|sequence|hashOutputs|locktime|hashtype|preimage))?\\b",
185+
"match": "\\b(tx)(?:.(version|locktime|inputs|outputs))?\\b",
180186
"captures":{
181187
"1":{
182188
"name":"variable.language.transaction.cashscript"

0 commit comments

Comments
 (0)