Source view chokes on unicode comment

19 views
Skip to first unread message

Lorenz Köhl

unread,
Feb 3, 2015, 4:14:29 PM2/3/15
to newspeak...@googlegroups.com
What did you want to do?
Create and use a class like this:

class ClassNameHere = (
(* This comment is erratic — it contains an em dash *)
|
  slot1
  slot2
|
) ()

Pasting unicode chars in comments often happens while I create and annotate class hierachies.

What did you do?

Bug report :-)

What happened?

The class creates w/o trouble, and it opened in Hopscotch in "Description Mode".
When I click "Source" I get the below stack trace.

What did you expect?

Unicode characters in comments should be permissible (ok not to render them with correct glyph,
but no debuggers).

This should be easy to reproduce.

DETAILS:

3 February 2015 9:54:36.386211 pm

VM: Mac OS version 1092 - Smalltalk
VM Name: Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1029 Newspeak Cog Spur Virtual Machine 5.0.3236
Image: nsboot-2015-01-28 [latest update: #11860]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /Users/lo/active/spawningpool/nsboot-spur-2015-01-28
Trusted Dir /foobar/tooBar/forSqueak/bogus/
Untrusted Dir /Users/lo/Library/Preferences/Newspeak/Internet/Untrusted

WideString(Object)>>error:
  Receiver: 'class ClassNameHere = (
(* This comment is erratic — it contains an em dash *)
|
  slot1
  ...etc...
  Arguments and temporary variables:
    aString:     'subscript is out of bounds: 99'
  Receiver's instance variables:
'class ClassNameHere = (
(* This comment is erratic — it contains an em dash *)
|
  slot1
  ...etc...

WideString(Object)>>errorSubscriptBounds:
  Receiver: 'class ClassNameHere = (
(* This comment is erratic — it contains an em dash *)
|
  slot1
  ...etc...
  Arguments and temporary variables:
    index:     99
  Receiver's instance variables:
'class ClassNameHere = (
(* This comment is erratic — it contains an em dash *)
|
  slot1
  ...etc...

WideString>>at:
  Receiver: 'class ClassNameHere = (
(* This comment is erratic — it contains an em dash *)
|
  slot1
  ...etc...
  Arguments and temporary variables:
    index:     99
  Receiver's instance variables:
'class ClassNameHere = (
(* This comment is erratic — it contains an em dash *)
|
  slot1
  ...etc...

MultiCompositionScanner(MultiCharacterScanner)>>scanMultiCharactersFrom:to:in:rightX:stopConditions:kern:
  Receiver: a MultiCompositionScanner
  Arguments and temporary variables:
    startIndex:     98
    stopIndex:     100
    sourceString:     'class ClassNameHere = (
(* This comment is erratic — it contains...etc...
    rightX:     913
    stops:     a TextStopConditions
    kernDelta:     0
    ascii:     41
    encoding:     0
    f:     nil
    nextDestX:     nil
    maxAscii:     255
    startEncoding:     0
    floatDestX:     0
    widthAndKernedWidth:     #(nil nil)
    nextChar:     nil
    atEndOfRun:     false
  Receiver's instance variables:
    destX:     0
    lastIndex:     98
    xTable:     #(0 5 10 15 20 25 30 35 40 45 46 51 56 61 62 67 72 77 82 87 92 97 102 1...etc...
    destY:     102
    stopConditions:     a TextStopConditions
    text:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it conta...etc...
    textStyle:     a TextStyle Accujen12
    alignment:     0
    leftMargin:     0
    rightMargin:     913
    font:     a StrikeFont(Accujen12B 15)
    line:     a TextLine 98 to: 0
    runStopIndex:     100
    spaceCount:     0
    spaceWidth:     4
    emphasisCode:     1
    kern:     0
    indentationLevel:     0
    wantsColumnBreaks:     false
    pendingKernX:     0
    baselineY:     nil
    firstDestX:     0
    presentation:     a TextStream a Text for ''
    presentationLine:     a TextLine 98 to: 0
    numOfComposition:     0
    lastWidth:     nil
    spaceX:     0
    lineHeight:     15
    baseline:     12
    breakableIndex:     76
    lineHeightAtBreak:     15
    baselineAtBreak:     12
    breakAtSpace:     false

MultiCompositionScanner(MultiCharacterScanner)>>scanCharactersFrom:to:in:rightX:stopConditions:kern:
  Receiver: a MultiCompositionScanner
  Arguments and temporary variables:
    startIndex:     98
    stopIndex:     100
    sourceString:     'class ClassNameHere = (
(* This comment is erratic — it contains...etc...
    rightX:     913
    stops:     a TextStopConditions
    kernDelta:     0
    startEncoding:     0
    selector:     #scanMultiCharactersFrom:to:in:rightX:stopConditions:kern:
  Receiver's instance variables:
    destX:     0
    lastIndex:     98
    xTable:     #(0 5 10 15 20 25 30 35 40 45 46 51 56 61 62 67 72 77 82 87 92 97 102 1...etc...
    destY:     102
    stopConditions:     a TextStopConditions
    text:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it conta...etc...
    textStyle:     a TextStyle Accujen12
    alignment:     0
    leftMargin:     0
    rightMargin:     913
    font:     a StrikeFont(Accujen12B 15)
    line:     a TextLine 98 to: 0
    runStopIndex:     100
    spaceCount:     0
    spaceWidth:     4
    emphasisCode:     1
    kern:     0
    indentationLevel:     0
    wantsColumnBreaks:     false
    pendingKernX:     0
    baselineY:     nil
    firstDestX:     0
    presentation:     a TextStream a Text for ''
    presentationLine:     a TextLine 98 to: 0
    numOfComposition:     0
    lastWidth:     nil
    spaceX:     0
    lineHeight:     15
    baseline:     12
    breakableIndex:     76
    lineHeightAtBreak:     15
    baselineAtBreak:     12
    breakAtSpace:     false

MultiCompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide:
  Receiver: a MultiCompositionScanner
  Arguments and temporary variables:
    startIndex:     98
    lineRectangle:     0@102 corner: 913@119
    firstLine:     false
    leftSide:     true
    rightSide:     true
    runLength:     3
    stopCondition:     nil
  Receiver's instance variables:
    destX:     0
    lastIndex:     98
    xTable:     #(0 5 10 15 20 25 30 35 40 45 46 51 56 61 62 67 72 77 82 87 92 97 102 1...etc...
    destY:     102
    stopConditions:     a TextStopConditions
    text:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it conta...etc...
    textStyle:     a TextStyle Accujen12
    alignment:     0
    leftMargin:     0
    rightMargin:     913
    font:     a StrikeFont(Accujen12B 15)
    line:     a TextLine 98 to: 0
    runStopIndex:     100
    spaceCount:     0
    spaceWidth:     4
    emphasisCode:     1
    kern:     0
    indentationLevel:     0
    wantsColumnBreaks:     false
    pendingKernX:     0
    baselineY:     nil
    firstDestX:     0
    presentation:     a TextStream a Text for ''
    presentationLine:     a TextLine 98 to: 0
    numOfComposition:     0
    lastWidth:     nil
    spaceX:     0
    lineHeight:     15
    baseline:     12
    breakableIndex:     76
    lineHeightAtBreak:     15
    baselineAtBreak:     12
    breakAtSpace:     false

MultiTextComposer>>composeEachRectangleIn:
  Receiver: a MultiTextComposer
  Arguments and temporary variables:
    rectangles:     {0@102 corner: 913@119}
    myLine:     nil
    lastChar:     nil
    i:     1
    iLimiT:     1
  Receiver's instance variables:
    lines:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: 79 a TextLine...etc...
    maxRightX:     326
    currentY:     102
    scanner:     a MultiCompositionScanner
    possibleSlide:     false
    nowSliding:     false
    prevIndex:     1
    prevLines:     #()
    currCharIndex:     98
    startCharIndex:     1
    stopCharIndex:     98
    deltaCharIndex:     0
    theText:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it co...etc...
    theContainer:     0@0 corner: 913@9999999
    isFirstLine:     false
    theTextStyle:     a TextStyle Accujen12
    defaultLineHeight:     17
    actualHeight:     17
    wantsColumnBreaks:     false
    presentation:     a Text for ''
    presentationLines:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: 7...etc...

MultiTextComposer(TextComposer)>>composeAllRectangles:
  Receiver: a MultiTextComposer
  Arguments and temporary variables:
    rectangles:     {0@102 corner: 913@119}
    charIndexBeforeLine:     98
    numberOfLinesBefore:     6
    reasonForStopping:     nil
    i:     nil
    iLimiT:     nil
  Receiver's instance variables:
    lines:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: 79 a TextLine...etc...
    maxRightX:     326
    currentY:     102
    scanner:     a MultiCompositionScanner
    possibleSlide:     false
    nowSliding:     false
    prevIndex:     1
    prevLines:     #()
    currCharIndex:     98
    startCharIndex:     1
    stopCharIndex:     98
    deltaCharIndex:     0
    theText:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it co...etc...
    theContainer:     0@0 corner: 913@9999999
    isFirstLine:     false
    theTextStyle:     a TextStyle Accujen12
    defaultLineHeight:     17
    actualHeight:     17
    wantsColumnBreaks:     false
    presentation:     a Text for ''
    presentationLines:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: 7...etc...

MultiTextComposer(TextComposer)>>composeOneLine
  Receiver: a MultiTextComposer
  Arguments and temporary variables:
    rectangles:     {0@102 corner: 913@119}
  Receiver's instance variables:
    lines:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: 79 a TextLine...etc...
    maxRightX:     326
    currentY:     102
    scanner:     a MultiCompositionScanner
    possibleSlide:     false
    nowSliding:     false
    prevIndex:     1
    prevLines:     #()
    currCharIndex:     98
    startCharIndex:     1
    stopCharIndex:     98
    deltaCharIndex:     0
    theText:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it co...etc...
    theContainer:     0@0 corner: 913@9999999
    isFirstLine:     false
    theTextStyle:     a TextStyle Accujen12
    defaultLineHeight:     17
    actualHeight:     17
    wantsColumnBreaks:     false
    presentation:     a Text for ''
    presentationLines:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: 7...etc...

MultiTextComposer(TextComposer)>>composeAllLines
  Receiver: a MultiTextComposer
  Arguments and temporary variables:

  Receiver's instance variables:
    lines:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: 79 a TextLine...etc...
    maxRightX:     326
    currentY:     102
    scanner:     a MultiCompositionScanner
    possibleSlide:     false
    nowSliding:     false
    prevIndex:     1
    prevLines:     #()
    currCharIndex:     98
    startCharIndex:     1
    stopCharIndex:     98
    deltaCharIndex:     0
    theText:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it co...etc...
    theContainer:     0@0 corner: 913@9999999
    isFirstLine:     false
    theTextStyle:     a TextStyle Accujen12
    defaultLineHeight:     17
    actualHeight:     17
    wantsColumnBreaks:     false
    presentation:     a Text for ''
    presentationLines:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: 7...etc...

MultiTextComposer>>multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks:
  Receiver: a MultiTextComposer
  Arguments and temporary variables:
    argStart:     1
    argStop:     98
    argDelta:     0
    argLinesCollection:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: ...etc...
    argPriorLines:     #()
    argStartY:     0
    argTextStyle:     a TextStyle Accujen12
    argText:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it co...etc...
    argContainer:     0@0 corner: 913@9999999
    argWantsColumnBreaks:     false
  Receiver's instance variables:
    lines:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: 79 a TextLine...etc...
    maxRightX:     326
    currentY:     102
    scanner:     a MultiCompositionScanner
    possibleSlide:     false
    nowSliding:     false
    prevIndex:     1
    prevLines:     #()
    currCharIndex:     98
    startCharIndex:     1
    stopCharIndex:     98
    deltaCharIndex:     0
    theText:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it co...etc...
    theContainer:     0@0 corner: 913@9999999
    isFirstLine:     false
    theTextStyle:     a TextStyle Accujen12
    defaultLineHeight:     17
    actualHeight:     17
    wantsColumnBreaks:     false
    presentation:     a Text for ''
    presentationLines:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: 7...etc...

MultiNewParagraph>>multiComposeLinesFrom:to:delta:into:priorLines:atY:
  Receiver: a MultiNewParagraph
  Arguments and temporary variables:
    start:     1
    stop:     98
    delta:     0
    lineColl:     an OrderedCollection(a TextLine 1 to: 24 a TextLine 25 to: 79 a TextL...etc...
    priorLines:     #()
    startingY:     0
    newResult:     nil
    composer:     a MultiTextComposer
    presentationInfo:     nil
  Receiver's instance variables:
    text:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it conta...etc...
    textStyle:     a TextStyle Accujen12
    firstCharacterIndex:     1
    container:     0@0 corner: 913@9999999
    lines:     {a TextLine 1 to: 1}
    positionWhenComposed:     0@0
    offsetToEnd:     97
    maxRightX:     nil
    selectionStart:     nil
    selectionStop:     nil
    wantsColumnBreaks:     false
    focused:     nil
    caretRect:     nil
    showCaret:     nil
    presentationText:     nil
    presentationLines:     nil

MultiNewParagraph(NewParagraph)>>composeAll
  Receiver: a MultiNewParagraph
  Arguments and temporary variables:

  Receiver's instance variables:
    text:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it conta...etc...
    textStyle:     a TextStyle Accujen12
    firstCharacterIndex:     1
    container:     0@0 corner: 913@9999999
    lines:     {a TextLine 1 to: 1}
    positionWhenComposed:     0@0
    offsetToEnd:     97
    maxRightX:     nil
    selectionStart:     nil
    selectionStop:     nil
    wantsColumnBreaks:     false
    focused:     nil
    caretRect:     nil
    showCaret:     nil
    presentationText:     nil
    presentationLines:     nil

MultiNewParagraph(NewParagraph)>>compose:style:from:in:
  Receiver: a MultiNewParagraph
  Arguments and temporary variables:
    t:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it contains...etc...
    ts:     a TextStyle Accujen12
    startingIndex:     1
    textContainer:     0@0 corner: 913@9999999
  Receiver's instance variables:
    text:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it conta...etc...
    textStyle:     a TextStyle Accujen12
    firstCharacterIndex:     1
    container:     0@0 corner: 913@9999999
    lines:     {a TextLine 1 to: 1}
    positionWhenComposed:     0@0
    offsetToEnd:     97
    maxRightX:     nil
    selectionStart:     nil
    selectionStop:     nil
    wantsColumnBreaks:     false
    focused:     nil
    caretRect:     nil
    showCaret:     nil
    presentationText:     nil
    presentationLines:     nil

BrazilTextMorphForEditView(TextMorph)>>paragraph
  Receiver: a BrazilTextMorphForEditView(697298)
  Arguments and temporary variables:

  Receiver's instance variables:
    bounds:     0@0 corner: 913@121
    owner:     a TransformMorph(676174)
    submorphs:     #()
    fullBounds:     0@0 corner: 913@121
    color:     Color black
    extension:     a MorphExtension (4088187) [other:  (CreatingParagraph -> true)]
    borderWidth:     0
    borderColor:     Color black
    textStyle:     a TextStyle Accujen12
    text:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it conta...etc...
    wrapFlag:     true
    paragraph:     a MultiNewParagraph
    editor:     nil
    container:     nil
    predecessor:     nil
    successor:     nil
    backgroundColor:     nil
    margins:     nil
    editHistory:     nil
    editView:     a BrazilTextViewMorph(3268236)
    acceptOnCR:     false

BrazilTextMorphForEditView(TextMorph)>>newContents:
  Receiver: a BrazilTextMorphForEditView(697298)
  Arguments and temporary variables:
    stringOrText:     a Text for 'class ClassNameHere = (
(* This comment is erratic — ...etc...
    newText:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it co...etc...
    embeddedMorphs:     an IdentitySet()
    attribs:     nil
    textSize:     nil
  Receiver's instance variables:
    bounds:     0@0 corner: 913@121
    owner:     a TransformMorph(676174)
    submorphs:     #()
    fullBounds:     0@0 corner: 913@121
    color:     Color black
    extension:     a MorphExtension (4088187) [other:  (CreatingParagraph -> true)]
    borderWidth:     0
    borderColor:     Color black
    textStyle:     a TextStyle Accujen12
    text:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it conta...etc...
    wrapFlag:     true
    paragraph:     a MultiNewParagraph
    editor:     nil
    container:     nil
    predecessor:     nil
    successor:     nil
    backgroundColor:     nil
    margins:     nil
    editHistory:     nil
    editView:     a BrazilTextViewMorph(3268236)
    acceptOnCR:     false

TextViewMorphicAgent>>reemphasizeText:
  Receiver: a TextViewMorphicAgent
  Arguments and temporary variables:
    text:     a Text for 'class ClassNameHere = (
(* This comment is erratic — it conta...etc...
    mark:     1
    point:     1
  Receiver's instance variables:
    visualX:     IDETools`CodeView`3659536#2646342 in Brazil`AreaClasses`ColumnCell`418...etc...
    attributeMappings:     an OrderedCollection(an AttributeMapping an AttributeMapping...etc...
    fullyMapped:     true
    morph:     a BrazilTextViewMorph(3268236)
    localText:     nil
    originalTextExtent:     nil
    cachedHeightWidth:     921
    cachedHeightForWidth:     124
    matchingVisualsBounds:     false
    morphCreationFinished:     true
    keystrokeHook:     nil

[] in [] in IDETools`CodeView`3659536(IDETools`CodeView)>>doColorize
  Receiver: IDETools`CodeView`3659536#2646342 in Brazil`AreaClasses`ColumnCell`418871
  Arguments and temporary variables:
<<error during printing>
  Receiver's instance variables:
    parent:     Brazil`ContainerClasses`Column`2343889#673529 in Brazil`AreaClasses`Row...etc...
    agent:     a TextViewMorphicAgent
    owner:     nil
    visibleA:     Brazil`PlumbingClasses`Attribute`3867047#3774963 true
    duct:     Ducts`Duct`2094385#2763988 of: IDETools`CodeView`3659536#2646342 in Brazi...etc...
    area:     Brazil`AreaClasses`ColumnCell`418871#2434768 size: nil expansibility: 0 c...etc...
    boundsH:     Brazil`PlumbingClasses`MappableHolder`3867047#1519103 0@0 corner: 921@...etc...
    updateLockLevel:     0
    currentNaturalExtent:     344@127
    textA:     Brazil`PlumbingClasses`Attribute`3867047#840925 a Text for 'class ClassN...etc...
    fontA:     Brazil`PlumbingClasses`Attribute`3867047#2819450 Brazil`PlumbingClasses`...etc...
    suppressScrollbarsA:     Brazil`PlumbingClasses`Attribute`3867047#3449114 true
    hasChangesH:     Ducts`Holder`2094385#3980869 false
    verticalScrollPositionHolder:     Ducts`Holder`2094385#3127431 0
    menuBlock:     nil
    enterKeyResponse:     [closure] in IDETools`CodeEditorFragment`3659536(HopscotchFra...etc...
    escapeKeyResponse:     [closure] in IDETools`CodeEditorFragment`3659536(HopscotchFr...etc...
    acceptKeyResponse:     [closure] in IDETools`CodeEditorFragment`3659536(HopscotchFr...etc...
    postMapActions:     MutableArrayList()
    colorizerBlockX:     [closure] in Newspeak3Browsing`NormalClassPresenter`1308599(Ne...etc...
    colorizationProcess:     nil
    colorizationMutex:     a Semaphore()

WorldState>>runStepMethodsIn:
  Receiver: a WorldState
  Arguments and temporary variables:
    aWorld:     a PasteUpMorph(2458823) [world]
    queue:     a SharedQueue(0)
    msg:     [closure] in [] in IDETools`CodeView`3659536(IDETools`CodeView)>>doColoriz...etc...
    limit:     200
    stamp:     264513525
  Receiver's instance variables:
    hands:     {a HandMorph(1897446)}
    activeHand:     a HandMorph(1897446)
    viewBox:     0@0 corner: 1376@855
    canvas:     a FormCanvas on: DisplayScreen(1376x855x32)
    damageRecorder:     a DamageRecorder
    stepList:     a Heap(StepMessage(#stepAt: -> a ClockMorph(228334)'9:54 pm')(a Clock...etc...
    lastStepTime:     264530117
    lastStepMessage:     nil
    lastCycleTime:     264530137
    commandHistory:     a CommandHistory
    alarms:     a MorphicAlarmQueue()
    lastAlarmTime:     264530117
    remoteServer:     nil
    multiCanvas:     nil


--- The full stack ---
WideString(Object)>>error:
WideString(Object)>>errorSubscriptBounds:
WideString>>at:
MultiCompositionScanner(MultiCharacterScanner)>>scanMultiCharactersFrom:to:in:rightX:stopConditions:kern:
MultiCompositionScanner(MultiCharacterScanner)>>scanCharactersFrom:to:in:rightX:stopConditions:kern:
MultiCompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide:
MultiTextComposer>>composeEachRectangleIn:
MultiTextComposer(TextComposer)>>composeAllRectangles:
MultiTextComposer(TextComposer)>>composeOneLine
MultiTextComposer(TextComposer)>>composeAllLines
MultiTextComposer>>multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks:
MultiNewParagraph>>multiComposeLinesFrom:to:delta:into:priorLines:atY:
MultiNewParagraph(NewParagraph)>>composeAll
MultiNewParagraph(NewParagraph)>>compose:style:from:in:
BrazilTextMorphForEditView(TextMorph)>>paragraph
BrazilTextMorphForEditView(TextMorph)>>newContents:
TextViewMorphicAgent>>reemphasizeText:
[] in [] in IDETools`CodeView`3659536(IDETools`CodeView)>>doColorize
WorldState>>runStepMethodsIn:
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PasteUpMorph>>runStepMethods
WorldState>>doOneCycleNowFor:
WorldState>>doOneCycleFor:
PasteUpMorph>>doOneCycle
[] in Project class>>spawnNewProcess
[] in BlockClosure>>newProcess

Reply all
Reply to author
Forward
0 new messages