@@ -5,11 +5,10 @@ namespace MySqlConnector.Core
5
5
{
6
6
internal abstract class SqlParser
7
7
{
8
- public int Parse ( string sql )
8
+ public void Parse ( string sql )
9
9
{
10
10
OnBeforeParse ( sql ?? throw new ArgumentNullException ( nameof ( sql ) ) ) ;
11
11
12
- int statementCount = 0 ;
13
12
int parameterStartIndex = - 1 ;
14
13
15
14
var state = State . Beginning ;
@@ -148,7 +147,6 @@ public int Parse(string sql)
148
147
}
149
148
else if ( ch == ';' )
150
149
{
151
- IncrementStatementCount ( state , ref statementCount ) ;
152
150
state = State . Beginning ;
153
151
}
154
152
else if ( ! IsWhitespace ( ch ) && state == State . Beginning )
@@ -158,9 +156,7 @@ public int Parse(string sql)
158
156
}
159
157
}
160
158
161
- IncrementStatementCount ( state , ref statementCount ) ;
162
159
OnParsed ( ) ;
163
- return statementCount ;
164
160
}
165
161
166
162
protected virtual void OnBeforeParse ( string sql )
@@ -178,13 +174,7 @@ protected virtual void OnNamedParameter(int index, int length)
178
174
protected virtual void OnParsed ( )
179
175
{
180
176
}
181
-
182
- private void IncrementStatementCount ( State state , ref int statementCount )
183
- {
184
- if ( state != State . Beginning && state != State . EndOfLineComment && state != State . CStyleComment && state != State . CStyleCommentAsterisk )
185
- statementCount ++ ;
186
- }
187
-
177
+
188
178
private static bool IsWhitespace ( char ch ) => ch == ' ' || ch == '\t ' || ch == '\r ' || ch == '\n ' ;
189
179
190
180
private static bool IsVariableName ( char ch ) => ( ch >= 'a' && ch <= 'z' ) || ( ch >= 'A' && ch <= 'Z' ) || ( ch >= '0' && ch <= '9' ) || ch == '.' || ch == '_' || ch == '$' ;
0 commit comments