Repository: Konstantin8105/c4go
Pull request #471 (2019-09-20 09:16:31)

AST: update nodes

codecov[bot]: # [Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/471?src=pr&el=h1) Report
> Merging [#471](https://codecov.io/gh/Konstantin8105/c4go/pull/471?src=pr&el=desc) into [master](https://codecov.io/gh/Konstantin8105/c4go/commit/9ce2a26dc4d4d065b06379e38377b705a7072e15?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/Konstantin8105/c4go/pull/471/graphs/tree.svg?width=650&token=esH2rHXlZ2&height=150&src=pr)](https://codecov.io/gh/Konstantin8105/c4go/pull/471?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #471      +/-   ##
==========================================
+ Coverage   84.78%   84.78%   +<.01%     
==========================================
  Files         192      192              
  Lines       11936    11939       +3     
==========================================
+ Hits        10120    10123       +3     
  Misses       1324     1324              
  Partials      492      492
```


| [Impacted Files](https://codecov.io/gh/Konstantin8105/c4go/pull/471?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [ast/warn\_unused\_result\_attr.go](https://codecov.io/gh/Konstantin8105/c4go/pull/471/diff?src=pr&el=tree#diff-YXN0L3dhcm5fdW51c2VkX3Jlc3VsdF9hdHRyLmdv) | `100% <100%> (ø)` | :arrow_up: |
| [ast/member\_expr.go](https://codecov.io/gh/Konstantin8105/c4go/pull/471/diff?src=pr&el=tree#diff-YXN0L21lbWJlcl9leHByLmdv) | `100% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/471?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/471?src=pr&el=footer). Last update [9ce2a26...ee1137e](https://codecov.io/gh/Konstantin8105/c4go/pull/471?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/ast/member_expr.go b/ast/member_expr.go
index fe94632..09a3dc1 100644
--- a/ast/member_expr.go
+++ b/ast/member_expr.go
@@ -11,6 +11,7 @@ type MemberExpr struct {
 	IsBitfield bool
 	Address2   string
 	IsPointer  bool
+	Other      string
 	ChildNodes []Node
 }
 
@@ -23,7 +24,8 @@ func parseMemberExpr(line string) *MemberExpr {
 		(?P<bitfield> bitfield)?
 		 (?P<pointer>[->.]+)
 		(?P<name>\w+)?
-		 (?P<address2>[0-9a-fx]+)`,
+		 (?P<address2>[0-9a-fx]+)
+		(?P<other> .*)?`,
 		line,
 	)
 
@@ -42,6 +44,7 @@ func parseMemberExpr(line string) *MemberExpr {
 		IsLvalue:   len(groups["lvalue"]) > 0,
 		IsBitfield: len(groups["bitfield"]) > 0,
 		Address2:   groups["address2"],
+		Other:      groups["other"],
 		ChildNodes: []Node{},
 	}
 }
diff --git a/ast/warn_unused_result_attr.go b/ast/warn_unused_result_attr.go
index 7a46b29..f439a15 100644
--- a/ast/warn_unused_result_attr.go
+++ b/ast/warn_unused_result_attr.go
@@ -6,16 +6,18 @@ type WarnUnusedResultAttr struct {
 	Addr       Address
 	Pos        Position
 	Inherited  bool
+	Other      string
 	ChildNodes []Node
 }
 
 func parseWarnUnusedResultAttr(line string) *WarnUnusedResultAttr {
-	groups := groupsFromRegex(`<(?P<position>.*)>(?P<inherited> Inherited)?( warn_unused_result)?`, line)
+	groups := groupsFromRegex(`<(?P<position>.*)>(?P<inherited> Inherited)?( warn_unused_result)?(?P<other>.*)?`, line)
 
 	return &WarnUnusedResultAttr{
 		Addr:       ParseAddress(groups["address"]),
 		Pos:        NewPositionFromString(groups["position"]),
 		Inherited:  len(groups["inherited"]) > 0,
+		Other:      groups["other"],
 		ChildNodes: []Node{},
 	}
 }


Test patch:
diff --git a/ast/decl_ref_expr_test.go b/ast/decl_ref_expr_test.go
index 845ef11..2ec2b6e 100644
--- a/ast/decl_ref_expr_test.go
+++ b/ast/decl_ref_expr_test.go
@@ -83,6 +83,20 @@ func TestDeclRefExpr(t *testing.T) {
 			Other:      " non_odr_use_unevaluated",
 			ChildNodes: []Node{},
 		},
+		`0x1f54868 <col:44> 'struct plotframe_type':'struct plotframe_type' lvalue Var 0x1ec6a60 'plot' 'struct plotframe_type':'struct plotframe_type' non_odr_use_unevaluated`: &DeclRefExpr{
+			Addr:       0x1f54868,
+			Pos:        NewPositionFromString("col:44"),
+			Type:       "struct plotframe_type",
+			Type1:      "struct plotframe_type",
+			IsLvalue:   true,
+			For:        "Var",
+			Address2:   "0x1ec6a60",
+			Name:       "plot",
+			Type2:      "struct plotframe_type",
+			Type3:      "struct plotframe_type",
+			Other:      " non_odr_use_unevaluated",
+			ChildNodes: []Node{},
+		},
 	}
 
 	runNodeTests(t, nodes)
diff --git a/ast/member_expr_test.go b/ast/member_expr_test.go
index fede742..644a6c0 100644
--- a/ast/member_expr_test.go
+++ b/ast/member_expr_test.go
@@ -114,6 +114,19 @@ func TestMemberExpr(t *testing.T) {
 			IsPointer:  true,
 			ChildNodes: []Node{},
 		},
+		`0x1f54888 <col:44, col:49> 'enum linestyle_type [19]' lvalue .lineStyle 0x1eb6830 non_odr_use_unevaluated`: &MemberExpr{
+			Addr:       0x1f54888,
+			Pos:        NewPositionFromString("col:44, col:49"),
+			Type:       "enum linestyle_type [19]",
+			Type2:      "",
+			IsLvalue:   true,
+			IsBitfield: false,
+			Name:       "lineStyle",
+			Address2:   "0x1eb6830",
+			IsPointer:  false,
+			Other:      " non_odr_use_unevaluated",
+			ChildNodes: []Node{},
+		},
 	}
 
 	runNodeTests(t, nodes)
diff --git a/ast/warn_unused_result_attr_test.go b/ast/warn_unused_result_attr_test.go
index 30f8a8a..c4e9a9c 100644
--- a/ast/warn_unused_result_attr_test.go
+++ b/ast/warn_unused_result_attr_test.go
@@ -24,6 +24,13 @@ func TestWarnUnusedResultAttr(t *testing.T) {
 			Inherited:  true,
 			ChildNodes: []Node{},
 		},
+		`0x1def418 <col:53> warn_unused_result ""`: &WarnUnusedResultAttr{
+			Addr:       0x1def418,
+			Pos:        NewPositionFromString("col:53"),
+			Inherited:  false,
+			Other:      " \"\"",
+			ChildNodes: []Node{},
+		},
 	}
 
 	runNodeTests(t, nodes)