I'm creating a programming language and for you to define variables in it you use this code:
def NomeDaVariavel = ValorDela;
And I wanted to know how I get only the Nome da variável
field, separated from ValorDela
.
Any ideas? Thank you.
Update
If (Regex.IsMatch(currentText, "^\s*(def)")) Then
Dim tempProvider As Match = Regex.Match(currentText, "^\s*def.*[^=]=")
Dim nomeDaVariavel As String = tempProvider.Value.Substring(
currentText.IndexOf("def") + Iff(currentText.Trim() = " = ", 4, 3)).Replace("=", "").Replace(" ", "")
Dim valorDaVariavel As String = ParseStr(currentText)
MsgBox(FX("A Variável 'def testando = 'Olá, mundo!';
' tem o valor de ''.", nomeDaVariavel, valorDaVariavel))
Continue For
End If
This worked because I tested it like this:
def NomeDaVariavel = ValorDela;
And it worked! The tip is ;-)