compile spacey function calls too
This commit is contained in:
parent
12370361c4
commit
dcf94296fa
|
|
@ -482,6 +482,7 @@ export class Compiler {
|
|||
PUSH 1 ; Named count
|
||||
CALL
|
||||
*/
|
||||
case terms.FunctionCallWithNewlines:
|
||||
case terms.FunctionCall: {
|
||||
const { identifierNode, namedArgs, positionalArgs } = getFunctionCallParts(node, input)
|
||||
const instructions: ProgramItem[] = []
|
||||
|
|
@ -863,7 +864,7 @@ export class Compiler {
|
|||
|
||||
default:
|
||||
throw new CompilerError(
|
||||
`Compiler doesn't know how to handle a "${node.type.name}" node.`,
|
||||
`Compiler doesn't know how to handle a "${node.type.name}" (${node.type.id}) node.`,
|
||||
node.from,
|
||||
node.to
|
||||
)
|
||||
|
|
|
|||
|
|
@ -440,6 +440,26 @@ describe('Parentheses', () => {
|
|||
PositionalArg
|
||||
Identifier arg3`)
|
||||
})
|
||||
|
||||
test('function call with mulitline identifiers starting separate lines in parens', () => {
|
||||
expect(`(
|
||||
|
||||
echo
|
||||
arg1
|
||||
arg2
|
||||
arg3
|
||||
|
||||
)`).toMatchTree(`
|
||||
ParenExpr
|
||||
FunctionCall
|
||||
Identifier echo
|
||||
PositionalArg
|
||||
Identifier arg1
|
||||
PositionalArg
|
||||
Identifier arg2
|
||||
PositionalArg
|
||||
Identifier arg3`)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Number literals', () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user