Repository: Konstantin8105/c4go
Pull request #475 (2019-10-31 07:00:52)

VisibilityAttr: add Implicit
Close  #474

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

```diff
@@            Coverage Diff             @@
##           master     #475      +/-   ##
==========================================
+ Coverage   84.78%   84.79%   +<.01%     
==========================================
  Files         192      192              
  Lines       11939    11941       +2     
==========================================
+ Hits        10123    10125       +2     
  Misses       1324     1324              
  Partials      492      492
```


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

------

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


Patch:
diff --git a/ast/visibility_attr.go b/ast/visibility_attr.go
index 7549d48..85be0e5 100644
--- a/ast/visibility_attr.go
+++ b/ast/visibility_attr.go
@@ -8,12 +8,14 @@ type VisibilityAttr struct {
 	IsDefault   bool
 	IsInherited bool
 	IsHidden    bool
+	IsImplicit  bool
 }
 
 func parseVisibilityAttr(line string) *VisibilityAttr {
 	groups := groupsFromRegex(
 		`<(?P<position>.*)>
 		(?P<inherited> Inherited)?
+		(?P<implicit> Implicit)?
 		(?P<default> Default)?
 		(?P<hidden> Hidden)?
 		`,
@@ -27,6 +29,7 @@ func parseVisibilityAttr(line string) *VisibilityAttr {
 		IsDefault:   len(groups["default"]) > 0,
 		IsInherited: len(groups["inherited"]) > 0,
 		IsHidden:    len(groups["hidden"]) > 0,
+		IsImplicit:  len(groups["implicit"]) > 0,
 	}
 }
 


Test patch:
diff --git a/ast/visibility_attr_test.go b/ast/visibility_attr_test.go
index c9f41cc..7319715 100644
--- a/ast/visibility_attr_test.go
+++ b/ast/visibility_attr_test.go
@@ -30,6 +30,15 @@ func TestVisibilityAttr(t *testing.T) {
 			IsDefault:   false,
 			IsHidden:    true,
 		},
+		`0x2960578 <line:37:13> Implicit Default`: &VisibilityAttr{
+			Addr:        0x2960578,
+			Pos:         NewPositionFromString("line:37:13"),
+			ChildNodes:  []Node{},
+			IsInherited: false,
+			IsDefault:   true,
+			IsHidden:    false,
+			IsImplicit:  true,
+		},
 	}
 
 	runNodeTests(t, nodes)