2013-08-19 Holger Hans Peter Freyther <[email protected]> * RewriteTests.st: Add TestRewrite>>#testOldSyntaxSymbolParsing. * SqueakParser.st: Add SqueakFileInScanner>>#scanBinary:. --- packages/stinst/parser/ChangeLog | 5 +++++ packages/stinst/parser/RewriteTests.st | 22 ++++++++++++++++++++++ packages/stinst/parser/SqueakParser.st | 8 ++++++++ 3 files changed, 35 insertions(+)
diff --git a/packages/stinst/parser/ChangeLog b/packages/stinst/parser/ChangeLog index d1a5106..b3a0a9f 100644 --- a/packages/stinst/parser/ChangeLog +++ b/packages/stinst/parser/ChangeLog @@ -1,3 +1,8 @@ +2013-08-19 Holger Hans Peter Freyther <[email protected]> + + * RewriteTests.st: Add TestRewrite>>#testOldSyntaxSymbolParsing. + * SqueakParser.st: Add SqueakFileInScanner>>#scanBinary:. + 2013-08-18 Holger Hans Peter Freyther <[email protected]> * STLoaderObjs.st: Add LoadedMethod>>#methodRecompilationSourceString. diff --git a/packages/stinst/parser/RewriteTests.st b/packages/stinst/parser/RewriteTests.st index 489a4f8..3712f92 100644 --- a/packages/stinst/parser/RewriteTests.st +++ b/packages/stinst/parser/RewriteTests.st @@ -428,6 +428,28 @@ TestCase subclass: TestRewrite [ self assert: (out contents indexOfSubCollection: 'Osmo.LogManager') = 0. ] + + testOldSyntaxSymbolParsing [ + | res | + res := (STClassLoader new + parseSmalltalkStream: +'Object subclass: #PhexMatcher + instanceVariableNames: ''value state'' + classVariableNames: '''' + poolDictionaries: '''' + category: ''Phexample-Core''! + +!PhexMatcher methodsFor: ''expecting'' stamp: ''JoeExample 10/27/2009 18:35''! +< expected + ^self expect: expected using: #<! !' readStream with: SqueakFileInParser) first. + + "Compare..." + self assert: (res >> #<) methodSourceString = '< expected + ^self expect: expected using: #<'. + + (res >> #<) methodFormattedSourceString printNl. + ] + testOldSyntaxNamespaceRewrite [ | class tree rule rewriter res out| diff --git a/packages/stinst/parser/SqueakParser.st b/packages/stinst/parser/SqueakParser.st index 6be255d..3747518 100644 --- a/packages/stinst/parser/SqueakParser.st +++ b/packages/stinst/parser/SqueakParser.st @@ -152,6 +152,14 @@ STFileScanner subclass: SqueakFileInScanner [ self step]. val := buffer contents. + + "Skip a trailing ! as it might come from a #<! !" + val last = $! + ifTrue: [ + stream skip: -1. + currentCharacter := $!. + characterType := #binary. + val := val allButLast]. val := val asSymbol. ^aClass value: val start: tokenStart ] -- 1.8.3.2 _______________________________________________ help-smalltalk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-smalltalk
