Zulip Chat Archive

Stream: lean4

Topic: Parser accepting everything


Siddhartha Gadgil (Feb 12 2024 at 02:33):

Is there any easy way to write a parser (category) that matches all strings?
I want to parse the head of a string in a custom syntax category and an easy way seems to be to follow by a universal parser as above.

Andrés Goens (Feb 12 2024 at 08:50):

all strings until the end of a line? it sounds like you'd need to write a custom parser for that. When #2293 gets merged that should be easier to do, I don't know how possible it is without that

Siddhartha Gadgil (Feb 12 2024 at 08:53):

I did expect that it will be a custom parser, but I was guessing a rather simple one. I will look at the code of a parser for numLit and see if I can adapt it.

Andrés Goens (Feb 12 2024 at 09:21):

that might work! or maybe the string literal one, as that kind of does what you want (parse anything until it finds a special character that ends the string)?

Siddhartha Gadgil (Feb 12 2024 at 09:28):

There is a takeWhileFn which I am trying.


Last updated: May 02 2025 at 03:31 UTC