We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In some cases the use of ParseTreeSearcher lead to more complex code that is more arcane.
For example
isInlineToDo | block step | self methodCompilationContextOrNil ifNotNil:[:c | c optionInlineToDo ifFalse: [ ^false ]]. self receiver isBlock ifTrue: [^ false]. self isCascaded ifTrue: [^ false]. (#(to:do: to:by:do:) includes: self selector) ifFalse: [^ false]. block := self arguments last. block isBlock ifFalse: [^ false]. block arguments size = 1 ifFalse: [^ false]. self arguments first isVariable ifTrue: [ (OCParseTreeSearcher new matches: self arguments first name , ' := `@object' do: [:n :a | true]; executeTree: block initialAnswer: false) ifTrue: [^ false]. ]. self arguments size = 3 "to:by:do:" ifTrue: [ step := self arguments second. (step isLiteralNode and: [step value isNumber])ifFalse: [^ false]. step value = 0 ifTrue: [^ false]. ]. ^ true
In Armor compiler we have the following.
ARCompiler >> isInlineToDo: anARMessageNode [ | block step | (anARMessageNode methodNode ifNotNil: [ :node | node compilationContext ]) ifNotNil: [ :c | c optionInlineToDo ifFalse: [ ^ false ] ]. anARMessageNode receiver isBlock ifTrue: [ ^ false ]. anARMessageNode isCascaded ifTrue: [ ^ false ]. (#( to:do: to:by:do: ) includes: anARMessageNode selector) ifFalse: [ ^ false ]. block := anARMessageNode arguments last. block isBlock ifFalse: [ ^ false ]. block arguments size = 1 ifFalse: [ ^ false ]. anARMessageNode arguments first isVariable ifTrue: [ (block allChildren anySatisfy: [ :child | child isAssignment and: [ child variable = anARMessageNode arguments first ] ]) ifTrue: [ ^ false ] ]. anARMessageNode arguments size = 3 ifTrue: [ step := anARMessageNode arguments second. (step isLiteralNode and: [ step value isNumber ]) ifFalse: [ ^ false ]. step value = 0 ifTrue: [ ^ false ] ]. "to:by:do:" ^ true ]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In some cases the use of ParseTreeSearcher lead to more complex code that is more arcane.
For example
In Armor compiler we have the following.
The text was updated successfully, but these errors were encountered: