comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/MessageContainer.java @ 19289:62c43fcf5be2

Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
author Christian Humer <christian.humer@gmail.com>
date Tue, 03 Feb 2015 15:07:07 +0100
parents 13cf9b6b325c
children 476374f3fe9a
comparison
equal deleted inserted replaced
19288:3a37116ef37f 19289:62c43fcf5be2
117 117
118 private void verifyExpectedMessages(ProcessorContext context, Log log, List<Message> msgs) { 118 private void verifyExpectedMessages(ProcessorContext context, Log log, List<Message> msgs) {
119 TypeElement expectError = context.getTruffleTypes().getExpectError(); 119 TypeElement expectError = context.getTruffleTypes().getExpectError();
120 if (expectError != null) { 120 if (expectError != null) {
121 Element element = getMessageElement(); 121 Element element = getMessageElement();
122 AnnotationMirror mirror = ElementUtils.findAnnotationMirror(element.getAnnotationMirrors(), expectError); 122 AnnotationMirror mirror = ElementUtils.findAnnotationMirror(element.getAnnotationMirrors(), expectError.asType());
123 if (mirror != null) { 123 if (mirror != null) {
124 List<String> values = ElementUtils.getAnnotationValueList(String.class, mirror, "value"); 124 List<String> values = ElementUtils.getAnnotationValueList(String.class, mirror, "value");
125 if (values == null) { 125 if (values == null) {
126 values = Collections.emptyList(); 126 values = Collections.emptyList();
127 } 127 }
147 147
148 String text = message.getText(); 148 String text = message.getText();
149 149
150 TypeElement expectError = context.getTruffleTypes().getExpectError(); 150 TypeElement expectError = context.getTruffleTypes().getExpectError();
151 if (expectError != null) { 151 if (expectError != null) {
152 AnnotationMirror mirror = ElementUtils.findAnnotationMirror(messageElement.getAnnotationMirrors(), expectError); 152 AnnotationMirror mirror = ElementUtils.findAnnotationMirror(messageElement.getAnnotationMirrors(), expectError.asType());
153 if (mirror != null) { 153 if (mirror != null) {
154 List<String> expectedTexts = ElementUtils.getAnnotationValueList(String.class, mirror, "value"); 154 List<String> expectedTexts = ElementUtils.getAnnotationValueList(String.class, mirror, "value");
155 boolean found = false; 155 boolean found = false;
156 for (String expectedText : expectedTexts) { 156 for (String expectedText : expectedTexts) {
157 if (expectedText.endsWith("%") && text.startsWith(expectedText.substring(0, expectedText.length() - 1))) { 157 if (expectedText.endsWith("%") && text.startsWith(expectedText.substring(0, expectedText.length() - 1))) {