Snakel/Errors

From Esolang
Jump to navigation Jump to search
Back to Snakel
This is still a work in progress. It may be changed in the future.

If you make an error in the code (for example putting an undefined variable into the code) in a Snakel interpreter. Then the terminal (or emiter as it's called in the gammaline universe) will emit an error and will explain and show where you made a mistake

TypeError

Using a wrong type in a variable

code:

­ 1: !for example
­ 2: num a="eso"

emiter:

­ Current operation stopped
­ Error type:TypeError
­ At what line:line 2
­ Explanation:
­ 2: num a="eso"
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ -----
­ Wrong value type. num is used as a's type, str was used instead

Not specifying a type or specify a non-existent type to a variable

code:

­ 1: i=user

emiter:

­ Current operation stopped
­ Error type:TypeError
­ At what line:line 1
­ Explanation:
­ 1: i=user
­ ­ ­ ­ ^
­ Invalid type. "" is not a "Type"


Removing an entry that is not on the list

code:

­ 1: l=["H","I"]
­ 2: entry.pop(l,"!")

emiter:

­ Current operation stopped
­­ Error type:TypeError
­­ At what line:line 2
­­ Explanation:
­­­ 2: entry.pop(l,"!")
­­­ ­­ ­­ ­­ ­­ ­­ ­­ ­­ ­­ ­­ ­­ ­­ ­­ ­­ ­­ ­­ ­---
­­ Pop non-related entry from list. "!" is not an element on list "l"


SyntaxError

Using anything BUT a tab/4 spaces as indentation

code:

­ 1: def main:none;
­ 2: ;tell["how"]

emiter:

­ Current operation stopped
­­ Error type:SyntaxError
­­ At what line:line 2
­­ Explanation:
­ 2: ;tell["how"]
­­­ ­­ ­­ ­ ­­^
­­ Invalid indentation. A tab or 4 spaces must be used as the indentation, ";" was used instead