Skip to content

Commit

Permalink
Fix GRAnsiCharacterRule: should only match character literals
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrichau committed Jan 28, 2024
1 parent c53e80a commit 933bc73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ initialize
replace: 'Character value: ``@expr'
with: 'Character codePoint: ``@expr'.
self
replace: '`#source to: `#target'
replace: '`#source `{:node | node value isCharacter }` to: `#target'
byEvaluating: [ :node |
(node receiver value isCharacter and: [
node arguments first value isCharacter ])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ testAnsiCharacterRule
class := self defineSubClassOf: #GRObject.
self compile: 'character Character value: 123' in: class.
self compile: 'characterRange $a to: $c' in: class.
self compile: 'integerRange 1 to: 10' in: class.
self
runTransformation: GRAnsiCharactersRule
changes: #('character Character codePoint: 123' 'characterRange ''abc''')

0 comments on commit 933bc73

Please sign in to comment.