@@ -94,9 +94,9 @@ private void ExtractEndOfLineComment()
9494 EndOfLineComment = match . Groups [ "comment" ] . Value . Trim ( ) ;
9595 }
9696
97- public AbsoluteCodeLine Previous { get ; private set ; }
97+ public AbsoluteCodeLine Previous { get ; }
9898
99- public string Original { get ; private set ; }
99+ public string Original { get ; }
100100
101101 public string Escaped
102102 {
@@ -120,58 +120,46 @@ public string Escaped
120120
121121 public string EndOfLineComment { get ; private set ; }
122122
123- public IEnumerable < string > Segments
124- {
125- get { return _segments ; }
126- }
123+ public IEnumerable < string > Segments => _segments ;
127124
128125 public string ContinuationRebuildText
129126 {
130127 get
131128 {
132- var output = ( _code + " " + EndOfLineComment ) . Trim ( ) ;
129+ var output = ( $ " { _code } { EndOfLineComment } " ) . Trim ( ) ;
133130 return HasContinuation ? output . Substring ( 0 , output . Length - 1 ) : output ;
134131 }
135132 }
136133
137- public bool ContainsOnlyComment
138- {
139- get { return _code . StartsWith ( "'" ) || _code . StartsWith ( "Rem " ) ; }
140- }
134+ public bool ContainsOnlyComment => _code . StartsWith ( "'" ) || _code . StartsWith ( "Rem " ) ;
141135
142- public bool IsDeclaration
143- {
144- get { return ! IsEmpty && ( ! IsProcedureStart && ! ProcedureStartIgnoreRegex . IsMatch ( _code ) ) && DeclarationRegex . IsMatch ( _code ) ; }
145- }
136+ public bool IsDeclaration => ! IsEmpty && ( ! IsProcedureStart && ! ProcedureStartIgnoreRegex . IsMatch ( _code ) ) && DeclarationRegex . IsMatch ( _code ) ;
146137
147138 public bool IsDeclarationContinuation { get ; set ; }
148139
149140 public bool HasDeclarationContinuation
150141 {
151142 get
152143 {
153- return ( ! IsProcedureStart && ! ProcedureStartIgnoreRegex . IsMatch ( _code ) ) &&
154- ! ContainsOnlyComment &&
155- string . IsNullOrEmpty ( EndOfLineComment ) &&
156- HasContinuation &&
157- ( ( IsDeclarationContinuation && Segments . Count ( ) == 1 ) || DeclarationRegex . IsMatch ( Segments . Last ( ) ) ) ;
144+ if ( ! string . IsNullOrEmpty ( EndOfLineComment )
145+ || ContainsOnlyComment
146+ || IsProcedureStart
147+ || ! HasContinuation
148+ || ProcedureStartIgnoreRegex . IsMatch ( _code ) )
149+ {
150+ return false ;
151+ }
152+
153+ return ( IsDeclarationContinuation && Segments . Count ( ) == 1 )
154+ || DeclarationRegex . IsMatch ( Segments . Last ( ) ) ;
158155 }
159156 }
160157
161- public bool HasContinuation
162- {
163- get { return _code . Equals ( "_" ) || _code . EndsWith ( " _" ) || EndOfLineComment . EndsWith ( " _" ) ; }
164- }
158+ public bool HasContinuation => _code . Equals ( "_" ) || _code . EndsWith ( " _" ) || EndOfLineComment . EndsWith ( " _" ) ;
165159
166- public bool IsPrecompilerDirective
167- {
168- get { return _code . TrimStart ( ) . StartsWith ( "#" ) ; }
169- }
160+ public bool IsPrecompilerDirective => _code . TrimStart ( ) . StartsWith ( "#" ) ;
170161
171- public bool IsBareDebugStatement
172- {
173- get { return _code . StartsWith ( "Debug." ) || _code . Equals ( "Stop" ) ; }
174- }
162+ public bool IsBareDebugStatement => _code . StartsWith ( "Debug." ) || _code . Equals ( "Stop" ) ;
175163
176164 public int EnumOrTypeStarts
177165 {
@@ -185,19 +173,15 @@ public int EnumOrTypeEnds
185173
186174 public bool IsProcedureStart
187175 {
188- get
189- { return _segments . Any ( s => ProcedureStartRegex . IsMatch ( s ) ) && ! _segments . Any ( s => ProcedureStartIgnoreRegex . IsMatch ( s ) ) ; }
176+ get { return _segments . Any ( s => ProcedureStartRegex . IsMatch ( s ) ) && ! _segments . Any ( s => ProcedureStartIgnoreRegex . IsMatch ( s ) ) ; }
190177 }
191178
192179 public bool IsProcedureEnd
193180 {
194181 get { return _segments . Any ( s => ProcedureEndRegex . IsMatch ( s ) ) ; }
195182 }
196183
197- public bool IsEmpty
198- {
199- get { return Original . Trim ( ) . Length == 0 ; }
200- }
184+ public bool IsEmpty => Original . Trim ( ) . Length == 0 ;
201185
202186 public int NextLineIndents
203187 {
@@ -301,7 +285,7 @@ private void AlignDims(int postition)
301285 {
302286 if ( _segments [ 0 ] . Trim ( ) . StartsWith ( "As " ) )
303287 {
304- _segments [ 0 ] = string . Format ( "{0}{1}" , new String ( ' ' , _settings . AlignDimColumn - postition - 1 ) , _segments [ 0 ] . Trim ( ) ) ;
288+ _segments [ 0 ] = string . Format ( "{0}{1}" , new string ( ' ' , _settings . AlignDimColumn - postition - 1 ) , _segments [ 0 ] . Trim ( ) ) ;
305289 return ;
306290 }
307291 var alignTokens = _segments [ 0 ] . Split ( new [ ] { " As " } , StringSplitOptions . None ) ;
0 commit comments