<commit_before>Class {
	#name : #GtGemStoneCoderModel,
	#superclass : #GtSourceCoder,
	#instVars : [
		'pharoBindings',
		'sessionName',
		'applicationStrategy',
		'remoteScript',
		'remoteBindings'
	],
	#category : 'GToolkit-GemStone-Lepiter-Coder'
}

{ #category : #converting }
GtGemStoneCoderModel >> asCoderUIModel [

	^ GtSourceCoderViewModel new coder: self
]

{ #category : #'api - ast' }
GtGemStoneCoderModel >> computeAst: theSourceString [
	^ GtPharoParser
		parseWithErrors: theSourceString
		startingAt: GtPharoParser startingStateForMethodSequence
]

{ #category : #initialize }
GtGemStoneCoderModel >> initializeAddOns: addOns [
	super initializeAddOns: addOns.
	
	addOns addStyler: (GtCoderAstSmaCCParserStyler new smaccStyler: StParser gtStyler).
	
	addOns
		addMainAction: 'Evaluate' translated
		icon: BrGlamorousVectorIcons play
		action: [ :aCoderUIModel :anElement | 
			GtCoderCodeExecutor doIt
				coderUIModel: aCoderUIModel;
				element: anElement;
				execute ]
		id: GtSourceCoderDoItActionId.
	addOns
		addMainAction: 'Inspect' translated
		icon: BrGlamorousVectorIcons playinspect
		action: [ :aCoderUIModel :anElement | 
			GtCoderCodeExecutor doItAndGo
				coderUIModel: aCoderUIModel;
				element: anElement;<commit_msg>Fix variable renaming in snippets for GemStone<commit_after>Class {
	#name : #GtGemStoneCoderModel,
	#superclass : #GtSourceCoder,
	#instVars : [
		'pharoBindings',
		'sessionName',
		'applicationStrategy',
		'remoteScript',
		'remoteBindings'
	],
	#category : #'GToolkit-GemStone-Lepiter-Coder'
}

{ #category : #converting }
GtGemStoneCoderModel >> asCoderUIModel [

	^ GtSourceCoderViewModel new coder: self
]

{ #category : #'api - ast' }
GtGemStoneCoderModel >> computeAst: theSourceString [
	^ GtPharoParser
		parseWithErrors: theSourceString
		startingAt: GtPharoParser startingStateForMethodSequence
]

{ #category : #'api - ast' }
GtGemStoneCoderModel >> implicitVariableReferencesTo: aString do: aBlock [
	self astAwait
		allNodesDo:
			[ :each | (each isVariable and: [ aString = each variableName asString and: [ each whoDefines isNil ] ]) ifTrue: [ aBlock value: each ] ]
]

{ #category : #initialize }
GtGemStoneCoderModel >> initializeAddOns: addOns [
	super initializeAddOns: addOns.
	
	addOns addStyler: (GtCoderAstSmaCCParserStyler new smaccStyler: StParser gtStyler).
	
	addOns
		addMainAction: 'Evaluate' translated
		icon: BrGlamorousVectorIcons play
		action: [ :aCoderUIModel :anElement | 
			GtCoderCodeExecutor doIt
				coderUIModel: aCoderUIModel;
				element: anElement;
				execute ]
		id: GtSourceCoderDoItActionId.
	addOns
		addMainAction: 'Inspect' translated
		icon: BrGlamorousVectorIcons playinspect
		action: [ :aCoderUIModel :anElement | 
			GtCoderCodeExecutor doItAndGo
				coderUIModel: aCoderUIModel;
				element: anElement;
{'fraction_non_alphanumeric': 0.09052183173588925, 'fraction_numerical': 0.0, 'mean_word_length': 5.22075055187638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5710413', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1028, 'n_words': 198}