diff --git a/README.md b/README.md index 93f5601..1c4e62a 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@ Parse and evalutate Haxe expressions. Usage : -```haxe +
var expr = "var x = 4; 1 + 2 * x"; var parser = new hscript.Parser(); var ast = parser.parseString(expr); var interp = new hscript.Interp(); trace(interp.execute(ast)); -``` +In case or parse or runtime error an `hscript.Expr.Error` is throwed. You can use `parser.line` to know the line number.