Skip to content

Commit

Permalink
2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Apr 10, 2020
1 parent b9a5663 commit b32dde3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,36 @@ You can use `parser.allowMetadata` to parse metadata before expressions on in an

You can use `new hscript.Macro(pos).convert(ast)` to convert an hscript AST to a Haxe macros one.

You can use `hscript.Checker` in order to type check and even get completion, using `haxe -xml` output for type information.

Limitations
-----------

Compared to Haxe, limitations are :

- no type declarations (classes, enums, typedefs) : only expressions
- `switch` construct is supported but not pattern matching (no variable capture, we use strict equality to compare `case` values and `switch` value)
- only one variable declaration is allowed in `var`
- the parser supports optional types for `var` and `function` if `allowTypes` is set, but the interpreter ignores them
- you can enable per-expression position tracking by compiling with `-D hscriptPos`
- you can parse some type declarations (import, class, typedef, etc.) with parseModule

Install
-------

In order to install Haxe Script, use `haxelib install hscript` and compile your program with `-lib hscript`.

There are only three files in hscript :
These are the main required files in hscript :

- `hscript.Expr` : contains enums declarations
- `hscript.Parser` : a small parser that turns a string into an expression structure (AST)
- `hscript.Interp` : a small interpreter that execute the AST and returns the latest evaluated value

Some other optional files :

- `hscript.Async` : converts Expr into asynchronous version
- `hscript.Bytes` : Expr serializer/unserializer
- `hscript.Checker` : type checking and completion for hscript Expr
- `hscript.Macro` : convert Haxe macro into hscript Expr
- `hscript.Printer` : convert hscript Expr to String
- `hscript.Tools` : utility functions (map/iter)

4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"url": "https://github.com/HaxeFoundation/hscript",
"license": "MIT",
"description": "Haxe Script is a scripting engine for a subset of the Haxe language",
"version": "2.3.0",
"releasenote": "",
"version": "2.4.0",
"releasenote": "Haxe 4.0 final + type checking/completion (hscript.Checker)",
"contributors": ["ncannasse"]
}

0 comments on commit b32dde3

Please sign in to comment.