# HG changeset patch # User Claus Gittinger # Date 1003324153 -7200 # Node ID 95abdd4272cd0f578a0fcb8994da8269c7865f8c # Parent d38dbc8f296116f77c36fe7f907579457f062906 scanning of keyword symbols in array consts fixed diff -r d38dbc8f2961 -r 95abdd4272cd Parser.st --- a/Parser.st Wed Oct 10 18:48:41 2001 +0200 +++ b/Parser.st Wed Oct 17 15:09:13 2001 +0200 @@ -4822,12 +4822,15 @@ ]. (tokenType == #HashLeftParen) ifTrue:[ + self inArrayLiteral:true. self nextToken. ParseErrorSignal handle:[:ex | + self inArrayLiteral:false. ^ #Error ] do:[ val := self array. ]. + self inArrayLiteral:false. self nextToken. (self noAssignmentAllowed:'assignment to a constant' at:pos) ifFalse:[ ^ #Error @@ -5987,6 +5990,6 @@ !Parser class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.305 2001-10-09 07:41:57 cg Exp $' + ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.306 2001-10-17 13:09:06 cg Exp $' ! ! Parser initialize! diff -r d38dbc8f2961 -r 95abdd4272cd Scanner.st --- a/Scanner.st Wed Oct 10 18:48:41 2001 +0200 +++ b/Scanner.st Wed Oct 17 15:09:13 2001 +0200 @@ -21,7 +21,8 @@ scanColonAsKeyword warnSTXSpecialComment warnUnderscoreInIdentifier warnOldStyleAssignment warnCommonMistakes outStream outCol warnSTXNameSpaceUse - warnPossibleIncompatibilities warnDollarInIdentifier' + warnPossibleIncompatibilities warnDollarInIdentifier + inArrayLiteral' classVariableNames:'TypeArray ActionArray AllowUnderscoreInIdentifier Warnings WarnSTXSpecials WarnOldStyleAssignment WarnUnderscoreInIdentifier WarnCommonMistakes WarnPossibleIncompatibilities @@ -586,6 +587,10 @@ "Modified: 23.5.1997 / 12:14:45 / cg" ! +inArrayLiteral:aBoolean + inArrayLiteral := aBoolean +! + lineNumber ^ lineNr ! @@ -1557,6 +1562,19 @@ (ch2 == $:) ifFalse:[ tokenName := token := string copyWith:nextChar. tokenType := #Keyword. + inArrayLiteral == true ifTrue:[ + (ch2 isLetter + or:[ch2 == $_ and:[allowUnderscoreInIdentifier]]) ifTrue:[ + "/ kludge: recurse to read the rest. + self nextIdentifier. + tokenName := token := (string copyWith:nextChar) , token. + tokenType ~~ #Keyword ifTrue:[ + self syntaxError:'invalid keyword symbol in array constant' + position:tokenPosition to:(source position - 1). + ]. + tokenType := #Keyword. + ]. + ]. ^ tokenType ]. peekChar := $:. @@ -2130,6 +2148,6 @@ !Scanner class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.128 2001-10-02 11:38:32 cg Exp $' + ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.129 2001-10-17 13:09:13 cg Exp $' ! ! Scanner initialize!