M3注释未声明

时间:2017-12-15 14:49:40

标签: rascal

我有一个由

创建的M3对象
M3 m3 = createM3FromDirectory(project)

用于某些项目目录。此外,我有

alias M3Dependencies = map[str depType, rel [loc from, loc to] dependencies];
M3Dependencies result = ();

在我的模块的序言中,我有:

extend lang::java::m3::Core;
extend lang::java::jdt::Project;
import lang::java::jdt::m3::AST;
import analysis::m3::Registry;

当我这样做时

result["extends"]     = m3@extends;

我得到一个例外,说未声明的注释:延伸到M3

此样本的代码在2015年和2016年正常运行,现在由于此异常而中断。 你能告诉我出了什么问题吗?

干杯,史蒂文克鲁塞纳

1 个答案:

答案 0 :(得分:2)

对此感到抱歉。我们正在逐步淘汰注释,它们将被关键字参数取代。每个关键字参数的名称与其替换的注释的名称相同。例如,请参阅data M3( rel[loc from, loc to] extends = {}, // classes extending classes and interfaces extending interfaces rel[loc from, loc to] implements = {}, // classes implementing interfaces rel[loc from, loc to] methodInvocation = {}, // methods calling each other (including constructors) rel[loc from, loc to] fieldAccess = {}, // code using data (like fields) rel[loc from, loc to] typeDependency = {}, // using a type literal in some code (types of variables, annotations) rel[loc from, loc to] methodOverrides = {}, // which method override which other methods rel[loc declaration, loc annotation] annotations = {} ); ,您可以在其中找到此定义:

m3@extends

因此,您之前必须编写m3.extends,现在应该编写public class TicketsQueue{ transient ArrayDeque<SimpleEntry<String, String>> tickets = new ArrayDeque<SimpleEntry<String, String>>(); public boolean offer(String category, String ticketId) { return tickets.offer(new SimpleEntry<String, String>(category, ticketId)); } public static void main(String args[]) { TicketsQueue tixQueue = new TicketsQueue(); tixQueue.offer("foo", "bar"); assert(tixQueue.tickets.isEmpty()); } } 。希望这会有所帮助。