MommaWatasu / OteraEngine.jl

This package is a template engine for Julia Lang.
https://mommawatasu.github.io/OteraEngine.jl/stable
MIT License
20 stars 4 forks source link

using doesn't work #12

Closed edyu closed 1 year ago

edyu commented 1 year ago

I tried

```
using Dates
now()
```

I get the following error:

┌ Error: ERROR:
│   exception =
│    syntax: "using" expression not at top level
│    Stacktrace:
│      [1] top-level scope
│        @ none:1
│      [2] eval
│        @ ./boot.jl:368 [inlined]
│      [3] eval
│        @ ~/.julia/packages/OteraEngine/oQ8sv/src/OteraEngine.jl:1 [inlined]
│      [4] (::OteraEngine.Template)(init::Dict{String, Any})
│        @ OteraEngine ~/.julia/packages/OteraEngine/oQ8sv/src/OteraEngine.jl:115
│      [5] (::Main.Api.var"#7#16")(req::HTTP.Messages.Request)
MommaWatasu commented 1 year ago

It looks like you’re using v0.1.3. Does this issue occur in v0.2.0?

edyu commented 1 year ago

in v0.2.0 here is the erorr:

┌ Error: ERROR:
│   exception =
│    ArgumentError: Package OteraEngine does not have Dates in its dependencies:
│    - You may have a partially installed environment. Try `Pkg.instantiate()`
│      to ensure all packages in the environment are installed.
│    - Or, if you have OteraEngine checked out for development and have
│      added Dates as a dependency but haven't updated your primary
│      environment's manifest file, try `Pkg.resolve()`.
│    - Otherwise you may need to report an issue with OteraEngine
│    Stacktrace:
│      [1] macro expansion
│        @ ./loading.jl:1167 [inlined]
│      [2] macro expansion
│        @ ./lock.jl:223 [inlined]
│      [3] require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1144
│      [4] eval
│        @ ./boot.jl:368 [inlined]
│      [5] eval
│        @ ~/.julia/packages/OteraEngine/lXojN/src/OteraEngine.jl:1 [inlined]
│      [6] (::OteraEngine.Template)(; tmp_init::Dict{String, String}, jl_init::Dict{String, Any})
│        @ OteraEngine ~/.julia/packages/OteraEngine/lXojN/src/template.jl:87
MommaWatasu commented 1 year ago

Hi, edyu.

I fixed this bug and improved parser. But, some problems still remain. I'll release a patch version if you want(I can't maintain this package for a while, so I can only do a temporary release.).

edyu commented 1 year ago

No problem. Thanks for the help. I was able to finish my project using minimal templating. Wouldn't be able to do it without your help. You can close this if you think it's fixed.