richardhundt/shine — pull request #64 by leonidborisenko (2014-09-21 23:57:15+00:00)
Title: Import macro with shorthand 'import macro ...' syntax

Add `import macro ...` syntax and document it.

Example (based on example from `README.md`):
```lua
-- file: macros.shn
function hello(ctx, expr)
util = require("shine.lang.util")
mesg = util::unquote(ctx.get(expr))
return ctx.op{'!call', 'print', ctx.op"Hello %{mesg}"}
end

export hello
```
```lua
-- file: hello.shn
import macro hello from "macros"

hello("World!")
```

PR also contains fix for following bug:
```lua
-- file:macros.shn
function fn(ctx, expr) return ctx.op"hello" end
```
```lua
--- file:error.shn
import my_macro = fn from "macros"
macro my_macro = my_macro
```
```
$ shine error.shn
Error: [string "shine.lang.translator"]:0: imported macro body for 'my_macro' cannot be resolved
stack traceback:
<...>
```