Closed steve02081504 closed 2 years ago
I think that v1.2.0 has supported it to some extent.
It seems that one of the reasons for the long log is that the reference* is undefined. I think the reason is that yayalint cannot detect variable definitions by LETTONAME or EVAL.
However, due to my lack of programming skills, it is difficult to detect them.
I think it's a bit too difficult to detect EVAL How about adding a regular expression filter just like the function?
I was able to implement it maybe in v1.3.1, please try it out.
Sorry, I've just been to two exams
I added ^reference%d+$
to the list of predefined variables, but it seems that the error log is not reduced as expected
Here is my configuration file & the output
I'm sorry. There was a mistake in the program. It is probably fixed in v1.3.2.
Thank you for all your hard work! I'm wondering if the filtering of functions uses the same logic as variables though, and only the variable part was changed in this revision?
Yes, the variable part only. Are there any problems remaining?
Yes, I've noticed that some functions are reported as errors even in the predefine or used list, such as IARRAY
and some others.
slight modification for yayalint
It must be because it was recognized as a variable, not a function.
I think function calls with no arguments should be written as IARRAY()
, not IARRAY
.
That way, syntax highlighting works and is easier for us to understand.
Oh I just noticed that these hints are talking about variables, sorry for the misstatement
But I think not having to write call signs after functions is a special feature of yaya, and one that can sometimes make code more concise - even if the syntax is sometimes misleading.
Although somewhat cumbersome, I wonder if lint could force any variable that hits the func.predefined
rule to be treated as a function, and reorganise the function list after reading the full dic file contents to circumvent any function misclassification as a variable?
maybe fixed in v1.3.6.
attempt to index a nil value
stack traceback:
[C]: in for iterator 'for iterator'
...ers\steve02081504\Desktop\temp\yayalint\user_defined.lua:241: in function 'user_defined.isUserDefinedFunction'
[string "yayalint"]:753: in upvalue 'recursive'
[string "yayalint"]:543: in upvalue 'recursive'
[string "yayalint"]:849: in upvalue 'interpret'
[string "yayalint"]:985: in local 'main'
[string "yayalint"]:990: in local 'func'
[string "yayalint"]:41: in main chunk
Press any key to continue . . .
This appeared when I was using the latest version of yayalint Hope this helps
That error should not occur, so the configuration may be wrong. Is func.predefined missing?
Please use v1.3.7 or later, as another bug was found in v1.3.6.
Oh sorry my life has been a bit chaotic lately, I have just made a mistakeπ
I wonder if lint could force any variable that hits the func.predefined rule to be treated as a function, and reorganise the function list after reading the full dic file contents to circumvent any function misclassification as a variable?
I'm still looking forward to future updates that will make it possible to recognise functions without the call sign!π±βπ Thanks for all this XD
It is supported in v1.3.7 or later.
I'm sorry to have taken your time.
Oh sorry I got it wrong again BTW, There are two small problems here:
syntax error: ../dic\games\Gobang\Gobang.dic before line 970 col 9 data elseif fight-defense>-8
syntax error: ../dic\games\linkwnd.dic before line 2270 col 62 data for _buff = FREAD(_mapfile);_buff != -1&& _buff !='';;_buff = FREAD(_mapfile){
syntax error: ../dic\games\linkwnd.dic before line 2270 col 62 data for _buff = FREAD(_mapfile);_buff != -1&& _buff !='';;_buff = FREAD(_mapfile){
This is fixed in v1.3.9. However, Gobang.dic line 969
k1=0.5f
^
It's odd to have f
(is variable?) right after a number.
Thanks for the info, I fixed it! I think it was a minor error on the part of whoever wrote the function, although I'm not sure why such code wouldn't cause yaya to report error.π
I still have some suggestions for information purposes:
username
as usermane
or uername
, but I don't think lint will warn if I assign a value to a misspelled variableProvide a function to ignore unused functions and global variables in a specific dic or dicdir lint configuration files placed in the ghost directory
Maybe implemented in v1.4.1.
Warn about similar variable names
If there are few typos, you will usually get an unused or undefined warning. It is possible to output the correct variable name at that time.
If the lint always checks to see if the variable name is correct, it will be difficult to determine if the variable name is correct, especially if the name is short.
[string "yayalint"]:747: attempt to concatenate a nil value (field 'col')
stack traceback:
[string "yayalint"]:747: in upvalue 'recursive'
[string "yayalint"]:854: in upvalue 'interpret'
[string "yayalint"]:991: in local 'main'
[string "yayalint"]:996: in local 'func'
[string "yayalint"]:41: in main chunk
Press any key to continue . . .
Sorry, I've been on my way home for the past 2 days so I haven't had time to touch the computer After I updated yayalint to the latest version, I got this error This time I checked carefully and there should be no config error
Sorry, it's my mistake. fixed in v1.5.2.
_l="%(_lunar[0])εΉ΄%(_lunar[1])ζ%(_lunar[2])ζ₯γ%(_lunar[7])\n%(_lunar[4])(%(_lunar[3]))εΉ΄ %(_lunar[5])ζ%(_lunar[6])\n%(_jieqi)%(_lunar[12])(%(_lunar[13])ζ%(_lunar[14])ζ₯)\n%(_lunar[9])\n%(_lunar[10])"
if _i+1==_d
_w+="\_l[%(_x-5),%(_y)][\q[%(_i+1),OnCalendar,%(_l),%(_year),%(_m),%(_i+1),##]]"
elseif _i+1==day && _m==month && _year==year
_w+="\_l[%(_x),%(_y)]\f[color,110,110,110]\f[underline,1]\q[%(_i+1),OnCalendar,%(_l),%(_year),%(_m),%(_i+1),##]\f[default]\f[sup,1]β\f[default]"
elseif _lunar[17]==0 || _lunar[17]==6
_w+="\f[color,255,0,0]\_l[%(_x),%(_y)]\q[%(_i+1),OnCalendar,%(_l),%(_year),%(_m),%(_i+1),##]\f[color,default]"
elseif _lunar[9] || _lunar[10]
_w+="\f[color,110,110,110]\_l[%(_x),%(_y)]\q[%(_i+1),OnCalendar,%(_l),%(_year),%(_m),%(_i+1),##]\f[default]"
else
_w+="\_l[%(_x),%(_y)]\q[%(_i+1),OnCalendar,%(_l),%(_year),%(_m),%(_i+1),##]"
I have this code where _l
is only used in the %()
formatting character in the string
But it looks like lint doesn't detect this use and marks _l
as an unused variable
Could you please provide a fix for this problem?
maybe fixed in v1.5.3.
Thanks for your efforts! Basically there are ok now, if I find any new ones later I will open another issue
Uh, this bunch of error messages is caused by me using yayalint like this:
I'm not sure if I'm using it right, but I think these are too many errors in report.
lint_with_taro.log
Some obvious possible changes you can do:
_loading_order_override
or_loading_order
file not foundload
,unload
, andrequest
functions as root functionsI'm not sure how much this error log tells us(After all, I know almost nothing about lua), but I thought it might give you some help! If you don't like this, feel free to close the issue
For testing purposes, you might consider clone Taromati2/ghost.