File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ A clear and concise description of what the bug is.
1414Steps to reproduce the behavior:
15151 . I create code for this and that
16162 . With a test for this and that
17- 3 . Instead of seeng this
17+ 3 . Instead of seeing this
18184 . I see that
1919
2020** Expected behavior**
Original file line number Diff line number Diff line change 1414
1515package ast
1616
17+ import "math"
18+
1719// NewSalience create new Salience AST object
1820func NewSalience (val int ) * Salience {
1921
@@ -34,5 +36,9 @@ type SalienceReceiver interface {
3436
3537// AcceptIntegerLiteral accept the assigned integer
3638func (sal * Salience ) AcceptIntegerLiteral (lit * IntegerLiteral ) {
37- sal .SalienceValue = int (lit .Integer )
39+ if lit .Integer >= math .MinInt32 && lit .Integer <= math .MaxInt32 {
40+ sal .SalienceValue = int (lit .Integer )
41+ } else {
42+ panic ("Salience value out of range" )
43+ }
3844}
You can’t perform that action at this time.
0 commit comments