Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user property declarations support #85

Merged
merged 14 commits into from
Jun 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix redundant gets on pre and postfix increment/decrement
- Fix redundant gets on prefix/postfix decrement and increment causing them to misbehave on properties
MerlinVR committed Jun 14, 2021
commit 149c60cd217009713cb17071f9e192ff32ed6cf0
6 changes: 3 additions & 3 deletions Assets/UdonSharp/Editor/UdonSharpASTVisitor.cs
Original file line number Diff line number Diff line change
@@ -1208,7 +1208,7 @@ public override void VisitPrefixUnaryExpression(PrefixUnaryExpressionSyntax node
operatorMethodCapture.SetToMethods(operatorMethods.ToArray());

SymbolDefinition valueConstant = visitorContext.topTable.CreateConstSymbol(operandCapture.GetReturnType(), System.Convert.ChangeType(1, operandCapture.GetReturnType()));

try
{
resultSymbol = operatorMethodCapture.Invoke(new SymbolDefinition[] { operandCapture.ExecuteGet(), valueConstant });
@@ -1221,7 +1221,7 @@ public override void VisitPrefixUnaryExpression(PrefixUnaryExpressionSyntax node
}

if (topScope != null)
topScope.SetToLocalSymbol(operandCapture.ExecuteGet());
topScope.SetToLocalSymbol(resultSymbol);
}
}
}
@@ -1272,7 +1272,7 @@ public override void VisitPostfixUnaryExpression(PostfixUnaryExpressionSyntax no

SymbolDefinition valueConstant = visitorContext.topTable.CreateConstSymbol(operandCapture.GetReturnType(), System.Convert.ChangeType(1, operandCapture.GetReturnType()));

SymbolDefinition resultSymbol = operatorMethodCapture.Invoke(new SymbolDefinition[] { operandCapture.ExecuteGet(), valueConstant });
SymbolDefinition resultSymbol = operatorMethodCapture.Invoke(new SymbolDefinition[] { preIncrementStore, valueConstant });

operandCapture.ExecuteSet(resultSymbol, true);
}