tranformation MP_QSTR__slash_lib into /lib
tranformation MP_QSTR__slash_lib into /lib
Which setting/step in creating binaries causes during the translation of e.g. MP_QSTR__slash_lib into /lib the mapping of "_slash_" into "/"? I assume it is a singe setting/flag, but searching did not reveal the right place.
Re: tranformation MP_QSTR__slash_lib into /lib
makeqstrdata.py processes the compiler-generated files and has
Code: Select all
codepoint2name[ord('/')] = 'slash'
Re: transformation MP_QSTR__slash_lib into /lib
I still have this problem, that a term MP_QSTR__slash_lib is NOT converted into "/lib", but into "_slash_lib". If I look into qstrdefs.generated.h, I find it there, opposed to other ports. Up to the point of the file qstrdefs.preprocessed.h it looks fine, but the last transformation does not happen for this specific file.
Re: tranformation MP_QSTR__slash_lib into /lib
Is there a way to reproduce this? I.e. what port and/or custom build are you using?
Re: tranformation MP_QSTR__slash_lib into /lib
That's the w600 port I am working on: https://github.com/robert-hh/micropytho ... ports/w60x
You can compile that with the standard setting: make V=s, but it requires a SDK for proper linking and compiling. A copy is here:
https://github.com/robert-hh/WM_SDK_W60X
But even without proper compiling, linking and loading it to a board, you can seen the wrong result int build/genhdr/qstrdefs.generated.h, because that's an early step.
The confusing thing is, that this seems to be the only failing QSTR, and that is for initializing sys.path
Obviously I can bypass the error by directly setting the path list with string constants. But it strange, and I must have had a similar problem in Jan 2019. I just don't remember what was the conclusion back then. It was definitely not with that port.
You can compile that with the standard setting: make V=s, but it requires a SDK for proper linking and compiling. A copy is here:
https://github.com/robert-hh/WM_SDK_W60X
But even without proper compiling, linking and loading it to a board, you can seen the wrong result int build/genhdr/qstrdefs.generated.h, because that's an early step.
The confusing thing is, that this seems to be the only failing QSTR, and that is for initializing sys.path
Obviously I can bypass the error by directly setting the path list with string constants. But it strange, and I must have had a similar problem in Jan 2019. I just don't remember what was the conclusion back then. It was definitely not with that port.
Re: tranformation MP_QSTR__slash_lib into /lib
It looks like you need to add a line: to your qstrdefsport.h file.
Code: Select all
Q(/lib)
Re: tranformation MP_QSTR__slash_lib into /lib
Thanks. That did the trick.