Add support for bytes keyword. FIDL-504 #comment Add support for bytes keyword Change-Id: I510ccfd111a875b502162cea862bba270e6d085a
diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml index 65e6f11..0e20c1e 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.8</version> + <version>0.9</version> <vendor url="https://fuchsia.googlesource.com/intellij-language-fidl/">The Fuchsia Authors </vendor> @@ -18,6 +18,10 @@ <change-notes><![CDATA[ <ul> + <li><b>0.9</b> + <ul> + <li>Add support for bytes keyword.</li> + </ul> <li><b>0.8</b> <ul> <li>Add support for bits syntax and binary numeric literals.</li>
diff --git a/src/fuchsia/developer/plugin/fidl/BUILD b/src/fuchsia/developer/plugin/fidl/BUILD index b83bc8c..03a8600 100644 --- a/src/fuchsia/developer/plugin/fidl/BUILD +++ b/src/fuchsia/developer/plugin/fidl/BUILD
@@ -75,6 +75,7 @@ "fuchsia/developer/plugin/fidl/psi/FidlUsingDeclaration.java", "fuchsia/developer/plugin/fidl/psi/FidlUsing.java", "fuchsia/developer/plugin/fidl/psi/FidlUsingList.java", + "fuchsia/developer/plugin/fidl/psi/FidlVectorAlias.java", "fuchsia/developer/plugin/fidl/psi/FidlVectorType.java", "fuchsia/developer/plugin/fidl/psi/FidlVisitor.java", "fuchsia/developer/plugin/fidl/psi/FidlXunionDeclaration.java", @@ -129,6 +130,7 @@ "fuchsia/developer/plugin/fidl/psi/impl/FidlUsingDeclarationImpl.java", "fuchsia/developer/plugin/fidl/psi/impl/FidlUsingImpl.java", "fuchsia/developer/plugin/fidl/psi/impl/FidlUsingListImpl.java", + "fuchsia/developer/plugin/fidl/psi/impl/FidlVectorAliasImpl.java", "fuchsia/developer/plugin/fidl/psi/impl/FidlVectorTypeImpl.java", "fuchsia/developer/plugin/fidl/psi/impl/FidlXunionDeclarationImpl.java", "fuchsia/developer/plugin/fidl/psi/impl/FidlXunionFieldImpl.java",
diff --git a/src/fuchsia/developer/plugin/fidl/Fidl.bnf b/src/fuchsia/developer/plugin/fidl/Fidl.bnf index 13e9854..eccc3f9 100644 --- a/src/fuchsia/developer/plugin/fidl/Fidl.bnf +++ b/src/fuchsia/developer/plugin/fidl/Fidl.bnf
@@ -110,7 +110,9 @@ array-type ::= ARRAY LANGLE type RANGLE COLON boundary-constant -vector-type ::= VECTOR LANGLE type RANGLE ( COLON boundary-constant )? ( QUESTION )? +vector-type ::= vector-alias ( COLON boundary-constant )? ( QUESTION )? + +vector-alias ::= VECTOR LANGLE type RANGLE | BYTES string-type ::= STRING ( COLON boundary-constant )? ( QUESTION )? @@ -145,4 +147,4 @@ REQUEST | RESERVED | RESOURCE | SOCKET | STRING | STRUCT | TABLE | THREAD | TIMER | UNION | USING_T | VECTOR | VMAR | VMO | XUNION | BOOL | FLOAT32 | FLOAT64 | INT8 | INT16 | INT32 | INT64 | UINT8 | UINT16 | UINT32 | UINT64 | - TRUE | FALSE | PROTOCOL | COMPOSE | BITS + TRUE | FALSE | PROTOCOL | COMPOSE | BITS | BYTES
diff --git a/src/fuchsia/developer/plugin/fidl/FidlLexer.flex b/src/fuchsia/developer/plugin/fidl/FidlLexer.flex index bb30899..9519e86 100644 --- a/src/fuchsia/developer/plugin/fidl/FidlLexer.flex +++ b/src/fuchsia/developer/plugin/fidl/FidlLexer.flex
@@ -34,6 +34,7 @@ ARRAY=array AS=as BITS=bits +BYTES=bytes CHANNEL=channel COMPOSE=compose CONST=const @@ -121,6 +122,7 @@ {USING_T} { return USING_T; } {AS} { return AS; } {BITS} { return BITS; } + {BYTES} { return BYTES; } {CONST} { return CONST; } {ENUM} { return ENUM; } {INTERFACE} { return INTERFACE; }
diff --git a/src/fuchsia/developer/plugin/fidl/SyntaxHighlighter.java b/src/fuchsia/developer/plugin/fidl/SyntaxHighlighter.java index 4f9569a..f324e57 100644 --- a/src/fuchsia/developer/plugin/fidl/SyntaxHighlighter.java +++ b/src/fuchsia/developer/plugin/fidl/SyntaxHighlighter.java
@@ -79,6 +79,7 @@ Types.USING_T, Types.AS, Types.BITS, + Types.BYTES, Types.CONST, Types.ENUM, Types.INTERFACE,