skip shebang in the first line
Something like this works now:
===
% PATH="./bin:$PATH" ./sum.ktscript 31 21
31 + 21 = 52
% cat sum.ktscript
#!/usr/bin/env kotlin -script
val a = Integer.parseInt(args[0])
val b = Integer.parseInt(args[1])
println("$a + $b = ${a + b}")
===
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
JetFile: Shebang.ktscript
|
||||
PsiComment(SHEBANG_COMMENT)('#!/usr/bin/env kotlin')
|
||||
PsiWhiteSpace('\n\n')
|
||||
SCRIPT
|
||||
BLOCK
|
||||
CALL_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('println')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('args')
|
||||
PsiElement(RPAR)(')')
|
||||
Reference in New Issue
Block a user