Hi Nicholas,<div><br></div><div>    how about renaming scanLitByte to scanLitByteVec?<br><br><div class="gmail_quote">On Fri, Nov 27, 2009 at 3:54 AM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Compiler-nice.98.mcz" target="_blank">http://source.squeak.org/trunk/Compiler-nice.98.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Compiler-nice.98<br>
Author: nice<br>
Time: 27 November 2009, 12:54:16 pm<br>
UUID: 4853aa4f-5bcb-e242-a130-f41f2c4d09ae<br>
Ancestors: Compiler-cwp.97<br>
<br>
Add support for literal ByteArray #[1 2 3]<br>
<br>
=============== Diff against Compiler-cwp.97 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Scanner&gt;&gt;scanLitByte (in category &#39;expression types&#39;) -----<br>
+ scanLitByte<br>
+       | stream |<br>
+       stream := (ByteArray new: 16) writeStream.<br>
+       [ tokenType = #rightBracket or: [ tokenType = #doIt ] ] whileFalse: [<br>
+               tokenType = #word<br>
+                       ifTrue: [ self scanLitWord ].<br>
+               (token isInteger and: [ token between: 0 and: 255 ])<br>
+                       ifFalse: [ ^ self offEnd: &#39;8-bit integer or right bracket expected&#39; ].<br>
+               stream nextPut: token.<br>
+               self scanToken ].<br>
+       token := stream contents!<br>
<br>
Item was changed:<br>
+ ----- Method: Scanner class&gt;&gt;initialize (in category &#39;initialization&#39;) -----<br>
- ----- Method: Scanner class&gt;&gt;initialize (in category &#39;class initialization&#39;) -----<br>
  initialize<br>
        | newTable |<br>
+       newTable := Array new: 256 withAll: #xBinary. &quot;default&quot;<br>
-       newTable _ Array new: 256 withAll: #xBinary. &quot;default&quot;<br>
        newTable atAll: #(9 10 12 13 32 ) put: #xDelimiter. &quot;tab lf ff cr space&quot;<br>
        newTable atAll: ($0 asciiValue to: $9 asciiValue) put: #xDigit.<br>
<br>
        1 to: 255<br>
                do: [:index |<br>
                        (Character value: index) isLetter<br>
                                ifTrue: [newTable at: index put: #xLetter]].<br>
<br>
        newTable at: 30 put: #doIt.<br>
        newTable at: $&quot; asciiValue put: #xDoubleQuote.<br>
        newTable at: $# asciiValue put: #xLitQuote.<br>
        newTable at: $$ asciiValue put: #xDollar.<br>
        newTable at: $&#39; asciiValue put: #xSingleQuote.<br>
        newTable at: $: asciiValue put: #xColon.<br>
        newTable at: $( asciiValue put: #leftParenthesis.<br>
        newTable at: $) asciiValue put: #rightParenthesis.<br>
        newTable at: $. asciiValue put: #period.<br>
        newTable at: $; asciiValue put: #semicolon.<br>
        newTable at: $[ asciiValue put: #leftBracket.<br>
        newTable at: $] asciiValue put: #rightBracket.<br>
        newTable at: ${ asciiValue put: #leftBrace.<br>
        newTable at: $} asciiValue put: #rightBrace.<br>
        newTable at: $^ asciiValue put: #upArrow.<br>
        newTable at: $_ asciiValue put: #leftArrow.<br>
        newTable at: $| asciiValue put: #verticalBar.<br>
+       TypeTable := newTable &quot;bon voyage!!&quot;<br>
-       TypeTable _ newTable &quot;bon voyage!!&quot;<br>
<br>
        &quot;Scanner initialize&quot;!<br>
<br>
Item was changed:<br>
  ----- Method: Scanner&gt;&gt;xLitQuote (in category &#39;multi-character scans&#39;) -----<br>
  xLitQuote<br>
        &quot;Symbols and vectors: #(1 (4 5) 2 3) #ifTrue:ifFalse: #&#39;abc&#39;.&quot;<br>
-<br>
        | start |<br>
        start := mark.<br>
        self step. &quot;litQuote&quot;<br>
        self scanToken.<br>
        tokenType = #leftParenthesis<br>
+               ifTrue: [self scanToken; scanLitVec.<br>
+                       mark := start + 1.<br>
-               ifTrue:<br>
-                       [self scanToken; scanLitVec.<br>
-                       mark := start+1.<br>
                        tokenType == #doIt<br>
                                ifTrue: [self offEnd: &#39;Unmatched parenthesis&#39;]]<br>
+               ifFalse: [tokenType = #leftBracket<br>
+                               ifTrue: [self scanToken; scanLitByte.<br>
+                                       mark := start + 1.<br>
+                                       tokenType == #doIt<br>
+                                               ifTrue: [self offEnd: &#39;Unmatched bracket&#39;]]<br>
+                               ifFalse: [(#(#word #keyword #colon ) includes: tokenType)<br>
+                                               ifTrue: [self scanLitWord]<br>
+                                               ifFalse: [tokenType == #literal<br>
+                                                               ifTrue: [token isSymbol<br>
+                                                                               ifTrue: [&quot;##word&quot;<br>
+                                                                                       token := token<br>
+                                                                                       &quot;May want to move toward ANSI<br>
+                                                                                       here &quot;]]<br>
+                                                               ifFalse: [tokenType == #string<br>
+                                                                               ifTrue: [token := token asSymbol]]]]].<br>
-               ifFalse:<br>
-                       [(#(word keyword colon ) includes: tokenType)<br>
-                               ifTrue:<br>
-                                       [self scanLitWord]<br>
-                               ifFalse:<br>
-                                       [(tokenType==#literal)<br>
-                                               ifTrue:<br>
-                                                       [(token isSymbol)<br>
-                                                               ifTrue: &quot;##word&quot;<br>
-                                                                       [token := token &quot;May want to move toward ANSI here&quot;]]<br>
-                                               ifFalse:<br>
-                                                       [tokenType==#string ifTrue: [token := token asSymbol]]]].<br>
        mark := start.<br>
        tokenType := #literal<br>
<br>
+       &quot;#(Pen)<br>
- &quot;     #(Pen)<br>
        #Pen<br>
        #&#39;Pen&#39;<br>
        ##Pen<br>
        ###Pen<br>
+       &quot;!<br>
- &quot;!<br>
<br>
<br>
</blockquote></div><br>
</div>