compiler/Dart__ScannerBase.st
changeset 3 46c322c66a29
parent 1 46dd2b3b6974
equal deleted inserted replaced
2:8fedb5e096fc 3:46c322c66a29
   453 !
   453 !
   454 
   454 
   455 parseError:aMessage
   455 parseError:aMessage
   456     "report an error"
   456     "report an error"
   457 
   457 
       
   458     <resource: #skipInDebuggersWalkBack>
       
   459 
   458     ^ self parseError:aMessage position:tokenStartPosition to:nil
   460     ^ self parseError:aMessage position:tokenStartPosition to:nil
   459 
   461 
   460     "Created: / 13.5.1998 / 16:45:13 / cg"
   462     "Created: / 13-05-1998 / 16:45:13 / cg"
       
   463     "Modified: / 11-01-2013 / 13:13:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   461 !
   464 !
   462 
   465 
   463 parseError:aMessage position:position
   466 parseError:aMessage position:position
   464     "report an error"
   467     "report an error"
   465 
   468 
       
   469     <resource: #skipInDebuggersWalkBack>
       
   470 
   466     ^ self parseError:aMessage position:position to:nil
   471     ^ self parseError:aMessage position:position to:nil
   467 
   472 
   468     "Created: / 13.5.1998 / 16:45:05 / cg"
   473     "Created: / 13-05-1998 / 16:45:05 / cg"
       
   474     "Modified: / 11-01-2013 / 13:13:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   469 !
   475 !
   470 
   476 
   471 parseError:aMessage position:position to:endPos
   477 parseError:aMessage position:position to:endPos
   472     "report an error"
   478     "report an error"
       
   479 
       
   480     <resource: #skipInDebuggersWalkBack>
   473 
   481 
   474     |m|
   482     |m|
   475 
   483 
   476     m := (self errorMessagePrefix) , ' ' , (aMessage ? '???').
   484     m := (self errorMessagePrefix) , ' ' , (aMessage ? '???').
   477     self notifyError:m position:position to:endPos.
   485     self notifyError:m position:position to:endPos.
   478     ^ false
   486     ^ false
   479 
   487 
   480     "Created: / 13.5.1998 / 16:44:55 / cg"
   488     "Created: / 13-05-1998 / 16:44:55 / cg"
   481     "Modified: / 28.9.1998 / 19:29:27 / cg"
   489     "Modified: / 28-09-1998 / 19:29:27 / cg"
       
   490     "Modified: / 11-01-2013 / 13:13:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   482 !
   491 !
   483 
   492 
   484 showErrorMessage:aMessage position:pos
   493 showErrorMessage:aMessage position:pos
   485     "show an errormessage on the Transcript"
   494     "show an errormessage on the Transcript"
   486 
   495 
   488 !
   497 !
   489 
   498 
   490 syntaxError:aMessage
   499 syntaxError:aMessage
   491     "a syntax error happened - position is not known"
   500     "a syntax error happened - position is not known"
   492 
   501 
       
   502     <resource: #skipInDebuggersWalkBack>
       
   503 
   493     ^ self syntaxError:aMessage position:tokenStartPosition
   504     ^ self syntaxError:aMessage position:tokenStartPosition
       
   505 
       
   506     "Modified: / 11-01-2013 / 13:13:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   494 !
   507 !
   495 
   508 
   496 syntaxError:aMessage position:position
   509 syntaxError:aMessage position:position
   497     "a syntax error happened - only start position is known"
   510     "a syntax error happened - only start position is known"
   498 
   511 
       
   512     <resource: #skipInDebuggersWalkBack>
       
   513 
   499     ^ self syntaxError:aMessage position:position to:nil
   514     ^ self syntaxError:aMessage position:position to:nil
       
   515 
       
   516     "Modified: / 11-01-2013 / 13:13:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   500 !
   517 !
   501 
   518 
   502 syntaxError:aMessage position:position to:endPos
   519 syntaxError:aMessage position:position to:endPos
   503     "a syntax error happened"
   520     "a syntax error happened"
       
   521 
       
   522     <resource: #skipInDebuggersWalkBack>
   504 
   523 
   505     |err|
   524     |err|
   506 
   525 
   507     err := ScannerError new.
   526     err := ScannerError new.
   508     err startPosition:tokenStartPosition.
   527     err startPosition:tokenStartPosition.
   509     err endPosition:tokenEndPosition.
   528     err endPosition:tokenEndPosition.
   510     err lineNumber:tokenLineNr.
   529     err lineNumber:tokenLineNr.
   511     err errorString:((self errorMessagePrefix) , ' ' , aMessage).
   530     err errorString:((self errorMessagePrefix) , ' ' , aMessage).
   512     err raiseRequest
   531     err raiseRequest
       
   532 
       
   533     "Modified: / 11-01-2013 / 13:13:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   513 !
   534 !
   514 
   535 
   515 warning:aMessage
   536 warning:aMessage
   516     "a warning - position is not known"
   537     "a warning - position is not known"
   517 
   538 
       
   539     <resource: #skipInDebuggersWalkBack>
       
   540 
   518     ^ self warning:aMessage position:tokenStartPosition
   541     ^ self warning:aMessage position:tokenStartPosition
       
   542 
       
   543     "Modified: / 11-01-2013 / 13:13:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   519 !
   544 !
   520 
   545 
   521 warning:aMessage position:position
   546 warning:aMessage position:position
   522     "a warning - only start position is known"
   547     "a warning - only start position is known"
   523 
   548 
       
   549     <resource: #skipInDebuggersWalkBack>
       
   550 
   524     ^ self warning:aMessage position:position to:nil
   551     ^ self warning:aMessage position:position to:nil
       
   552 
       
   553     "Modified: / 11-01-2013 / 13:13:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   525 !
   554 !
   526 
   555 
   527 warning:aMessage position:position to:endPos
   556 warning:aMessage position:position to:endPos
   528     "a warning"
   557     "a warning"
   529 
   558 
       
   559     <resource: #skipInDebuggersWalkBack>
       
   560 
   530     ^ self notifyWarning:((self warningMessagePrefix) , ' ' , aMessage) position:position to:endPos
   561     ^ self notifyWarning:((self warningMessagePrefix) , ' ' , aMessage) position:position to:endPos
       
   562 
       
   563     "Modified: / 11-01-2013 / 13:13:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   531 !
   564 !
   532 
   565 
   533 warningMessagePrefix
   566 warningMessagePrefix
   534     ^ 'Warning:'
   567     ^ 'Warning:'
   535 ! !
   568 ! !