Create templates to quickly answer FAQs or store snippets for re-use.
It stands for End of Line. Here, it means that it was expecting to find a matching quotation, but instead hit the End of the Line without finding a match, which was unexpected.
Literal means you've got a literal representation of this string, i.e. the string itself in quotes. An array literal might be something like [1,2,3,4,5] - it's a bit of text that corresponds directly to the data type it represents.
Edit: the reason this syntax error comes out that way is because of the literal, actually. Though to a human the syntax error is that your quote isn't matched, what the parser was doing was attempting to read in a string literal to build its internal in-memory representation of a String from it. This isn't a multi-line string, so as it was reading in (scanning) the literal one token at a time, it ran into the end of a line. That's illegal in a string literal, thus this syntax error. Of course, the fix is to add the quote, which means the parser successfully reads the whole string literal and then moves on to the end of the line, where it now occurs in a valid, expected place.
I like this idea, intentionally breaking working code. You can learn a lot about how your language works from understanding why specifically you're getting a given error. Thanks for the tip!
Cool. I got the idea from "Learn Python the Hard Way' and I'm definitely going to continue using it.
I think it means ”end of line”.
Thank! That's what Ben Lovy said also.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.