Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing import 'regex' in 'uclang/demos/imx_sdma/assembler.ucl' #2

Open
mingodad opened this issue Apr 2, 2021 · 4 comments
Open

Comments

@mingodad
Copy link

mingodad commented Apr 2, 2021

Testing this project and trying to execute 'uclang/demos/imx_sdma/main.ucl' I'm getting this error message:

uclang main.ucl
 ---------------------------------------- 
1. ERROR: in file: "./assembler.ucl" on line: 57
      [ new Regex("^ *$"), 0x0000, m_ignore_cb ],

Class name Regex cannot be resolved
 ---------------------------------------- 

And after adding 'import regex;' to 'uclang/demos/imx_sdma/assembler.ucl' no error reported.

Another issue I'm having when trying to execute 'uclang/examples/*' directly it doesn't due to not having the 'export UCLANG_MODS_PATH=' set and it doesn't seem that we can us import with relative paths.

@izuzanak
Copy link
Owner

izuzanak commented Apr 2, 2021

Class Regex was historically part of module sys, from which it was removed to separated module regex. Demo example was not fixed from since then.
Fixed in (e246ee9).
Thank you for noticing.

@izuzanak
Copy link
Owner

izuzanak commented Apr 2, 2021

There are three sources of directories to be searched for modules:

  1. Default directories: . and modules.
  2. Command line argument -mods=. Argument should precede name of script and should contain directories separated by colon. Eg. -mods=DIR1:DIR2:DIR3.
  3. Environment variable UCLANG_MODS_PATH, containing directories separated by colon. Eg. export UCLANG_MODS_PATH=DIR1:DIR2:DIR3

In both cases directories can be absolute or relative.

@mingodad
Copy link
Author

mingodad commented Apr 2, 2021

Thank you for reply !

Would be nice if that information could be available from command line like uclang -h or uclang --help.

When I mentioned about relative path for import I was meaning something like import ../tutorial;.

@izuzanak
Copy link
Owner

izuzanak commented Apr 3, 2021

I will occasionally add --help argument, and also change existing arguments from some weird combination of short/long version eg. -mods to long version eg. --mods.

You are right, module to be imported is identified just by its name (identifier). Module implementation is looked for in module directories mentioned in previous comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants