Permalink
Browse files

Fix lambda parameters bindings escaping lambda expressions when used …

…in grammar rules
  • Loading branch information...
pmoura committed Aug 16, 2018
1 parent 4c067be commit 7898534fe8809c706107b37139329f11bfb7de15
Showing with 9 additions and 10 deletions.
  1. +1 −1 VERSION.txt
  2. +8 −9 core/core.pl
View
@@ -1 +1 @@
3.20.0-b03
3.20.0-b04
View
@@ -3375,7 +3375,7 @@
% versions, 'rcN' for release candidates (with N being a natural number),
% and 'stable' for stable versions
'$lgt_version_data'(logtalk(3, 20, 0, b03)).
'$lgt_version_data'(logtalk(3, 20, 0, b04)).
@@ -20523,26 +20523,25 @@
var(Var),
!.
'$lgt_dcg_body'(Free/Parameters>>Lambda, S0, S, Goal, Ctx) :-
'$lgt_dcg_body'(Free/Parameters>>Lambda, S0, S, call(Free/Parameters>>Lambda, S0, S), Ctx) :-
!,
'$lgt_check_lambda_expression'(Free/Parameters>>Lambda, Ctx),
( Parameters = [S0, S] ->
Goal = Lambda
( \+ Parameters \= [_, _] ->
true
; throw(representation_error(lambda_parameters))
).
'$lgt_dcg_body'(Parameters>>Lambda, S0, S, Lambda, Ctx) :-
'$lgt_dcg_body'(Parameters>>Lambda, S0, S, call(Parameters>>Lambda, S0, S), Ctx) :-
!,
'$lgt_check_lambda_expression'(Parameters>>Lambda, Ctx),
( Parameters = [S0, S] ->
( \+ Parameters \= [_, _] ->
true
; throw(representation_error(lambda_parameters))
).
'$lgt_dcg_body'(Free/Lambda, S0, S, Goal, Ctx) :-
'$lgt_dcg_body'(Free/Lambda, S0, S, call(Free/Lambda, S0, S), Ctx) :-
!,
'$lgt_check_lambda_expression'(Free/Lambda, Ctx),
'$lgt_dcg_body'(Lambda, S0, S, Goal, Ctx).
'$lgt_check_lambda_expression'(Free/Lambda, Ctx).
'$lgt_dcg_body'(Obj::RGoal, S0, S, CGoal, _) :-
!,

0 comments on commit 7898534

Please sign in to comment.