@@ -71,18 +71,12 @@ if "%fccreate%" == "true" (
7171 exit /b
7272)
7373set fccomment = false
74- set wloopnum = 0
75- set wloopnum2 = 0
7674set proctar = something
7775set inlftar = something
7876set classtar = something
7977set methodtar = something
8078set fchcomment = false
81- set matchInd = 0
82- set forInd = 0
83- set wloopInd = 0
84- set wloopInd2 = 0
85- set prevLoopInd = 0
79+ set /a wloopnum = 0, wloopnum2 = 0, matchInd = 0, forInd = 0, wloopInd = 0, wloopInd2 = 0, prevLoopInd = 0
8680echo @echo off> %output% .bat
8781if " %2 " == " --de-enabled" echo setlocal enabledelayedexpansion>> %output% .bat
8882if " %3 " == " --de-enabled" echo setlocal enabledelayedexpansion>> %output% .bat
@@ -264,73 +258,24 @@ for /f "tokens=* delims= " %%x in (%output%.fclang) do (
264258 )
265259 )
266260 )
267- if %%a == string_reverse[] (
268- call libgen string reverse
269- set printString = !printString:string_reverse[] =call fclib_string_reverse.bat !
270- )
271- if %%a == string_length[] (
272- call libgen string length
273- set printString = !printString:string_length[] =call fclib_string_length.bat !
274- )
275- if %%a == string_slice[] (
276- call libgen string slice
277- set printString = !printString:string_slice[] =call fclib_string_slice.bat !
278- )
279- if %%a == string_upper[] (
280- call libgen string upper
281- set printString = !printString:string_upper[] =call fclib_string_upper.bat !
282- )
283- if %%a == string_lower[] (
284- call libgen string lower
285- set printString = !printString:string_lower[] =call fclib_string_lower.bat !
286- )
287- if %%a == string_chr[] (
288- call libgen string chr
289- set printString = !printString:string_chr[] =call fclib_string_chr.bat !
290- )
291- if %%a == string_ord[] (
292- call libgen string ord
293- set printString = !printString:string_ord[] =call fclib_string_ord.bat !
294- )
295- if %%a == string_indexOf[] (
296- call libgen string indexOf
297- set printString = !printString:string_indexOf[] =call fclib_string_indexOf.bat !
298- )
299- if %%a == string_lastIndexOf[] (
300- call libgen string lastIndexOf
301- set printString = !printString:string_lastIndexOf[] =call fclib_string_lastIndexOf.bat !
302- )
303- if %%a == string_trim[] (
304- call libgen string trim
305- set printString = !printString:string_trim[] =call fclib_string_trim.bat !
306- )
307- if %%a == string_startswith[] (
308- call libgen string startwith
309- set printString = !printString:string_startswith[] =call fclib_string_startwith.bat !
310- )
311- if %%a == string_endswith[] (
312- call libgen string endwith
313- set printString = !printString:string_endswith[] =call fclib_string_endwith.bat !
314- )
315- if %%a == factorial[] (
316- call libgen math fact
317- set printString = !printString:factorial[] =call fclib_math_fact.bat !
318- )
319- if %%a == odd[] (
320- call libgen math odd
321- set printString = !printString:odd[] =call fclib_math_odd.bat !
322- )
323- if %%a == even[] (
324- call libgen math even
325- set printString = !printString:even[] =call fclib_math_even.bat !
326- )
327- if %%a == pow[] (
328- call libgen math pow
329- set printString = !printString:pow[] =call fclib_math_pow.bat !
330- )
331- if %%a == abs[] (
332- call libgen math abs
333- set printString = !printString:abs[] =call fclib_math_abs.bat !
261+ if " !ch:~-2 ! " == " []" (
262+ call :get_len chlen !ch!
263+ set /a chlen -= 2
264+ for %%i in (!chlen! ) do set chl = !ch:~0 ,%%i !
265+ for %%i in (!ch! ) do (
266+ if " !ch:~0 ,7 ! " == " string_" (
267+ call libgen string !chl:~7 !
268+ for %%j in (!chl:~7 ! ) do set printString = !printString:%%i =call fclib_string_%%j.bat !
269+ )
270+ if " !ch:~0 ,5 ! " == " math_" (
271+ call libgen math !chl:~5 !
272+ for %%j in (!chl:~5 ! ) do set printString = !printString:%%i =call fclib_math_%%j.bat !
273+ )
274+ if " !ch:~0 ,4 ! " == " arr_" (
275+ call libgen array !chl:~4 !
276+ for %%j in (!chl:~4 ! ) do set printString = !printString:%%i =call fclib_array_%%j.bat !
277+ )
278+ )
334279 )
335280 if %%a == max[] (
336281 call libgen list max
@@ -344,74 +289,6 @@ for /f "tokens=* delims= " %%x in (%output%.fclang) do (
344289 call libgen list sum
345290 set printString = !printString:sum[] =call fclib_list_sum.bat !
346291 )
347- if %%a == arr_qsort[] (
348- call libgen array qsort
349- set printString = !printString:arr_qsort[] =call fclib_array_qsort.bat !
350- )
351- if %%a == arr_max[] (
352- call libgen array max
353- set printString = !printString:arr_max[] =call fclib_array_max.bat !
354- )
355- if %%a == arr_min[] (
356- call libgen array min
357- set printString = !printString:arr_min[] =call fclib_array_min.bat !
358- )
359- if %%a == arr_sum[] (
360- call libgen array sum
361- set printString = !printString:arr_sum[] =call fclib_array_sum.bat !
362- )
363- if %%a == arr_join[] (
364- call libgen array join
365- set printString = !printString:arr_join[] =call fclib_array_join.bat !
366- )
367- if %%a == arr_push[] (
368- call libgen array push
369- set printString = !printString:arr_push[] =call fclib_array_push.bat !
370- )
371- if %%a == arr_pop[] (
372- call libgen array pop
373- set printString = !printString:arr_pop[] =call fclib_array_pop.bat !
374- )
375- if %%a == arr_shift[] (
376- call libgen array shift
377- set printString = !printString:arr_shift[] =call fclib_array_shift.bat !
378- )
379- if %%a == arr_unshift[] (
380- call libgen array unshift
381- set printString = !printString:arr_unshift[] =call fclib_array_unshift.bat !
382- )
383- if %%a == arr_clear[] (
384- call libgen array clear
385- set printString = !printString:arr_clear[] =call fclib_array_clear.bat !
386- )
387- if %%a == arr_fill[] (
388- call libgen array fill
389- set printString = !printString:arr_fill[] =call fclib_array_fill.bat !
390- )
391- if %%a == arr_splice[] (
392- call libgen array splice
393- set printString = !printString:arr_splice[] =call fclib_array_splice.bat !
394- )
395- if %%a == arr_reverse[] (
396- call libgen array reverse
397- set printString = !printString:arr_reverse[] =call fclib_array_reverse.bat !
398- )
399- if %%a == arr_length[] (
400- call libgen array len
401- set printString = !printString:arr_length[] =call fclib_array_len.bat !
402- )
403- if %%a == arr_indexOf[] (
404- call libgen array indexOf
405- set printString = !printString:arr_indexOf[] =call fclib_array_indexOf.bat !
406- )
407- if %%a == arr_includes[] (
408- call libgen array includes
409- set printString = !printString:arr_includes[] =call fclib_array_includes.bat !
410- )
411- if %%a == arr_lastIndexOf[] (
412- call libgen array lastIndexOf
413- set printString = !printString:arr_lastIndexOf[] =call fclib_array_lastIndexOf.bat !
414- )
415292 if %%a == deny[] (
416293 echo .> %output% .bat
417294 set deniedToken = true
@@ -423,8 +300,10 @@ for /f "tokens=* delims= " %%x in (%output%.fclang) do (
423300 set fccondition = !printString:while[] =!
424301 set fcpos[!wloopInd!] = !wloopnum!
425302 for %%i in (!wloopInd! ) do (
426- echo :WhileLoop!fcpos[%%i ]! >> !outtar!
427- echo if not !fccondition! goto EndLoop!fcpos[%%i ]! >> !outtar!
303+ (
304+ echo :WhileLoop!fcpos[%%i ]!
305+ echo if not !fccondition! goto EndLoop!fcpos[%%i ]!
306+ )>> !outtar!
428307 )
429308 set /a wloopnum += 1
430309 set /a wloopInd += 1
@@ -434,25 +313,24 @@ for /f "tokens=* delims= " %%x in (%output%.fclang) do (
434313 if %%a == for[] (
435314 set prevLoop[!prevLoopInd!] = for
436315 if " !procadd! " == " true" (set outtar=!proctar! .bat) else if " !inlfadd! " == " true" (set outtar=!inlftar! .inline) else (set outtar=%output% .bat)
437- set turn = 0
438316 set process = !printString:for[] =!
439- for %%i in (!process! ) do (
440- if !turn! == 0 set varname[!forInd!] = %%i
441- if !turn! == 1 set start[!forInd!] = %%i
442- if !turn! == 2 set step[!forInd!] = %%i
443- if !turn! == 3 set end[!forInd!] = %%i
444- set /a turn += 1
317+ for /f " tokens=1-4 delims= " %%i in (" !process! " ) do (
318+ set varname[!forInd!] = %%i
319+ set start[!forInd!] = %%j
320+ set step[!forInd!] = %%k
321+ set end[!forInd!] = %%l
445322 )
446323 set fcpos[!wloopInd!] = !wloopnum!
447324 for %%i in (!wloopInd! ) do (
448- for %%s in (!forInd! ) do echo set !varname[%%s ]! =!start[%%s ]! >> !outtar!
449- for %%s in (!forInd! ) do echo :WhileLoop!fcpos[%%i ]! >> !outtar!
450- for %%s in (!forInd! ) do echo if ^^! !varname[%%s ]! ^^! GEQ !end[%%s ]! goto EndLoop!fcpos[%%i ]! >> !outtar!
325+ for %%s in (!forInd! ) do (
326+ (
327+ echo set !varname[%%s ]! =!start[%%s ]!
328+ echo :WhileLoop!fcpos[%%i ]!
329+ echo if ^^! !varname[%%s ]! ^^! GEQ !end[%%s ]! goto EndLoop!fcpos[%%i ]!
330+ )>> !outtar!
331+ )
451332 )
452- set /a wloopnum += 1
453- set /a wloopInd += 1
454- set /a forInd += 1
455- set /a prevLoopInd += 1
333+ set /a wloopnum += 1, wloopInd += 1, forInd += 1, prevLoopInd += 1
456334 set deniedToken = true
457335 )
458336 set whileCheck = false
@@ -513,9 +391,11 @@ for /f "tokens=* delims= " %%x in (%output%.fclang) do (
513391 set /a _wloopInd2 = ! wloopInd2! - 1
514392 set fccondition2 = !printString:until[] =!
515393 for %%i in (!_wloopInd2! ) do (
516- echo if !fccondition2! goto UntilLoop!fcpos2[%%i ]! >> !outtar!
517- echo goto RepeatLoop!fcpos2[%%i ]! >> !outtar!
518- echo :UntilLoop!fcpos2[%%i ]! >> !outtar!
394+ (
395+ echo if !fccondition2! goto UntilLoop!fcpos2[%%i ]!
396+ echo goto RepeatLoop!fcpos2[%%i ]!
397+ echo :UntilLoop!fcpos2[%%i ]!
398+ )>> !outtar!
519399 )
520400 set /a wloopInd2 -= 1
521401 set deniedToken = true
@@ -695,7 +575,7 @@ if "%fcread%" == "true" type %output%.bat
695575if not " %fccompile% " == " true" if not " %fcread% " == " true" call %output% .bat
696576exit /b
697577:fcversion
698- echo FreakC DevKit Version 0.19.2 BETA
578+ echo FreakC DevKit Version 0.19.3 BETA
699579exit /b
700580
701581:get_len
0 commit comments