Repository: Konstantin8105/c4go
Pull request #468 (2019-09-10 13:57:58)

AST: DeclRefExpr

codecov[bot]: # [Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/468?src=pr&el=h1) Report
> Merging [#468](https://codecov.io/gh/Konstantin8105/c4go/pull/468?src=pr&el=desc) into [master](https://codecov.io/gh/Konstantin8105/c4go/commit/4f5ec916fa65e8520e88e0a71637226679a875a5?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/468/graphs/tree.svg?width=650&token=esH2rHXlZ2&height=150&src=pr)](https://codecov.io/gh/Konstantin8105/c4go/pull/468?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #468      +/-   ##
==========================================
+ Coverage   84.78%   84.78%   +<.01%     
==========================================
  Files         192      192              
  Lines       11934    11936       +2     
==========================================
+ Hits        10118    10120       +2     
  Misses       1324     1324              
  Partials      492      492
```


| [Impacted Files](https://codecov.io/gh/Konstantin8105/c4go/pull/468?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [ast/decl\_ref\_expr.go](https://codecov.io/gh/Konstantin8105/c4go/pull/468/diff?src=pr&el=tree#diff-YXN0L2RlY2xfcmVmX2V4cHIuZ28=) | `100% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/468?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/468?src=pr&el=footer). Last update [4f5ec91...64304e4](https://codecov.io/gh/Konstantin8105/c4go/pull/468?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/ast/decl_ref_expr.go b/ast/decl_ref_expr.go
index e4e6916..46dd652 100644
--- a/ast/decl_ref_expr.go
+++ b/ast/decl_ref_expr.go
@@ -12,6 +12,7 @@ type DeclRefExpr struct {
 	Name       string
 	Type2      string
 	Type3      string
+	Other      string
 	ChildNodes []Node
 }
 
@@ -25,6 +26,7 @@ func parseDeclRefExpr(line string) *DeclRefExpr {
 		 (?P<address2>[0-9a-fx]+)
 		 '(?P<name>.*?)'
 		 '(?P<type2>.*?)'(:'(?P<type3>.*?)')?
+		(?P<other> .*?)?
 		`,
 		line,
 	)
@@ -40,6 +42,7 @@ func parseDeclRefExpr(line string) *DeclRefExpr {
 		Name:       groups["name"],
 		Type2:      groups["type2"],
 		Type3:      groups["type3"],
+		Other:      groups["other"],
 		ChildNodes: []Node{},
 	}
 }
diff --git a/go.mod b/go.mod
index 92ea7c1..b4d3c5d 100644
--- a/go.mod
+++ b/go.mod
@@ -8,3 +8,5 @@ require (
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	golang.org/x/sys v0.0.0-20190609082536-301114b31cce
 )
+
+go 1.13


Test patch:
diff --git a/ast/decl_ref_expr_test.go b/ast/decl_ref_expr_test.go
index d9e06c3..845ef11 100644
--- a/ast/decl_ref_expr_test.go
+++ b/ast/decl_ref_expr_test.go
@@ -71,6 +71,18 @@ func TestDeclRefExpr(t *testing.T) {
 			Type3:      "T_ENUM",
 			ChildNodes: []Node{},
 		},
+		`0x2961ea8 <col:109> 'YYSTYPE *' lvalue Var 0x295fd88 'yyvs' 'YYSTYPE *' non_odr_use_unevaluated`: &DeclRefExpr{
+			Addr:       0x2961ea8,
+			Pos:        NewPositionFromString("col:109"),
+			Type:       "YYSTYPE *",
+			IsLvalue:   true,
+			For:        "Var",
+			Address2:   "0x295fd88",
+			Name:       "yyvs",
+			Type2:      "YYSTYPE *",
+			Other:      " non_odr_use_unevaluated",
+			ChildNodes: []Node{},
+		},
 	}
 
 	runNodeTests(t, nodes)