#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Mon, 03 Jun 2019 11:13:19 +0200
changeset 4430 25c8c1a7a28b
parent 4429 13faa6fe3a82
child 4431 5cbe584d6f60
#FEATURE by cg class: ParserFlags class definition added: #allowRStrings #allowRStrings: changed: #initialize class: ParserFlags class added: #allowRStrings #allowRStrings: changed: #initialize
ParserFlags.st
--- a/ParserFlags.st	Mon Jun 03 10:59:08 2019 +0200
+++ b/ParserFlags.st	Mon Jun 03 11:13:19 2019 +0200
@@ -62,7 +62,7 @@
 		allowSignedByteArrayElements allowSymbolsStartingWithDigit
 		allowJavaScriptConst allowPeriodAsNameSpaceSeparator
 		allowCStrings warnAboutPossiblyUninitializedLocals allowEStrings
-		singlePrecisionFloatF'
+		singlePrecisionFloatF allowRStrings'
 	classVariableNames:'AllowArrayIndexSyntaxExtension AllowAssignmentToBlockArgument
 		AllowAssignmentToMethodArgument AllowAssignmentToPoolVariable
 		AllowCaretAsBinop AllowCharacterEscapes AllowDollarInIdentifier
@@ -110,7 +110,7 @@
 		AllowSymbolsStartingWithDigit AllowJavaScriptConst
 		AllowJavaScriptLet AllowPeriodAsNameSpaceSeparator AllowCStrings
 		WarnAboutPossiblyUninitializedLocals AllowEStrings
-		SinglePrecisionFloatF'
+		SinglePrecisionFloatF AllowRStrings'
 	poolDictionaries:''
 	category:'System-Compiler'
 !
@@ -1226,6 +1226,26 @@
     "
 !
 
+allowRStrings
+    "rstrings have the syntax:
+        r'...'
+     which generates a regex"
+        
+    ^ AllowRStrings
+
+    "Created: / 03-06-2019 / 11:12:11 / Claus Gittinger"
+!
+
+allowRStrings:aBoolean
+    "rstrings have the syntax:
+        r'...'
+     which generates a regex"
+        
+    AllowRStrings := aBoolean
+
+    "Created: / 03-06-2019 / 11:12:37 / Claus Gittinger"
+!
+
 allowReservedWordsAsSelectors
     "return true, if self, super, thisContext, nil, true and false are to be allowed
      as unary message selectors."
@@ -1983,6 +2003,7 @@
     "/ these are only used by the new compiler
     AllowCStrings := true.                     "/ c'...' syntax
     AllowEStrings := false.                    "/ e'...' syntax
+    AllowRStrings := false.                    "/ r'...' syntax
     AllowUnicodeStrings := false.
     AllowUnicodeCharacters := false.
     AllowCharacterEscapes := false.
@@ -2073,7 +2094,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: / 26-05-2019 / 11:32:55 / Claus Gittinger"
+    "Modified: / 03-06-2019 / 11:12:55 / Claus Gittinger"
 !
 
 initializeSTCFlagsForTopDirectory:topDirArg
@@ -2937,6 +2958,26 @@
     "Modified (comment): / 09-02-2019 / 15:53:11 / Claus Gittinger"
 !
 
+allowRStrings
+    "rstrings have the syntax:
+        r'...'
+     which generates a regex"
+
+    ^ allowRStrings ? false.
+
+    "Created: / 03-06-2019 / 11:11:25 / Claus Gittinger"
+!
+
+allowRStrings:aBoolean
+    "rstrings have the syntax:
+        r'...'
+     which generates a regex"
+
+    allowRStrings := aBoolean
+
+    "Created: / 03-06-2019 / 11:11:51 / Claus Gittinger"
+!
+
 allowReservedWordsAsSelectors
     ^ allowReservedWordsAsSelectors
 !
@@ -3607,6 +3648,7 @@
     "/ these are only supported in the new compiler
     allowCStrings := AllowCStrings.
     allowEStrings := AllowEStrings.
+    allowRStrings := AllowRStrings.
     allowUnicodeStrings := AllowUnicodeStrings.
     allowUnicodeCharacters := AllowUnicodeCharacters.
     allowCharacterEscapes := AllowCharacterEscapes.
@@ -3646,7 +3688,7 @@
     "
 
     "Modified: / 08-08-2017 / 23:50:01 / cg"
-    "Modified: / 26-05-2019 / 11:33:14 / Claus Gittinger"
+    "Modified: / 03-06-2019 / 11:13:07 / Claus Gittinger"
 ! !
 
 !ParserFlags class methodsFor:'documentation'!