The patch should fix the issue and make STInST consistent (with a test case).

On 09/09/2013 10:16, Holger Hans Peter Freyther wrote:
Issue status update for http://smalltalk.gnu.org/node/815
Post a follow up: http://smalltalk.gnu.org/project/comments/add/815

Project:      GNU Smalltalk
Version:      <none>
Component:    STInST
Category:     bug reports
Priority:     normal
Assigned to:  Unassigned
Reported by:  zecke
Updated by:   zecke
Status:       active

STInST and gst-parse.c are inconsistent about a trailing '.' at the end
of the class definition. E.g. like this:


Object subclass: Test [
].


It has been found while trying to load Cairo with the 'Compiler'
package.



_______________________________________________
help-smalltalk mailing list
help-smalltalk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-smalltalk

>From b0c17f9d896bed58c0567153a933b3649bfb536e Mon Sep 17 00:00:00 2001
From: Gwenael Casaccio <mrg...@gmail.com>
Date: Tue, 10 Sep 2013 15:33:56 +0200
Subject: [PATCH] Make STInST and gst-parse.c consistent about a trailing '.'
 at the end of the class definition

---
 packages/stinst/parser/ChangeLog         |  6 ++++
 packages/stinst/parser/GSTParser.st      |  1 +
 packages/stinst/parser/GSTParserTests.st | 53 ++++++++++++++++++++++++++++++++
 packages/stinst/parser/package.xml       |  2 ++
 4 files changed, 62 insertions(+)
 create mode 100644 packages/stinst/parser/GSTParserTests.st

diff --git a/packages/stinst/parser/ChangeLog b/packages/stinst/parser/ChangeLog
index 072a89c..16bf75c 100644
--- a/packages/stinst/parser/ChangeLog
+++ b/packages/stinst/parser/ChangeLog
@@ -1,3 +1,9 @@
+2013-09-10  Gwenael Casaccio <gwenael.casac...@gmail.com>
+
+	* GSTParser.st: Make STInST and gst-parse.c consistent about a trailing '.' 
+	at the end of the class definition.
+	* GSTParserTests.st: Add testcase for trailing consistency.
+
 2013-08-10  Gwenael Casaccio <gwenael.casac...@gmail.com>
 
 	* STLoaderObjs.st: Fix ProxyNamespace>>#printOn: and add ProxyNamespace>>#examineOn:.
diff --git a/packages/stinst/parser/GSTParser.st b/packages/stinst/parser/GSTParser.st
index 66fedcb..7d934e1 100644
--- a/packages/stinst/parser/GSTParser.st
+++ b/packages/stinst/parser/GSTParser.st
@@ -168,6 +168,7 @@ STInST.STFileInParser subclass: GSTFileInParser [
 	    addInstVars := self
 		parseClassBodyElement: addInstVars
 		withinExtend: extend ].
+        currentToken isSpecial ifTrue: [ self skipToken: $. ].
 	taggee := oldTaggee.
     ]
     
diff --git a/packages/stinst/parser/GSTParserTests.st b/packages/stinst/parser/GSTParserTests.st
new file mode 100644
index 0000000..9722000
--- /dev/null
+++ b/packages/stinst/parser/GSTParserTests.st
@@ -0,0 +1,53 @@
+"======================================================================
+|
+|   GSTParser tests
+|
+|
+ ======================================================================"
+
+"======================================================================
+|
+| Copyright (C) 2013 Free Software Foundation, Inc.
+| Written by Gwenael Casaccio.
+|
+| This file is part of the GNU Smalltalk class library.
+|
+| The GNU Smalltalk class library is free software; you can redistribute it
+| and/or modify it under the terms of the GNU Lesser General Public License
+| as published by the Free Software Foundation; either version 2.1, or (at
+| your option) any later version.
+| 
+| The GNU Smalltalk class library is distributed in the hope that it will be
+| useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
+| General Public License for more details.
+| 
+| You should have received a copy of the GNU Lesser General Public License
+| along with the GNU Smalltalk class library; see the file COPYING.LIB.
+| If not, write to the Free Software Foundation, 59 Temple Place - Suite
+| 330, Boston, MA 02110-1301, USA.  
+|
+ ======================================================================"
+
+
+
+Namespace current: STInST.Tests [
+
+TestCase subclass: TestGSTParser [
+    <comment: 'I test that rewriting a method for the OldSyntaxExport and
+    SqueakExporter will pick up the new code.'>
+
+    testRegression[
+        <category: 'testing'>
+
+        STEvaluationDriver new
+            parseSmalltalkStream: 'Object subclass: Xork1 []. Object subclass: Xork2 [].' readStream
+            with: GSTFileInParser.
+
+        self assert: (Smalltalk includesGlobalNamed: #Xork1).
+        self assert: (Smalltalk includesGlobalNamed: #Xork2).
+    ]
+]
+
+]
+
diff --git a/packages/stinst/parser/package.xml b/packages/stinst/parser/package.xml
index e4881fd..106ce80 100644
--- a/packages/stinst/parser/package.xml
+++ b/packages/stinst/parser/package.xml
@@ -36,10 +36,12 @@
    <sunit>STInST.Tests.TestClassicPoolResolution</sunit>
    <sunit>STInST.Tests.TestDebugInformation</sunit>
    <sunit>STInST.Tests.TestSTLoaderObjects</sunit>
+   <sunit>STInST.Tests.TestGSTParser</sunit>
    <filein>RewriteTests.st</filein>
    <filein>PoolResolutionTests.st</filein>
    <filein>DebugInformationTests.st</filein>
    <filein>STLoaderObjsTests.st</filein>
+   <filein>GSTParserTests.st</filein>
   </test>
 
   <file>ChangeLog</file>
-- 
1.8.1.2

_______________________________________________
help-smalltalk mailing list
help-smalltalk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to