diff options
author | 2024-09-03 20:36:47 +0900 | |
---|---|---|
committer | 2024-09-03 20:36:47 +0900 | |
commit | e9cc403553a2886a608a59c24f2ee7aab12946fd (patch) | |
tree | 63b097651fdd6efce77779c3842f46fee27a9c51 /androidmk/parser/ast.go | |
parent | cdd70d268a25626651ace46e56a327e366697fdb (diff) |
Fix End() of Rule
If a directive appears in the middle of a Rule,
the Rule does not reflect its length.
This must be reflected to obtain the correct End() position of the Rule.
Change-Id: I67a78f95487829c639b0c1414ac4cc096faa6363
Diffstat (limited to 'androidmk/parser/ast.go')
-rw-r--r-- | androidmk/parser/ast.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/androidmk/parser/ast.go b/androidmk/parser/ast.go index d5d135443..c3d198f94 100644 --- a/androidmk/parser/ast.go +++ b/androidmk/parser/ast.go @@ -84,6 +84,7 @@ type Rule struct { Prerequisites *MakeString RecipePos Pos Recipe string + RecipeEndPos Pos } func (x *Rule) Dump() string { @@ -95,7 +96,7 @@ func (x *Rule) Dump() string { } func (x *Rule) Pos() Pos { return x.Target.Pos() } -func (x *Rule) End() Pos { return Pos(int(x.RecipePos) + len(x.Recipe)) } +func (x *Rule) End() Pos { return x.RecipeEndPos } type Variable struct { Name *MakeString |