Uast: Update tests, make the tests a bit more readable (provide toString() methods for Uast kinds)
This commit is contained in:
+7
-7
@@ -1,6 +1,6 @@
|
||||
UFile (package = null)
|
||||
UClass (_Dummy_, enum = false, interface = false, object = false)
|
||||
UClass (ControlStructures, enum = false, interface = false, object = false)
|
||||
UClass (_Dummy_, kind = class)
|
||||
UClass (ControlStructures, kind = class)
|
||||
UFunction (main, kind = function, paramCount = 1)
|
||||
UBlockExpression
|
||||
UIfExpression
|
||||
@@ -11,7 +11,7 @@ UFile (package = null)
|
||||
ULiteralExpression (0)
|
||||
UBlockExpression
|
||||
USpecialExpressionList (return)
|
||||
|
||||
|
||||
EmptyExpression
|
||||
UDeclarationsExpression
|
||||
UVariable (mode, kind = local)
|
||||
@@ -30,7 +30,7 @@ UFile (package = null)
|
||||
UQualifiedExpression
|
||||
USimpleReferenceExpression (System)
|
||||
USimpleReferenceExpression (out)
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 1)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 1)
|
||||
USimpleReferenceExpression (println)
|
||||
USimpleReferenceExpression (arg)
|
||||
UForExpression
|
||||
@@ -49,7 +49,7 @@ UFile (package = null)
|
||||
UQualifiedExpression
|
||||
USimpleReferenceExpression (System)
|
||||
USimpleReferenceExpression (out)
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 1)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 1)
|
||||
USimpleReferenceExpression (println)
|
||||
UBinaryExpression (+)
|
||||
UBinaryExpression (+)
|
||||
@@ -72,7 +72,7 @@ UFile (package = null)
|
||||
UQualifiedExpression
|
||||
USimpleReferenceExpression (System)
|
||||
USimpleReferenceExpression (out)
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 1)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 1)
|
||||
USimpleReferenceExpression (println)
|
||||
UBinaryExpression (+)
|
||||
ULiteralExpression ("Index ")
|
||||
@@ -93,7 +93,7 @@ UFile (package = null)
|
||||
UQualifiedExpression
|
||||
USimpleReferenceExpression (System)
|
||||
USimpleReferenceExpression (out)
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 1)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 1)
|
||||
USimpleReferenceExpression (println)
|
||||
USimpleReferenceExpression (i)
|
||||
UAssignmentExpression (+=)
|
||||
|
||||
+6
-6
@@ -1,9 +1,9 @@
|
||||
UFile (package = null)
|
||||
UClass (_Dummy_, enum = false, interface = false, object = false)
|
||||
UClass (Lambda, enum = false, interface = false, object = false)
|
||||
UClass (_Dummy_, kind = class)
|
||||
UClass (Lambda, kind = class)
|
||||
UFunction (example, kind = function, paramCount = 0)
|
||||
UBlockExpression
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 2)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 2)
|
||||
USimpleReferenceExpression (doJob)
|
||||
ULambdaExpression
|
||||
UVariable (arg, kind = parameter)
|
||||
@@ -18,13 +18,13 @@ UFile (package = null)
|
||||
UQualifiedExpression
|
||||
USimpleReferenceExpression (System)
|
||||
USimpleReferenceExpression (out)
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 1)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 1)
|
||||
USimpleReferenceExpression (println)
|
||||
UQualifiedExpression
|
||||
USimpleReferenceExpression (job)
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 1)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 1)
|
||||
USimpleReferenceExpression (doJob)
|
||||
USimpleReferenceExpression (arg)
|
||||
UClass (Job, enum = false, interface = true, object = false)
|
||||
UClass (Job, kind = interface)
|
||||
UFunction (doJob, kind = function, paramCount = 1)
|
||||
EmptyExpression
|
||||
+6
-7
@@ -1,11 +1,10 @@
|
||||
UFile (package = null)
|
||||
UClass (_Dummy_, enum = false, interface = false, object = false)
|
||||
UClass (NestedClasses, enum = false, interface = false, object = false)
|
||||
UClass (Nested, enum = false, interface = false, object = false)
|
||||
UClass (_Dummy_, kind = class)
|
||||
UClass (NestedClasses, kind = class)
|
||||
UClass (Nested, kind = class)
|
||||
UFunction (func1, kind = function, paramCount = 0)
|
||||
UBlockExpression
|
||||
|
||||
UClass (Inner, enum = false, interface = false, object = false)
|
||||
|
||||
UClass (Inner, kind = class)
|
||||
UFunction (func2, kind = function, paramCount = 0)
|
||||
UBlockExpression
|
||||
|
||||
UBlockExpression
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
UFile (package = null)
|
||||
UClass (_Dummy_, enum = false, interface = false, object = false)
|
||||
UClass (Simple, enum = false, interface = false, object = false)
|
||||
UClass (_Dummy_, kind = class)
|
||||
UClass (Simple, kind = class)
|
||||
UVariable (name, kind = member)
|
||||
EmptyExpression
|
||||
UFunction (Simple, kind = function, paramCount = 1)
|
||||
UFunction (<init>, kind = CONSTRUCTOR, paramCount = 1)
|
||||
UBlockExpression
|
||||
UAssignmentExpression (=)
|
||||
UQualifiedExpression
|
||||
|
||||
+14
-14
@@ -1,6 +1,6 @@
|
||||
UFile (package = null)
|
||||
UClass (_Dummy_, enum = false, interface = false, object = false)
|
||||
UClass (SpecialExpressions, enum = false, interface = false, object = false)
|
||||
UClass (_Dummy_, kind = class)
|
||||
UClass (SpecialExpressions, kind = class)
|
||||
UFunction (test, kind = function, paramCount = 0)
|
||||
UBlockExpression
|
||||
USpecialExpressionList (assert)
|
||||
@@ -20,7 +20,7 @@ UFile (package = null)
|
||||
UQualifiedExpression
|
||||
USimpleReferenceExpression (System)
|
||||
USimpleReferenceExpression (out)
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 1)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 1)
|
||||
USimpleReferenceExpression (println)
|
||||
ULiteralExpression ("A")
|
||||
UDeclarationsExpression
|
||||
@@ -41,7 +41,7 @@ UFile (package = null)
|
||||
ULiteralExpression (3)
|
||||
UBlockExpression
|
||||
USpecialExpressionList (break)
|
||||
|
||||
|
||||
EmptyExpression
|
||||
UIfExpression
|
||||
UBinaryExpression (===)
|
||||
@@ -51,20 +51,20 @@ UFile (package = null)
|
||||
ULiteralExpression (0)
|
||||
UBlockExpression
|
||||
USpecialExpressionList (continue)
|
||||
|
||||
|
||||
EmptyExpression
|
||||
UPostfixExpression (--)
|
||||
USimpleReferenceExpression (a)
|
||||
UQualifiedExpression
|
||||
UThisExpression
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 0)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 0)
|
||||
USimpleReferenceExpression (test)
|
||||
|
||||
|
||||
UQualifiedExpression
|
||||
USuperExpression
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 0)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 0)
|
||||
USimpleReferenceExpression (hashCode)
|
||||
|
||||
|
||||
UDeclarationsExpression
|
||||
UVariable (x, kind = local)
|
||||
EmptyExpression
|
||||
@@ -78,7 +78,7 @@ UFile (package = null)
|
||||
USimpleReferenceExpression (x)
|
||||
ULiteralExpression ("1")
|
||||
USpecialExpressionList (break)
|
||||
|
||||
|
||||
UExpressionSwitchClauseExpression
|
||||
ULiteralExpression (3)
|
||||
UAssignmentExpression (=)
|
||||
@@ -97,16 +97,16 @@ UFile (package = null)
|
||||
UQualifiedExpression
|
||||
UQualifiedExpression
|
||||
USimpleReferenceExpression (System)
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 2)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 2)
|
||||
USimpleReferenceExpression (getProperty)
|
||||
ULiteralExpression ("abc")
|
||||
ULiteralExpression ("")
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 1)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 1)
|
||||
USimpleReferenceExpression (equals)
|
||||
ULiteralExpression ("1")
|
||||
UBlockExpression
|
||||
USpecialExpressionList (throw)
|
||||
UFunctionCallExpression (CONSTRUCTOR_CALL, argCount = 1)
|
||||
UFunctionCallExpression (UastCallKind(name='constructor_call'), argCount = 1)
|
||||
<no element>
|
||||
ULiteralExpression ("Err")
|
||||
EmptyExpression
|
||||
@@ -114,7 +114,7 @@ UFile (package = null)
|
||||
UBlockExpression
|
||||
UQualifiedExpression
|
||||
USimpleReferenceExpression (Thread)
|
||||
UFunctionCallExpression (FUNCTION_CALL, argCount = 1)
|
||||
UFunctionCallExpression (UastCallKind(name='function_call'), argCount = 1)
|
||||
USimpleReferenceExpression (sleep)
|
||||
ULiteralExpression (1000) UCatchClause
|
||||
UBlockExpression
|
||||
|
||||
Reference in New Issue
Block a user