/usr/share/perl5/Language/INTERCAL/Splats.pm is in clc-intercal 1:1.0~4pre1.-94.-2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | package Language::INTERCAL::Splats;
# Splats and error messages
# This file is part of CLC-INTERCAL
# Copyright (c) 2006-2008 Claudio Calvelli, all rights reserved.
# CLC-INTERCAL is copyrighted software. However, permission to use, modify,
# and distribute it is granted provided that the conditions set out in the
# licence agreement are met. See files README and COPYING in the distribution.
use strict;
use vars qw($VERSION $PERVERSION);
($VERSION) = ($PERVERSION = "CLC-INTERCAL/Base INTERCAL/Splats.pm 1.-94.-2") =~ /\s(\S+)$/;
use Carp;
use Language::INTERCAL::Exporter '1.-94.-2';
use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS);
@EXPORT_OK = qw(
splatnumber splatname splatdescription faint
SP_ARRAY SP_ASSIGN SP_BASE SP_BCMATCH SP_BUG SP_CHARSET SP_CIRCULAR
SP_CLASS SP_CLASSWAR SP_COMEFROM SP_COMMENT SP_CONTEXT SP_CONVERT
SP_CREATION SP_DIGITS SP_DIVIDE SP_EARLY SP_EVENT SP_EVOLUTION
SP_FALL_OFF SP_FORBIDDEN SP_FREE SP_HIDDEN SP_HOLIDAY SP_ILLEGAL
SP_INDIGESTION SP_INTERNAL SP_INTERNET SP_INVALID SP_INVARRAY
SP_INVCLASS SP_INVLABEL SP_INVSPLAT SP_IOERR SP_IOMODE SP_IOTYPE
SP_ISARRAY SP_ISCLASS SP_ISNUMBER SP_JUNK SP_LANGUAGE SP_LECTURE
SP_MAKE_NEW SP_MODEERR SP_NEXTING SP_NOARRAY SP_NOASSIGN SP_NOBELONG
SP_NOCLASS SP_NOCURRICULUM SP_NODIM SP_NONUMBER SP_NOOWNER
SP_NOREGISTER SP_NORESUME SP_NOSPECIAL SP_NOSTUDENT SP_NOSUCHCHAR
SP_NOSUCHLABEL SP_NOSYSCALL SP_NOTCLASS SP_NOTHREAD SP_NOVALUE
SP_NUMBER SP_OVREG SP_OWNER SP_QUANTUM SP_READ SP_REGGRIM SP_REGISTER
SP_REGNUM SP_RESUME SP_ROMAN SP_SEEKERR SP_SPECIAL SP_SPLAT SP_SPOTS
SP_SUBSCRIPT SP_SUBSIZE SP_SWAP SP_SYMBOL SP_SYSCALL SP_THREESPOT
SP_TODO SP_TOOMANYLABS SP_UBUG
);
%EXPORT_TAGS = (
SP => [qw(
faint
SP_ARRAY SP_ASSIGN SP_BASE SP_BCMATCH SP_BUG SP_CHARSET SP_CIRCULAR
SP_CLASS SP_CLASSWAR SP_COMEFROM SP_COMMENT SP_CONTEXT SP_CONVERT
SP_CREATION SP_DIGITS SP_DIVIDE SP_EARLY SP_EVENT SP_EVOLUTION
SP_FALL_OFF SP_FORBIDDEN SP_FREE SP_HIDDEN SP_HOLIDAY SP_ILLEGAL
SP_INDIGESTION SP_INTERNAL SP_INTERNET SP_INVALID SP_INVARRAY
SP_INVCLASS SP_INVLABEL SP_INVSPLAT SP_IOERR SP_IOMODE SP_IOTYPE
SP_ISARRAY SP_ISCLASS SP_ISNUMBER SP_JUNK SP_LANGUAGE SP_LECTURE
SP_MAKE_NEW SP_MODEERR SP_NEXTING SP_NOARRAY SP_NOASSIGN
SP_NOBELONG SP_NOCLASS SP_NOCURRICULUM SP_NODIM SP_NONUMBER
SP_NOOWNER SP_NOREGISTER SP_NORESUME SP_NOSPECIAL SP_NOSTUDENT
SP_NOSUCHCHAR SP_NOSUCHLABEL SP_NOSYSCALL SP_NOTCLASS SP_NOTHREAD
SP_NOVALUE SP_NUMBER SP_OVREG SP_OWNER SP_QUANTUM SP_READ
SP_REGGRIM SP_REGISTER SP_REGNUM SP_RESUME SP_ROMAN SP_SEEKERR
SP_SPECIAL SP_SPLAT SP_SPOTS SP_SUBSCRIPT SP_SUBSIZE SP_SWAP
SP_SYMBOL SP_SYSCALL SP_THREESPOT SP_TODO SP_TOOMANYLABS SP_UBUG
)],
);
my %splatbyname = (
ARRAY => 280,
ASSIGN => 277,
BASE => 8,
BCMATCH => 578,
BUG => 774,
CHARSET => 10,
CIRCULAR => 818,
CLASS => 254,
CLASSWAR => 603,
COMEFROM => 555,
COMMENT => 0,
CONTEXT => 398,
CONVERT => 444,
CREATION => 816,
DIGITS => 534,
DIVIDE => 662,
EARLY => 999,
EVENT => 751,
EVOLUTION => 815,
FALL_OFF => 633,
FORBIDDEN => 796,
FREE => 511,
HIDDEN => 436,
HOLIDAY => 799,
ILLEGAL => 997,
INDIGESTION => 664,
INTERNAL => 634,
INTERNET => 899,
INVALID => 69,
INVARRAY => 251,
INVCLASS => 253,
INVLABEL => 131,
INVSPLAT => 457,
IOERR => 642,
IOMODE => 641,
IOTYPE => 9,
ISARRAY => 243,
ISCLASS => 244,
ISNUMBER => 438,
JUNK => 128,
LANGUAGE => 700,
LECTURE => 699,
MAKE_NEW => 443,
MODEERR => 644,
NEXTING => 123,
NOARRAY => 245,
NOASSIGN => 752,
NOBELONG => 512,
NOCLASS => 250,
NOCURRICULUM => 823,
NODIM => 241,
NONUMBER => 701,
NOOWNER => 513,
NOREGISTER => 437,
NORESUME => 621,
NOSPECIAL => 257,
NOSTUDENT => 822,
NOSUCHCHAR => 109,
NOSUCHLABEL => 129,
NOSYSCALL => 660,
NOTCLASS => 242,
NOTHREAD => 369,
NOVALUE => 256,
NUMBER => 281,
OVREG => 252,
OWNER => 514,
QUANTUM => 666,
READ => 432,
REGGRIM => 898,
REGISTER => 433,
REGNUM => 70,
RESUME => 632,
ROMAN => 4,
SEEKERR => 643,
SPECIAL => 247,
SPLAT => 456,
SPOTS => 274,
SUBSCRIPT => 276,
SUBSIZE => 279,
SWAP => 445,
SYMBOL => 535,
SYSCALL => 661,
THREESPOT => 702,
TODO => 1,
TOOMANYLABS => 130,
UBUG => 775,
);
my %splats = (
0 => ['COMMENT', '%'],
1 => ['TODO', 'Not implemented: %'],
4 => ['ROMAN', 'Unknown read type for Roman numerals: %'],
8 => ['BASE', 'Base must be between 2 and 7 (got %)'],
9 => ['IOTYPE', 'Invalid I/O Type: %'],
10 => ['CHARSET', 'Invalid character set: %'],
69 => ['INVALID', 'Invalid bytecode (%) for %'],
70 => ['REGNUM', 'Invalid register number "%"'],
109 => ['NOSUCHCHAR', 'Invalid character (%) for %'],
123 => ['NEXTING', 'Program attempted more than % levels of NEXTing'],
128 => ['JUNK', 'Cannot use JUNK in this grammar'],
129 => ['NOSUCHLABEL', 'Could not find label %'],
130 => ['TOOMANYLABS', 'Cannot decide between % instances of label %'],
131 => ['INVLABEL', 'Invalid label %'],
241 => ['NODIM', 'Array not dimensioned'],
242 => ['NOTCLASS', 'Non-class value used as class'],
243 => ['ISARRAY', 'Array register used as value'],
244 => ['ISCLASS', 'Class register used as value'],
245 => ['NOARRAY', 'Non-array register used as array'],
247 => ['SPECIAL', 'Attempt to use special register %'],
250 => ['NOCLASS', 'Invalid value % assigned to class'],
251 => ['INVARRAY', 'Invalid value in array element: %'],
252 => ['OVREG', 'Cannot use overload register %'],
253 => ['INVCLASS', 'Invalid lecture: %'],
254 => ['CLASS', 'Invalid subject: %'],
256 => ['NOVALUE', 'This register cannot hold a value'],
257 => ['NOSPECIAL', 'Normal register used as special'],
274 => ['SPOTS', 'Number % too large for %'],
276 => ['SUBSCRIPT', 'Invalid subscript %: %'],
277 => ['ASSIGN', 'Impossible assignment (base %): cannot find #X such that #%X is #%'],
279 => ['SUBSIZE', 'Invalid number of subscripts: % provided, % required'],
280 => ['ARRAY', 'Invalid array: %'],
281 => ['NUMBER', 'Invalid number: %'],
369 => ['NOTHREAD', 'Thread % does not exist'],
398 => ['CONTEXT', 'Invalid context: %'],
432 => ['READ', 'Not suitable for %'],
433 => ['REGISTER', 'Not a valid register: %'],
436 => ['HIDDEN', 'Register % stashed away too well'],
437 => ['NOREGISTER', 'Cannot % numbers'],
438 => ['ISNUMBER', 'Numbers cannot %'],
443 => ['MAKE_NEW', 'Cannot make new opcode %'],
444 => ['CONVERT', 'Cannot convert % to %'],
445 => ['SWAP', 'Cannot swap % and %'],
456 => ['SPLAT', 'No splat'],
457 => ['INVSPLAT', 'Invalid splat %'],
511 => ['FREE', 'Register % is not a slave'],
512 => ['NOBELONG', 'Register % does not belong to register %'],
513 => ['NOOWNER', 'Slave % does not have % owners (just %)'],
514 => ['OWNER', 'Invalid owner number: %'],
534 => ['DIGITS', 'Wrong number of digits for base %: %'],
535 => ['SYMBOL', 'Invalid symbol: %'],
555 => ['COMEFROM', 'Multiple "COME FROM" %'],
578 => ['BCMATCH', 'Invalid bytecode pattern in %: %'],
603 => ['CLASSWAR', 'Class war between % and %'],
621 => ['NORESUME', 'Pointless RESUME'],
632 => ['RESUME', 'Program terminated via RESUME'],
633 => ['FALL_OFF', 'Falling off the edge of the program'],
634 => ['INTERNAL', 'Internal error: %'],
641 => ['IOMODE', 'Invalid I/O mode %'],
642 => ['IOERR', 'Input output error in %: %'],
643 => ['SEEKERR', 'Seek/tell error: %'],
644 => ['MODEERR', 'I/O error: %'],
660 => ['NOSYSCALL', 'Undefined system call %'],
661 => ['SYSCALL', 'Missing system call number'],
662 => ['DIVIDE', 'Unary division by zero'],
664 => ['INDIGESTION', 'Program is too large'],
666 => ['QUANTUM', '% does not have a quantum version'],
699 => ['LECTURE', 'Not in a lecture'],
700 => ['LANGUAGE', 'Invalid language: %'],
701 => ['NONUMBER', 'Value written in is not a number: %'],
702 => ['THREESPOT', 'Value written in is larger than two spots'],
751 => ['EVENT', 'Invalid event: BODY WHILE CONDITION'],
752 => ['NOASSIGN', 'Cannot assign %: %'],
774 => ['BUG', 'Compiler error'],
775 => ['UBUG', 'Unexplainable compiler error'],
796 => ['FORBIDDEN', '% is forbidden in INTERCAL-1972'],
799 => ['HOLIDAY', 'No class teaches subjects %'],
815 => ['EVOLUTION', 'Creation not allowed: %'],
816 => ['CREATION', 'CREATE statement misconfiguration: %'],
818 => ['CIRCULAR', 'Circular reasoning in %'],
822 => ['NOSTUDENT', 'Register % is not a student'],
823 => ['NOCURRICULUM', 'Subject % is not in %\'s curriculum'],
898 => ['REGGRIM', 'Error in Regular Grimace: %'],
899 => ['INTERNET', 'INTERcal NETwork error talking to %: %'],
997 => ['ILLEGAL', 'Illegal operator % for base %'],
999 => ['EARLY', 'Lecture at % is too early'],
);
sub SP_ARRAY () { 280 }
sub SP_ASSIGN () { 277 }
sub SP_BASE () { 8 }
sub SP_BCMATCH () { 578 }
sub SP_BUG () { 774 }
sub SP_CHARSET () { 10 }
sub SP_CIRCULAR () { 818 }
sub SP_CLASS () { 254 }
sub SP_CLASSWAR () { 603 }
sub SP_COMEFROM () { 555 }
sub SP_COMMENT () { 0 }
sub SP_CONTEXT () { 398 }
sub SP_CONVERT () { 444 }
sub SP_CREATION () { 816 }
sub SP_DIGITS () { 534 }
sub SP_DIVIDE () { 662 }
sub SP_EARLY () { 999 }
sub SP_EVENT () { 751 }
sub SP_EVOLUTION () { 815 }
sub SP_FALL_OFF () { 633 }
sub SP_FORBIDDEN () { 796 }
sub SP_FREE () { 511 }
sub SP_HIDDEN () { 436 }
sub SP_HOLIDAY () { 799 }
sub SP_ILLEGAL () { 997 }
sub SP_INDIGESTION () { 664 }
sub SP_INTERNAL () { 634 }
sub SP_INTERNET () { 899 }
sub SP_INVALID () { 69 }
sub SP_INVARRAY () { 251 }
sub SP_INVCLASS () { 253 }
sub SP_INVLABEL () { 131 }
sub SP_INVSPLAT () { 457 }
sub SP_IOERR () { 642 }
sub SP_IOMODE () { 641 }
sub SP_IOTYPE () { 9 }
sub SP_ISARRAY () { 243 }
sub SP_ISCLASS () { 244 }
sub SP_ISNUMBER () { 438 }
sub SP_JUNK () { 128 }
sub SP_LANGUAGE () { 700 }
sub SP_LECTURE () { 699 }
sub SP_MAKE_NEW () { 443 }
sub SP_MODEERR () { 644 }
sub SP_NEXTING () { 123 }
sub SP_NOARRAY () { 245 }
sub SP_NOASSIGN () { 752 }
sub SP_NOBELONG () { 512 }
sub SP_NOCLASS () { 250 }
sub SP_NOCURRICULUM () { 823 }
sub SP_NODIM () { 241 }
sub SP_NONUMBER () { 701 }
sub SP_NOOWNER () { 513 }
sub SP_NOREGISTER () { 437 }
sub SP_NORESUME () { 621 }
sub SP_NOSPECIAL () { 257 }
sub SP_NOSTUDENT () { 822 }
sub SP_NOSUCHCHAR () { 109 }
sub SP_NOSUCHLABEL () { 129 }
sub SP_NOSYSCALL () { 660 }
sub SP_NOTCLASS () { 242 }
sub SP_NOTHREAD () { 369 }
sub SP_NOVALUE () { 256 }
sub SP_NUMBER () { 281 }
sub SP_OVREG () { 252 }
sub SP_OWNER () { 514 }
sub SP_QUANTUM () { 666 }
sub SP_READ () { 432 }
sub SP_REGGRIM () { 898 }
sub SP_REGISTER () { 433 }
sub SP_REGNUM () { 70 }
sub SP_RESUME () { 632 }
sub SP_ROMAN () { 4 }
sub SP_SEEKERR () { 643 }
sub SP_SPECIAL () { 247 }
sub SP_SPLAT () { 456 }
sub SP_SPOTS () { 274 }
sub SP_SUBSCRIPT () { 276 }
sub SP_SUBSIZE () { 279 }
sub SP_SWAP () { 445 }
sub SP_SYMBOL () { 535 }
sub SP_SYSCALL () { 661 }
sub SP_THREESPOT () { 702 }
sub SP_TODO () { 1 }
sub SP_TOOMANYLABS () { 130 }
sub SP_UBUG () { 775 }
sub faint {
@_ >= 1 or croak "Usage: faint(NUM, ARGS)";
die splatdescription(@_) . "\n";
}
sub splatnumber {
@_ == 1 or croak "Usage: splatnumber(SPLATNAME)";
my $s = shift;
exists $splatbyname{$s} ? $splatbyname{$s} : -1;
}
sub splatname {
@_ == 1 or croak "Usage: splatname(SPLAT)";
my $s = shift;
exists $splats{$s} ? $splats{$s}[0] : undef;
}
sub splatdescription {
@_ >= 1 or croak "Usage: splatdescription(SPLAT, ARGS)";
my $s = shift;
$s %= 1000;
return 'Unknown splat code' if ! exists $splats{$s};
my $desc = $splats{$s}[1];
$desc =~ s/%/shift || '?'/ge;
$desc .= " (?" . join(' ', @_) . "?)" if @_;
sprintf("*%03d %s", $s, $desc);
}
1;
__END__
=pod
=head1 TITLE
Language::INTERCAL::Splats - errors
=head1 DESCRIPTION
Execution of I<CLC-INTERCAL> program can produce many errors, one of
the most common is attempting to execute a comment. Errors are
reported using a I<splat>, consisting of an error code and an error
message. The splat code is also available in the special expression
I<*> after the error occurred: this is only useful when the
program is multithreaded (another thread produced the splat) or
within events, as producing a splat is always fatal and causes the
program to terminate.
When printing a splat, the format will always be:
*nnn message
where nnn is the splat code. See file blib/htmldoc/errors.html in
the distribution build directory (or the corresponding page in the
online reference manual) for a list of splat codes.
=head1 SEE ALSO
A qualified psychiatrist
=head1 AUTHOR
Claudio Calvelli - intercal (whirlpool) sdf.lonestar.org
(Please include the word INTERLEAVING in the subject when emailing that
address, or the email may be ignored)
|