@@ -96,7 +96,7 @@ fn traverse_node_value(scope: &Scope, node: &Dict, name: Option<String>) -> ImlV
96
96
let mut value = node[ "value" ] . to_string ( ) ;
97
97
98
98
if value. len ( ) == 0 {
99
- scope. error (
99
+ scope. push_error (
100
100
traverse_node_offset ( node) ,
101
101
format ! ( "Empty match not allowed" ) ,
102
102
) ;
@@ -204,7 +204,7 @@ fn traverse_node_value(scope: &Scope, node: &Dict, name: Option<String>) -> ImlV
204
204
) ;
205
205
206
206
if utils:: identifier_is_consumable ( & name) && !default. is_consuming ( ) {
207
- scope. error (
207
+ scope. push_error (
208
208
offset,
209
209
format ! (
210
210
"Generic '{}' defines consumable, but '{}' is not consuming" ,
@@ -219,7 +219,7 @@ fn traverse_node_value(scope: &Scope, node: &Dict, name: Option<String>) -> ImlV
219
219
} ;
220
220
221
221
if generics. insert ( name. clone ( ) , default) . is_some ( ) {
222
- scope. error (
222
+ scope. push_error (
223
223
offset,
224
224
format ! ( "Generic '{}' already defined in signature before" , name) ,
225
225
) ;
@@ -230,7 +230,7 @@ fn traverse_node_value(scope: &Scope, node: &Dict, name: Option<String>) -> ImlV
230
230
231
231
// Check for correct identifier semantics
232
232
if !first. is_lowercase ( ) {
233
- scope. error (
233
+ scope. push_error (
234
234
traverse_node_offset ( node) ,
235
235
if first == '_' {
236
236
format ! (
@@ -265,7 +265,7 @@ fn traverse_node_value(scope: &Scope, node: &Dict, name: Option<String>) -> ImlV
265
265
)
266
266
. is_some ( )
267
267
{
268
- scope. error (
268
+ scope. push_error (
269
269
traverse_node_offset ( node) ,
270
270
format ! ( "Argument '{}' already given in signature before" , name) ,
271
271
) ;
@@ -320,7 +320,7 @@ fn traverse_node_value(scope: &Scope, node: &Dict, name: Option<String>) -> ImlV
320
320
match emit. object :: < Str > ( ) . unwrap ( ) . as_str ( ) {
321
321
"genarg" => {
322
322
if !nargs. is_empty ( ) {
323
- scope. error (
323
+ scope. push_error (
324
324
traverse_node_offset ( node) ,
325
325
format ! (
326
326
"Sequencial generics need to be specified before named generics."
@@ -345,7 +345,7 @@ fn traverse_node_value(scope: &Scope, node: &Dict, name: Option<String>) -> ImlV
345
345
let ident = ident. object :: < Str > ( ) . unwrap ( ) . as_str ( ) ;
346
346
347
347
if nargs. contains_key ( ident) {
348
- scope. error (
348
+ scope. push_error (
349
349
traverse_node_offset ( genarg) ,
350
350
format ! ( "Named generic '{}' provided more than once." , ident) ,
351
351
) ;
@@ -559,7 +559,7 @@ fn traverse_node_lvalue(scope: &Scope, node: &Dict, store: bool, hold: bool) ->
559
559
}
560
560
// Check for not assigning to a constant (at any level)
561
561
Some ( _) => {
562
- scope. error (
562
+ scope. push_error (
563
563
traverse_node_offset ( node) ,
564
564
format ! ( "Cannot assign to constant '{}'" , name) ,
565
565
) ;
@@ -569,7 +569,7 @@ fn traverse_node_lvalue(scope: &Scope, node: &Dict, store: bool, hold: bool) ->
569
569
None => {
570
570
// Check if identifier is not a reserved word
571
571
if scope. compiler . restrict && RESERVED_KEYWORDS . contains ( & name) {
572
- scope. error (
572
+ scope. push_error (
573
573
traverse_node_offset ( node) ,
574
574
format ! ( "Expected identifier, found reserved word '{}'" , name) ,
575
575
) ;
@@ -579,7 +579,7 @@ fn traverse_node_lvalue(scope: &Scope, node: &Dict, store: bool, hold: bool) ->
579
579
580
580
// Check if identifier is not defining a consumable
581
581
if utils:: identifier_is_consumable ( name) {
582
- scope. error (
582
+ scope. push_error (
583
583
traverse_node_offset ( node) ,
584
584
585
585
if & name[ 0 ..1 ] == "_" {
@@ -601,7 +601,7 @@ fn traverse_node_lvalue(scope: &Scope, node: &Dict, store: bool, hold: bool) ->
601
601
602
602
// When chained lvalue, name must be declared!
603
603
if children. len ( ) > 1 {
604
- scope. error (
604
+ scope. push_error (
605
605
traverse_node_offset ( node) ,
606
606
format ! (
607
607
"Undeclared variable '{}', please define it first" ,
@@ -684,7 +684,7 @@ fn traverse_node_rvalue(scope: &Scope, node: &Dict, mode: Rvalue) -> ImlOp {
684
684
685
685
// Check if identifier is not a reserved word
686
686
if scope. compiler . restrict && RESERVED_KEYWORDS . contains ( & name) {
687
- scope. error (
687
+ scope. push_error (
688
688
offset,
689
689
format ! ( "Expected identifier, found reserved word '{}'" , name) ,
690
690
) ;
@@ -869,7 +869,7 @@ fn traverse_node(scope: &Scope, node: &Dict) -> ImlOp {
869
869
}
870
870
}
871
871
} else {
872
- scope. error (
872
+ scope. push_error (
873
873
traverse_node_offset ( node) ,
874
874
format ! ( "'{}' may only be used in parselet scope" , emit) ,
875
875
) ;
@@ -932,7 +932,7 @@ fn traverse_node(scope: &Scope, node: &Dict) -> ImlOp {
932
932
match emit. object :: < Str > ( ) . unwrap ( ) . as_str ( ) {
933
933
"callarg" => {
934
934
if nargs > 0 {
935
- scope. error (
935
+ scope. push_error (
936
936
traverse_node_offset ( node) ,
937
937
format ! (
938
938
"Sequencial arguments need to be specified before named arguments."
@@ -1101,7 +1101,7 @@ fn traverse_node(scope: &Scope, node: &Dict) -> ImlOp {
1101
1101
if scope. compiler . restrict
1102
1102
&& ( RESERVED_KEYWORDS . contains ( & ident) || RESERVED_TOKENS . contains ( & ident) )
1103
1103
{
1104
- scope. error (
1104
+ scope. push_error (
1105
1105
traverse_node_offset ( node) ,
1106
1106
format ! ( "Expected identifier, found reserved word '{}'" , ident) ,
1107
1107
) ;
@@ -1117,7 +1117,7 @@ fn traverse_node(scope: &Scope, node: &Dict) -> ImlOp {
1117
1117
1118
1118
if value. is_consuming ( ) {
1119
1119
if !utils:: identifier_is_consumable ( ident) {
1120
- scope. error (
1120
+ scope. push_error (
1121
1121
traverse_node_offset ( node) ,
1122
1122
format ! (
1123
1123
"Cannot assign to constant '{}' as consumable. Use an identifier starting in upper-case, e.g. '{}{}'" ,
@@ -1128,7 +1128,7 @@ fn traverse_node(scope: &Scope, node: &Dict) -> ImlOp {
1128
1128
return ImlOp :: Nop ;
1129
1129
}
1130
1130
} else if utils:: identifier_is_consumable ( ident) {
1131
- scope. error (
1131
+ scope. push_error (
1132
1132
traverse_node_offset ( node) ,
1133
1133
if ident. starts_with ( "_" ) {
1134
1134
format ! (
@@ -1203,7 +1203,7 @@ fn traverse_node(scope: &Scope, node: &Dict) -> ImlOp {
1203
1203
let op = match parts[ 1 ] {
1204
1204
"accept" | "break" | "exit" | "push" => {
1205
1205
if parts[ 1 ] == "break" && !scope. is_loop ( ) {
1206
- scope. error (
1206
+ scope. push_error (
1207
1207
traverse_node_offset ( node) ,
1208
1208
format ! ( "'break' cannot be used outside of a loop." ) ,
1209
1209
) ;
@@ -1237,7 +1237,7 @@ fn traverse_node(scope: &Scope, node: &Dict) -> ImlOp {
1237
1237
1238
1238
"continue" => {
1239
1239
if !scope. is_loop ( ) {
1240
- scope. error (
1240
+ scope. push_error (
1241
1241
traverse_node_offset ( node) ,
1242
1242
format ! ( "'continue' cannot be used outside of a loop." ) ,
1243
1243
) ;
@@ -1379,7 +1379,7 @@ fn traverse_node(scope: &Scope, node: &Dict) -> ImlOp {
1379
1379
1380
1380
/*
1381
1381
if !res.is_consuming() {
1382
- scope.error (
1382
+ scope.push_error (
1383
1383
traverse_node_offset(node),
1384
1384
format!(
1385
1385
"Operator '{}' has no effect on non-consuming {}",
0 commit comments