diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 6f2d0fda..d5c02378 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -14,7 +14,7 @@ A clear and concise description of what the bug is. Steps to reproduce the behavior: 1. I create code for this and that 2. With a test for this and that -3. Instead of seeng this +3. Instead of seeing this 4. I see that **Expected behavior** diff --git a/ast/Salience.go b/ast/Salience.go index de84dbcf..fae2d7eb 100755 --- a/ast/Salience.go +++ b/ast/Salience.go @@ -14,6 +14,8 @@ package ast +import "math" + // NewSalience create new Salience AST object func NewSalience(val int) *Salience { @@ -34,5 +36,9 @@ type SalienceReceiver interface { // AcceptIntegerLiteral accept the assigned integer func (sal *Salience) AcceptIntegerLiteral(lit *IntegerLiteral) { - sal.SalienceValue = int(lit.Integer) + if lit.Integer >= math.MinInt32 && lit.Integer <= math.MaxInt32 { + sal.SalienceValue = int(lit.Integer) + } else { + panic("Salience value out of range") + } }