mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-21 07:17:25 +03:00
2.7 KiB
2.7 KiB
This file contains programs with parse errors and type errors, for visual inspection of error message quality and to check for regressions or changes to error reporting.
Parse errors
Some basic errors of literals.
Floating point literals
x = 1. -- missing some digits after the decimal
This number isn't valid syntax:
1 | x = 1. -- missing some digits after the decimal
I was expecting some digits after the '.', for example: 1.0 or
1.1e37.
x = 1e -- missing an exponent
This number isn't valid syntax:
1 | x = 1e -- missing an exponent
I was expecting some digits for the exponent, for example:
1e37.
x = 1e- -- missing an exponent
This number isn't valid syntax:
1 | x = 1e- -- missing an exponent
I was expecting some digits for the exponent, for example:
1e-37.
x = 1E+ -- missing an exponent
This number isn't valid syntax:
1 | x = 1E+ -- missing an exponent
I was expecting some digits for the exponent, for example:
1e+37.
Hex, octal, and bytes literals
x = 0xoogabooga -- invalid hex chars
This number isn't valid syntax:
1 | x = 0xoogabooga -- invalid hex chars
I was expecting only hexidecimal characters (one of
0123456789abcdefABCDEF) after the 0x.
x = 0o987654321 -- 9 and 8 are not valid octal char
This number isn't valid syntax:
1 | x = 0o987654321 -- 9 and 8 are not valid octal char
I was expecting only octal characters (one of 01234567) after
the 0o.
x = 0xsf -- odd number of hex chars in a bytes literal
This bytes literal isn't valid syntax: 0xsf
1 | x = 0xsf -- odd number of hex chars in a bytes literal
I was expecting an even number of hexidecimal characters (one
of 0123456789abcdefABCDEF) after the 0xs.
x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal
This bytes literal isn't valid syntax: 0xsnotvalidhexchars
1 | x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal
I was expecting an even number of hexidecimal characters (one
of 0123456789abcdefABCDEF) after the 0xs.
Layout errors
foo = else -- not matching if
I found a closing 'else' here without a matching 'then'.
1 | foo = else -- not matching if
foo = then -- unclosed
I found a closing 'then' here without a matching 'if'.
1 | foo = then -- unclosed
foo = with -- unclosed
I found a closing 'with' here without a matching 'handle' or 'match'.
1 | foo = with -- unclosed