Skip to content

Commit 657137c

Browse files
committed
patch 8.2.2319: "exptype_T" can be read as "expected type"
Problem: "exptype_T" can be read as "expected type". Solution: Rename to "exprtype_T", expression type.
1 parent e7525c5 commit 657137c

9 files changed

Lines changed: 26 additions & 24 deletions

File tree

src/eval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2655,7 +2655,7 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
26552655
{
26562656
char_u *p;
26572657
int getnext;
2658-
exptype_T type = EXPR_UNKNOWN;
2658+
exprtype_T type = EXPR_UNKNOWN;
26592659
int len = 2;
26602660
int type_is = FALSE;
26612661

src/proto/typval.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ char_u *tv_get_string_buf_chk(typval_T *varp, char_u *buf);
1818
char_u *tv_stringify(typval_T *varp, char_u *buf);
1919
int tv_check_lock(typval_T *tv, char_u *name, int use_gettext);
2020
void copy_tv(typval_T *from, typval_T *to);
21-
int typval_compare(typval_T *typ1, typval_T *typ2, exptype_T type, int ic);
21+
int typval_compare(typval_T *typ1, typval_T *typ2, exprtype_T type, int ic);
2222
char_u *typval_tostring(typval_T *arg);
2323
int tv_islocked(typval_T *tv);
2424
int tv_equal(typval_T *tv1, typval_T *tv2, int ic, int recursive);

src/proto/vim9compile.pro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* vim9compile.c */
22
int check_defined(char_u *p, size_t len, cctx_T *cctx);
3-
int check_compare_types(exptype_T type, typval_T *tv1, typval_T *tv2);
3+
int check_compare_types(exprtype_T type, typval_T *tv1, typval_T *tv2);
44
int use_typecheck(type_T *actual, type_T *expected);
55
int get_script_item_idx(int sid, char_u *name, int check_writable, cctx_T *cctx);
66
imported_T *find_imported(char_u *name, size_t len, cctx_T *cctx);
@@ -9,7 +9,7 @@ char_u *peek_next_line_from_context(cctx_T *cctx);
99
char_u *next_line_from_context(cctx_T *cctx, int skip_comment);
1010
char_u *to_name_end(char_u *arg, int use_namespace);
1111
char_u *to_name_const_end(char_u *arg);
12-
exptype_T get_compare_type(char_u *p, int *len, int *type_is);
12+
exprtype_T get_compare_type(char_u *p, int *len, int *type_is);
1313
void error_white_both(char_u *op, int len);
1414
int assignment_len(char_u *p, int *heredoc);
1515
void vim9_declare_error(char_u *name);

src/structs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4029,7 +4029,7 @@ typedef enum
40294029
EXPR_MULT, // *
40304030
EXPR_DIV, // /
40314031
EXPR_REM, // %
4032-
} exptype_T;
4032+
} exprtype_T;
40334033

40344034
/*
40354035
* Structure used for reading in json_decode().

src/typval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ copy_tv(typval_T *from, typval_T *to)
649649
typval_compare(
650650
typval_T *typ1, // first operand
651651
typval_T *typ2, // second operand
652-
exptype_T type, // operator
652+
exprtype_T type, // operator
653653
int ic) // ignore case
654654
{
655655
int i;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2319,
753755
/**/
754756
2318,
755757
/**/

src/vim9.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ typedef enum {
105105
ISN_ADDLIST, // add two lists
106106
ISN_ADDBLOB, // add two blobs
107107

108-
// operation with two arguments; isn_arg.op.op_type is exptype_T
108+
// operation with two arguments; isn_arg.op.op_type is exprtype_T
109109
ISN_OPNR,
110110
ISN_OPFLOAT,
111111
ISN_OPANY,
112112

113-
// comparative operations; isn_arg.op.op_type is exptype_T, op_ic used
113+
// comparative operations; isn_arg.op.op_type is exprtype_T, op_ic used
114114
ISN_COMPAREBOOL,
115115
ISN_COMPARESPECIAL,
116116
ISN_COMPARENR,
@@ -217,7 +217,7 @@ typedef struct {
217217

218218
// arguments to ISN_OPNR, ISN_OPFLOAT, etc.
219219
typedef struct {
220-
exptype_T op_type;
220+
exprtype_T op_type;
221221
int op_ic; // TRUE with '#', FALSE with '?', else MAYBE
222222
} opexpr_T;
223223

src/vim9compile.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ generate_two_op(cctx_T *cctx, char_u *op)
669669
* Return ISN_DROP when failed.
670670
*/
671671
static isntype_T
672-
get_compare_isn(exptype_T exptype, vartype_T type1, vartype_T type2)
672+
get_compare_isn(exprtype_T exprtype, vartype_T type1, vartype_T type2)
673673
{
674674
isntype_T isntype = ISN_DROP;
675675

@@ -699,22 +699,22 @@ get_compare_isn(exptype_T exptype, vartype_T type1, vartype_T type2)
699699
&& (type2 == VAR_NUMBER || type2 ==VAR_FLOAT)))
700700
isntype = ISN_COMPAREANY;
701701

702-
if ((exptype == EXPR_IS || exptype == EXPR_ISNOT)
702+
if ((exprtype == EXPR_IS || exprtype == EXPR_ISNOT)
703703
&& (isntype == ISN_COMPAREBOOL
704704
|| isntype == ISN_COMPARESPECIAL
705705
|| isntype == ISN_COMPARENR
706706
|| isntype == ISN_COMPAREFLOAT))
707707
{
708708
semsg(_(e_cannot_use_str_with_str),
709-
exptype == EXPR_IS ? "is" : "isnot" , vartype_name(type1));
709+
exprtype == EXPR_IS ? "is" : "isnot" , vartype_name(type1));
710710
return ISN_DROP;
711711
}
712712
if (isntype == ISN_DROP
713-
|| ((exptype != EXPR_EQUAL && exptype != EXPR_NEQUAL
713+
|| ((exprtype != EXPR_EQUAL && exprtype != EXPR_NEQUAL
714714
&& (type1 == VAR_BOOL || type1 == VAR_SPECIAL
715715
|| type2 == VAR_BOOL || type2 == VAR_SPECIAL)))
716-
|| ((exptype != EXPR_EQUAL && exptype != EXPR_NEQUAL
717-
&& exptype != EXPR_IS && exptype != EXPR_ISNOT
716+
|| ((exprtype != EXPR_EQUAL && exprtype != EXPR_NEQUAL
717+
&& exprtype != EXPR_IS && exprtype != EXPR_ISNOT
718718
&& (type1 == VAR_BLOB || type2 == VAR_BLOB
719719
|| type1 == VAR_LIST || type2 == VAR_LIST))))
720720
{
@@ -726,7 +726,7 @@ get_compare_isn(exptype_T exptype, vartype_T type1, vartype_T type2)
726726
}
727727

728728
int
729-
check_compare_types(exptype_T type, typval_T *tv1, typval_T *tv2)
729+
check_compare_types(exprtype_T type, typval_T *tv1, typval_T *tv2)
730730
{
731731
if (get_compare_isn(type, tv1->v_type, tv2->v_type) == ISN_DROP)
732732
return FAIL;
@@ -737,7 +737,7 @@ check_compare_types(exptype_T type, typval_T *tv1, typval_T *tv2)
737737
* Generate an ISN_COMPARE* instruction with a boolean result.
738738
*/
739739
static int
740-
generate_COMPARE(cctx_T *cctx, exptype_T exptype, int ic)
740+
generate_COMPARE(cctx_T *cctx, exprtype_T exprtype, int ic)
741741
{
742742
isntype_T isntype;
743743
isn_T *isn;
@@ -752,13 +752,13 @@ generate_COMPARE(cctx_T *cctx, exptype_T exptype, int ic)
752752
// checking.
753753
type1 = ((type_T **)stack->ga_data)[stack->ga_len - 2]->tt_type;
754754
type2 = ((type_T **)stack->ga_data)[stack->ga_len - 1]->tt_type;
755-
isntype = get_compare_isn(exptype, type1, type2);
755+
isntype = get_compare_isn(exprtype, type1, type2);
756756
if (isntype == ISN_DROP)
757757
return FAIL;
758758

759759
if ((isn = generate_instr(cctx, isntype)) == NULL)
760760
return FAIL;
761-
isn->isn_arg.op.op_type = exptype;
761+
isn->isn_arg.op.op_type = exprtype;
762762
isn->isn_arg.op.op_ic = ic;
763763

764764
// takes two arguments, puts one bool back
@@ -3348,10 +3348,10 @@ get_vim_constant(char_u **arg, typval_T *rettv)
33483348
}
33493349
}
33503350

3351-
exptype_T
3351+
exprtype_T
33523352
get_compare_type(char_u *p, int *len, int *type_is)
33533353
{
3354-
exptype_T type = EXPR_UNKNOWN;
3354+
exprtype_T type = EXPR_UNKNOWN;
33553355
int i;
33563356

33573357
switch (p[0])
@@ -4346,7 +4346,7 @@ compile_expr5(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
43464346
static int
43474347
compile_expr4(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
43484348
{
4349-
exptype_T type = EXPR_UNKNOWN;
4349+
exprtype_T type = EXPR_UNKNOWN;
43504350
char_u *p;
43514351
char_u *next;
43524352
int len = 2;

src/vim9execute.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2725,11 +2725,11 @@ call_def_function(
27252725
{
27262726
typval_T *tv1 = STACK_TV_BOT(-2);
27272727
typval_T *tv2 = STACK_TV_BOT(-1);
2728-
exptype_T exptype = iptr->isn_arg.op.op_type;
2728+
exprtype_T exprtype = iptr->isn_arg.op.op_type;
27292729
int ic = iptr->isn_arg.op.op_ic;
27302730

27312731
SOURCING_LNUM = iptr->isn_lnum;
2732-
typval_compare(tv1, tv2, exptype, ic);
2732+
typval_compare(tv1, tv2, exprtype, ic);
27332733
clear_tv(tv2);
27342734
--ectx.ec_stack.ga_len;
27352735
}

0 commit comments

Comments
 (0)