lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> I have a relatively simple contrived grammar (below) which works great
> with small files.
> When I try to feed it a large file though I get an error:
>     stack overflow (too many runtime captures)

You may try something like this: (Warning: untested code!!)

-     Name = Cmt(Name, function(str, pos, name)
-     	count = count + 1
-     	return true, name
-     end)

+     Name = C(Cmt(Name, function(str, pos)
+     	count = count + 1
+     	return true
+     end))

That is, get the name as a regular capture, instead of a runtime one.

-- Roberto