Skip to content

Commit 1177fee

Browse files
committed
main: fix the logic verifying the value set to line: field
Signed-off-by: Masatake YAMATO <[email protected]>
1 parent e21f020 commit 1177fee

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

Units/optscript.r/op-line.d/args.ctags

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
--kinddef-X=d,def,definitions
66

77
--regex-X=/[ \t]*def ([a-z])/\1/d/{exclusive}{{
8-
. dup :line 2 mul line:
8+
. dup :line 2 idiv line:
99
}}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
a input.unknown /^def a$/;" d line:2
2-
b input.unknown /^def b$/;" d line:4
3-
c input.unknown /^def c$/;" d line:6
1+
a input.unknown /^#$/;" d line:1
2+
b input.unknown /^def a$/;" d line:2
3+
c input.unknown /^#$/;" d line:3
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
#
12
def a
3+
#
24
def b
5+
#
36
def c
47

main/field.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static fieldDefinition fieldDefinitionsExuberant [] = {
223223
.dataType = FIELDTYPE_INTEGER,
224224
.getterValueType = "int",
225225
.getValueObject = getFieldValueForLineCommon,
226-
.setterValueType = "matchloc|int",
226+
.setterValueType = "matchloc|line:int", /* line <= getInputLineNumber(); */
227227
.checkValueForSetter= checkFieldValueForLineCommon,
228228
.setValueObject = setFieldValueForLineCommon,
229229
},
@@ -1878,7 +1878,7 @@ static EsObject* setFieldValueForLineCommon (tagEntryInfo *tag, const fieldDefin
18781878
we cannot fill tag->filePosition with
18791879
getInputFilePositionForLine(); */
18801880
if (fdef->ftype == FIELD_LINE_NUMBER
1881-
&& l < getInputLineNumber())
1881+
&& l > getInputLineNumber())
18821882
return OPT_ERR_RANGECHECK;
18831883
}
18841884
else

0 commit comments

Comments
 (0)