diff --git a/packages/omgidl-parser/src/idl.ne b/packages/omgidl-parser/src/idl.ne index aa541c1..595d280 100644 --- a/packages/omgidl-parser/src/idl.ne +++ b/packages/omgidl-parser/src/idl.ne @@ -7,7 +7,6 @@ const keywords = [ , "module" , "enum" , "const" - , "include" , "typedef" , "union" , "switch" diff --git a/packages/omgidl-parser/src/parseIDL.test.ts b/packages/omgidl-parser/src/parseIDL.test.ts index a0458e9..eeeffcb 100644 --- a/packages/omgidl-parser/src/parseIDL.test.ts +++ b/packages/omgidl-parser/src/parseIDL.test.ts @@ -2674,4 +2674,24 @@ module rosidl_parser { };`; expect(() => parse(msgDef)).toThrow(/unexpected RCBR token: "}"/i); }); + it("supports 'include' as a field name", () => { + const msgDef = ` + struct SomeStruct { + boolean include; + };`; + const ast = parseIDL(msgDef); + expect(ast).toEqual([ + { + name: "SomeStruct", + aggregatedKind: "struct", + definitions: [ + { + name: "include", + isComplex: false, + type: "bool", + }, + ], + }, + ]); + }); });