mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-26 07:49:28 +01:00
improve error message
This commit is contained in:
parent
2f2c39a07a
commit
742eb6e128
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2018 - 2019 Volker Berlin (i-net software)
|
Copyright 2018 - 2020 Volker Berlin (i-net software)
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -202,6 +202,7 @@ public class WatParser extends WasmCodeBuilder {
|
|||||||
addTableInstruction( false, getInt( tokens, ++i), javaCodePos, lineNumber );
|
addTableInstruction( false, getInt( tokens, ++i), javaCodePos, lineNumber );
|
||||||
break;
|
break;
|
||||||
case "call":
|
case "call":
|
||||||
|
try {
|
||||||
StringBuilder builder = new StringBuilder( get( tokens, ++i ) );
|
StringBuilder builder = new StringBuilder( get( tokens, ++i ) );
|
||||||
String str;
|
String str;
|
||||||
do {
|
do {
|
||||||
@ -211,6 +212,9 @@ public class WatParser extends WasmCodeBuilder {
|
|||||||
builder.append( get( tokens, ++i ) );
|
builder.append( get( tokens, ++i ) );
|
||||||
FunctionName name = new FunctionName( builder.substring( 1 ) );
|
FunctionName name = new FunctionName( builder.substring( 1 ) );
|
||||||
addCallInstruction( name, javaCodePos, lineNumber );
|
addCallInstruction( name, javaCodePos, lineNumber );
|
||||||
|
} catch( Exception ex ) {
|
||||||
|
throw new WasmException( "The syntax for a function name is $package.ClassName.methodName(paramSignature)returnSignature", lineNumber );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "return":
|
case "return":
|
||||||
addBlockInstruction( WasmBlockOperator.RETURN, null, javaCodePos, lineNumber );
|
addBlockInstruction( WasmBlockOperator.RETURN, null, javaCodePos, lineNumber );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user