ParserFlags.st
changeset 4333 06e11aae91bd
parent 4302 97c125843381
child 4335 d58aa3c7751c
--- a/ParserFlags.st	Fri Feb 08 17:24:08 2019 +0100
+++ b/ParserFlags.st	Fri Feb 08 18:45:32 2019 +0100
@@ -60,7 +60,8 @@
 		allowSTXExtendedArrayLiterals warnAssignmentToBlockArgument
 		warnAssignmentToMethodArgument warnAssignmentToPoolVariable
 		allowSignedByteArrayElements allowSymbolsStartingWithDigit
-		allowJavaScriptConst allowPeriodAsNameSpaceSeparator'
+		allowJavaScriptConst allowPeriodAsNameSpaceSeparator
+		allowCStrings'
 	classVariableNames:'AllowArrayIndexSyntaxExtension AllowAssignmentToBlockArgument
 		AllowAssignmentToMethodArgument AllowAssignmentToPoolVariable
 		AllowCaretAsBinop AllowCharacterEscapes AllowDollarInIdentifier
@@ -106,7 +107,7 @@
 		WarnUndeclared WarnUnderscoreInIdentifier WarnUnusedVars Warnings
 		AutoDefineVariables AllowSignedByteArrayElements
 		AllowSymbolsStartingWithDigit AllowJavaScriptConst
-		AllowJavaScriptLet AllowPeriodAsNameSpaceSeparator'
+		AllowJavaScriptLet AllowPeriodAsNameSpaceSeparator AllowCStrings'
 	poolDictionaries:''
 	category:'System-Compiler'
 !
@@ -143,6 +144,89 @@
     for stx debugging:
         STCKeepCIntermediate := true
 
+    the flags control:
+        Warnings                            -- enable/disable any warnings from the compiler
+          WarnUndeclared                    -- warn about undeclared variables
+          WarnUnusedVars                    -- warn about unused variables
+          WarnST80Directives                -- warn when ST80 (visualworks) directives (primitives) are used
+          WarnAboutWrongVariableNames       -- conventions / style
+          WarnAboutVariableNameConventions 
+          WarnAboutNonLowercaseLocalVariableNames
+          WarnAboutShortLocalVariableNames
+          WarnAboutBadComments 
+          WarnCommonMistakes
+          WarnAboutReferenceToPrivateClass
+        WarnPossibleIncompatibilities
+          WarnSTXSpecials                   -- warn when special ST/X syntax extensions are used
+          WarnUnderscoreInIdentifier        -- underscores in identifier (not all Smalltalk dialects support this)
+          WarnDollarInIdentifier            -- dollar in identifier (not all Smalltalk dialects support this)
+          WarnParagraphInIdentifier         -- paragraph character in identifier
+          WarnOldStyleAssignment            -- assignment with _ - character
+          WarnHiddenVariables               -- locals shadowing outer/instvars
+          WarnInconsistentReturnValues      -- boolean/non-boolean return values
+          WarnAboutPeriodInSymbol
+          WarnAboutPossibleSTCCompilationProblems
+          WarnAboutUnknownCharacterEscapesInJavaScriptStringConstant
+          WarnAssignmentToBlockArgument 
+          WarnAssignmentToMethodArgument
+          WarnAssignmentToPoolVariable
+        WarnPlausibilityChecks
+          WarnAboutPossiblyUnimplementedSelectors
+
+       AllowReservedWordsAsSelectors
+       AllowUnderscoreInIdentifier 
+       AllowParagraphInIdentifier 
+       AllowDollarInIdentifier              -- st80-vms dollars in identifiers
+       AllowOldStyleAssignment              -- st80 underscore as assignment
+       AllowDolphinExtensions               -- dolphin computed literal
+       AllowQualifiedNames                  -- vw3 qualified names
+       AllowExtendedBinarySelectors         -- vw5.4 extended binary selectors (plus/minus, center-dot etc.)
+       AllowCaretAsBinop                    -- too dangerous
+       AllowLiteralNameSpaceSymbols         -- st/x literal nameSpace-symbols (#foo::bar)
+       AllowArrayIndexSyntaxExtension 
+       AllowFunctionCallSyntaxForBlockEvaluation 
+       AllowLocalVariableDeclarationWithInitializerExpression 
+       AllowDomainVariables 
+       AllowArrayIndexSyntaxExtension 
+       AllowReservedWordsAsSelectors 
+       AllowVariableReferences 
+       AllowLazyValueExtension 
+       AllowFixedPointLiterals 
+       AllowExtendedSTXSyntax 
+       AllowVisualAgeESSymbolLiterals 
+       AllowExtensionsToPrivateClasses 
+       AllowVisualAgePrimitives 
+       AllowSqueakExtensions                -- squeak computed array
+       AllowSqueakPrimitives 
+       AllowSTVPrimitives                   -- number-sign syntax
+       AllowSTVExtensions 
+       AllowNationalCharactersInIdentifier 
+       AllowHashAsBinarySelector 
+       AllowSTXEOLComments                  -- DQuote/ EOL comments
+       AllowSTXDelimiterComments            -- DQuote<<END delimiter comments
+       AllowVisualWorksMethodAnnotations 
+       AllowPossibleSTCCompilationProblems  -- must be true, to allow fileIn
+       AllowEmptyStatements 
+       AllowPeriodInSymbol 
+       AllowPeriodAsNameSpaceSeparator 
+
+       AllowCStrings                        -- c'....' is a string with C-escapes
+       AllowUnicodeStrings 
+       AllowUnicodeCharacters 
+       AllowCharacterEscapes 
+       AllowStringEscapes 
+       AllowAssignmentToBlockArgument 
+       AllowAssignmentToMethodArgument 
+       AllowAssignmentToPoolVariable 
+       AllowSignedByteArrayElements 
+       AllowSymbolsStartingWithDigit 
+
+       AllowJavaScriptConst               
+
+       ArraysAreImmutable                 -- still care for ST-80 compatibility
+       StringsAreImmutable                -- still care for ST-80 compatibility
+       ImplicitSelfSends 
+    
 "
 ! !
 
@@ -727,6 +811,18 @@
     "Created: / 08-09-2011 / 14:50:48 / cg"
 !
 
+allowCStrings
+    ^ AllowCStrings
+
+    "Created: / 08-02-2019 / 18:42:15 / Claus Gittinger"
+!
+
+allowCStrings:aBoolean
+    AllowCStrings := aBoolean.
+
+    "Created: / 08-02-2019 / 18:42:30 / Claus Gittinger"
+!
+
 allowDollarInIdentifier
     "return true, if $-characters are allowed in identifiers.
      Notice, that dollars are NEVER allowed as the first character in an identifier
@@ -1721,6 +1817,7 @@
     AllowPeriodInSymbol := false.
     AllowPeriodAsNameSpaceSeparator := false.
     "/ these are only used by the new compiler
+    AllowCStrings := false.                     "/ c'...' syntax
     AllowUnicodeStrings := false.
     AllowUnicodeCharacters := false.
     AllowCharacterEscapes := false.
@@ -1811,7 +1908,7 @@
     "Modified: / 09-08-2006 / 18:47:18 / fm"
     "Modified: / 08-08-2017 / 23:49:41 / cg"
     "Modified (comment): / 11-05-2018 / 10:12:29 / stefan"
-    "Modified: / 23-09-2018 / 00:48:33 / Claus Gittinger"
+    "Modified (comment): / 08-02-2019 / 18:41:52 / Claus Gittinger"
 !
 
 initializeSTCFlagsForTopDirectory:topDirArg
@@ -2328,6 +2425,18 @@
     allowAssignmentToPoolVariable := aBoolean.
 !
 
+allowCStrings
+    ^ allowCStrings ? false.
+
+    "Created: / 08-02-2019 / 18:28:33 / Claus Gittinger"
+!
+
+allowCStrings:aBoolean
+    allowCStrings := aBoolean
+
+    "Created: / 08-02-2019 / 18:28:47 / Claus Gittinger"
+!
+
 allowCaretAsBinop
     ^ allowCaretAsBinop
 !
@@ -3077,6 +3186,7 @@
     allowPeriodAsNameSpaceSeparator := AllowPeriodAsNameSpaceSeparator.
     
     "/ these are only supported in the new compiler
+    allowCStrings := AllowCStrings.
     allowUnicodeStrings := AllowUnicodeStrings.
     allowUnicodeCharacters := AllowUnicodeCharacters.
     allowCharacterEscapes := AllowCharacterEscapes.
@@ -3116,7 +3226,7 @@
     "
 
     "Modified: / 08-08-2017 / 23:50:01 / cg"
-    "Modified: / 23-09-2018 / 00:49:41 / Claus Gittinger"
+    "Modified: / 08-02-2019 / 18:29:16 / Claus Gittinger"
 ! !
 
 !ParserFlags class methodsFor:'documentation'!