mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-23 09:59:25 +00:00
fix bad member resolution at end of block
fix missing method and type docs
This commit is contained in:
@@ -507,8 +507,8 @@ function sourceType(docs, modifiers, tokens, scope_or_pkgname, typeKind, owner,
|
|||||||
if (tokens.isValue('implements')) {
|
if (tokens.isValue('implements')) {
|
||||||
type.implements_types = typeIdentList(tokens, type, imports, typemap);
|
type.implements_types = typeIdentList(tokens, type, imports, typemap);
|
||||||
}
|
}
|
||||||
tokens.expectValue('{');
|
|
||||||
tokens.clearMLC();
|
tokens.clearMLC();
|
||||||
|
tokens.expectValue('{');
|
||||||
if (type.typeKind === 'enum') {
|
if (type.typeKind === 'enum') {
|
||||||
if (!/[;}]/.test(tokens.current.value)) {
|
if (!/[;}]/.test(tokens.current.value)) {
|
||||||
enumValueList(type, tokens, imports, typemap);
|
enumValueList(type, tokens, imports, typemap);
|
||||||
@@ -702,6 +702,7 @@ function typeDeclaration(package_name, scope, docs, modifiers, typeKind, kind_to
|
|||||||
if (type instanceof SourceType) {
|
if (type instanceof SourceType) {
|
||||||
// update the missing parts
|
// update the missing parts
|
||||||
type.setModifierTokens(modifiers);
|
type.setModifierTokens(modifiers);
|
||||||
|
type.docs = docs;
|
||||||
} else {
|
} else {
|
||||||
type = new SourceType(package_name, scope, docs, modifiers, typeKind, kind_token, name, typemap);
|
type = new SourceType(package_name, scope, docs, modifiers, typeKind, kind_token, name, typemap);
|
||||||
}
|
}
|
||||||
@@ -1702,32 +1703,27 @@ function qualifiers(matches, tokens, mdecls, scope, imports, typemap) {
|
|||||||
*/
|
*/
|
||||||
function memberQualifier(matches, tokens, mdecls, scope, imports, typemap) {
|
function memberQualifier(matches, tokens, mdecls, scope, imports, typemap) {
|
||||||
tokens.mark();
|
tokens.mark();
|
||||||
const dot = tokens.current;
|
const dot = tokens.consume();
|
||||||
tokens.expectValue('.');
|
|
||||||
let expr, label = `${matches.source}.${tokens.current.value}`;
|
let expr, label = `${matches.source}.${tokens.current.value}`;
|
||||||
let types = [], package_name = '';
|
let types = [], package_name = '';
|
||||||
switch (tokens.current.value) {
|
switch (tokens.current.value) {
|
||||||
case 'class':
|
case 'class':
|
||||||
expr = new ClassMemberExpression(matches, tokens.current);
|
expr = new ClassMemberExpression(matches, tokens.consume());
|
||||||
break;
|
break;
|
||||||
case 'this':
|
case 'this':
|
||||||
case 'super':
|
case 'super':
|
||||||
expr = new ThisMemberExpression(matches, tokens.current);
|
expr = new ThisMemberExpression(matches, tokens.consume());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
let member = tokens.current;
|
let member = tokens.getIfKind('ident');
|
||||||
if (member.kind === 'ident') {
|
if (member) {
|
||||||
if (matches.package_name || matches.types[0]) {
|
if (matches.package_name || matches.types[0]) {
|
||||||
({ types, package_name } = resolveNextTypeOrPackage(member.value, matches.types, matches.package_name, typemap));
|
({ types, package_name } = resolveNextTypeOrPackage(member.value, matches.types, matches.package_name, typemap));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
member = null;
|
|
||||||
addproblem(tokens, ParseProblem.Error(tokens.current, `Identifier expected`));
|
|
||||||
}
|
}
|
||||||
expr = new MemberExpression(matches, dot, member);
|
expr = new MemberExpression(matches, dot, member);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tokens.inc();
|
|
||||||
return new ResolvedIdent(label, [expr], [], types, package_name, [...matches.tokens, ...tokens.markEnd()]);
|
return new ResolvedIdent(label, [expr], [], types, package_name, [...matches.tokens, ...tokens.markEnd()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user