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

Lua string functions not fully supported #4

Closed
nichtich opened this issue Apr 26, 2011 · 5 comments
Closed

Lua string functions not fully supported #4

nichtich opened this issue Apr 26, 2011 · 5 comments

Comments

@nichtich
Copy link

Apparently Lua string functions is not fully supported in the compiled Lua interpreter. I successfully tried

  • string.byte("ABCDE", 2)
  • string.char(65,66,67,68,69)
  • string.format("%.7f", math.pi)
  • string.gsub("Hello banana", "banana", "Lua user")
  • string.gsub("banana", "(an)", "%1-")
  • string.rep("Lua ",5)
  • string.reverse("lua")
  • string.sub("Hello Lua user", -8, 9)
  • string.upper("Hello, Lua user!")

but the following functions produces an (error object is not a string) which is not very helpful anyway:

  • string.find("Hello Lua user", "Lua")
  • string.gsub("Hello Lua user", "(%w+)", print)
  • for word in string.gmatch("Hello Lua user", "%a+") do print(word) end
  • string.match("I have 2 questions for you.", "%d+ %a+")

Since searching in strings is a very common task, the Lua interpreter is of little use with this limitations. I think the bug is in the compilation of lstrlib.c but I could not track down the error.

@kripken
Copy link
Member

kripken commented Apr 26, 2011

It should not be hard to debug this (using the autodebugger, see Debugging wiki page), once we have Lua built from source in the test runner (that will let us see what source code corresponds to the .ll and .js, etc.). I filed issue #5 for doing that.

@max99x
Copy link
Contributor

max99x commented Aug 23, 2011

All of these work perfectly on the current trunk. Perhaps the demo page should be updated?

@max99x max99x closed this as completed Aug 23, 2011
@kripken
Copy link
Member

kripken commented Sep 25, 2011

Perhaps the demo page should be updated?

I guess I can just link to repl.it now ;) Would you be ok with that?

@max99x
Copy link
Contributor

max99x commented Sep 26, 2011

I certainly would! :)

@kripken
Copy link
Member

kripken commented Oct 5, 2011

Done.

HCLJason added a commit to HCLJason/emscripten that referenced this issue Feb 16, 2022
tlively pushed a commit to tlively/emscripten that referenced this issue Mar 23, 2022
Honry pushed a commit to Honry/emscripten that referenced this issue May 23, 2022
Split Conv2d to Conv2d and ConvTranspose2d
steveisok pushed a commit to steveisok/emscripten that referenced this issue Sep 18, 2023
sbc100 pushed a commit that referenced this issue Jun 25, 2024
I released a new version of contrib.glfw3 with a workaround/bug fix. I
wanted to point out that there is the same issue that was
[created](#18089) on
10/22 for the built-in implementation. That was never addressed. I also
wanted to point out that SDL2 also suffers from the same issue...

I found [this issue](ocornut/imgui#7732) while
working on a project using ImGui.


![Meta_V](https://github.com/ocornut/imgui/assets/357116/0cec5893-d146-40fe-ae15-2fd00e7bd319)

Release notes:
- Implemented workaround for
[#4](pongasoft/emscripten-glfw#4): _Using
Super + "Key" on macOS results in "Key" not being released_.
Due to the [broken
state](https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser)
of javascript handling the `Super/Meta` key, there is no good solution.
The workaround implemented, releases all keys when `Super` is released.
Although not a perfect solution, it guarantees that the state is
_eventually_ consistent:
- if "Key" was released while "Super" was held, then when "Super" gets
released, "Key" is released (later than when actually released, final
state is consistent: "Key" in `Release` state)
- if "Key" is still held when "Super" is released, "Key" is released
when "Super" gets released, but immediately gets a down event (Up/Down
event, final state is consistent": "Key" in `Pressed` state)
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

3 participants