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

KaTeX compiles, but running fails with Lua error "too many C levels (limit is 200)" #18

Open
akavel opened this issue Apr 15, 2017 · 2 comments

Comments

@akavel
Copy link

akavel commented Apr 15, 2017

I tried translating KaTeX (v0.7.1 from git) with castl (1.2.4). The translation "succeeded", with commands roughly as below:

$ cd katex
$ git checkout v0.7.1
$ for f in katex.js src/*.js; do castl $f -o --debug --node; done

However, trying to run the following Lua script afterwards with Lua 5.2:

local katex = assert(loadfile 'katex.js.lua')()

failed with a Lua error: [...] too many C levels (limit is 200) [...], which seems to mean there's too deep nesting in the code.

I'm aware that castl is an experimental project, but I'm reporting this problem just in case you (or someone else) are crazy enough to try fixing the issue somehow :)

@PaulBernier
Copy link
Owner

PaulBernier commented Apr 18, 2017

Hi Mateusz,
Thanks for reporting that. Yes I believe you are right in your assessment of the problem. One thing we can try to do is to narrow down what kind of JS code lead to such levels of nesting, maybe it's can be optimized. Does the error stack trace point to a particular piece of code? (If not, to be honest I won't have time to put effort investigating)

@akavel
Copy link
Author

akavel commented Apr 18, 2017

Yes, there was a stack trace, and not that long really (specifially, that's not a case of one's regular "stack overflow" with a super long stack trace). But I'm sorry, I don't really have time to reproduce it either.

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