timtadh / tcel

A type checked functional language.
Other
7 stars 1 forks source link

Lexer failing: Matched the empty string ( id 32) #2

Open auyer opened 6 years ago

auyer commented 6 years ago

When running the examples, I get the empty String error, although it was suposed to be cautght by the ( |\t|\n) regex

In multiple Runs, this is the results:

> lexing ex/ex1.x
panic:  Lexer error: matched the empty string at 0:0 (tc=62) for match id 32. 

> lexing ex/ex2.x
panic: Lexer error: matched the empty string at 0:0 (tc=106) for match id 32.

> lexing ex/ex3.x
panic: Lexer error: matched the empty string at 0:0 (tc=195) for match id 32.

go run main.go ex/ex4.x
> lexing ex/ex4.x
panic: Lexer error: matched the empty string at 0:0 (tc=17) for match id 32.

> lexing ex/ex5.x
panic: Lexer error: matched the empty string at 0:0 (tc=261) for match id 32.

> lexing ex/fib.x
panic: Lexer error: matched the empty string at 0:0 (tc=702) for match id 32.

I am investigating, but I am also still learning the inner workings of this code . I do not guarantee to find the issue.

timtadh commented 6 years ago

What is your version of lexmachine that you are using? lexmachine should not compile the lexer if it is able to match the empty string (this was a recent change).

Note: I haven't touched tcels code in around 4 years. I like the syntax that I had developed but I doubt I will do anything much with it at this point.

auyer commented 6 years ago

I am using the latest version ( Git HEAD) of lexmachine. The problem was solved in PR #3

auyer commented 6 years ago

I understand you don't plan to keep updating this repository, but I plan to understand this project completely, and fork it to create a educational compiler.