core: \foo is literally just foo. To escape it, do ``\ foo`` instead.
Fix smalltalk too.modern-harvey2
							parent
							
								
									fbaa172732
								
							
						
					
					
						commit
						b0858e48b8
					
				|  | @ -81,7 +81,7 @@ ERROR: can't-nest-definitions word ; | ||||||
| 
 | 
 | ||||||
| : (:) ( -- word def effect ) | : (:) ( -- word def effect ) | ||||||
|     [ |     [ | ||||||
|         scan-new-word |         scan-new-syntax-word | ||||||
|         scan-effect |         scan-effect | ||||||
|         parse-definition swap |         parse-definition swap | ||||||
|     ] with-definition ; |     ] with-definition ; | ||||||
|  |  | ||||||
|  | @ -118,10 +118,16 @@ DEFER: parse-token | ||||||
|         nip |         nip | ||||||
|     ] if ; |     ] if ; | ||||||
| 
 | 
 | ||||||
|  | : unescape-token ( string -- string' ) | ||||||
|  |     dup length 1 = [ "\\" ?head drop ] unless ; | ||||||
|  | 
 | ||||||
|  | : unescape-tokens ( seq -- seq' ) | ||||||
|  |     [ unescape-token ] map ; | ||||||
|  | 
 | ||||||
| : parse-token ( lexer -- str/f ) | : parse-token ( lexer -- str/f ) | ||||||
|     dup parse-raw [ skip-comments ] [ drop f ] if* ; |     dup parse-raw [ skip-comments ] [ drop f ] if* ; | ||||||
| 
 | 
 | ||||||
| : ?scan-token ( -- str/f ) lexer get parse-token ; | : ?scan-token ( -- str/f ) lexer get parse-token unescape-token ; | ||||||
| 
 | 
 | ||||||
| PREDICATE: unexpected-eof < unexpected got>> not ; | PREDICATE: unexpected-eof < unexpected got>> not ; | ||||||
| 
 | 
 | ||||||
|  | @ -143,12 +149,6 @@ PREDICATE: unexpected-eof < unexpected got>> not ; | ||||||
| : parse-tokens ( end -- seq ) | : parse-tokens ( end -- seq ) | ||||||
|     [ ] map-tokens ; |     [ ] map-tokens ; | ||||||
| 
 | 
 | ||||||
| : unescape-token ( string -- string' ) |  | ||||||
|     "\\" ?head drop ; |  | ||||||
| 
 |  | ||||||
| : unescape-tokens ( seq -- seq' ) |  | ||||||
|     [ unescape-token ] map ; |  | ||||||
| 
 |  | ||||||
| TUPLE: lexer-error line column line-text parsing-words error ; | TUPLE: lexer-error line column line-text parsing-words error ; | ||||||
| 
 | 
 | ||||||
| M: lexer-error error-file error>> error-file ; | M: lexer-error error-file error>> error-file ; | ||||||
|  |  | ||||||
|  | @ -26,14 +26,14 @@ M: ast-name compile-ast name>> swap lookup-reader ; | ||||||
|     [ compile-arguments ] 2bi |     [ compile-arguments ] 2bi | ||||||
|     [ new ] 3append ; |     [ new ] 3append ; | ||||||
| 
 | 
 | ||||||
| : compile-ifTrue:ifFalse: ( lexenv ast -- quot ) | : \compile-ifTrue:ifFalse: ( lexenv ast -- quot ) | ||||||
|     [ receiver>> compile-ast ] |     [ receiver>> compile-ast ] | ||||||
|     [ compile-arguments ] 2bi |     [ compile-arguments ] 2bi | ||||||
|     [ if ] 3append ; |     [ if ] 3append ; | ||||||
| 
 | 
 | ||||||
| M: ast-message-send compile-ast | M: ast-message-send compile-ast | ||||||
|     dup selector>> { |     dup selector>> { | ||||||
|         { "ifTrue:ifFalse:" [ compile-ifTrue:ifFalse: ] } |         { "ifTrue:ifFalse:" [ \compile-ifTrue:ifFalse: ] } | ||||||
|         { "new" [ compile-new ] } |         { "new" [ compile-new ] } | ||||||
|         [ |         [ | ||||||
|             drop |             drop | ||||||
|  |  | ||||||
|  | @ -17,8 +17,8 @@ SELECTOR: tab | ||||||
| SELECTOR: nl | SELECTOR: nl | ||||||
| 
 | 
 | ||||||
| M: object selector-print: [ present ] dip stream-print nil ; | M: object selector-print: [ present ] dip stream-print nil ; | ||||||
| M: object selector-nextPutAll: selector-print: ; | M: object selector-nextPutAll: \selector-print: ; | ||||||
| M: object selector-tab "    " swap selector-print: ; | M: object selector-tab "    " swap \selector-print: ; | ||||||
| M: object selector-nl stream-nl nil ; | M: object selector-nl stream-nl nil ; | ||||||
| 
 | 
 | ||||||
| SELECTOR: + | SELECTOR: + | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue