From f07415cded087c8d12247cb758ba56a4a05c3004 Mon Sep 17 00:00:00 2001 From: Torsten Bergmann Date: Fri, 16 Apr 2021 22:47:10 +0200 Subject: [PATCH] Use #substrings not #subStrings and fix shadowed var in ASN1DefinitionModel>>#parseFieldNames Fix #37 --- source/ASN1-Core/ASN1DefinitionModel.class.st | 8 ++++---- source/ASN1-Core/ASN1FieldDefinition.class.st | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/ASN1-Core/ASN1DefinitionModel.class.st b/source/ASN1-Core/ASN1DefinitionModel.class.st index ca754d0..78bd526 100644 --- a/source/ASN1-Core/ASN1DefinitionModel.class.st +++ b/source/ASN1-Core/ASN1DefinitionModel.class.st @@ -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' } diff --git a/source/ASN1-Core/ASN1FieldDefinition.class.st b/source/ASN1-Core/ASN1FieldDefinition.class.st index 226a8d8..0845f4c 100644 --- a/source/ASN1-Core/ASN1FieldDefinition.class.st +++ b/source/ASN1-Core/ASN1FieldDefinition.class.st @@ -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 ] @@ -142,7 +142,7 @@ 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). @@ -150,7 +150,7 @@ ASN1FieldDefinition >> parseFieldInfo: fieldInfo [ ] ifFalse: [ fieldInfo ]. - explodedString := noTagIndexString subStrings asOrderedCollection. + explodedString := noTagIndexString substrings asOrderedCollection. (explodedString includes: 'EXPLICIT') ifTrue: [ explodedString := explodedString remove: 'EXPLICIT'; yourself. self isExplicit: true.