Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Oct 19, 2024
1 parent 65c7c63 commit adce07b
Show file tree
Hide file tree
Showing 17 changed files with 2,767 additions and 2,397 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,8 @@ public Object visitLambda(org.python.pydev.parser.jython.ast.Lambda node) throws
@Override
public Object visitNameTok(NameTok nameTok) throws Exception {
unhandled_node(nameTok);
if (nameTok.ctx == NameTok.VarArg || nameTok.ctx == NameTok.KwArg || nameTok.ctx == NameTok.TypeVarName) {
if (nameTok.ctx == NameTok.VarArg || nameTok.ctx == NameTok.KwArg || nameTok.ctx == NameTok.TypeVarName
|| nameTok.ctx == NameTok.TypeAliasName) {
SourceToken token = AbstractVisitor.makeToken(nameTok, moduleName, nature, this.current);
scope.addToken(token, token, (nameTok).id);
if (checkCurrentScopeForAssignmentsToBuiltins()) {
Expand Down Expand Up @@ -912,6 +913,15 @@ public Object visitFor(For node) throws Exception {
return ret;
}

// @Override
// public Object visitTypeAlias(TypeAlias node) throws Exception {
// // Something as: type Point[T, Y] = tuple[T, Y]
// if(node.name != null) {
//
// }
//
// return null;
// }
/**
* Overridden because we want the value to be visited before the targets
* @see org.python.pydev.parser.jython.ast.VisitorIF#visitAssign(org.python.pydev.parser.jython.ast.Assign)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
import org.python.pydev.parser.jython.ast.Suite;
import org.python.pydev.parser.jython.ast.TryExcept;
import org.python.pydev.parser.jython.ast.TryFinally;
import org.python.pydev.parser.jython.ast.TypeAlias;
import org.python.pydev.parser.jython.ast.TypeParamsSuite;
import org.python.pydev.parser.jython.ast.TypeVar;
import org.python.pydev.parser.jython.ast.TypeVarTuple;
Expand Down Expand Up @@ -886,4 +887,13 @@ public Object visitTypeParamsSuite(TypeParamsSuite node) throws Exception {
}
return null;
}

@Override
public Object visitTypeAlias(TypeAlias node) throws Exception {
boolean ret = unhandled_node(node);
if (ret) {
traverse(node);
}
return null;
}
}
Loading

0 comments on commit adce07b

Please sign in to comment.