Add support for error syntax.
Bump version number to 0.6.
Change-Id: I185b63f8770c804c2d1d8e03c5cedd5657d702bb
diff --git a/FIDL-Plugin.iml b/FIDL-Plugin.iml
index db00b41..c0dfef1 100644
--- a/FIDL-Plugin.iml
+++ b/FIDL-Plugin.iml
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PLUGIN_MODULE" version="4">
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/resources/META-INF/plugin.xml" />
+ <component name="FacetManager">
+ <facet type="Python" name="Python">
+ <configuration sdkName="" />
+ </facet>
+ </component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
@@ -10,5 +15,14 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/26.0-android/guava-26.0-android.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
</component>
</module>
\ No newline at end of file
diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml
index da81a32..77785d3 100644
--- a/resources/META-INF/plugin.xml
+++ b/resources/META-INF/plugin.xml
@@ -1,7 +1,7 @@
<idea-plugin>
<id>fuchsia.developer.plugin.fidl</id>
<name>FIDL</name>
- <version>0.5.1</version>
+ <version>0.6</version>
<vendor
url="https://fuchsia.googlesource.com/intellij-language-fidl/">The Fuchsia Authors
</vendor>
@@ -18,6 +18,12 @@
<change-notes><![CDATA[
<ul>
+ <li><b>0.6</b>
+ <ul>
+ <li>Add temporary support for extensible unions.</li>
+ <li>Add support for error syntax.</li>
+ </ul>
+ </li>
<li><b>0.5</b>
<ul>
<li>Fix for exception in syntax highlighter init</li>
diff --git a/src/fuchsia/developer/plugin/fidl/Fidl.bnf b/src/fuchsia/developer/plugin/fidl/Fidl.bnf
index 96564f8..36efaec 100644
--- a/src/fuchsia/developer/plugin/fidl/Fidl.bnf
+++ b/src/fuchsia/developer/plugin/fidl/Fidl.bnf
@@ -52,7 +52,7 @@
super-interface-list ::= compound-identifier COMMA super-interface-list | compound-identifier
-interface-method ::= ( ordinal COLON )? interface-parameters
+interface-method ::= ( ordinal COLON )? interface-parameters ( ERROR type )?
interface-parameters ::= identifier-token parameter-list ( ARROW parameter-list )?
| ARROW identifier-token parameter-list
@@ -123,7 +123,7 @@
literal ::= STRING_LITERAL | NUMERIC_LITERAL | TRUE | FALSE
-identifier-token ::= IDENTIFIER | ARRAY | AS | CHANNEL | CONST | ENUM | EVENT | EVENTPAIR | FIFO |
+identifier-token ::= IDENTIFIER | ARRAY | AS | CHANNEL | CONST | ENUM | ERROR | EVENT | EVENTPAIR | FIFO |
GUEST | HANDLE | INTERFACE | INTERRUPT | JOB | LIBRARY | LOG | PORT | PROCESS |
REQUEST | RESERVED | RESOURCE | SOCKET | STRING | STRUCT | TABLE | THREAD |
TIMER | UNION | USING_T | VECTOR | VMAR | VMO | XUNION | BOOL | FLOAT32 |
diff --git a/src/fuchsia/developer/plugin/fidl/FidlLexer.flex b/src/fuchsia/developer/plugin/fidl/FidlLexer.flex
index c2725fa..b5d4195 100644
--- a/src/fuchsia/developer/plugin/fidl/FidlLexer.flex
+++ b/src/fuchsia/developer/plugin/fidl/FidlLexer.flex
@@ -36,6 +36,7 @@
CHANNEL=channel
CONST=const
ENUM=enum
+ERROR=error
EVENT=event
EVENTPAIR=eventpair
FIFO=fifo
@@ -120,6 +121,7 @@
{TABLE} { return TABLE; }
{UNION} { return UNION; }
{XUNION} { return XUNION; }
+ {ERROR} { return ERROR; }
{ARRAY} { return ARRAY; }
{VECTOR} { return VECTOR; }
{STRING} { return STRING; }
diff --git a/src/fuchsia/developer/plugin/fidl/SyntaxHighlighter.java b/src/fuchsia/developer/plugin/fidl/SyntaxHighlighter.java
index 8754c43..6688aa2 100644
--- a/src/fuchsia/developer/plugin/fidl/SyntaxHighlighter.java
+++ b/src/fuchsia/developer/plugin/fidl/SyntaxHighlighter.java
@@ -85,6 +85,7 @@
Types.TABLE,
Types.UNION,
Types.XUNION,
+ Types.ERROR,
Types.ARRAY,
Types.VECTOR,
Types.STRING,