Skip to content

Commit

Permalink
declareC pragma + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivojawer committed Jul 31, 2023
1 parent 23c31f2 commit 5e5bb2d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion smalltalksrc/VMMaker/RBPragmaNode.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Extension { #name : #RBPragmaNode }
{ #category : #'*VMMaker' }
RBPragmaNode >> isTypeDefinition [

^ self selector = #var:type:
^ #( #var:type: #var:declareC: ) includes: self selector
]
27 changes: 27 additions & 0 deletions smalltalksrc/VMMakerTests/VMLiterRulesTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Class {
#name : #VMLiterRulesTest,
#superclass : #TestCase,
#category : #VMMakerTests
}

{ #category : #tests }
VMLiterRulesTest >> testSlangRedundantTypeDeclaration [

| ast |
ast := self class compiler parse:
'testMethod <var:#aVar type: #aType>'.
self assert:
(ReSlangRedundantTypeDeclarationRule new basicCheck:
ast pragmas first).
ast := self class compiler parse:
'testMethod <var:#aVar declareC: #aDeclaration>'.
self assert:
(ReSlangRedundantTypeDeclarationRule new basicCheck:
ast pragmas first).

ast := self class compiler parse:
'testMethod <var:#aVar declareC: #aDeclaration> | aVar |'.
self deny:
(ReSlangRedundantTypeDeclarationRule new basicCheck:
ast pragmas first)
]

0 comments on commit 5e5bb2d

Please sign in to comment.