Update MemberReference.vb

master
xieguigang 5 years ago
parent 747ec853e2
commit 7641fc7d9c

@ -1,18 +1,29 @@
Imports LINQ.Runtime
Imports any = Microsoft.VisualBasic.Scripting
Namespace Interpreter.Expressions
Public Class MemberReference : Inherits Expression
ReadOnly symbol As Expression
ReadOnly memberName As Expression
ReadOnly memberName As String
Sub New(symbol As Expression, memberName As Expression)
Me.symbol = symbol
Me.memberName = memberName
If TypeOf memberName Is SymbolReference Then
Me.memberName = DirectCast(memberName, SymbolReference).symbolName
ElseIf TypeOf memberName Is Literals Then
Me.memberName = any.ToString(memberName.Exec(Nothing))
Else
Throw New InvalidExpressionException(memberName.name)
End If
End Sub
Public Overrides Function Exec(env As Environment) As Object
Dim symbol As Object = Me.symbol.Exec(env)
Throw New NotImplementedException()
End Function

Loading…
Cancel
Save