Skip to content

Commit 6f00044

Browse files
authored
Merge pull request #368 from EvgSkv/ti2023
Report annotation error to the user.
2 parents 5c645ec + 86af5c6 commit 6f00044

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

compiler/functors.py

+9
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,15 @@ def CollectAnnotations(self, predicates):
337337
'@NoInject']:
338338
continue
339339
for rule in rules:
340+
if ('literal' not in
341+
rule['head']['record']['field_value'][0]['value']['expression'] or
342+
'the_predicate' not in
343+
rule['head']['record']['field_value'][0]['value']['expression'][
344+
'literal']):
345+
raise FunctorError('This annotation requires predicate symbol '
346+
'as the first positional argument.',
347+
rule['full_text'])
348+
340349
if rule['head']['record']['field_value'][0]['value']['expression'][
341350
'literal']['the_predicate']['predicate_name'] in predicates:
342351
result.append(rule)

0 commit comments

Comments
 (0)