if not treated as an expression in argument lists

This commit is contained in:
sweinreuter
2011-03-10 20:17:13 +01:00
parent 2b0c51e5aa
commit 7e0104bb59
5 changed files with 65 additions and 9 deletions
@@ -45,7 +45,7 @@ public final class XPath2ElementTypes {
public static final TokenSet EXPRESSIONS = TokenSet.orSet(
XPathElementTypes.EXPRESSIONS,
TokenSet.create(XPathElementTypes.NODE_TYPE, CONTEXT_ITEM, FOR, RANGE_EXPRESSION, QUANTIFIED, INSTANCE_OF, TREAT_AS, CASTABLE_AS, CAST_AS)
TokenSet.create(XPathElementTypes.NODE_TYPE, SEQUENCE, CONTEXT_ITEM, IF, FOR, RANGE_EXPRESSION, QUANTIFIED, INSTANCE_OF, TREAT_AS, CASTABLE_AS, CAST_AS)
);
private XPath2ElementTypes() {
@@ -0,0 +1,32 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.intellij.lang.xpath;
/*
* Created by IntelliJ IDEA.
* User: sweinreuter
* Date: 10.03.11
*/
public class XPath2HighlightingTest extends XPath2HighlightingTestBase {
public void testIfInsideArgumentList() throws Throwable {
doXPathHighlighting();
}
@Override
protected String getSubPath() {
return "xpath/highlighting";
}
}
@@ -0,0 +1,30 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.intellij.lang.xpath;
import com.intellij.util.ArrayUtil;
/*
* Created by IntelliJ IDEA.
* User: sweinreuter
* Date: 10.03.11
*/
public abstract class XPath2HighlightingTestBase extends TestBase {
protected void doXPathHighlighting(String... moreFiles) throws Throwable {
final String name = getTestFileName();
myFixture.testHighlighting(true, false, false, ArrayUtil.append(moreFiles, name + ".xpath2"));
}
}
@@ -15,9 +15,7 @@
*/
package org.intellij.lang.xpath;
import com.intellij.util.ArrayUtil;
public class XPath2TypeTest extends TestBase {
public class XPath2TypeTest extends XPath2HighlightingTestBase {
public void testQNameToQName() throws Throwable {
doXPathHighlighting();
@@ -91,11 +89,6 @@ public class XPath2TypeTest extends TestBase {
doXPathHighlighting();
}
private void doXPathHighlighting(String... moreFiles) throws Throwable {
final String name = getTestFileName();
myFixture.testHighlighting(true, false, false, ArrayUtil.append(moreFiles, name + ".xpath2"));
}
@Override
protected String getSubPath() {
return "xpath/highlighting/types";
@@ -0,0 +1 @@
concat('', if (true()) then '1' else '2')