Skip to content

Commit

Permalink
Use #substrings not #subStrings and fix shadowed var in ASN1Definitio…
Browse files Browse the repository at this point in the history
…nModel>>#parseFieldNames

Fix #37
  • Loading branch information
astares committed Apr 16, 2021
1 parent b85799f commit f07415c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions source/ASN1-Core/ASN1DefinitionModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ ASN1DefinitionModel >> parseASN1DefinitionString [

{ #category : #'services parsing' }
ASN1DefinitionModel >> parseFieldNames [
| aString fields |
| aString result |
aString := self asn1DefinitionString.
fields := OrderedCollection new.
result := OrderedCollection new.
(aString copyFrom: (aString indexOf: ${) + 1 to: (aString indexOf: $}) - 1) linesDo: [:aLine |
(((aLine indexOfSubCollection: '--') > 0) or: [aLine withBlanksTrimmed isEmpty])ifFalse: [
fields add: aLine subStrings first
result add: aLine substrings first
].
].
^fields
^result
]

{ #category : #'services parsing' }
Expand Down
6 changes: 3 additions & 3 deletions source/ASN1-Core/ASN1FieldDefinition.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ASN1FieldDefinition class >> forField: aFieldName onDefinition: aDefinitionStrin
ifFalse: [noCommentsString := noCommentsString, aLine].
].
fieldInfo := (noCommentsString explode: $,)
detect: [:aField | aField subStrings first = aFieldName] ifNone: [^nil].
detect: [:aField | aField substrings first = aFieldName] ifNone: [^nil].
^ self new parseFieldInfo: fieldInfo;
yourself
]
Expand Down Expand Up @@ -142,15 +142,15 @@ ASN1FieldDefinition >> isOptional: anObject [
ASN1FieldDefinition >> parseFieldInfo: fieldInfo [
"fill the current instance with fieldInformation"
| subStrings explodedString noTagIndexString |
subStrings := fieldInfo subStrings.
subStrings := fieldInfo substrings.
self fieldName: subStrings first.
noTagIndexString := (fieldInfo includes: $[) ifTrue: [
self tagIndex: (fieldInfo copyFrom: (fieldInfo indexOf: $[) + 1 to: (fieldInfo indexOf: $]) - 1).
(fieldInfo copyFrom: 1 to: (fieldInfo indexOf: $[) -1), (fieldInfo copyFrom: (fieldInfo indexOf: $]) +1 to: fieldInfo size).
] ifFalse: [
fieldInfo
].
explodedString := noTagIndexString subStrings asOrderedCollection.
explodedString := noTagIndexString substrings asOrderedCollection.
(explodedString includes: 'EXPLICIT') ifTrue: [
explodedString := explodedString remove: 'EXPLICIT'; yourself.
self isExplicit: true.
Expand Down

0 comments on commit f07415c

Please sign in to comment.