Skip to content

Commit

Permalink
Add pub access modifier to publicly used struct fields (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm authored Apr 8, 2024
1 parent c43c3f1 commit af1abf1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions func/func.v
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub type VectorValuedFn = fn (x f64, y []f64, params []f64) f64

// Definition of an arbitrary function with parameters
pub struct Fn {
pub:
f ArbitraryFn @[required]
mut:
params []f64
Expand Down Expand Up @@ -46,6 +47,7 @@ pub fn (f Fn) safe_eval(x f64) !f64 {

// Definition of an arbitrary function returning two values, r1, r2
pub struct FnFdf {
pub:
f ?ArbitraryFn
df ?DfFn
fdf ?FdfFn
Expand Down
3 changes: 3 additions & 0 deletions iter/ranges.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub:

@[params]
pub struct IntIterParams {
pub:
start i64
stop i64 @[required]
step i64 = 1
Expand Down Expand Up @@ -71,6 +72,7 @@ pub:

@[params]
pub struct FloatIterParams {
pub:
start f64
stop f64 @[required]
step f64 = 1.0
Expand Down Expand Up @@ -126,6 +128,7 @@ pub:

@[params]
pub struct LinearIterParams {
pub:
start f64 @[required]
stop f64 @[required]
len i64 = 50
Expand Down
1 change: 1 addition & 0 deletions plot/show.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import time
@[params]
pub struct PlotConfig {
net.ListenOptions
pub:
timeout time.Duration = 1 * time.second
use_cdn bool
saddr string = ':0'
Expand Down
1 change: 1 addition & 0 deletions roots/bisection.v
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub mut:
// BisectionParams contains the parameters for the bisection method
@[params]
pub struct BisectionParams {
pub:
xmin f64
xmax f64
epsrel f64 = 1e-6
Expand Down
1 change: 1 addition & 0 deletions util/util.v
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub fn arange(n int) []int {

@[params]
pub struct RangeStep {
pub:
step int = 1
}

Expand Down

0 comments on commit af1abf1

Please sign in to comment.