From f0511184bd5ecc68d87ad7ef74e9f792cd3c66e8 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Mon, 10 Nov 2014 15:41:36 -0700 Subject: [PATCH] fixed issues matching spaces --- tools/lcd/idl/parser/lcd_idl.peg | 26 +++++++++++++------------- tools/lcd/idl/test/rpc_test.idl | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/lcd/idl/parser/lcd_idl.peg b/tools/lcd/idl/parser/lcd_idl.peg index a81f4562b139..887c8d0c1800 100644 --- a/tools/lcd/idl/parser/lcd_idl.peg +++ b/tools/lcd/idl/parser/lcd_idl.peg @@ -69,7 +69,7 @@ File = Spacing v:Verbatim? t:Things* {{ } value = new File((char*) v.getValue(), current_file_scope(), rpcs); }} -Typedef = "typedef" Spacing "<" Spacing rt:RealType Spacing "," Spacing mt:Type_form Spacing ">" Spacing id:Identifier Spacing {{ +Typedef = "typedef" Spacing "<" Spacing rt:RealType Spacing "," Spacing mt:Type_form ">" Spacing id:Identifier Spacing {{ Typedef * val = new Typedef((char*) rt.getValue(), (Type*) mt.getValue()); insertType((char*)id.getValue(),val); }} @@ -264,18 +264,18 @@ Line_comment = Line_comm_start Line_comm_rest Line_comm_end = "\n" -signed_type = "int" {{ value = getType("int");}} - | "char" {{ value = getType("char"); }} - | "capability" {{ value = getType("capability"); }} - | "short" {{ value = getType("short");}} - | "long" Space+ "long" {{ value = getType("long long");}} - | "long" {{ value = getType("long"); }} - -unsigned_type = "unsigned" Space+ "int" {{ value = getType("unsigned int"); }} - | "unsigned" Space+ "char" {{ value = getType("unsigned char"); }} - | "unsigned" Space+ "short" {{ value = getType("unsigned long"); }} - | "unsigned" Space+ "long" Space+ "long" {{ value = getType("unsigned long long"); }} - | "unsigned" Space+ "long" {{ value = getType("unsigned long"); }} +signed_type = "int" Space+{{ value = getType("int");}} + | "char" Space+ {{ value = getType("char"); }} + | "capability" Space+ {{ value = getType("capability"); }} + | "short" Space+ {{ value = getType("short");}} + | "long" Space+ "long" Space+ {{ value = getType("long long");}} + | "long" Space+ {{ value = getType("long"); }} + +unsigned_type = "unsigned" Space+ "int" Space+ {{ value = getType("unsigned int"); }} + | "unsigned" Space+ "char" Space+ {{ value = getType("unsigned char"); }} + | "unsigned" Space+ "short" Space+ {{ value = getType("unsigned long"); }} + | "unsigned" Space+ "long" Space+ "long" Space+ {{ value = getType("unsigned long long"); }} + | "unsigned" Space+ "long" Space+ {{ value = getType("unsigned long"); }} type = unsigned_type | signed_type diff --git a/tools/lcd/idl/test/rpc_test.idl b/tools/lcd/idl/test/rpc_test.idl index 54e51532b659..da8b359c1bf7 100644 --- a/tools/lcd/idl/test/rpc_test.idl +++ b/tools/lcd/idl/test/rpc_test.idl @@ -1,3 +1,3 @@ rpc int foo(capability cpa, char v1, int v2); -rpc int bar(projection super_block *rp); \ No newline at end of file +rpc int bar(projection super_block * rp); -- GitLab