Skip to content

Commit

Permalink
Merge branch 'topic/diags_ocaml' into 'master'
Browse files Browse the repository at this point in the history
Fix ocaml bindings generation.

See merge request eng/libadalang/libadalang!1507
  • Loading branch information
Roldak committed Jan 11, 2024
2 parents 6bfa5a6 + 834a0ea commit cf09acf
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ada/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,18 +479,18 @@ def valid_keywords():

@langkit_property(public=True, return_type=T.AdaNode,
ignore_warn_on_node=True)
def call_context(context=T.LogicContext):
def call_context(ctx=T.LogicContext):
"""
Assuming that Self is the error location of a semantic diagnostic and
that ``context`` is one of its logic contexts indicating which
subprogram was tried, return a node that indicates with more precision
which part of the subprogram caused a mismatch. For example, if Self
corresponds to the second actual in the ``CallExpr``, this returns the
second parameter of the candidate subprogram.
that ``ctx`` is one of its logic contexts indicating which subprogram
was tried, return a node that indicates with more precision which part
of the subprogram caused a mismatch. For example, if Self corresponds
to the second actual in the ``CallExpr``, this returns the second
parameter of the candidate subprogram.
"""
bd = Var(context.decl_node.cast(BasicDecl))
bd = Var(ctx.decl_node.cast(BasicDecl))
return bd._.subp_spec_or_null.then(
lambda spec: context.ref_node.cast(Name)._.parent_callexpr.then(
lambda spec: ctx.ref_node.cast(Name)._.parent_callexpr.then(
lambda ce: If(
Self == ce.node,
spec.returns.node,
Expand All @@ -507,7 +507,7 @@ def call_context(context=T.LogicContext):
),
default_val=bd.defining_name.node
),
default_val=context.decl_node.node
default_val=ctx.decl_node.node
)

@langkit_property(public=True)
Expand Down

0 comments on commit cf09acf

Please sign in to comment.