Skip to content

Conversation

@BradLewis
Copy link
Contributor

@BradLewis BradLewis commented Nov 15, 2025

We got an error reported in ols:

".../ols/ols"  "stderr"        ".../odin/core/odin/parser/parser.odin(103:14) Invalid slice indices 0:2 is out of range 0..<1\n"

My guess is we have a string with the tokenizer text only being 1 character, though I'm not really sure how that happens.

Edit: I changed it to just explicitly verify the length as I'm not even sure how it got into the state of having this error.

@laytan
Copy link
Collaborator

laytan commented Nov 15, 2025

I am guessing it happens on this?

foo :: ``

Hmm on second look, I think not

@BradLewis
Copy link
Contributor Author

BradLewis commented Nov 16, 2025

That was my guess but it seems fine for me, and that should have length 2 for the two quote characters. I also tried with just

foo :: ` // also ' and "

but that seemed to be fine as well

@laytan
Copy link
Collaborator

laytan commented Nov 16, 2025

Probably an unterminated string (at the end of the file?) actually, where you do get a syntax error but we return an incomplete string token.

@BradLewis
Copy link
Contributor Author

Ah yeah I'm able to reproduce it with the very minimal program now

package main

foo :: "

It just doesn't cause any issues with ols but will crash when manually parsing the file.

@laytan laytan merged commit 614e98f into odin-lang:master Nov 16, 2025
14 of 17 checks passed
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

Successfully merging this pull request may close these issues.

2 participants