Skip to content

Commit

Permalink
{pyactr} Remove redundant warnings about print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
asmaloney committed Aug 17, 2023
1 parent 38629f7 commit 235342c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion framework/pyactr/pyactr.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ func (PyACTR) ValidateModel(model *actr.Model) (log *issues.Log) {

for _, production := range model.Productions {
numPrintStatements := 0
warnedPrintStatements := false

if production.DoStatements != nil {
for _, statement := range production.DoStatements {
if statement.Print != nil {
if !warnedPrintStatements && statement.Print != nil {
numPrintStatements++
if numPrintStatements > 1 {
location := issues.Location{
Expand All @@ -81,6 +82,7 @@ func (PyACTR) ValidateModel(model *actr.Model) (log *issues.Log) {
ColumnEnd: 0,
}
log.Warning(&location, "pyactr only supports one print statement per production (in %q)", production.Name)
warnedPrintStatements = true
}
}

Expand Down

0 comments on commit 235342c

Please sign in to comment.