bool global_attrs_enabled = true;
bool has_get, has_set;
bool parameter_modifiers_not_allowed;
- bool params_modifiers_not_allowed;
+ bool complex_parameters_modifiers_not_allowed;
bool arglist_allowed;
-
+ bool default_parameter_used;
/// When using the interactive parser, this holds the
/// resulting expression
%token EVAL_COMPILATION_UNIT_PARSER
%token EVAL_USING_DECLARATIONS_UNIT_PARSER
+//
+// This token is generated to trigger the completion engine at this point
+//
+%token GENERATE_COMPLETION
+
+//
+// This token is return repeatedly after the first GENERATE_COMPLETION
+// token is produced and before the final EOF
+//
+%token COMPLETE_COMPLETION
+
/* Add precedence rules to solve dangling else s/r conflict */
%nonassoc IF
%nonassoc ELSE
| outer_declarations global_attributes opt_EOF
| global_attributes opt_EOF
| opt_EOF /* allow empty files */
- | interactive_parsing opt_EOF
+ | interactive_parsing { Lexer.CompleteOnEOF = false; } opt_EOF
;
opt_EOF
if (global_attrs_enabled) {
if (current_attr_target == "module") {
- CodeGen.Module.AddAttributes (sect);
+ current_container.Module.AddAttributes (sect);
$$ = null;
} else if (current_attr_target != null && current_attr_target.Length > 0) {
CodeGen.Assembly.AddAttributes (sect);
if (global_attrs_enabled) {
if (current_attr_target == "module") {
- CodeGen.Module.AddAttributes (sect);
+ current_container.Module.AddAttributes (sect);
$$ = null;
} else if (current_attr_target == "assembly") {
CodeGen.Assembly.AddAttributes (sect);
{
++lexer.parsing_block;
}
- opt_attribute_arguments
+ opt_attribute_arguments
{
--lexer.parsing_block;
MemberName mname = (MemberName) $1;
attribute_arguments
- : opt_positional_argument_list
- {
- if ($1 == null)
- $$ = null;
- else {
- $$ = new object [] { $1, null };
- }
- }
- | positional_argument_list COMMA named_argument_list
+ : /* empty */ { $$ = null; }
+ | positional_or_named_argument
{
- $$ = new object[] { $1, $3 };
+ ArrayList a = new ArrayList (4);
+ a.Add ($1);
+ $$ = new object [] { a, null };
}
- | named_argument_list
+ | named_attribute_argument
{
- $$ = new object [] { null, $1 };
+ ArrayList a = new ArrayList (4);
+ a.Add ($1);
+ $$ = new object [] { null, a };
}
- ;
-
-
-opt_positional_argument_list
- : /* empty */ { $$ = null; }
- | positional_argument_list
- ;
-
-positional_argument_list
- : expression
+ | attribute_arguments COMMA positional_or_named_argument
{
- ArrayList args = new ArrayList (4);
- args.Add (new Argument ((Expression) $1, Argument.AType.Expression));
-
- $$ = args;
+ object[] o = (object[]) $1;
+ if (o [1] != null) {
+ Report.Error (1016, ((Argument) $3).Expr.Location, "Named attribute arguments must appear after the positional arguments");
+ o [0] = new ArrayList (4);
+ }
+
+ ArrayList args = ((ArrayList) o [0]);
+ if (args.Count > 0 && !($3 is NamedArgument) && args [args.Count - 1] is NamedArgument)
+ Error_NamedArgumentExpected ((NamedArgument) args [args.Count - 1]);
+
+ args.Add ($3);
}
- | positional_argument_list COMMA expression
- {
- ArrayList args = (ArrayList) $1;
- args.Add (new Argument ((Expression) $3, Argument.AType.Expression));
-
- $$ = args;
- }
- ;
-
-named_argument_list
- : named_argument
+ | attribute_arguments COMMA named_attribute_argument
{
- ArrayList args = new ArrayList (4);
- args.Add ($1);
+ object[] o = (object[]) $1;
+ if (o [1] == null) {
+ o [1] = new ArrayList (4);
+ }
- $$ = args;
+ ((ArrayList) o [1]).Add ($3);
}
- | named_argument_list COMMA named_argument
- {
- ArrayList args = (ArrayList) $1;
- args.Add ($3);
+ ;
- $$ = args;
- }
- | named_argument_list COMMA expression
+positional_or_named_argument
+ : expression
{
- Report.Error (1016, ((Expression) $3).Location, "Named attribute argument expected");
- $$ = null;
+ $$ = new Argument ((Expression) $1);
}
+ | named_argument
;
-named_argument
+named_attribute_argument
: IDENTIFIER ASSIGN expression
{
- // FIXME: keep location
- $$ = new DictionaryEntry (
- ((LocatedToken) $1).Value,
- new Argument ((Expression) $3, Argument.AType.Expression));
+ $$ = new NamedArgument ((LocatedToken) $1, (Expression) $3);
}
;
+
+named_argument
+ : IDENTIFIER COLON expression
+ {
+ if (RootContext.Version <= LanguageVersion.V_3)
+ Report.FeatureIsNotAvailable (GetLocation ($1), "named argument");
+
+ $$ = new NamedArgument ((LocatedToken) $1, (Expression) $3);
+ }
+ ;
class_body
opt_modifiers
PARTIAL
VOID method_declaration_name
- OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
+ OPEN_PARENS
+ {
+ arglist_allowed = true;
+ }
+ opt_formal_parameter_list CLOSE_PARENS
{
lexer.ConstraintsParsing = true;
}
opt_type_parameter_constraints_clauses
{
lexer.ConstraintsParsing = false;
+ arglist_allowed = false;
MemberName name = (MemberName) $5;
- current_local_parameters = (ParametersCompiled) $7;
+ current_local_parameters = (ParametersCompiled) $8;
- if ($9 != null && name.TypeArguments == null)
+ if ($10 != null && name.TypeArguments == null)
Report.Error (80, lexer.Location,
"Constraints are not allowed on non-generic declarations");
generic = new GenericMethod (current_namespace, current_class, name,
TypeManager.system_void_expr, current_local_parameters);
- generic.SetParameterInfo ((ArrayList) $10);
+ generic.SetParameterInfo ((ArrayList) $11);
}
int modifiers = (int) $2;
Report.Error (751, name.Location, "A partial method must be declared within a " +
"partial class or partial struct");
}
-
+
modifiers |= Modifiers.PARTIAL | Modifiers.PRIVATE;
method = new Method (current_class, generic, TypeManager.system_void_expr,
;
formal_parameter_list
- : fixed_parameters
+ : fixed_parameters
{
ArrayList pars_list = (ArrayList) $1;
: fixed_parameter
{
ArrayList pars = new ArrayList (4);
-
- pars.Add ($1);
+ Parameter p = (Parameter) $1;
+ pars.Add (p);
+
+ default_parameter_used = p.HasDefaultValue;
$$ = pars;
}
| fixed_parameters COMMA fixed_parameter
{
ArrayList pars = (ArrayList) $1;
- Parameter p = (Parameter)$3;
+ Parameter p = (Parameter) $3;
if (p != null) {
if (p.HasExtensionMethodModifier)
Report.Error (1100, p.Location, "The parameter modifier `this' can only be used on the first parameter");
+ else if (!p.HasDefaultValue && default_parameter_used)
+ Report.Error (1737, p.Location, "Optional parameter cannot precede required parameters");
+
+ default_parameter_used |= p.HasDefaultValue;
pars.Add (p);
}
$$ = $1;
| opt_attributes
opt_parameter_modifier
type
+ error
{
- Report.Error (1001, GetLocation ($3), "Identifier expected");
- $$ = new Parameter ((FullNamedExpression) $3, "NeedSomeGeneratorHere", (Parameter.Modifier) $2, (Attributes) $1, lexer.Location);
- }
- | opt_attributes
- opt_parameter_modifier
- type
- error {
- CheckIdentifierToken (yyToken, GetLocation ($4));
- $$ = null;
+ Location l = GetLocation ($4);
+ CheckIdentifierToken (yyToken, l);
+ $$ = new Parameter ((FullNamedExpression) $3, "NeedSomeGeneratorHere", (Parameter.Modifier) $2, (Attributes) $1, l);
}
| opt_attributes
opt_parameter_modifier
IDENTIFIER
ASSIGN
constant_expression
- {
+ {
+ if (RootContext.Version <= LanguageVersion.V_3) {
+ Report.FeatureIsNotAvailable (GetLocation ($5), "optional parameter");
+ }
+
+ Parameter.Modifier mod = (Parameter.Modifier) $2;
+ if (mod != Parameter.Modifier.NONE) {
+ switch (mod) {
+ case Parameter.Modifier.REF:
+ case Parameter.Modifier.OUT:
+ Report.Error (1741, GetLocation ($2), "Cannot specify a default value for the `{0}' parameter",
+ Parameter.GetModifierSignature (mod));
+ break;
+
+ case Parameter.Modifier.This:
+ Report.Error (1743, GetLocation ($2), "Cannot specify a default value for the `{0}' parameter",
+ Parameter.GetModifierSignature (mod));
+ break;
+ default:
+ throw new NotImplementedException (mod.ToString ());
+ }
+
+ mod = Parameter.Modifier.NONE;
+ }
+
+ if (complex_parameters_modifiers_not_allowed)
+ Report.Error (1065, GetLocation ($6), "Optional parameter is not valid in this context");
+
LocatedToken lt = (LocatedToken) $4;
- Report.Error (241, lt.Location, "Default parameter specifiers are not permitted");
- $$ = null;
- }
+ $$ = new Parameter ((FullNamedExpression) $3, lt.Value, mod, (Attributes) $1, lt.Location);
+ if ($6 != null)
+ ((Parameter) $$).DefaultValue = (Expression) $6;
+ }
;
opt_parameter_modifier
parameter_array
: opt_attributes params_modifier type IDENTIFIER
- {
+ {
LocatedToken lt = (LocatedToken) $4;
$$ = new ParamsParameter ((FullNamedExpression) $3, lt.Value, (Attributes) $1, lt.Location);
}
+ | opt_attributes params_modifier type IDENTIFIER ASSIGN constant_expression
+ {
+ Report.Error (1751, GetLocation ($2), "Cannot specify a default value for a parameter array");
+
+ LocatedToken lt = (LocatedToken) $4;
+ $$ = new ParamsParameter ((FullNamedExpression) $3, lt.Value, (Attributes) $1, lt.Location);
+ }
| opt_attributes params_modifier type error {
CheckIdentifierToken (yyToken, GetLocation ($4));
$$ = null;
params_modifier
: PARAMS
{
- if (params_modifiers_not_allowed)
+ if (complex_parameters_modifiers_not_allowed)
Report.Error (1670, ((Location) $1), "The `params' modifier is not allowed in current context");
}
| PARAMS parameter_modifier
operator_declarator
: operator_type OPERATOR overloadable_operator OPEN_PARENS
{
- params_modifiers_not_allowed = true;
+ complex_parameters_modifiers_not_allowed = true;
}
opt_parameter_list_no_mod CLOSE_PARENS
{
- params_modifiers_not_allowed = false;
+ complex_parameters_modifiers_not_allowed = false;
Location loc = (Location) $2;
Operator.OpType op = (Operator.OpType) $3;
conversion_operator_declarator
: IMPLICIT OPERATOR type OPEN_PARENS
{
- params_modifiers_not_allowed = true;
+ complex_parameters_modifiers_not_allowed = true;
}
opt_parameter_list_no_mod CLOSE_PARENS
{
- params_modifiers_not_allowed = false;
+ complex_parameters_modifiers_not_allowed = false;
Location loc = (Location) $2;
current_local_parameters = (ParametersCompiled)$6;
}
| EXPLICIT OPERATOR type OPEN_PARENS
{
- params_modifiers_not_allowed = true;
+ complex_parameters_modifiers_not_allowed = true;
}
opt_parameter_list_no_mod CLOSE_PARENS
{
- params_modifiers_not_allowed = false;
+ complex_parameters_modifiers_not_allowed = false;
Location loc = (Location) $2;
current_local_parameters = (ParametersCompiled)$6;
tmpComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.Allowed;
}
+ arglist_allowed = true;
}
OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
{
+ arglist_allowed = false;
current_local_parameters = (ParametersCompiled) $6;
//
implicit_value_parameter_type = (FullNamedExpression) $3;
indexer_parameters = (ParametersCompiled) $6;
- if (indexer_parameters.IsEmpty)
+ if (indexer_parameters.IsEmpty) {
Report.Error (1551, GetLocation ($5), "Indexers must have at least one parameter");
+ } else if (indexer_parameters.Count == 1) {
+ Parameter p = indexer_parameters [0];
+ if (p.HasDefaultValue)
+ p.Warning_UselessOptionalParameter ();
+ }
if (RootContext.Documentation != null) {
tmpComment = Lexer.consume_doc_comment ();
}
| INTERR_NULLABLE
{
- if (RootContext.Version < LanguageVersion.ISO_2)
+ if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2)
+ Report.FeatureIsNotSupported (lexer.Location, "nullable types");
+ else if (RootContext.Version < LanguageVersion.ISO_2)
Report.FeatureIsNotAvailable (lexer.Location, "nullable types");
$$ = this;
: /* empty */ { $$ = null; }
| OP_GENERICS_LT type_arguments OP_GENERICS_GT
{
- if (RootContext.Version < LanguageVersion.ISO_2)
+ if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2)
+ Report.FeatureIsNotSupported (lexer.Location, "generics");
+ else if (RootContext.Version < LanguageVersion.ISO_2)
Report.FeatureIsNotAvailable (GetLocation ($1), "generics");
$$ = $2;
: /* empty */ { $$ = null; }
| OP_GENERICS_LT_DECL type_parameters OP_GENERICS_GT
{
- if (RootContext.Version < LanguageVersion.ISO_2)
+ if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2)
+ Report.FeatureIsNotSupported (lexer.Location, "generics");
+ else if (RootContext.Version < LanguageVersion.ISO_2)
Report.FeatureIsNotAvailable (GetLocation ($1), "generics");
$$ = $2;
: opt_attributes opt_type_parameter_variance IDENTIFIER
{
LocatedToken lt = (LocatedToken)$3;
- $$ = new TypeParameterName (lt.Value, (Attributes)$1, (Variance)$2, lt.Location);
+ $$ = new TypeParameterName (lt.Value, (Attributes)$1, (Variance) $2, lt.Location);
}
| error
{
if ($2 != null) {
$$ = new ComposedCast (name.GetTypeExpression (), "?", lexer.Location);
} else {
- if (name.Left == null && name.Name == "var" &&
- (RootContext.Version > LanguageVersion.ISO_2 || RootContext.Version == LanguageVersion.Default_MCS))
+ if (name.Left == null && name.Name == "var" && RootContext.Version > LanguageVersion.ISO_2)
$$ = current_array_type = new VarExpr (name.Location);
else
$$ = name.GetTypeExpression ();
LocatedToken lt = (LocatedToken) $1;
$$ = new SimpleName (MemberName.MakeName (lt.Value, (TypeArguments)$2), (TypeArguments)$2, lt.Location);
}
+ | IDENTIFIER GENERATE_COMPLETION {
+ LocatedToken lt = (LocatedToken) $1;
+ $$ = new CompletionSimpleName (MemberName.MakeName (lt.Value, null), lt.Location);
+ }
| parenthesized_expression
| default_value_expression
| member_access
{
$$ = new ParenthesizedExpression ((Expression) $2);
}
+ | OPEN_PARENS expression COMPLETE_COMPLETION
+ {
+ $$ = new ParenthesizedExpression ((Expression) $2);
+ }
;
member_access
$$ = new QualifiedAliasMember (lt1.Value, lt2.Value, (TypeArguments) $3, lt1.Location);
}
+ | primary_expression DOT GENERATE_COMPLETION {
+ $$ = new CompletionMemberAccess ((Expression) $1, null,GetLocation ($3));
+ }
+ | primary_expression DOT IDENTIFIER GENERATE_COMPLETION {
+ LocatedToken lt = (LocatedToken) $3;
+ $$ = new CompletionMemberAccess ((Expression) $1, lt.Value, lt.Location);
+ }
+ | predefined_type DOT GENERATE_COMPLETION
+ {
+ // TODO: Location is wrong as some predefined types doesn't hold a location
+ $$ = new CompletionMemberAccess ((Expression) $1, null, lexer.Location);
+ }
+ | predefined_type DOT IDENTIFIER GENERATE_COMPLETION {
+ LocatedToken lt = (LocatedToken) $3;
+ $$ = new CompletionMemberAccess ((Expression) $1, lt.Value, lt.Location);
+ }
;
invocation_expression
;
object_or_collection_initializer
- : OPEN_BRACE opt_member_initializer_list CLOSE_BRACE
+ : OPEN_BRACE opt_member_initializer_list close_brace_or_complete_completion
{
if ($2 == null)
- $$ = CollectionOrObjectInitializers.Empty;
+ $$ = CollectionOrObjectInitializers.Empty;
else
- $$ = new CollectionOrObjectInitializers ((ArrayList) $2, GetLocation ($1));
+ $$ = new CollectionOrObjectInitializers ((ArrayList) $2, GetLocation ($1));
}
| OPEN_BRACE member_initializer_list COMMA CLOSE_BRACE
{
;
member_initializer_list
- : member_initializer
+ : member_initializer
{
ArrayList a = new ArrayList ();
a.Add ($1);
LocatedToken lt = $1 as LocatedToken;
$$ = new ElementInitializer (lt.Value, (Expression)$3, lt.Location);
}
- | non_assignment_expression
+ | GENERATE_COMPLETION
{
- $$ = new CollectionElementInitializer ((Expression)$1);
+ $$ = new CompletionElementInitializer (null, GetLocation ($1));
+ }
+ | non_assignment_expression opt_COMPLETE_COMPLETION {
+ CompletionSimpleName csn = $1 as CompletionSimpleName;
+ if (csn == null)
+ $$ = new CollectionElementInitializer ((Expression)$1);
+ else
+ $$ = new CompletionElementInitializer (csn.Prefix, csn.Location);
}
| OPEN_BRACE expression_list CLOSE_BRACE
{
| argument_list COMMA argument
{
ArrayList list = (ArrayList) $1;
+ if (!($3 is NamedArgument) && list [list.Count - 1] is NamedArgument)
+ Error_NamedArgumentExpected ((NamedArgument) list [list.Count - 1]);
+
list.Add ($3);
$$ = list;
}
argument
: expression
{
- $$ = new Argument ((Expression) $1, Argument.AType.Expression);
+ $$ = new Argument ((Expression) $1);
}
| non_simple_argument
- {
- $$ = $1;
- }
+ | named_argument
;
non_simple_argument
Argument[] args = new Argument [list.Count];
list.CopyTo (args, 0);
- Expression expr = new Arglist (args, (Location) $1);
- $$ = new Argument (expr, Argument.AType.Expression);
+ $$ = new Argument (new Arglist (args, (Location) $1));
}
| ARGLIST open_parens_any CLOSE_PARENS
{
- $$ = new Argument (new Arglist ((Location) $1), Argument.AType.Expression);
+ $$ = new Argument (new Arglist ((Location) $1));
}
| ARGLIST
{
- $$ = new Argument (new ArglistAccess ((Location) $1), Argument.AType.ArgList);
+ $$ = new Argument (new ArglistAccess ((Location) $1));
}
;
variable_reference
- : expression { note ("section 5.4"); $$ = $1; }
+ : expression
;
element_access
anonymous_type_expression
: NEW OPEN_BRACE anonymous_type_parameters_opt_comma CLOSE_BRACE
{
- if (RootContext.Version <= LanguageVersion.ISO_2)
+ if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2)
+ Report.FeatureIsNotSupported (lexer.Location, "anonymous types");
+ else if (RootContext.Version <= LanguageVersion.ISO_2)
Report.FeatureIsNotAvailable (GetLocation ($1), "anonymous types");
$$ = new AnonymousTypeDeclaration ((ArrayList) $3, current_container, GetLocation ($1));
generic_dimension
: GENERIC_DIMENSION
{
- if (RootContext.Version < LanguageVersion.ISO_2)
+ if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2)
+ Report.FeatureIsNotSupported (lexer.Location, "generics");
+ else if (RootContext.Version < LanguageVersion.ISO_2)
Report.FeatureIsNotAvailable (lexer.Location, "generics");
$$ = $1;
anonymous_method_signature
: OPEN_PARENS
{
- params_modifiers_not_allowed = true;
+ complex_parameters_modifiers_not_allowed = true;
}
opt_formal_parameter_list CLOSE_PARENS
{
- params_modifiers_not_allowed = false;
+ complex_parameters_modifiers_not_allowed = false;
$$ = $3;
}
;
;
expression
- : assignment_expression
- | non_assignment_expression
+ : assignment_expression
+ | non_assignment_expression
;
non_assignment_expression
}
| type_parameter_variance
{
- if (RootContext.Version < LanguageVersion.Future)
- Report.FeatureIsNotAvailable (lexer.Location, "generic variance");
+ if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2)
+ Report.FeatureIsNotSupported (lexer.Location, "generic type variance");
+ else if (RootContext.Version <= LanguageVersion.V_3)
+ Report.FeatureIsNotAvailable (lexer.Location, "generic type variance");
+
$$ = $1;
}
;
++lexer.parsing_block;
start_block ((Location) $1);
}
- opt_statement_list CLOSE_BRACE
+ opt_statement_list block_end
+ {
+ $$ = $4;
+ }
+ ;
+
+block_end
+ : CLOSE_BRACE
{
--lexer.parsing_block;
- $$ = end_block ((Location) $4);
+ $$ = end_block ((Location) $1);
+ }
+ | COMPLETE_COMPLETION
+ {
+ --lexer.parsing_block;
+ $$ = end_block (lexer.Location);
}
;
+
block_prepared
: OPEN_BRACE
{
//
if (rank_or_nullable.Length == 0) {
SimpleName sn = expr as SimpleName;
- if (sn != null && sn.Name == "var" &&
- (RootContext.Version > LanguageVersion.ISO_2 || RootContext.Version == LanguageVersion.Default_MCS))
+ if (sn != null && sn.Name == "var" && RootContext.Version > LanguageVersion.ISO_2)
$$ = current_array_type = new VarExpr (sn.Location);
else
$$ = $1;
expression_statement
: statement_expression SEMICOLON { $$ = $1; }
+ | statement_expression COMPLETE_COMPLETION { $$ = $1; }
;
interactive_expression_statement
: interactive_statement_expression SEMICOLON { $$ = $1; }
+ | interactive_statement_expression COMPLETE_COMPLETION { $$ = $1; }
;
//
++lexer.parsing_block;
start_block (lexer.Location);
}
- interactive_statement_list
+ interactive_statement_list opt_COMPLETE_COMPLETION
{
--lexer.parsing_block;
Method method = (Method) oob_stack.Pop ();
| global_attributes
| /* nothing */
;
+
+opt_COMPLETE_COMPLETION
+ : /* nothing */
+ | COMPLETE_COMPLETION
+ ;
+
+close_brace_or_complete_completion
+ : CLOSE_BRACE
+ | COMPLETE_COMPLETION
+ ;
%%
// <summary>
}
}
-void Error_ExpectingTypeName (Expression expr)
+static void Error_ExpectingTypeName (Expression expr)
{
if (expr is Invocation){
Report.Error (1002, expr.Location, "Expecting `;'");
Report.Error (1031, loc, "Type expected");
}
+static void Error_NamedArgumentExpected (NamedArgument a)
+{
+ Report.Error (1738, a.Name.Location, "Named arguments must appear after the positional arguments");
+}
+
void push_current_class (TypeContainer tc, object partial_token)
{
if (RootContext.EvalMode){
Report.Error (1003, l, "Syntax error, " + msg);
}
-void note (string s)
-{
- // Used to put annotations
-}
-
Tokenizer lexer;
public Tokenizer Lexer {
case Token.WHILE:
return "while";
case Token.ARGLIST:
- return "arglist";
+ return "__arglist";
case Token.PARTIAL:
return "partial";
case Token.ARROW:
case Token.EVAL_COMPILATION_UNIT_PARSER:
case Token.EVAL_USING_DECLARATIONS_UNIT_PARSER:
case Token.EVAL_STATEMENT_PARSER:
- case Token.LAST_KEYWORD:
+ case Token.LAST_KEYWORD:
+ case Token.GENERATE_COMPLETION:
+ case Token.COMPLETE_COMPLETION:
return "<internal>";
// A bit more robust.