-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add highlight in color settings page for directive, function and type
- Loading branch information
1 parent
4726190
commit 7b147fb
Showing
4 changed files
with
53 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.wavesplatform.rideplugin | ||
|
||
import com.intellij.openapi.util.io.StreamUtil | ||
import java.io.BufferedReader | ||
import java.io.InputStreamReader | ||
|
||
fun loadCodeSampleResource(ctx: Any, resource: String): String { | ||
val stream = ctx.javaClass.classLoader.getResourceAsStream(resource)!! | ||
return StreamUtil.convertSeparators(StreamUtil.readText(BufferedReader(InputStreamReader(stream)))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<Directive>{-# SCRIPT_TYPE ACCOUNT #-}</Directive> | ||
<Directive>{-# CONTENT_TYPE LIBRARY #-}</Directive> | ||
<Directive>{-# STDLIB_VERSION 5 #-}</Directive> | ||
|
||
|
||
let int = 42 # Integer variable definition | ||
let string = "Ride the Waves!" # String variable definition | ||
let bool = true # Boolean variable definition | ||
|
||
<Annotation>@Callable(i)</Annotation> | ||
func <Function>functionName</Function>() = { | ||
let encodedString = base58'AAAAA' | ||
strict balance = <Function>wavesBalance</Function>(this).<Function>value</Function>().regular | ||
let array = [AttachedPayment(unit,100000000)] | ||
true | ||
} | ||
|
||
func <Function>sum</Function>(accum: <Type>Int</Type>, next: <Type>Int</Type>) = accum | ||
let arr = [1,2,3,4,5] | ||
FOLD<5>(arr, 0, sum) | ||
|
||
func <Function>getAddressKey</Function>() = { | ||
let addr = <Type>Address</Type>(base58'3N4iKL6ikwxiL7yNvWQmw7rg3wGna8uL6LU') | ||
<Function>getInteger</Function>(addr, "noKey") | ||
} | ||
|
||
match tx { | ||
case t: <Type>TransferTransaction|ExchangeTransaction|MassTransferTransaction|Order</Type> => false | ||
case _: <Type>Transaction</Type> => <Function>sigVerify</Function>(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | ||
case _ => {false} | ||
} | ||
|
||
func <Function>filterEven</Function>(accum: <Type>List[Int|String]</Type>, next: <Type>Int</Type>) = { | ||
if (next % 2 == 0) then accum :+ next else accum | ||
} |