Compare commits
1387 Commits
weekly.202
...
master
Author | SHA1 | Date |
---|---|---|
Jef Roosens | e9aca12560 | |
Jef Roosens | ad966c29c2 | |
Jef Roosens | 0e3efb655e | |
Jef Roosens | b817f8ebc9 | |
Jef Roosens | 3d0ecd0a2d | |
Jef Roosens | 77b5845c2c | |
CC | d336b7b877 | |
Delyan Angelov | ccc3271493 | |
Emirhan Yener | e5bbb23389 | |
Wertzui123 | c10ba6d81a | |
Delyan Angelov | b0fe21f018 | |
Alexander Medvednikov | c17200c33d | |
Larpon | 298dc77c38 | |
yuyi | e9a8f5fcc7 | |
Wertzui123 | 587101a1ea | |
Delyan Angelov | 2524207d1c | |
Alexander Medvednikov | 78c527b243 | |
Alexander Medvednikov | dbc51a4579 | |
l-m | ed8c63cc0b | |
Delyan Angelov | a7108ff05c | |
Delyan Angelov | b8d9bfec16 | |
Delyan Angelov | 436081a9f5 | |
Delyan Angelov | 1b87a4770c | |
Delyan Angelov | 856270cac2 | |
Alexander Medvednikov | 989c5e26f5 | |
Alexander Medvednikov | fe673e7963 | |
Alexander Medvednikov | ae2183043b | |
Dialga | 5cd5d551e3 | |
Alexander Medvednikov | c9ab086029 | |
yuyi | e6c3de2f46 | |
Larpon | 3fb88500a2 | |
yuyi | 585b5145fa | |
Delyan Angelov | 6a4ba22eae | |
pancake | 23d1c792c0 | |
Delyan Angelov | 74fb473301 | |
Delyan Angelov | 6c060b76fd | |
Delyan Angelov | 48b2ab157b | |
yuyi | c64c4907a2 | |
Delyan Angelov | e2e3992e0d | |
ghosttk | 8172fecb51 | |
Larpon | 9f5e442dab | |
yuyi | c160ba2a8d | |
Delyan Angelov | c6f94e9cab | |
yuyi | cab6355a38 | |
Delyan Angelov | f08c768c8e | |
Ulises Jeremias Cornejo Fandos | e505fcdac0 | |
yuyi | f6f77e5264 | |
David 'Epper' Marshall | 524df8da1b | |
Delyan Angelov | 473d26ce47 | |
pancake | 1caff5b379 | |
yuyi | 8703e336e0 | |
Delyan Angelov | 1fc9e1a716 | |
Delyan Angelov | fa2e8d8459 | |
Delyan Angelov | 0e4198f23b | |
yuyi | cf1fc6f090 | |
Alexander Medvednikov | 924239026c | |
Alexander Medvednikov | bc60b0d1a3 | |
Alexander Medvednikov | d215618f4c | |
yuyi | de136f6baf | |
Delyan Angelov | 37ef1ee453 | |
Delyan Angelov | 7b1ade237b | |
Delyan Angelov | b9cb56572f | |
Alexander Medvednikov | 6875a173ec | |
Delyan Angelov | 97be840a6d | |
lemon | e0310964d9 | |
Alexander Medvednikov | 10051e005a | |
wahur666 | 18dfaf6164 | |
yuyi | 01fdd5d07f | |
Alexander Medvednikov | b89617726c | |
Louis Schmieder | 5df3d8ac75 | |
Alexander Medvednikov | fb5a40d1c8 | |
yuyi | 26714fadc5 | |
Alexander Medvednikov | 9c72b85f72 | |
Danilo Lekovic | df239b9208 | |
yuyi | f2962c34dd | |
Delyan Angelov | 205221074c | |
yuyi | 0c1708db23 | |
yuyi | 5135952c9c | |
yuyi | 7f38b92ca8 | |
yuyi | 7c50d276c7 | |
lemon | e4e858b132 | |
yuyi | 6d8a0ad15d | |
Spydr | 2f1a896d18 | |
Leo Developer | 67716b5b59 | |
yuyi | 5efa67906c | |
yuyi | 3535927bcd | |
Delyan Angelov | 139c34c07d | |
Delyan Angelov | 4682e17ac1 | |
Delyan Angelov | 7e06203da8 | |
Delyan Angelov | ff8e286c88 | |
Spydr | 5c104cf981 | |
Spydr | 8fa1e30dd2 | |
Alexander Medvednikov | f08266ab66 | |
Joe Conigliaro | f3351b6a29 | |
Delyan Angelov | 5cea8d30fa | |
yuyi | a538ab7e8c | |
yuyi | cdf4ffc513 | |
lemon | c7a619d16e | |
Dialga | da7a166708 | |
spaceface | 26d051475a | |
Delyan Angelov | b27b6b2047 | |
yuyi | fcaf529228 | |
Larpon | 690a8422d1 | |
Delyan Angelov | f4869bcdc6 | |
Delyan Angelov | ea71ea3ec1 | |
yuyi | 922f003729 | |
Larpon | be23ddc253 | |
yuyi | 784361f153 | |
Delyan Angelov | e1360ccf8c | |
Ben | 39e54a508b | |
spaceface | 4ed9780b80 | |
yuyi | e6580fefaa | |
Spydr | 8563696476 | |
Larpon | f58e5a94c2 | |
Ben | c6b1c8d07a | |
Mikey | 5ac9b5c9f1 | |
Delyan Angelov | 4b3c3d9082 | |
Larpon | 96a9faf2fd | |
David Valdespino Pavon | 1d462136bc | |
Larpon | 8027919285 | |
Delyan Angelov | 82594c0156 | |
Delyan Angelov | a942ecf737 | |
Delyan Angelov | 82d23dedf1 | |
yuyi | 7780f56c31 | |
ChAoS_UnItY | 73b59c7b16 | |
yuyi | abf35270cf | |
ChAoS_UnItY | ce26d5bc5c | |
Delyan Angelov | 778fe2cde0 | |
Delyan Angelov | 6398043094 | |
Alexander Medvednikov | 7f67981637 | |
yuyi | 8a2236d3f8 | |
Alexander Medvednikov | e89a6269e4 | |
yuyi | ce771876a3 | |
ChAoS_UnItY | df80b33dc0 | |
Leo Developer | 3a90d8ef14 | |
Ikko Ashimine | 7b25957a26 | |
ChAoS_UnItY | b000728845 | |
yuyi | 4cf6abd99d | |
ChAoS_UnItY | f6ebbc99cd | |
yuyi | 5d429140a4 | |
Wertzui123 | d71fd04c81 | |
Delyan Angelov | 3c5ae41712 | |
Delyan Angelov | 3ac3375b43 | |
Delyan Angelov | 82eb495617 | |
Delyan Angelov | f2171b4148 | |
Delyan Angelov | 4cfff58fdf | |
Alexander Medvednikov | a8461a900d | |
yuyi | 66572d5ead | |
Delyan Angelov | c15d1c6e7e | |
Delyan Angelov | 6f9070e06d | |
Delyan Angelov | dbaecdc058 | |
yuyi | daa94de93f | |
yuyi | dcbd8d6405 | |
ChAoS_UnItY | 65066098d8 | |
yuyi | 251716fa0e | |
Delyan Angelov | 9f7656f328 | |
Delyan Angelov | c892b3203e | |
Hunam | 41414b5d5f | |
Delyan Angelov | aae5b9fb95 | |
Delyan Angelov | ed759b2ec9 | |
Delyan Angelov | 031629faa1 | |
Delyan Angelov | 9a0ec7f367 | |
yuyi | 545eaae77b | |
Alexander Medvednikov | 8b0e843cb8 | |
yuyi | 10fb16e00b | |
Claudio Cesar de Sá | 5bf246fce6 | |
Ben | e201665e92 | |
Wertzui123 | f971da9a93 | |
ChAoS_UnItY | a95cdac635 | |
yuyi | 55951e0943 | |
Hunam | d0a1608ede | |
yuyi | 33a2d00445 | |
Delyan Angelov | bf70f0b436 | |
Delyan Angelov | c91b646372 | |
yuyi | 786045c7da | |
Delyan Angelov | 5a2c271bd4 | |
Delyan Angelov | 2fa64f1471 | |
yuyi | fefb9643b2 | |
Delyan Angelov | 846ddfd728 | |
Alexander Medvednikov | f40c30c3dc | |
Alexander Medvednikov | c54c9b817c | |
Larpon | 84e375e38a | |
yuyi | 80cc88427b | |
playX | db34adaec8 | |
Delyan Angelov | dc30089c74 | |
Ben | 4ffdcf8058 | |
Delyan Angelov | 928dafeb6d | |
Delyan Angelov | fc64f09f0b | |
Delyan Angelov | 0f3b2c2ae7 | |
Delyan Angelov | 58ebc0680e | |
yuyi | 844ba2a177 | |
Hunam | 78d1b7f4ef | |
yuyi | 2c5febe25e | |
yuyi | 79d861ad4f | |
Delyan Angelov | 63d15086e7 | |
Delyan Angelov | c006d5c242 | |
yuyi | c0ef6dbde8 | |
yuyi | 7dcc19df55 | |
Delyan Angelov | c6a6eb9a3c | |
yuyi | b8e8768928 | |
yuyi | a46cf10e92 | |
Delyan Angelov | 4894f61998 | |
yuyi | a971b9a99a | |
Larpon | f3e7f24ee6 | |
spaceface | 52a3e5e780 | |
Delyan Angelov | f7995c8916 | |
Delyan Angelov | 36cb552918 | |
Delyan Angelov | 156aa661ee | |
Louis Schmieder | a83ac948a0 | |
yuyi | b97ef09b2d | |
Delyan Angelov | bb6ef8bba8 | |
Delyan Angelov | 8c969efe6b | |
Wertzui123 | 1017335365 | |
yuyi | 3849cdcecc | |
Delyan Angelov | 410b57b2fa | |
Larpon | 95cc535fc7 | |
Larpon | 9f5e999b4a | |
Larpon | 6c08af63ff | |
yuyi | 59e57f0c62 | |
kahsa | dd8c96f6bc | |
Delyan Angelov | 31c234485a | |
yuyi | e19ac0c4a7 | |
yuyi | 79a75c5ac0 | |
yuyi | 0eb3f8854d | |
Ben | f431020764 | |
yuyi | f35f7fe997 | |
yuyi | a5b98cb267 | |
yuyi | 5ade39f8db | |
Delyan Angelov | 953ef1f8c9 | |
Delyan Angelov | dda49fe735 | |
yuyi | a3c0a9b791 | |
yuyi | 4ef9e2c05a | |
Alexander Medvednikov | 863eeca2e0 | |
Daniel Däschle | 5e95bdc451 | |
yuyi | 7f03b89611 | |
spaceface | ba859c584b | |
Delyan Angelov | 5328dabad1 | |
spaceface | e5ff2ab455 | |
yuyi | 1f3336c9d3 | |
Alexander Medvednikov | 245d28d57a | |
Daniel Däschle | d3ffd983c8 | |
Subhomoy Haldar | 3647fb4def | |
Delyan Angelov | 64a686f41f | |
yuyi | 50ab2cfd1a | |
Delyan Angelov | 0ceb16f285 | |
Delyan Angelov | c0dcc80e18 | |
Delyan Angelov | a7afb2d1eb | |
Ben | 971c55cf30 | |
Daniel Däschle | efc5cab8c3 | |
Alexander Medvednikov | 53c217fe5e | |
Vincenzo Palazzo | 17bba712bd | |
Daniel Däschle | d81fbb1ccd | |
Delyan Angelov | dd1049f21d | |
yuyi | 28b0cbddad | |
yuyi | 913164bc73 | |
yuyi | bf44572f30 | |
StunxFS | 11bdb04d0c | |
Delyan Angelov | ca00b59b3f | |
David 'Epper' Marshall | 120f31b4d9 | |
David 'Epper' Marshall | 23568f19da | |
crthpl | 95d24e543d | |
yuyi | 55e7daa2f9 | |
crthpl | 46f94e8d68 | |
Daniel Däschle | a52fbc5e51 | |
yuyi | 3291c59ebf | |
Delyan Angelov | 634e8c3624 | |
yuyi | 15c62bc8e8 | |
Delyan Angelov | 25812e52f0 | |
Delyan Angelov | a52590572f | |
Delyan Angelov | 3d5617c4fa | |
Delyan Angelov | 809b1ca3b4 | |
yuyi | b482c0512b | |
Delyan Angelov | 805a7d9713 | |
yuyi | 5b96f7e8fd | |
yuyi | 4cbfa884c5 | |
Delyan Angelov | f2447a4bd8 | |
Delyan Angelov | 2cc3b74e19 | |
Larpon | 9de0c725f6 | |
Adam Oates | a786c58d0a | |
yuyi | 417a6dc506 | |
Larpon | 8eea861c93 | |
Delyan Angelov | ed17779434 | |
Delyan Angelov | ebac3bebb1 | |
playX | a608516b82 | |
spaceface | b5fb848508 | |
Delyan Angelov | 65d9c8fa6f | |
Delyan Angelov | dfa2d63616 | |
Delyan Angelov | 4e56147223 | |
Alexander Medvednikov | 2a06290ac7 | |
Ned | db4b49a5ca | |
Delyan Angelov | da42f0d42b | |
Delyan Angelov | 3fc4459485 | |
yuyi | 020845f6c3 | |
yuyi | d7b1e57186 | |
yuyi | 60e817ff32 | |
yuyi | d6aa85d059 | |
playX | 7c6eaa8204 | |
Delyan Angelov | 78ab3296c9 | |
WoodyAtHome | 02c8a6057c | |
Alexander Medvednikov | d10f83ce15 | |
playX | bc397bb0e1 | |
Delyan Angelov | 32dd801201 | |
Delyan Angelov | 9cb8bb2968 | |
yuyi | c624de8523 | |
Delyan Angelov | e5c7fe3006 | |
Delyan Angelov | 39874ae168 | |
yuyi | d59f4e9479 | |
Larpon | ef6225c542 | |
yuyi | 0ab4133128 | |
spaceface | 36bec823c2 | |
WoodyAtHome | c2b763655d | |
Delyan Angelov | 1cf683d482 | |
Delyan Angelov | b4c529066a | |
Ben | cbb24d34c9 | |
yuyi | 7fe3ef9a6e | |
Larpon | 5068b8b293 | |
Jah-On | 02e026e298 | |
WoodyAtHome | eeff02a8ee | |
spaceface | c01a8a1737 | |
Delyan Angelov | c2bc9f4960 | |
crthpl | e4065bd57b | |
David 'Epper' Marshall | c28051020a | |
Delyan Angelov | b50f7fdc71 | |
Delyan Angelov | c70e18ea8f | |
Delyan Angelov | 3a09ccc80a | |
Larpon | dd6629e932 | |
David 'Epper' Marshall | 8d141878ce | |
Delyan Angelov | 67963e0ff2 | |
Delyan Angelov | 1225a865a3 | |
yuyi | fe9f97074b | |
Alexander Medvednikov | 3adad32355 | |
Alexander Medvednikov | b42c824cdb | |
Daniel Däschle | f0d46413d9 | |
JalonSolov | b3e80a3100 | |
j. redhead | 441637eeb4 | |
Delyan Angelov | cee7856c0f | |
Delyan Angelov | 714ce4e7fc | |
Delyan Angelov | c1bafe7a5a | |
playX | 6ec4185017 | |
Daniel Däschle | d407a6449d | |
Delyan Angelov | ed12a5c84c | |
yuyi | 3c95504a35 | |
Daniel Däschle | d679146a80 | |
Delyan Angelov | df029da942 | |
Daniel Däschle | 0972e67f72 | |
Delyan Angelov | 8ef9dc6247 | |
Delyan Angelov | 668d1b04d2 | |
Hunam | 20139ad756 | |
playX | 4952967366 | |
yuyi | f48f7014f0 | |
penguindark | e93a8766e5 | |
Delyan Angelov | b7ca4c1668 | |
yuyi | 8830af5c89 | |
yuyi | 5bc4fea9e0 | |
CC | 901b8f0c24 | |
spaceface | 49382f1f43 | |
Emily Hudson | c19b037880 | |
yuyi | cd4fa041ff | |
Larpon | 34a252ef84 | |
David 'Epper' Marshall | 26b81d68b5 | |
Larpon | 0ec1c8d9f0 | |
yuyi | 3afc7c4c6d | |
Delyan Angelov | cf536b848b | |
yuyi | 8f765ed5f1 | |
yuyi | 5697d4375b | |
yuyi | 606d8cfaca | |
Isaiah | 9e09b709e3 | |
yuyi | 940c78bdfd | |
Subhomoy Haldar | 79f8a3c796 | |
StunxFS | d24dce8eb3 | |
Dialga | 4400f9891e | |
yuyi | 8519996201 | |
Merlin Diavova | 106487d62f | |
David 'Epper' Marshall | 650fb493bd | |
Delyan Angelov | 084f2867b6 | |
WoodyAtHome | a0a3499bdc | |
Alexander Medvednikov | 0526499d5f | |
Merlin Diavova | f8747d05dc | |
StunxFS | d5e70552eb | |
David 'Epper' Marshall | aef95721a4 | |
yuyi | b04d46770b | |
yuyi | 724e7f037a | |
David 'Epper' Marshall | a91226c376 | |
Delyan Angelov | b53b1cc7cb | |
Delyan Angelov | 7ecd65221e | |
Delyan Angelov | 56cf0b0a2e | |
Delyan Angelov | 7f974a275a | |
Delyan Angelov | f956acd2f6 | |
Delyan Angelov | 9e8e364493 | |
Alexander Medvednikov | ca42ace367 | |
Alexander Medvednikov | 35cfa0da7c | |
playX | 6a6c005dc0 | |
Alexander Medvednikov | 9fb8de14dd | |
Alexander Medvednikov | 89c1e7f980 | |
yuyi | 70184ad1f8 | |
Alexander Medvednikov | 14f06ead1b | |
yuyi | 621574c12a | |
Hunam | 0699f324b5 | |
Lathanao | ce99a306c0 | |
StunxFS | 87de6df0e6 | |
Ekopalypse | 2027a1969b | |
Daniel Däschle | 76cdf75299 | |
yuyi | 45fe87c9e3 | |
yuyi | 3091f31019 | |
Claudio Cesar de Sá | 634796ae42 | |
Andréas Livet | 9fde5b067b | |
Daniel Däschle | 89fe82b732 | |
yuyi | b6058bfd6e | |
playX | 8afdb1c3ef | |
StunxFS | 7499506cf8 | |
Delyan Angelov | 785e9af8f1 | |
Delyan Angelov | 7170a09382 | |
Delyan Angelov | 01c1892995 | |
Delyan Angelov | a6b3e5d6a5 | |
Ned | 76a7354506 | |
yuyi | 4242e7610f | |
yuyi | e2aa5c9b3f | |
Ikko Ashimine | 223b96a59a | |
Delyan Angelov | 1a4d9017e2 | |
Alexander Medvednikov | af8be14639 | |
yuyi | ac90a2b53d | |
playX | 3bd6455178 | |
Alexander Medvednikov | 3d4b8dffdf | |
yuyi | f321422964 | |
Alexander Medvednikov | 1e9156fd71 | |
yuyi | 3732db2bcc | |
playX | 146051b231 | |
Delyan Angelov | 04a77c731e | |
yuyi | 63eacede95 | |
Hunam | 6da300428e | |
yuyi | 276bd8060c | |
Delyan Angelov | 0e5c1cee48 | |
Delyan Angelov | 4da2908d63 | |
StunxFS | cf92224248 | |
Delyan Angelov | ab1c265679 | |
spaceface | db185598d2 | |
yuyi | 990afe37e1 | |
yuyi | d72a25098a | |
yuyi | 25c1b174ca | |
yuyi | b9cf2db6a8 | |
playX | afbe6bf3a2 | |
Isaiah | a4fd349cf1 | |
yuyi | 968d2b4654 | |
spaceface | 332e821518 | |
Delyan Angelov | aed2d0caf2 | |
David 'Epper' Marshall | 91c1157810 | |
Daniel Däschle | ec92d467d1 | |
playX | 0b54196962 | |
Daniel Däschle | 9f8a34a528 | |
Delyan Angelov | 63d413f93c | |
Delyan Angelov | c0b37409d2 | |
Delyan Angelov | 8da42bfc85 | |
Delyan Angelov | 5277ce7dce | |
David 'Epper' Marshall | a2338dbb7c | |
Delyan Angelov | dcdfdf4dd8 | |
spaceface | dab649ec8a | |
Alexander Medvednikov | ce31a01a70 | |
yuyi | cd30b6ea82 | |
Daniel Däschle | 08fd0ce0de | |
StunxFS | db185e6580 | |
Benjamin Thomas | 48eb40cd2c | |
David 'Epper' Marshall | 881d0c04f1 | |
yuyi | ec865cfb37 | |
yuyi | 317acfda97 | |
Wertzui123 | 872f739396 | |
StunxFS | 995485c649 | |
StunxFS | 8b798acadd | |
Alexander Medvednikov | 77645fcf35 | |
spaceface | 14309594fe | |
David 'Epper' Marshall | 5a42350a78 | |
StunxFS | e24482a143 | |
playX | e56385d57d | |
yuyi | 7aca67fb60 | |
yuyi | dd94ab890a | |
yuyi | c802688690 | |
Atom | a225b25117 | |
Delyan Angelov | 4538efd8f4 | |
Delyan Angelov | e0ed8f8278 | |
Delyan Angelov | f72297c331 | |
Delyan Angelov | be04ec0620 | |
yuyi | 7dd5d9ee61 | |
yuyi | 09f8b6a380 | |
tzSharing | eb03fad934 | |
Delyan Angelov | f53b9b4f12 | |
Alexander Medvednikov | 7dbfa86f25 | |
yuyi | 82ac39eca6 | |
yuyi | 752e105f25 | |
tzSharing | 85f616877f | |
playX | b76095f28a | |
R cqls | c26b7666c7 | |
yuyi | be513b4c27 | |
Larpon | 1c48a8d760 | |
yuyi | 660201c188 | |
Brian Callahan | b9a0e2d285 | |
yuyi | 38afd74d26 | |
playX | 95880dfe5c | |
playX | dce2173ac9 | |
Alexander Medvednikov | 501b293e84 | |
Larpon | d799abd139 | |
yuyi | e42dc8e228 | |
yuyi | f89c81087b | |
yuyi | aeba110d01 | |
Larpon | 283d181047 | |
yuyi | 88f22b4367 | |
Delyan Angelov | 60e205a193 | |
Delyan Angelov | d35d67c2bd | |
Nick Treleaven | d8a5df9044 | |
Delyan Angelov | 147e6e669f | |
yuyi | 922cee9162 | |
Delyan Angelov | 1291b621f6 | |
fleur | ddbe812f1b | |
Haren S | 11ee2b6409 | |
stackotter | 563469ed9f | |
yuyi | c819f0f86f | |
Alexander Medvednikov | 9355048b6c | |
Delyan Angelov | 3388caa6c5 | |
Delyan Angelov | 365e7d6b34 | |
yuyi | d934472b17 | |
yuyi | b86320a669 | |
Claudio Cesar de Sá | a2db44bc38 | |
yuyi | 5dce091379 | |
Alexander Medvednikov | 9b565bf765 | |
tzSharing | 03d21a727e | |
Larpon | 506259adb6 | |
yuyi | 26b0e7fd34 | |
Delyan Angelov | 2080557f50 | |
yuyi | 8a18f9175a | |
yuyi | 448938be0d | |
yuyi | 99eb9fdaab | |
yuyi | f13583b04a | |
yuyi | 8013bd43b0 | |
Delyan Angelov | 5e8c4a3aff | |
StunxFS | 2a0b372d0d | |
ChAoS_UnItY | c5824c36f2 | |
Delyan Angelov | c789ea5a15 | |
sunnylcw | 4491b535ec | |
Delyan Angelov | 31b28af179 | |
lemon | 960225f7a7 | |
Nick Treleaven | 1533b77404 | |
yuyi | 0260c2a552 | |
Hunam | 0374f021c5 | |
mjh | 1546645f63 | |
Larpon | a1342e85c3 | |
yuyi | 52ea0b8cc3 | |
yuyi | ce4c2afc9c | |
yuyi | 44ba19716b | |
yuyi | 0c3b69eaef | |
Alexander Medvednikov | 364656b312 | |
Isaiah | 0887b59254 | |
yuyi | 8cc79e4299 | |
playX | 711e90cf99 | |
playX | f6a0c26a85 | |
Delyan Angelov | 9646e4b9d8 | |
Delyan Angelov | 006df58451 | |
JalonSolov | daf5d32327 | |
yuyi | a318a2e09e | |
yuyi | e16ce3af88 | |
yuyi | 6164654d11 | |
Nick Treleaven | 4400efeb9f | |
yuyi | 7ef64bde50 | |
yuyi | d0a11f50ca | |
Delyan Angelov | 379b638b57 | |
yuyi | fe371845da | |
spaceface | 775c4c34b5 | |
Ikko Ashimine | 56a3539ea9 | |
yuyi | 17c34b09a6 | |
yuyi | cb44f5981e | |
Vincenzo Palazzo | 4f14f7714f | |
Vincenzo Palazzo | 48486e1afb | |
Cameron Katri | 1fc54a1e5b | |
Delyan Angelov | 8a57f7ed2d | |
Julien de Carufel | 16ead4e63c | |
Alexander Medvednikov | 43931a8e77 | |
Delyan Angelov | 5b7e538119 | |
Delyan Angelov | 4a71b27c52 | |
Delyan Angelov | d75c408868 | |
Delyan Angelov | 82c5621621 | |
Delyan Angelov | 675f8b6300 | |
Delyan Angelov | ad231cec2f | |
Delyan Angelov | 87a373d82c | |
Delyan Angelov | c7aedb8e8d | |
Delyan Angelov | 375361b787 | |
Delyan Angelov | 840f474fb5 | |
Delyan Angelov | e802e0b9cb | |
Delyan Angelov | bb2a324d61 | |
Delyan Angelov | 868d3e1008 | |
Alexander Medvednikov | c03fe020bf | |
Delyan Angelov | 6f5a513d8b | |
Delyan Angelov | e18cb9748f | |
Delyan Angelov | 173e6a943b | |
Delyan Angelov | cc8803c602 | |
Alexander Medvednikov | 78cb6e2b41 | |
Alexander Medvednikov | 1c6f63ac0a | |
Alexander Medvednikov | fbb9e65c0f | |
Alexander Medvednikov | ae6a25f44e | |
Alexander Medvednikov | e97ebf8cfc | |
Alexander Medvednikov | 258d1f77dc | |
Alexander Medvednikov | af73e195da | |
Alexander Medvednikov | fb192d949b | |
Alexander Medvednikov | 0527ac633e | |
Alexander Medvednikov | dbcf6e9c33 | |
Alexander Medvednikov | c14984899b | |
Alexander Medvednikov | a1372e284c | |
Alexander Medvednikov | c3ad4e2069 | |
Alexander Medvednikov | d4a0d6f73c | |
Alexander Medvednikov | b49d873217 | |
Alexander Medvednikov | 014c3c97f0 | |
Alexander Medvednikov | 7f3b91e688 | |
Alexander Medvednikov | 1e7eb713fb | |
Alexander Medvednikov | ba7b329c73 | |
Alexander Medvednikov | e6ff1508d2 | |
Delyan Angelov | 566f150b24 | |
Delyan Angelov | c3ee4fb2a2 | |
Alexander Medvednikov | 3b36f16365 | |
Alexander Medvednikov | 0dff050735 | |
yuyi | 2d6d6c9ac9 | |
yuyi | c4dff0d797 | |
yuyi | 72c2dc805d | |
Delyan Angelov | f6c9a60f99 | |
Delyan Angelov | bf62b2e33e | |
Delyan Angelov | f1f75897b3 | |
Delyan Angelov | a62560d2c1 | |
Delyan Angelov | e555335bf0 | |
fleur | 68401d9dc8 | |
Delyan Angelov | 5905590e78 | |
Vincenzo Palazzo | 48c295150f | |
yuyi | dc08105022 | |
Delyan Angelov | e5809363de | |
Alexander Medvednikov | d7adb67d52 | |
Alexander Medvednikov | 2525a30b5f | |
yuyi | e3e5bef139 | |
Nick Treleaven | c780de6282 | |
fleur | 6718958058 | |
牧心 | a810fbb80e | |
Delyan Angelov | 8788512c4d | |
Delyan Angelov | 4c7cdd2a2d | |
Delyan Angelov | 62032c43db | |
Delyan Angelov | 9b43713ec5 | |
Delyan Angelov | 716cb17aea | |
crthpl | afb07e0e16 | |
yuyi | 3e3b2e25db | |
Larpon | 07207db998 | |
Delyan Angelov | cb969e0934 | |
Delyan Angelov | 382586da6d | |
Delyan Angelov | e64c8cce62 | |
yuyi | 5551cb248c | |
牧心 | 25d8faabf6 | |
Delyan Angelov | 843ce43077 | |
Delyan Angelov | e4dfffd70b | |
Nick Treleaven | 1938bc48e7 | |
yuyi | fa66183f43 | |
Delyan Angelov | a0e7a46be4 | |
Delyan Angelov | 6c25f5b291 | |
Subhomoy Haldar | 3f90809035 | |
牧心 | 11d9a67e3b | |
Delyan Angelov | 8517b8f8b0 | |
Delyan Angelov | 88c4a64a15 | |
yuyi | 93a5d03182 | |
Vincenzo Palazzo | 3571f66a82 | |
yuyi | 473bc0254d | |
Delyan Angelov | 89d64b21ea | |
Delyan Angelov | df30b79971 | |
Daniel Oberhoff | 58febe4607 | |
yuyi | 704e3c6e72 | |
Nick Treleaven | bf385d2ac9 | |
pancake | 804f2f56d4 | |
pancake | e3da3101f6 | |
Delyan Angelov | 60e718e7c6 | |
Vincenzo Palazzo | 2d867a2766 | |
yuyi | 2a88b313d4 | |
yuyi | 617608b23d | |
Larpon | 45a427e68b | |
Larpon | 52f1c615a6 | |
Joe Conigliaro | a0c07454b1 | |
Joe Conigliaro | 426e9d1734 | |
Joe Conigliaro | e1c8b07fa5 | |
Joe Conigliaro | 8dc2601080 | |
mir.zhou | 6425000ce4 | |
Delyan Angelov | 5a695c81dc | |
crthpl | b232a3b0d1 | |
Delyan Angelov | eea46c4e1a | |
Subhomoy Haldar | 022fae1e7f | |
Pascal Masschelier | 95753ffb30 | |
playX | 6a820c2845 | |
Vincenzo Palazzo | 4666a27e5f | |
Larpon | d34ef69229 | |
yuyi | e7fd8c4e7c | |
yuyi | a58dde48f8 | |
yuyi | c9dcdf6744 | |
Larpon | 56e6fd01c5 | |
Delyan Angelov | c5d8d27b90 | |
Vincenzo Palazzo | 6412f8ba0b | |
Larpon | 1482db6d1a | |
Vincenzo Palazzo | 359f16fdfd | |
yuyi | 0cba579a7b | |
Delyan Angelov | 2ecfd1b351 | |
Larpon | 11ccf06441 | |
Larpon | 2350dbbd57 | |
Larpon | 0b046c14a8 | |
Delyan Angelov | f5e4d17cf3 | |
Alexander Medvednikov | 829fed4af0 | |
Nick Treleaven | 7d8db1042d | |
yuyi | f6b8e1e13f | |
Delyan Angelov | 0bd8fbc9a8 | |
Nick Treleaven | 2cd9c91e98 | |
Larpon | aa9e2ebb25 | |
pancake | 5369379738 | |
Alexander Medvednikov | 92bfd9b353 | |
StunxFS | 725b472d37 | |
Nick Treleaven | 91b40304b7 | |
StunxFS | 1211b2e941 | |
Alexander Medvednikov | 719a3b5de3 | |
Alexander Medvednikov | a55e930c00 | |
Alexander Medvednikov | cc227d8520 | |
Nick Treleaven | d10135e2c4 | |
Delyan Angelov | 44603f8e59 | |
Vincenzo Palazzo | 51c1d666c2 | |
StunxFS | 38853568b4 | |
Nick Treleaven | 782d5374c9 | |
Delyan Angelov | a1e9cae5d2 | |
yuyi | 0497b885dc | |
yuyi | 8c55a9ecd3 | |
Cameron Katri | 340543dfc0 | |
Delyan Angelov | 71dc6c224a | |
Cameron Katri | d585fbea8a | |
Nick Treleaven | 42f92db0ab | |
yuyi | faa55b46de | |
yuyi | 0bf0c73a49 | |
pancake | af79c1e6ef | |
Vincenzo Palazzo | d7817863c6 | |
Delyan Angelov | 9d2529b611 | |
yuyi | 6987f2c087 | |
Vincenzo Palazzo | 02c80bd445 | |
Nick Treleaven | 9c1981a309 | |
yuyi | bc98c11d9d | |
yuyi | db3bbb58cf | |
Nick Treleaven | a87cd9663e | |
R cqls | 5c43493183 | |
Delyan Angelov | fb5df9665e | |
Delyan Angelov | fa3fa2e74f | |
Cameron Katri | b15240185e | |
Delyan Angelov | 4222fd0862 | |
Delyan Angelov | 74eabba52e | |
kylepritchard | 6137ce23c0 | |
yuyi | ae1cb5697e | |
yuyi | d40a502981 | |
Delyan Angelov | 61f078664c | |
Subhomoy Haldar | 7ef7188f4b | |
Delyan Angelov | 8121a8ada0 | |
Delyan Angelov | 566735b298 | |
Cameron Katri | 093994655c | |
Cameron Katri | 3e69d3813b | |
Delyan Angelov | cc637e5ee8 | |
yuyi | 55d9464890 | |
yuyi | 42a67831bf | |
yuyi | c71770d9c5 | |
Delyan Angelov | 04cc037955 | |
Delyan Angelov | 7ee93c8a20 | |
yuyi | fd34ebd84e | |
Delyan Angelov | 4f551d76c0 | |
yuyi | 509367b293 | |
Nick Treleaven | 476f19c090 | |
yuyi | dd1a8cbadc | |
yuyi | 62553dcc2e | |
Nick Treleaven | c7a92425f0 | |
Nick Treleaven | afdf8f50e7 | |
Nick Treleaven | 3a4bb09de2 | |
Subhomoy Haldar | f75ce9dd82 | |
yuyi | 875ad1f6ea | |
Nick Treleaven | d748529337 | |
Nick Treleaven | 02f72c8230 | |
Nick Treleaven | dc9fd2bd7e | |
Delyan Angelov | a07d066e8f | |
Delyan Angelov | 0e496a8de2 | |
Delyan Angelov | bea0d500d0 | |
Nick Treleaven | fcb57312b9 | |
Delyan Angelov | 8c396356bb | |
Delyan Angelov | 7f28d91190 | |
Alexander Medvednikov | 0248349e7c | |
Nick Treleaven | ea4410cdb5 | |
Delyan Angelov | 347db755c8 | |
Delyan Angelov | ddc2c49365 | |
Delyan Angelov | d6c40865f9 | |
Delyan Angelov | 5b492e26dd | |
Nick Treleaven | a4ab3c1f14 | |
Delyan Angelov | 9bbb52e9cc | |
yuyi | 78d9975798 | |
yuyi | 1566f7f766 | |
Delyan Angelov | 5b668dba2b | |
Delyan Angelov | ce576d01c4 | |
Nick Treleaven | 2e963e36ac | |
yuyi | 35cd8112a5 | |
Vincenzo Palazzo | 8b072aa962 | |
yuyi | dff39bac78 | |
yuyi | e3dca82f9c | |
yuyi | 0337882240 | |
Larpon | 894080b844 | |
Ikko Ashimine | 82120d02a8 | |
yuyi | a9837ba95d | |
yuyi | 56f5ed4789 | |
Nick Treleaven | afbccf79f7 | |
yuyi | f66d2f5d43 | |
Delyan Angelov | 381cf4b61d | |
yuyi | c0437afbcd | |
Delyan Angelov | 9ad64b0bd8 | |
Delyan Angelov | 178afd006b | |
Delyan Angelov | 3bae489e35 | |
Delyan Angelov | f2e0ab5912 | |
yuyi | 5815ab8d00 | |
yuyi | 81bb1ea71f | |
El Koulali András | f5036629ca | |
yuyi | d9cca53bd0 | |
Delyan Angelov | 21e9b1deb0 | |
Alexander Medvednikov | 80c94ea73e | |
yuyi | c4b424717c | |
Delyan Angelov | aaf87e04a2 | |
Delyan Angelov | 7216b5df11 | |
Delyan Angelov | caa0e25939 | |
Delyan Angelov | 71edaa071a | |
yuyi | 0a78847782 | |
yuyi | 8c3687aa10 | |
Delyan Angelov | 8ab0bcb6aa | |
Delyan Angelov | 57db261538 | |
yuyi | 3e40cd5baa | |
Delyan Angelov | c05634ebd1 | |
Delyan Angelov | 02b889dac3 | |
Delyan Angelov | eb7c9cec3d | |
Delyan Angelov | 4dd68d3965 | |
Delyan Angelov | 0cc63107ff | |
Delyan Angelov | ee6b23c2a7 | |
yuyi | 5237d1d446 | |
Larpon | 156efec278 | |
yuyi | 3e41be1ff4 | |
Delyan Angelov | 1734e72638 | |
yuyi | 5f79fa8a30 | |
Nick Treleaven | f903ef24e8 | |
yuyi | bb2ddb98a3 | |
Delyan Angelov | 54b0a2aa62 | |
Delyan Angelov | 0ca87ad09f | |
Delyan Angelov | 236bcda549 | |
Delyan Angelov | 817bedec5d | |
Nick Treleaven | 00563a130d | |
ylluminate | d87b5d40b6 | |
Hunam | 8a2d3f6470 | |
yuyi | 136f39a2d4 | |
Delyan Angelov | 7a4715288c | |
yuyi | 7f62346213 | |
yuyi | 315e07abf6 | |
yuyi | 33167960ed | |
yuyi | 57cba4d3f0 | |
Delyan Angelov | 089c93b613 | |
yuyi | 49155ec312 | |
yuyi | 92cafd8851 | |
yuyi | 1d83ab6be1 | |
playX | 78b1cbefff | |
pancake | c5174c2c69 | |
Nick Treleaven | 34dd4f34ab | |
yuyi | ea3c0166c0 | |
serg-meus | d6eb6d5bae | |
yuyi | dbb18e3656 | |
pancake | a1d0db792e | |
kylepritchard | a8f6574471 | |
playX | c8b0f51c13 | |
Delyan Angelov | 4d99157cd5 | |
yuyi | f7feb634d2 | |
Mihai Galos | 9495aacf3e | |
Adam Oates | 424ef0b2b8 | |
yuyi | 27f9bc9ba0 | |
Delyan Angelov | 83762fa4a4 | |
Subhomoy Haldar | 40504e8600 | |
Delyan Angelov | a3e9409196 | |
yuyi | 795fe5844c | |
yuyi | 10ab758aa7 | |
Delyan Angelov | 8dc4b1d9a3 | |
yuyi | 1993bf2a12 | |
yuyi | c1c3ae2a18 | |
yuyi | 3f351036a2 | |
yuyi | dd06698ee3 | |
Delyan Angelov | f3388df577 | |
Delyan Angelov | e8c8f0e7c0 | |
Nick Treleaven | 4bea35b028 | |
JalonSolov | de2fc87995 | |
Nick Treleaven | 7231a3f135 | |
yuyi | 4c33003f86 | |
Nick Treleaven | 54de04a916 | |
yuyi | 6c7243f2f7 | |
Mihai Galos | d5b087de10 | |
pancake | 3f1e232c9b | |
Delyan Angelov | 10474f35f6 | |
Delyan Angelov | 137fade014 | |
yuyi | 3fe8204062 | |
Delyan Angelov | f6aba9a3fe | |
yuyi | cea3149369 | |
Nick Treleaven | 17fcc788f2 | |
Delyan Angelov | beb1b8ce1b | |
pancake | b20c911d3e | |
Subhomoy Haldar | 0fd4c699dd | |
yuyi | e6270b05dc | |
Alexander Medvednikov | 36ec47cd20 | |
Delyan Angelov | f74b65b63f | |
yuyi | c8e33ad219 | |
Delyan Angelov | b0f651bf81 | |
yuyi | 6380b9eb15 | |
yuyi | 22fda7c3dd | |
yuyi | 8136157f87 | |
Ned | 0e5ae7126f | |
kahsa | 3ef437e679 | |
Ned | 437fa02f27 | |
Hunam | 74d5106e8f | |
yuyi | f70e5bd69b | |
ChAoS_UnItY | 63b41e67fa | |
Devin Bayer | 9cc73fd0f8 | |
Delyan Angelov | 4331d6dea0 | |
yuyi | a98eebde7f | |
kahsa | 1e76cccd48 | |
yuyi | ac1b31dbba | |
Delyan Angelov | 3364f2aadf | |
yuyi | 288b13b51d | |
Delyan Angelov | 4e7db5bab0 | |
ChAoS_UnItY | 6a3d34ae11 | |
Delyan Angelov | 57c6454656 | |
yuyi | 36e80266e6 | |
yuyi | ffe6ff3cc8 | |
yuyi | 22017ff8f4 | |
yuyi | 7f8f571ed2 | |
kahsa | 6d57315aca | |
Ikko Ashimine | aa633dab41 | |
Delyan Angelov | fd91811fe2 | |
yuyi | 996bd41ce8 | |
Joe Conigliaro | 3b6e122d9d | |
yuyi | 0028e557f9 | |
yuyi | 9a2df0df0e | |
yuyi | 013589e9fe | |
Subhomoy Haldar | a0d9e6e1c2 | |
yuyi | efeb3e04da | |
yuyi | 81c787ef91 | |
yuyi | bc16c61f6f | |
yuyi | 0fb1eaef04 | |
Mihai Galos | 4215bb125c | |
yuyi | 0d9792bdf2 | |
Larpon | d80f5165dd | |
yuyi | 83ea97b1a3 | |
Larpon | 73f931b52e | |
Delyan Angelov | 9535d38645 | |
Bastian Buck | fa645516c3 | |
Bastian Buck | 0d07a64230 | |
Delyan Angelov | 9523c23e14 | |
yuyi | d30ad344e8 | |
kahsa | f6891c405a | |
yuyi | a28249c119 | |
kahsa | 9662b79662 | |
Subhomoy Haldar | 114a341f5f | |
Bastian Buck | 5c0b7b0d05 | |
yuyi | b5e7cef1b1 | |
yuyi | c3ec738126 | |
gcxfd | 838a8f2183 | |
mahdi ramezaan zaade | 2712e43802 | |
Delyan Angelov | d2e8302d21 | |
yuyi | 6486fffc5a | |
Vincenzo Palazzo | 6a876d4170 | |
Larpon | 1032cf5c04 | |
Delyan Angelov | 33d379d530 | |
gcxfd | ee1de06678 | |
Vincenzo Palazzo | 7bd8503170 | |
Delyan Angelov | 4a765bc33b | |
Delyan Angelov | f2e5bb447e | |
yuyi | 07e9ed1a1d | |
playX | b842e89acc | |
yuyi | 83cdd8bedd | |
simon place | 8ba4a3dd01 | |
kahsa | 809772db4e | |
gcxfd | 8b033c3993 | |
yuyi | 04654ed518 | |
yuyi | 75ebac006d | |
gcxfd | dbae2d6af4 | |
yuyi | 09f08e1fee | |
eyun | 67e33bf9bc | |
eyun | 2b974cdb97 | |
yuyi | 0236931c78 | |
Alexander Medvednikov | 3fa6622ee8 | |
Dialga | bcc4de19fc | |
yuyi | 0208e9672d | |
Milo | 4cdb244151 | |
Delyan Angelov | d86b18844e | |
Delyan Angelov | fad254dcce | |
Delyan Angelov | 3c38abc56e | |
Delyan Angelov | c9867a9ae4 | |
yuyi | 14073ac0fe | |
Subhomoy Haldar | 072480352c | |
Delyan Angelov | a886242700 | |
Delyan Angelov | 3bcd11260f | |
Delyan Angelov | ef5ea0ef21 | |
Alexander Medvednikov | 3d46005195 | |
Joe Conigliaro | f4051e0252 | |
Anton Zavodchikov | da9331f8ff | |
Delyan Angelov | eb45a321a5 | |
Joe Conigliaro | d739abbb3f | |
Delyan Angelov | ebb66aa82c | |
Delyan Angelov | 554a689213 | |
Joe Conigliaro | 07b15a209a | |
Joe Conigliaro | 6fc654821f | |
Delyan Angelov | 245b70cabc | |
Delyan Angelov | 230dc26858 | |
yuyi | 4f9039991f | |
Delyan Angelov | 901a4d8b84 | |
yuyi | 842fd7a27e | |
Delyan Angelov | 89b99ad4c3 | |
blackshirt | 54b10e99a1 | |
Tarcisio Gruppi | f68144774d | |
Delyan Angelov | d3b8ac2e46 | |
yuyi | f8b8950b96 | |
Alexander Medvednikov | 5a14748e7c | |
Delyan Angelov | 9c24d09dc3 | |
starryskye | 6d2a88e31f | |
vyrus001 | d4fc8601e0 | |
Mihai Galos | b8d656b308 | |
blackshirt | 3ac4155f0c | |
Delyan Angelov | ff34b79d39 | |
Larpon | 80444c8ec4 | |
Delyan Angelov | d25652fbcf | |
yuyi | fb3dd82400 | |
mint | 73cf597bec | |
yuyi | f9fc136c24 | |
crthpl | e23db2f9b7 | |
Delyan Angelov | 89e9f8a00c | |
yuyi | dc0b0c83c6 | |
Delyan Angelov | f8bf3db568 | |
igor | efdbe9d92c | |
yuyi | 8119a297f7 | |
yuyi | b2f984280b | |
yuyi | 2e0f8ee9e2 | |
Vincenzo Palazzo | bf11df40e2 | |
blackshirt | 57e850e932 | |
Delyan Angelov | 74048e2f17 | |
Vincenzo Palazzo | 6ea4f361a1 | |
igor | 9ff0c51e61 | |
Delyan Angelov | bad30bdd79 | |
yuyi | 5071a54b99 | |
yuyi | b5379255da | |
Ulises Jeremias Cornejo Fandos | 4391ae563d | |
Delyan Angelov | a74d28ae5f | |
Delyan Angelov | 799c95dc4e | |
Delyan Angelov | 11a0df5bee | |
crthpl | 0eee012ae9 | |
Tim Basel | 37c151efe5 | |
yuyi | ae0e90f5d8 | |
yuyi | 7178367de0 | |
Tim Basel | 9d0a5942ac | |
Vincenzo Palazzo | 61024d4b75 | |
Juergen Donnerstag | 654bc49d3c | |
Artem | e0618f94e8 | |
yuyi | a21f4563b3 | |
Vincenzo Palazzo | 7f29418c63 | |
Delyan Angelov | 1c19573382 | |
kahsa | b205e2fc67 | |
Delyan Angelov | 9ed18efa53 | |
Artem | 43d6b97c21 | |
yuyi | f2eb50008d | |
Vincenzo Palazzo | 0d1d259bb4 | |
yuyi | 4be3c92640 | |
Delyan Angelov | 356ccf247f | |
Delyan Angelov | dd835acb8d | |
Subhomoy Haldar | 5d2995c4d5 | |
Delyan Angelov | 1dbde05267 | |
Delyan Angelov | ff02f94fd6 | |
Snavy | f0806822dd | |
playX | 4ef7d26133 | |
Larpon | 5df83812a0 | |
Vincenzo Palazzo | 10dcb2e0d9 | |
Delyan Angelov | 1dc239227d | |
Delyan Angelov | 7f70493e1d | |
Delyan Angelov | 191e99c248 | |
Larpon | 649ecab11f | |
Vincenzo Palazzo | d46ac40758 | |
Larpon | 31df2c4f45 | |
kahsa | fd9aa8bee6 | |
Delyan Angelov | 1be0cb0306 | |
div72 | 939bc9f26f | |
Ikko Ashimine | 31739c2586 | |
Delyan Angelov | 66f21cae55 | |
yuyi | ece73836aa | |
Vincenzo Palazzo | 4e13ee22e9 | |
Alexander Medvednikov | f23d2c8cf4 | |
div72 | cec7e91714 | |
Sandro Martini | 054c8b1f13 | |
Delyan Angelov | 5faabe7464 | |
yuyi | 4d485ae687 | |
Asher | 47ee292ba4 | |
yuyi | 173b4652fb | |
Vincenzo Palazzo | c9a8d6448d | |
Vincenzo Palazzo | b9fce4ef09 | |
Delyan Angelov | a054f868a0 | |
Delyan Angelov | d02c0636d8 | |
yuyi | a61b4809dc | |
Delyan Angelov | 89d399b035 | |
Delyan Angelov | 85d36ed231 | |
kahsa | ede9f29323 | |
yuyi | be1e40dac0 | |
Delyan Angelov | 9344c27021 | |
crthpl | c0c07db7cc | |
penguindark | c3573454d1 | |
yuyi | b10b65e134 | |
Delyan Angelov | b2c299da48 | |
Delyan Angelov | d8cce0a71d | |
yuyi | a014844050 | |
Tarcisio Gruppi | 51513ae19a | |
penguindark | 7c1b249da0 | |
Delyan Angelov | 310969a057 | |
Delyan Angelov | db50e79d26 | |
yuyi | b34860e39b | |
Delyan Angelov | 46a096b95d | |
Delyan Angelov | b11ce91141 | |
Delyan Angelov | 894da4b40b | |
Delyan Angelov | 96c8188083 | |
Delyan Angelov | f6cb772347 | |
Merlin Diavova | f3683b7cdc | |
Delyan Angelov | eb7f152f3d | |
Delyan Angelov | afd3ca8273 | |
Benjamin Stigsen | a4fb5d2cfd | |
Delyan Angelov | 44dddecc09 | |
Ken | e43794ad61 | |
Benjamin Stigsen | ceb05b163a | |
kahsa | 7f22ed7935 | |
kahsa | 61d28c8a8c | |
Delyan Angelov | 71d98717dc | |
Yamada Hayao | edc6c9e24f | |
kahsa | 1f20127502 | |
Delyan Angelov | 8491e83e3f | |
Larpon | 41b9b2988a | |
Larpon | faaa7035c4 | |
Delyan Angelov | eb765f975c | |
Delyan Angelov | daa5be4c27 | |
yuyi | 9dce8194a8 | |
Delyan Angelov | f8f7bc8ead | |
Delyan Angelov | ebad7301f9 | |
Delyan Angelov | e1a2ab345d | |
yuyi | 3bd528b218 | |
Delyan Angelov | 3fa9128716 | |
Larpon | 65a97a9fbe | |
JalonSolov | 01c72d44e8 | |
Delyan Angelov | 2d184559b6 | |
yuyi | 291a1ffd8d | |
yuyi | d71fc0d13f | |
kahsa | 867056dafb | |
Delyan Angelov | 0979723636 | |
Delyan Angelov | 469282b20d | |
Alexander Medvednikov | 4715fb67c1 | |
Tim Basel | 1fdbdf4a6b | |
Larpon | 95d86324c3 | |
Larpon | 28ddd8440a | |
yuyi | ca1f675dba | |
Subhomoy Haldar | fe77e64b3e | |
Delyan Angelov | a913983408 | |
crthpl | 009a65b1fc | |
Delyan Angelov | 5f38ba896e | |
Delyan Angelov | 32f2f0dfa1 | |
yuyi | 509a8fcaf1 | |
Delyan Angelov | 7199528a27 | |
Delyan Angelov | 1cea7b0c73 | |
kahsa | 387b2db658 | |
Delyan Angelov | 0347dadf75 | |
ZoaR | 4ba9a2ffbe | |
yuyi | 3bfad1b943 | |
skurgs | 7fd08eca96 | |
Alexander Medvednikov | 216a505c2a | |
yuyi | edf0bc365c | |
Benjamin Stigsen | 4e0e2ef753 | |
Delyan Angelov | 34f0d442df | |
Delyan Angelov | 86a2562fa7 | |
Delyan Angelov | 657270faa8 | |
Delyan Angelov | 86930873ac | |
Wertzui123 | 22c21e62a1 | |
Delyan Angelov | fba9587323 | |
Delyan Angelov | 359b674cff | |
Delyan Angelov | 9057e9f1dd | |
Delyan Angelov | 62c3ad4953 | |
Delyan Angelov | fa6f7d4c83 | |
Delyan Angelov | 85ec0248e9 | |
Delyan Angelov | 9ebd56caa7 | |
yuyi | e66e35ced1 | |
Larpon | 839ae6b2e4 | |
Larpon | 2b4f7e7685 | |
Larpon | 7ae96f0e38 | |
Delyan Angelov | 36c9ed6889 | |
Delyan Angelov | 04aab250aa | |
crthpl | cbd3c14e83 | |
yuyi | ffb263c2e1 | |
yuyi | 05ff8f516d | |
Charles WANG | 79cb0db2ff | |
Tim Basel | 6c8e7f53b5 | |
yuyi | edbb39b81d | |
Delyan Angelov | 295156e054 | |
Delyan Angelov | 9e0156b46a | |
Delyan Angelov | 62687842e2 | |
kahsa | 758d1f44ab | |
yuyi | 7c9cd855b4 | |
yuyi | d553071e65 | |
Subhomoy Haldar | 5143837d66 | |
yuyi | 09797e493e | |
Tim Basel | 14b33baa3b | |
Wertzui123 | d67be6302b | |
yuyi | ba3308296b | |
Delyan Angelov | d63f395061 | |
Tim Basel | d714dcef75 | |
Alexander Medvednikov | 38d3239b50 | |
playX | c48a9e71f5 | |
jeffmikels | 7a2705d8ce | |
Tim Basel | bb6c46e1ef | |
Delyan Angelov | 95b0c3789f | |
Delyan Angelov | 1c5eb7ccdc | |
Delyan Angelov | 6dfa11e2f7 | |
yuyi | ef562c92a5 | |
Delyan Angelov | 91bfab79a5 | |
Delyan Angelov | 40a5c5c1a0 | |
yuyi | f0b7e5049b | |
kahsa | 1c4c430642 | |
Delyan Angelov | d8263171ff | |
yuyi | 39f80840d7 | |
Delyan Angelov | 835484a953 | |
Delyan Angelov | 4597c74d1a | |
trueFireblade | 727c9fb4a1 | |
Delyan Angelov | d1ac22e3bb | |
yuyi | 851f265a5e | |
playX | 8de1934f51 | |
yuyi | 31615d67c4 | |
Hunam | db48594bd4 | |
Delyan Angelov | 2a3a4cfc84 | |
yuyi | 315b2deda9 | |
Delyan Angelov | ab7cc5809a | |
Delyan Angelov | f24e9cc80a | |
Delyan Angelov | d0bb810b42 | |
Delyan Angelov | 57563599a7 | |
Delyan Angelov | 6485b6eeb7 | |
yuyi | dfc23d939f | |
playX | 7fe62a8b3e | |
trueFireblade | 9fd65b5b18 | |
jeffmikels | f19197f9b0 | |
yuyi | 879d1d2f11 | |
playX | 104e0c5692 | |
jeffmikels | 9329b6c8c8 | |
yuyi | 4660220f4c | |
Delyan Angelov | 6168a4d3a2 | |
jeffmikels | 70aedaf184 | |
jeffmikels | 4189b7e280 | |
yuyi | 155f897270 | |
Larpon | 7fbd856bf8 | |
jeffmikels | 7882915409 | |
yuyi | 547169674d | |
Delyan Angelov | b658b65774 | |
yuyi | 89165ed259 | |
jeffmikels | f99b79480d | |
Yuki Morota | c98af3c526 | |
jeffmikels | ab642cac43 | |
Ikko Ashimine | ea660315e0 | |
Delyan Angelov | c27ffc6054 | |
yuyi | f3d8bbdf3d | |
Tim Basel | 10efe47f03 | |
Delyan Angelov | ecc7accc8e | |
Delyan Angelov | 8acd84d04a | |
Ekopalypse | cb684b5c64 | |
yuyi | 1e52b2c134 | |
jeffmikels | 078229f213 | |
yuyi | 791972ebc9 | |
Larpon | f54ad51946 | |
playX | 65eb383cfd | |
Delyan Angelov | da0b89cc57 | |
playX | c07ce3ff15 | |
yuyi | 4ce6e663bf | |
yuyi | 02f791d9fe | |
Charles WANG | 7f1cc44b04 | |
Saptak Bhoumik | 5e85d4cb39 | |
Larpon | 535317eba3 | |
yuyi | 236a1d0255 | |
yuyi | 0ac450927c | |
yuyi | 86ba4517b1 | |
jeffmikels | 5e5d62ed4c | |
Larpon | 05ec8ec15b | |
Larpon | b44b8c472d | |
kahsa | e2a0046849 | |
penguindark | 92fcb82ca3 | |
penguindark | 22fce6a525 | |
yuyi | 64c8fb061d | |
Ekopalypse | 64028eedb8 | |
Delyan Angelov | 70bf200e16 | |
688862 | 83e9585d06 | |
Delyan Angelov | b778c1d097 | |
Ken | 9cbfa882e6 | |
playX | 4d166e3b55 | |
Delyan Angelov | ec55c0fcd2 | |
playX | ac7e79ffd2 | |
Delyan Angelov | 95f6bd7fca | |
Delyan Angelov | bb6aabd430 | |
Larpon | 5cffa1a2e4 | |
Delyan Angelov | 5717066147 | |
Larpon | 3e9c1c1a3a | |
Larpon | 17911432b9 | |
Artem | a73e1462f0 | |
Delyan Angelov | d3317cbd4f | |
Delyan Angelov | 571aa1bac9 | |
Delyan Angelov | 26c63461f4 | |
688862 | 2b42ea9883 | |
Larpon | 7276705684 | |
jeffmikels | 6e6d51a1c9 | |
playX | 287331bc19 | |
yuyi | c9d8fecc75 | |
yuyi | 5bc72c9c01 | |
Ken | 7dc64de360 | |
Delyan Angelov | 60527a5655 | |
yuyi | 1c382ad2b4 | |
yuyi | 1654d8b810 | |
Larpon | 6dca022caf | |
Delyan Angelov | 8088f462c9 | |
Larpon | 214853c373 | |
playX | ec91de3504 | |
yuyi | fb66ec7cfb | |
kahsa | fca699a439 | |
kahsa | 075cd29c14 | |
Delyan Angelov | c97f0c59d1 | |
Larpon | 3ae4513e2e | |
playX | 70a0aab72b | |
jeffmikels | a60b381d5e | |
Delyan Angelov | 59357e873d | |
spaceface | de711da774 | |
Tim Basel | 897bbb7da5 | |
Delyan Angelov | d3489d4246 | |
Delyan Angelov | 57fa9768d5 | |
yuyi | ba9aad1d92 | |
Delyan Angelov | 89ac2a37c5 | |
Delyan Angelov | b3930c3d6a | |
yuyi | 6c1ae4f689 | |
Delyan Angelov | 0f01236e52 | |
yuyi | b2538e83da | |
yuyi | b94c5c2a9c | |
yuyi | 054bb272df | |
Alexander Medvednikov | 59ed4be49a | |
Delyan Angelov | feadf777c3 | |
yuyi | 00a0c1886e | |
pancake | 4b55800ffd | |
Delyan Angelov | 89d92d536a | |
yuyi | da989e19ca | |
Larpon | 88a973b617 | |
Delyan Angelov | 9974495f5e | |
Delyan Angelov | e03d52d322 | |
Delyan Angelov | ee858568ff | |
Delyan Angelov | b4111451bf | |
Delyan Angelov | 3aba840af1 | |
yuyi | d5b111ec99 | |
penguindark | 1ad4fbd841 | |
Larpon | 4d4398fa8a | |
Delyan Angelov | 41e763f79c | |
yuyi | 64f1ea6fe9 | |
Delyan Angelov | 41078bc438 | |
Delyan Angelov | 1521d08e84 | |
Delyan Angelov | 9278d4ec19 | |
Alexander Medvednikov | 0e1cfd4a28 | |
Delyan Angelov | 697eca5ddf | |
penguindark | 908296cdfb | |
pancake | 7b4ba66720 | |
yuyi | 7622ff3f54 | |
yuyi | 6438512529 | |
yuyi | a0a1807e2b | |
Delyan Angelov | b10ff1e41b | |
Delyan Angelov | ae036b6146 | |
Delyan Angelov | df8384b62e | |
Delyan Angelov | 93c40e696d | |
Delyan Angelov | bf9f684c59 | |
Delyan Angelov | 7531f78f67 | |
yuyi | d421f28de4 | |
Delyan Angelov | 4114dd0815 | |
Delyan Angelov | 99fdcd2e71 | |
Delyan Angelov | ca5154747e | |
Delyan Angelov | 537760edcd | |
Delyan Angelov | cb34309f6f | |
yuyi | cc577e1bfb | |
Delyan Angelov | 69c90ef50d | |
Delyan Angelov | 7c78bf9466 | |
Delyan Angelov | 9b8cf1ad37 | |
Hunam | 5607cfbd32 | |
penguindark | 5e5529441c | |
Delyan Angelov | 43fee6b3d5 | |
Delyan Angelov | 730b2a9263 | |
yuyi | c1711b8f05 | |
Alexander Medvednikov | 6176ce9f03 | |
penguindark | dadc965082 | |
Delyan Angelov | 14648fa41e | |
yuyi | 34e175a343 | |
Delyan Angelov | a2eb90ee4e |
73
.cirrus.yml
|
@ -13,76 +13,3 @@ freebsd_task:
|
|||
##tcc -v -v
|
||||
echo 'Build cmd/tools/fast'
|
||||
cd cmd/tools/fast && ../../../v fast.v && ./fast -clang
|
||||
|
||||
|
||||
arm64_task:
|
||||
name: Code CI / arm64-ubuntu-tcc
|
||||
arm_container:
|
||||
image: ubuntu:latest
|
||||
install_script: apt-get update -y && apt-get install --quiet -y build-essential pkg-config wget git valgrind libsqlite3-dev libssl-dev libxi-dev libxcursor-dev libfreetype6-dev libxi-dev libxcursor-dev libgl-dev xfonts-75dpi xfonts-base libmysqlclient-dev libpq-dev gcc-10-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
VFLAGS: -cc tcc -no-retry-compilation
|
||||
VJOBS: 2
|
||||
script: |
|
||||
set -e
|
||||
|
||||
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_arm64.deb
|
||||
apt install --fix-missing -y ./wkhtmltox_0.12.6-1.focal_arm64.deb
|
||||
|
||||
# ensure that a V binary can be built, even if tcc has broken for some reason
|
||||
VFLAGS='-cc gcc' make
|
||||
|
||||
./v -g self
|
||||
./v -g self
|
||||
|
||||
./v -d debug_malloc -d debug_realloc -o v cmd/v
|
||||
./v -cg -cstrict -o v cmd/v
|
||||
#Test v->c
|
||||
thirdparty/tcc/tcc.exe -version
|
||||
./v -cg -o v cmd/v # Make sure vtcc can build itself twice
|
||||
|
||||
# - name: v self compilation
|
||||
./v -o v2 cmd/v && ./v2 -o v3 cmd/v && ./v3 -o v4 cmd/v
|
||||
|
||||
# - name: v self compilation with -skip-unused
|
||||
./v -skip-unused -o v2 cmd/v && ./v2 -skip-unused -o v3 cmd/v && ./v3 -skip-unused -o v4 cmd/v
|
||||
|
||||
# - name: v doctor
|
||||
./v doctor
|
||||
|
||||
# - name: Verify `v test` works
|
||||
./v cmd/tools/test_if_v_test_system_works.v
|
||||
./cmd/tools/test_if_v_test_system_works
|
||||
|
||||
# - name: Self tests
|
||||
./v -silent test-self
|
||||
|
||||
## - name: Self tests (-cstrict)
|
||||
## ./v -cstrict test-self
|
||||
|
||||
# - name: Test time functions in a timezone UTC-12
|
||||
TZ=Etc/GMT+12 ./v test vlib/time/
|
||||
# - name: Test time functions in a timezone UTC-3
|
||||
TZ=Etc/GMT+3 ./v test vlib/time/
|
||||
# - name: Test time functions in a timezone UTC+3
|
||||
TZ=Etc/GMT-3 ./v test vlib/time/
|
||||
# - name: Test time functions in a timezone UTC+12
|
||||
TZ=Etc/GMT-12 ./v test vlib/time/
|
||||
# - name: Test time functions in a timezone using daylight saving (Europe/Paris)
|
||||
TZ=Europe/Paris ./v test vlib/time/
|
||||
# - name: Build examples
|
||||
./v -W build-examples
|
||||
# - name: Test building v tools
|
||||
./v -W build-tools
|
||||
# - name: Test v binaries
|
||||
./v build-vbinaries
|
||||
# - name: Run a VSH script
|
||||
./v run examples/v_script.vsh
|
||||
# - name: Test v tutorials
|
||||
./v tutorials/building_a_simple_web_blog_with_vweb/code/blog
|
||||
|
||||
# test the arm32 version of tcc
|
||||
# TODO: support something like `V_EMULATOR=qemu-arm v run file.v` so that V automatically runs all binaries under qemu
|
||||
./v -arch arm32 -cc arm-linux-gnueabihf-gcc-10 -o av cmd/v && qemu-arm -L /usr/arm-linux-gnueabihf ./av -arch arm32 -cc arm-linux-gnueabihf-gcc-10 -o av2 cmd/v && qemu-arm -L /usr/arm-linux-gnueabihf ./av2 -arch arm32 -cc arm-linux-gnueabihf-gcc-10 -o av3 cmd/v && qemu-arm -L /usr/arm-linux-gnueabihf ./av3 -arch arm32 -cc arm-linux-gnueabihf-gcc-10 -o av4 cmd/v
|
||||
./v -arch arm32 -o closure_test.c vlib/v/tests/closure_test.v && arm-linux-gnueabihf-gcc-10 -o closure_test closure_test.c && qemu-arm -L /usr/arm-linux-gnueabihf ./closure_test
|
||||
|
|
|
@ -16,6 +16,11 @@ indent_size = 2
|
|||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
# lines that are too long will trigger an error in cmd/tools/vcheck-md.v
|
||||
# run v check-md [folder/file] to test markdown files
|
||||
# the longest normal line is specified with this constant:
|
||||
# `too_long_line_length_other = 100`
|
||||
max_line_length = 100
|
||||
|
||||
[*.{txt,out}]
|
||||
insert_final_newline = false
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
*.v linguist-language=V text=auto eol=lf
|
||||
*.vv linguist-language=V text=auto eol=lf
|
||||
*.vsh linguist-language=V text=auto eol=lf
|
||||
**/v.mod linguist-language=V text=auto eol=lf
|
||||
*.bat text=auto eol=crlf
|
||||
Dockerfile.* linguist-language=Dockerfile
|
||||
*.toml text eol=lf
|
||||
|
|
|
@ -14,6 +14,8 @@ assignees: ''
|
|||
**V version:**
|
||||
**OS:**
|
||||
|
||||
<!-- Please include the standalone minimal reproducible code.
|
||||
If not, it may be closed by the administrators. -->
|
||||
**What did you do?**
|
||||
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ ls -lat
|
|||
## try running the known failing tests first to get faster feedback
|
||||
./v test vlib/builtin/string_test.v vlib/strings/builder_test.v
|
||||
|
||||
./v test-cleancode
|
||||
|
||||
./v test-self
|
||||
|
||||
./v build-vbinaries
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
#!/usr/bin/env -S v
|
||||
|
||||
module main
|
||||
|
||||
import os
|
||||
import vab.vxt
|
||||
import vab.android.ndk
|
||||
|
||||
fn main() {
|
||||
assert ndk.found()
|
||||
assert vxt.found()
|
||||
|
||||
work_dir := os.join_path(os.temp_dir(), 'android_cross_compile_test')
|
||||
os.rm(work_dir) or {}
|
||||
os.mkdir_all(work_dir) or { panic(err) }
|
||||
vexe := vxt.vexe()
|
||||
|
||||
examples_dir := os.join_path(vxt.home(), 'examples')
|
||||
v_example := os.join_path(examples_dir, 'toml.v')
|
||||
|
||||
ndk_version := ndk.default_version()
|
||||
|
||||
sysroot_path := ndk.sysroot_path(ndk_version) or { panic(err) }
|
||||
include_path := os.join_path(sysroot_path, 'usr', 'include')
|
||||
android_include_path := os.join_path(include_path, 'android')
|
||||
|
||||
//'-I"$include_path"'
|
||||
cflags := ['-I"$android_include_path"', '-Wno-unused-value', '-Wno-implicit-function-declaration',
|
||||
'-Wno-int-conversion']
|
||||
for arch in ndk.supported_archs {
|
||||
for level in ['min', 'max'] {
|
||||
compiler_api := match level {
|
||||
'min' {
|
||||
ndk.compiler_min_api(.c, ndk_version, arch) or { panic(err) }
|
||||
}
|
||||
'max' {
|
||||
ndk.compiler_max_api(.c, ndk_version, arch) or { panic(err) }
|
||||
}
|
||||
else {
|
||||
panic('invalid min/max level')
|
||||
}
|
||||
}
|
||||
|
||||
os.setenv('VCROSS_COMPILER_NAME', compiler_api, true)
|
||||
c_file := os.join_path(work_dir, arch + '-' + level + '.c')
|
||||
o_file := os.join_path(work_dir, arch + '-' + level + '.o')
|
||||
|
||||
// x.v -> x.c
|
||||
v_compile_cmd := '$vexe -o $c_file -os android -gc none $v_example'
|
||||
vres := os.execute(v_compile_cmd)
|
||||
if vres.exit_code != 0 {
|
||||
panic('"$v_compile_cmd" failed: $vres.output')
|
||||
}
|
||||
assert os.exists(c_file)
|
||||
|
||||
// x.c -> x.o
|
||||
compile_cmd := '$compiler_api ${cflags.join(' ')} -c $c_file -o $o_file'
|
||||
cres := os.execute(compile_cmd)
|
||||
if cres.exit_code != 0 {
|
||||
panic('"$compile_cmd" failed: $cres.output')
|
||||
}
|
||||
assert os.exists(o_file)
|
||||
compiler_exe_name := os.file_name(compiler_api)
|
||||
println('Compiled examples/toml.v successfully for ($level) $arch $compiler_exe_name')
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,42 +9,13 @@ on:
|
|||
- "**.md"
|
||||
|
||||
concurrency:
|
||||
group: build-${{ github.event.pull_request.number || github.sha }}
|
||||
group: build-ci-${{ github.event.pull_request.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
code-formatting-perf-regressions:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
VFLAGS: -cc gcc
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Environment info
|
||||
run: echo $VFLAGS $GITHUB_SHA $GITHUB_REF
|
||||
- name: Build local v
|
||||
run: make -j4
|
||||
- name: v test-cleancode
|
||||
run: ./v -silent test-cleancode
|
||||
- name: v test-fmt
|
||||
run: ./v -silent test-fmt
|
||||
|
||||
## Performance regressions
|
||||
- name: Clone & Build vmaster/v
|
||||
run: |
|
||||
git clone --depth=1 https://github.com/vlang/v vmaster/
|
||||
(cd vmaster; make -j4)
|
||||
- name: V versions
|
||||
run: ./v version && ./vmaster/v version
|
||||
- name: Build the repeat tool
|
||||
run: ./v cmd/tools/repeat.v
|
||||
- name: Repeat -o hw.c examples/hello_world.v
|
||||
run: cmd/tools/repeat --max_time 251 --series 3 --count 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -show-timings -o hw.c examples/hello_world.v' . ./vmaster
|
||||
- name: Repeat -o v.c cmd/v
|
||||
run: cmd/tools/repeat --max_time 1501 --series 3 --count 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -show-timings -o v.c cmd/v' . ./vmaster
|
||||
|
||||
ubuntu-tcc:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc tcc -no-retry-compilation
|
||||
|
@ -63,6 +34,7 @@ jobs:
|
|||
run: |
|
||||
echo $VFLAGS
|
||||
make
|
||||
./v test-cleancode
|
||||
./v -d debug_malloc -d debug_realloc -o v cmd/v
|
||||
./v -cg -cstrict -o v cmd/v
|
||||
# Test v -realloc arena allocation
|
||||
|
@ -71,7 +43,7 @@ jobs:
|
|||
run: |
|
||||
thirdparty/tcc/tcc.exe -version
|
||||
./v -cg -o v cmd/v # Make sure vtcc can build itself twice
|
||||
# ./v -silent test-all
|
||||
# ./v test-all
|
||||
- name: v self compilation
|
||||
run: ./v -o v2 cmd/v && ./v2 -o v3 cmd/v && ./v3 -o v4 cmd/v
|
||||
- name: v self compilation with -skip-unused
|
||||
|
@ -81,12 +53,15 @@ jobs:
|
|||
./v doctor
|
||||
- name: Verify `v test` works
|
||||
run: |
|
||||
echo $VFLAGS
|
||||
./v cmd/tools/test_if_v_test_system_works.v
|
||||
./cmd/tools/test_if_v_test_system_works
|
||||
- name: All code is formatted
|
||||
run: ./v test-cleancode
|
||||
- name: Self tests
|
||||
run: ./v -silent test-self
|
||||
run: ./v test-self
|
||||
# - name: Self tests (-cstrict)
|
||||
# run: ./v -cstrict test-self
|
||||
# run: V_CI_CSTRICT=1 ./v -cstrict test-self
|
||||
- name: Test time functions in a timezone UTC-12
|
||||
run: TZ=Etc/GMT+12 ./v test vlib/time/
|
||||
- name: Test time functions in a timezone UTC-3
|
||||
|
@ -109,9 +84,18 @@ jobs:
|
|||
run: ./v tutorials/building_a_simple_web_blog_with_vweb/code/blog
|
||||
- name: Build cmd/tools/fast
|
||||
run: cd cmd/tools/fast && ../../../v fast.v && ./fast
|
||||
- name: V self compilation with -usecache
|
||||
run: |
|
||||
unset VFLAGS
|
||||
./v -usecache examples/hello_world.v && examples/hello_world
|
||||
./v -o v2 -usecache cmd/v
|
||||
./v2 -o v3 -usecache cmd/v
|
||||
./v3 version
|
||||
./v3 -o tetris -usecache examples/tetris/tetris.v
|
||||
|
||||
ubuntu-tcc-boehm-gc:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc tcc -no-retry-compilation
|
||||
|
@ -146,109 +130,29 @@ jobs:
|
|||
run: |
|
||||
./v -gc boehm cmd/tools/test_if_v_test_system_works.v
|
||||
./cmd/tools/test_if_v_test_system_works
|
||||
- name: All code is formatted
|
||||
run: ./v test-cleancode
|
||||
- name: Self tests with `-gc boehm` with V compiler using Boehm-GC itself
|
||||
run: ./v -gc boehm -silent test-self
|
||||
run: ./v -gc boehm test-self
|
||||
- name: Test leak detector
|
||||
run: |
|
||||
./v -gc boehm_leak -o testcase_leak vlib/v/tests/testcase_leak.v
|
||||
./v -gc boehm_leak -o testcase_leak vlib/v/tests/testcase_leak.vv
|
||||
./testcase_leak 2>leaks.txt
|
||||
grep "Found 1 leaked object" leaks.txt && grep ", sz=1000," leaks.txt
|
||||
grep "Found 1 leaked object" leaks.txt && grep -P ", sz=\s?1000," leaks.txt
|
||||
- name: Test leak detector not being active for `-gc boehm`
|
||||
run: |
|
||||
./v -gc boehm -o testcase_leak vlib/v/tests/testcase_leak.v
|
||||
./v -gc boehm -o testcase_leak vlib/v/tests/testcase_leak.vv
|
||||
./testcase_leak 2>leaks.txt
|
||||
[ "$(stat -c %s leaks.txt)" = "0" ]
|
||||
- name: Test leak detector not being active for normal compile
|
||||
run: |
|
||||
./v -o testcase_leak vlib/v/tests/testcase_leak.v
|
||||
./v -o testcase_leak vlib/v/tests/testcase_leak.vv
|
||||
./testcase_leak 2>leaks.txt
|
||||
[ "$(stat -c %s leaks.txt)" = "0" ]
|
||||
|
||||
misc-tooling:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc tcc -no-retry-compilation
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 10
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev valgrind
|
||||
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
||||
sudo apt-get install --quiet -y xfonts-75dpi xfonts-base
|
||||
- name: Build v
|
||||
run: make
|
||||
|
||||
- name: Ensure V can be compiled with -autofree
|
||||
run: ./v -autofree -o v2 cmd/v ## NB: this does not mean it runs, but at least keeps it from regressing
|
||||
|
||||
- name: Shader examples can be build
|
||||
run: |
|
||||
wget https://github.com/floooh/sokol-tools-bin/raw/master/bin/linux/sokol-shdc
|
||||
chmod +x ./sokol-shdc
|
||||
for f in examples/sokol/02_cubes_glsl/cube_glsl \
|
||||
examples/sokol/03_march_tracing_glsl/rt_glsl \
|
||||
examples/sokol/04_multi_shader_glsl/rt_glsl_puppy \
|
||||
examples/sokol/04_multi_shader_glsl/rt_glsl_march \
|
||||
examples/sokol/05_instancing_glsl/rt_glsl_instancing \
|
||||
examples/sokol/06_obj_viewer/gouraud \
|
||||
; do \
|
||||
echo "compiling shader $f.glsl ..."; \
|
||||
./sokol-shdc --input $f.glsl --output $f.h --slang glsl330 ; \
|
||||
done
|
||||
for vfile in examples/sokol/0?*/*.v; do echo "compiling $vfile ..."; ./v $vfile ; done
|
||||
|
||||
- name: Install C++ dependencies
|
||||
run: |
|
||||
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev
|
||||
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
||||
sudo apt-get install --quiet -y valgrind g++-9
|
||||
- name: Build V
|
||||
run: make -j4
|
||||
- name: g++ version
|
||||
run: g++-9 --version
|
||||
- name: V self compilation with g++
|
||||
run: ./v -cc g++-9 -no-std -cflags -std=c++11 -o v2 cmd/v && ./v2 -cc g++-9 -no-std -cflags -std=c++11 -o v3 cmd/v
|
||||
## - name: Running tests with g++
|
||||
## run: ./v -cc g++-9 -silent test-self
|
||||
|
||||
|
||||
alpine-docker-musl-gcc:
|
||||
name: alpine-musl
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
container:
|
||||
# Alpine docker pre-built container
|
||||
image: thevlang/vlang:alpine-build
|
||||
env:
|
||||
V_CI_MUSL: 1
|
||||
VFLAGS: -cc gcc
|
||||
volumes:
|
||||
- ${{github.workspace}}:/opt/vlang
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Show Environment
|
||||
run: |
|
||||
echo "PWD:"
|
||||
pwd
|
||||
echo "ENVIRONMENT:"
|
||||
env
|
||||
echo "C Compiler:"
|
||||
gcc --version
|
||||
|
||||
- name: Build V
|
||||
run: CC=gcc make
|
||||
|
||||
- name: Test V fixed tests
|
||||
run: ./v -silent test-self
|
||||
|
||||
macos:
|
||||
runs-on: macOS-latest
|
||||
runs-on: macOS-12
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc clang
|
||||
|
@ -273,12 +177,6 @@ jobs:
|
|||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./v2 -o v.c cmd/v
|
||||
- name: Build V using V
|
||||
run: ./v -o v2 cmd/v && ./v2 -o v3 cmd/v
|
||||
- name: usecache
|
||||
run: |
|
||||
./v -usecache examples/hello_world.v && examples/hello_world
|
||||
# ./v -o v2 -usecache cmd/v
|
||||
# ./v2 -o v3 -usecache cmd/v
|
||||
# ./v3 -usecache examples/tetris/tetris.v
|
||||
- name: Test symlink
|
||||
run: ./v symlink
|
||||
# - name: Set up pg database
|
||||
|
@ -288,22 +186,22 @@ jobs:
|
|||
# psql -d postgres -c 'create database customerdb;'
|
||||
# psql -d customerdb -f examples/database/pg/mydb.sql
|
||||
# - name: Test v->c
|
||||
# run: ./v -silent test-all
|
||||
# run: ./v test-all
|
||||
# - name: Test v binaries
|
||||
# run: ./v build-vbinaries
|
||||
## - name: Test v->js
|
||||
## run: ./v -o hi.js examples/hello_v_js.v && node hi.js
|
||||
- name: Verify `v test` works
|
||||
run: |
|
||||
echo $VFLAGS
|
||||
./v cmd/tools/test_if_v_test_system_works.v
|
||||
./cmd/tools/test_if_v_test_system_works
|
||||
|
||||
- name: All code is formatted
|
||||
run: VJOBS=1 ./v test-cleancode
|
||||
- name: Self tests
|
||||
run: VJOBS=1 ./v -silent test-self
|
||||
|
||||
run: VJOBS=1 ./v test-self
|
||||
- name: Build examples
|
||||
run: ./v build-examples
|
||||
|
||||
- name: Build examples with -autofree
|
||||
run: |
|
||||
./v -autofree -o tetris examples/tetris/tetris.v
|
||||
|
@ -311,14 +209,12 @@ jobs:
|
|||
- name: v doctor
|
||||
run: |
|
||||
./v doctor
|
||||
|
||||
- name: Test ved
|
||||
run: |
|
||||
git clone --depth 1 https://github.com/vlang/ved
|
||||
cd ved && ../v -o ved .
|
||||
../v -autofree .
|
||||
cd ..
|
||||
|
||||
# - name: Test c2v
|
||||
# run: |
|
||||
# git clone --depth 1 https://github.com/vlang/c2v
|
||||
|
@ -327,7 +223,6 @@ jobs:
|
|||
# ../v run tests/run_tests.vsh
|
||||
# ../v -experimental -w c2v_test.v
|
||||
# cd ..
|
||||
|
||||
- name: Build V UI examples
|
||||
run: |
|
||||
git clone --depth 1 https://github.com/vlang/ui
|
||||
|
@ -336,9 +231,18 @@ jobs:
|
|||
ln -s $(pwd) ~/.vmodules/ui
|
||||
../v examples/rectangles.v
|
||||
## ../v run examples/build_examples.vsh
|
||||
- name: V self compilation with -usecache
|
||||
run: |
|
||||
unset VFLAGS
|
||||
./v -usecache examples/hello_world.v && examples/hello_world
|
||||
./v -o v2 -usecache cmd/v
|
||||
./v2 -o v3 -usecache cmd/v
|
||||
./v3 version
|
||||
./v3 -o tetris -usecache examples/tetris/tetris.v
|
||||
|
||||
ubuntu:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -361,36 +265,40 @@ jobs:
|
|||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./v2 -o v.c cmd/v
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./v3 -o v.c cmd/v
|
||||
# - name: Test V
|
||||
# run: ./v -silent test-all
|
||||
# run: ./v test-all
|
||||
# - name: Test v binaries
|
||||
# run: ./v build-vbinaries
|
||||
## - name: Test v->js
|
||||
## run: ./v -o hi.js examples/hello_v_js.v && node hi.js
|
||||
# - name: Build Vorum
|
||||
# run: git clone --depth 1 https://github.com/vlang/vorum && cd vorum && ../v . && cd ..
|
||||
# - name: Build vpm
|
||||
# run: git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . && cd ..
|
||||
- name: Build vpm
|
||||
run: git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . && cd ..
|
||||
- name: Freestanding
|
||||
run: ./v -freestanding run vlib/os/bare/bare_example_linux.v
|
||||
- name: v self compilation
|
||||
- name: V self compilation
|
||||
run: ./v -o v2 cmd/v && ./v2 -o v3 cmd/v && ./v3 -o v4 cmd/v
|
||||
# QTODO
|
||||
# - name: v self compilation with -usecache
|
||||
# run: |
|
||||
# ./v -o v2 -usecache cmd/v
|
||||
# ./v2 -o v3 -usecache cmd/v
|
||||
# ./v3 -usecache examples/tetris/tetris.v
|
||||
- name: V self compilation with -usecache
|
||||
run: |
|
||||
unset VFLAGS
|
||||
./v -usecache examples/hello_world.v && examples/hello_world
|
||||
./v -o v2 -usecache cmd/v
|
||||
./v2 -o v3 -usecache cmd/v
|
||||
./v3 version
|
||||
./v3 -o tetris -usecache examples/tetris/tetris.v
|
||||
- name: Verify `v test` works
|
||||
run: |
|
||||
echo $VFLAGS
|
||||
./v cmd/tools/test_if_v_test_system_works.v
|
||||
./cmd/tools/test_if_v_test_system_works
|
||||
- name: All code is formatted
|
||||
run: ./v test-cleancode
|
||||
- name: Self tests
|
||||
run: |
|
||||
./v -silent test-self
|
||||
run: ./v test-self
|
||||
- name: Self tests (-prod)
|
||||
run: ./v -o vprod -prod cmd/v && ./vprod -silent test-self
|
||||
run: ./v -o vprod -prod cmd/v && ./vprod test-self
|
||||
- name: Self tests (-cstrict)
|
||||
run: ./v -cc gcc -cstrict test-self
|
||||
run: VTEST_JUST_ESSENTIAL=1 V_CI_CSTRICT=1 ./v -cc gcc -cstrict test-self
|
||||
- name: Build examples
|
||||
run: ./v build-examples
|
||||
- name: Build tetris.v with -autofree
|
||||
|
@ -434,6 +342,7 @@ jobs:
|
|||
|
||||
ubuntu-clang:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc clang
|
||||
|
@ -464,23 +373,31 @@ jobs:
|
|||
ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./v5 -o v.c cmd/v
|
||||
- name: v self compilation
|
||||
run: ./v -o v2 cmd/v && ./v2 -o v3 cmd/v && ./v3 -o v4 cmd/v
|
||||
# QTODO
|
||||
# - name: v self compilation with -usecache
|
||||
# run: |
|
||||
# ./v -o v2 -usecache cmd/v
|
||||
# ./v2 -o v3 -usecache cmd/v
|
||||
# ./v3 -usecache examples/tetris/tetris.v
|
||||
- name: v self compilation with -usecache
|
||||
run: |
|
||||
unset VFLAGS
|
||||
./v -usecache examples/hello_world.v && examples/hello_world
|
||||
./v -o v2 -usecache cmd/v
|
||||
./v2 -o v3 -usecache cmd/v
|
||||
./v3 version
|
||||
./v3 -o tetris -usecache examples/tetris/tetris.v
|
||||
- name: Verify `v test` works
|
||||
run: |
|
||||
echo $VFLAGS
|
||||
./v cmd/tools/test_if_v_test_system_works.v
|
||||
./cmd/tools/test_if_v_test_system_works
|
||||
- name: All code is formatted
|
||||
run: ./v test-cleancode
|
||||
|
||||
- name: Self tests
|
||||
run: ./v test-self
|
||||
- name: Self tests (vprod)
|
||||
run: |
|
||||
./v -silent test-self
|
||||
- name: Self tests (-prod)
|
||||
run: ./v -o vprod -prod cmd/v && ./vprod -silent test-self
|
||||
./v -o vprod -prod cmd/v
|
||||
./vprod test-self
|
||||
- name: Self tests (-cstrict)
|
||||
run: ./v -cstrict test-self
|
||||
run: VTEST_JUST_ESSENTIAL=1 V_CI_CSTRICT=1 ./vprod -cstrict test-self
|
||||
|
||||
- name: Build examples
|
||||
run: ./v build-examples
|
||||
- name: Build examples with -autofree
|
||||
|
@ -514,76 +431,13 @@ jobs:
|
|||
echo "Running it..."
|
||||
ls
|
||||
|
||||
# ubuntu-autofree-selfcompile:
|
||||
# runs-on: ubuntu-20.04
|
||||
# timeout-minutes: 121
|
||||
# env:
|
||||
# VFLAGS: -cc gcc
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
# - name: Build V
|
||||
# run: make -j4
|
||||
# - name: V self compilation with -autofree
|
||||
# run: ./v -o v2 -autofree cmd/v && ./v2 -o v3 -autofree cmd/v && ./v3 -o v4 -autofree cmd/v
|
||||
|
||||
# Ubuntu docker pre-built container
|
||||
ubuntu-musl:
|
||||
name: ubuntu-musl
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
container:
|
||||
image: thevlang/vlang:ubuntu-build
|
||||
env:
|
||||
V_CI_MUSL: 1
|
||||
V_CI_UBUNTU_MUSL: 1
|
||||
VFLAGS: -cc musl-gcc
|
||||
volumes:
|
||||
- ${{github.workspace}}:/opt/vlang
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build V
|
||||
run: |
|
||||
echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v
|
||||
- name: Verify `v test` works
|
||||
run: |
|
||||
./v cmd/tools/test_if_v_test_system_works.v
|
||||
./cmd/tools/test_if_v_test_system_works
|
||||
- name: Test V fixed tests
|
||||
run: |
|
||||
./v -silent test-self
|
||||
|
||||
# ubuntu-musl:
|
||||
# runs-on: ubuntu-20.04
|
||||
# timeout-minutes: 121
|
||||
# env:
|
||||
# VFLAGS: -cc musl-gcc
|
||||
# V_CI_MUSL: 1
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
# - uses: actions/setup-node@v1
|
||||
# with:
|
||||
# node-version: 12.x
|
||||
# - name: Install dependencies
|
||||
# run: |
|
||||
# sudo apt-get install --quiet -y musl musl-tools libssl-dev sqlite3 libsqlite3-dev valgrind
|
||||
# - name: Build v
|
||||
# run: echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v
|
||||
# # - name: Test v binaries
|
||||
# # run: ./v build-vbinaries
|
||||
# ## - name: Test v->js
|
||||
# ## run: ./v -o hi.js examples/hello_v_js.v && node hi.js
|
||||
# - name: quick debug
|
||||
# run: ./v -stats vlib/strconv/format_test.v
|
||||
# - name: Self tests
|
||||
# run: ./v -silent test-self
|
||||
|
||||
windows-gcc:
|
||||
runs-on: windows-2019
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc gcc
|
||||
VERBOSE_MAKE: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
|
@ -594,7 +448,9 @@ jobs:
|
|||
gcc --version
|
||||
.\make.bat -gcc
|
||||
- name: Test new v.c
|
||||
run: .\v.exe -o v.c cmd/v && gcc -Werror -I ./thirdparty/stdatomic/win -municode -w v.c
|
||||
run: |
|
||||
.\v.exe -o v.c cmd/v
|
||||
gcc -Werror -municode -w v.c
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
.\v.exe setup-freetype
|
||||
|
@ -604,14 +460,31 @@ jobs:
|
|||
./v doctor
|
||||
- name: Verify `v test` works
|
||||
run: |
|
||||
echo $VFLAGS
|
||||
./v cmd/tools/test_if_v_test_system_works.v
|
||||
./cmd/tools/test_if_v_test_system_works
|
||||
- name: All code is formatted
|
||||
run: ./v test-cleancode
|
||||
- name: Self tests
|
||||
run: .\v.exe test-self
|
||||
# - name: Test
|
||||
# run: .\v.exe test-all
|
||||
- name: Test time functions in a timezone UTC-12
|
||||
run: |
|
||||
.\v.exe -silent test-self
|
||||
# - name: Test
|
||||
# run: |
|
||||
# .\v.exe -silent test-all
|
||||
tzutil /s "Dateline Standard Time"
|
||||
./v test vlib/time/
|
||||
- name: Test time functions in a timezone UTC-3
|
||||
run: |
|
||||
tzutil /s "Greenland Standard Time"
|
||||
./v test vlib/time/
|
||||
- name: Test time functions in a timezone UTC+3
|
||||
run: |
|
||||
tzutil /s "Russian Standard Time"
|
||||
./v test vlib/time/
|
||||
- name: Test time functions in a timezone UTC+12
|
||||
run: |
|
||||
tzutil /s "New Zealand Standard Time"
|
||||
./v test vlib/time/
|
||||
- name: Test v->js
|
||||
run: ./v -o hi.js examples/hello_v_js.v && node hi.js
|
||||
- name: Test v binaries
|
||||
|
@ -623,9 +496,11 @@ jobs:
|
|||
|
||||
windows-msvc:
|
||||
runs-on: windows-2019
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc msvc
|
||||
VERBOSE_MAKE: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
|
@ -646,15 +521,18 @@ jobs:
|
|||
./v doctor
|
||||
- name: Verify `v test` works
|
||||
run: |
|
||||
echo $VFLAGS
|
||||
./v cmd/tools/test_if_v_test_system_works.v
|
||||
./cmd/tools/test_if_v_test_system_works
|
||||
### TODO: test-cleancode fails with msvc. Investigate why???
|
||||
## - name: All code is formatted
|
||||
## run: ./v test-cleancode
|
||||
- name: Self tests
|
||||
run: |
|
||||
./v -cg cmd\tools\vtest-self.v
|
||||
./v -silent test-self
|
||||
./v test-self
|
||||
# - name: Test
|
||||
# run: |
|
||||
# .\v.exe -silent test-all
|
||||
# run: .\v.exe test-all
|
||||
- name: Test v->js
|
||||
run: ./v -o hi.js examples/hello_v_js.v && node hi.js
|
||||
- name: Test v binaries
|
||||
|
@ -666,11 +544,13 @@ jobs:
|
|||
|
||||
windows-tcc:
|
||||
runs-on: windows-2019
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc tcc -no-retry-compilation
|
||||
VJOBS: 1
|
||||
VTEST_SHOW_START: 1
|
||||
VERBOSE_MAKE: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
|
@ -680,7 +560,9 @@ jobs:
|
|||
run: |
|
||||
.\make.bat -tcc
|
||||
- name: Test new v.c
|
||||
run: .\v.exe -o v.c cmd/v && .\thirdparty\tcc\tcc.exe -I ./thirdparty/stdatomic/win -Werror -w -ladvapi32 -bt10 v.c
|
||||
run: |
|
||||
.\v.exe -o v.c cmd/v
|
||||
.\thirdparty\tcc\tcc.exe -Werror -w -ladvapi32 -bt10 v.c
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
.\v.exe setup-freetype
|
||||
|
@ -688,31 +570,23 @@ jobs:
|
|||
- name: v doctor
|
||||
run: |
|
||||
./v doctor
|
||||
|
||||
- name: Verify `v test` works
|
||||
run: |
|
||||
.\v.exe cmd/tools/test_if_v_test_system_works.v
|
||||
.\cmd\tools\test_if_v_test_system_works.exe
|
||||
|
||||
- name: Verify `v vlib/v/gen/c/coutput_test.v` works
|
||||
run: |
|
||||
.\v.exe vlib/v/gen/c/coutput_test.v
|
||||
|
||||
- name: Make sure running TCC64 instead of TCC32
|
||||
run: ./v test .github\workflows\make_sure_ci_run_with_64bit_compiler_test.v
|
||||
|
||||
- name: Test ./v doc -v clipboard *BEFORE building tools*
|
||||
run: ./v doc -v clipboard
|
||||
|
||||
- name: Test v build-tools
|
||||
run: ./v -W build-tools
|
||||
|
||||
- name: Test ./v doc clipboard
|
||||
run: ./v doc clipboard
|
||||
|
||||
- name: All code is formatted
|
||||
run: ./v test-cleancode
|
||||
- name: Self tests
|
||||
run: ./v test-self
|
||||
|
||||
- name: Test v->js
|
||||
run: ./v -o hi.js examples/hello_v_js.v && node hi.js
|
||||
- name: Test v binaries
|
||||
|
@ -720,7 +594,9 @@ jobs:
|
|||
- name: Build examples
|
||||
run: ./v build-examples
|
||||
- name: v2 self compilation
|
||||
run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v
|
||||
run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v && .\v3.exe -o v4.exe cmd/v
|
||||
- name: v2 self compilation with -gc boehm
|
||||
run: .\v.exe -o v2.exe -gc boehm cmd/v && .\v2.exe -o v3.exe -gc boehm cmd/v && .\v3.exe -o v4.exe -gc boehm cmd/v
|
||||
|
||||
## ## tcc32
|
||||
## - name: Build with make.bat -tcc32
|
||||
|
@ -729,7 +605,7 @@ jobs:
|
|||
## .\v.exe wipe-cache
|
||||
## .\make.bat -tcc32
|
||||
## - name: Test new v.c
|
||||
## run: .\v.exe -o v.c cmd/v && .\thirdparty\tcc\tcc.exe -I ./thirdparty/stdatomic/win -Werror -g -w -ladvapi32 -bt10 v.c
|
||||
## run: .\v.exe -o v.c cmd/v && .\thirdparty\tcc\tcc.exe -Werror -g -w -ladvapi32 -bt10 v.c
|
||||
## - name: v doctor
|
||||
## run: ./v doctor
|
||||
##
|
||||
|
@ -762,127 +638,43 @@ jobs:
|
|||
## - name: v2 self compilation
|
||||
## run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v
|
||||
|
||||
parser-silent:
|
||||
name: Parser silent mode
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install zzuf
|
||||
run: sudo apt install -qq zzuf
|
||||
- name: Build local v
|
||||
run: |
|
||||
make -j4
|
||||
./v -g cmd/tools/vtest-parser.v
|
||||
- name: Run test-parser
|
||||
run: |
|
||||
./v test-parser -S examples/hello_world.v
|
||||
./v test-parser -S examples/hanoi.v
|
||||
./v test-parser -S examples/fibonacci.v
|
||||
./v test-parser -S examples/cli.v
|
||||
./v test-parser -S examples/json.v
|
||||
./v test-parser -S examples/vmod.v
|
||||
./v test-parser -S examples/regex/regex_example.v
|
||||
./v test-parser -S examples/2048/2048.v
|
||||
|
||||
- name: Run test-parser over fuzzed files
|
||||
run: |
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hello_world.v > examples/hello_world_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hanoi.v > examples/hanoi_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/fibonacci.v > examples/fibonacci_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/cli.v > examples/cli_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/json.v > examples/json_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/vmod.v > examples/vmod_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/regex/regex_example.v > examples/regex_example_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/2048/2048.v > examples/2048/2048_fuzz.v
|
||||
./v test-parser -S examples/hello_world_fuzz.v
|
||||
./v test-parser -S examples/hanoi_fuzz.v
|
||||
./v test-parser -S examples/cli_fuzz.v
|
||||
./v test-parser -S examples/regex_example_fuzz.v
|
||||
./v test-parser -S examples/2048/2048_fuzz.v
|
||||
# ubuntu-autofree-selfcompile:
|
||||
# runs-on: ubuntu-20.04
|
||||
# if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
# timeout-minutes: 121
|
||||
# env:
|
||||
# VFLAGS: -cc gcc
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
# - name: Build V
|
||||
# run: make -j4
|
||||
# - name: V self compilation with -autofree
|
||||
# run: ./v -o v2 -autofree cmd/v && ./v2 -o v3 -autofree cmd/v && ./v3 -o v4 -autofree cmd/v
|
||||
|
||||
v-apps-compile:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 121
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build V
|
||||
run: make && sudo ./v symlink
|
||||
|
||||
## vls
|
||||
- name: Clone VLS
|
||||
run: git clone --depth 1 https://github.com/vlang/vls
|
||||
- name: Build VLS
|
||||
run: pushd vls; v cmd/vls ; popd
|
||||
- name: Build VLS with -prod
|
||||
run: pushd vls; v -prod cmd/vls; popd
|
||||
|
||||
## vsl
|
||||
- name: Clone VSL
|
||||
run: git clone --depth 1 https://github.com/vlang/vsl ~/.vmodules/vsl
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev libgc-dev
|
||||
- name: Execute Tests using Pure V Backend
|
||||
run: ~/.vmodules/vsl/bin/test
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math
|
||||
run: ~/.vmodules/vsl/bin/test --use-cblas
|
||||
- name: Execute Tests using Pure V Backend and Garbage Collection enabled
|
||||
run: ~/.vmodules/vsl/bin/test --use-gc boehm
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math and Garbage Collection enabled
|
||||
run: ~/.vmodules/vsl/bin/test --use-cblas --use-gc boehm
|
||||
|
||||
## vtl
|
||||
- name: Clone VTL
|
||||
run: git clone --depth 1 https://github.com/vlang/vtl ~/.vmodules/vtl
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev libgc-dev
|
||||
- name: Execute Tests using Pure V Backend
|
||||
run: ~/.vmodules/vtl/bin/test
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math
|
||||
run: ~/.vmodules/vtl/bin/test --use-cblas
|
||||
- name: Execute Tests using Pure V Backend and Garbage Collection enabled
|
||||
run: ~/.vmodules/vtl/bin/test --use-gc boehm
|
||||
- name: Execute Tests using Pure V Backend with Pure V Math and Garbage Collection enabled
|
||||
run: ~/.vmodules/vtl/bin/test --use-cblas --use-gc boehm
|
||||
|
||||
## vab
|
||||
- name: Clone vab
|
||||
run: git clone --depth 1 https://github.com/vlang/vab
|
||||
- name: Build vab
|
||||
run: cd vab; ../v ./vab.v ; cd ..
|
||||
|
||||
## gitly
|
||||
- name: Install markdown
|
||||
run: ./v install markdown
|
||||
- name: Build Gitly
|
||||
run: |
|
||||
git clone --depth 1 https://github.com/vlang/gitly
|
||||
cd gitly
|
||||
../v .
|
||||
# ./gitly -ci_run
|
||||
../v -autofree .
|
||||
../v -o x tests/first_run.v
|
||||
./x
|
||||
cd ..
|
||||
|
||||
## vex
|
||||
- name: Install Vex dependencies
|
||||
run: sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev
|
||||
- name: Install Vex
|
||||
run: mkdir -p ~/.vmodules/nedpals; git clone https://github.com/nedpals/vex ~/.vmodules/nedpals/vex
|
||||
- name: Compile the simple Vex example
|
||||
run: ./v ~/.vmodules/nedpals/vex/examples/simple_example.v
|
||||
- name: Run Vex Tests
|
||||
run: ./v test ~/.vmodules/nedpals/vex
|
||||
|
||||
## vpm modules
|
||||
- name: Install UI through VPM
|
||||
run: ./v install ui
|
||||
|
||||
## libsodium
|
||||
- name: Install libsodium-dev package
|
||||
run: sudo apt-get install --quiet -y libsodium-dev
|
||||
- name: Installl the libsodium wrapper through VPM
|
||||
run: ./v install libsodium
|
||||
- name: Test libsodium
|
||||
run: ./v test ~/.vmodules/libsodium
|
||||
# ubuntu-musl:
|
||||
# runs-on: ubuntu-20.04
|
||||
# if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
# timeout-minutes: 121
|
||||
# env:
|
||||
# VFLAGS: -cc musl-gcc
|
||||
# V_CI_MUSL: 1
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
# - uses: actions/setup-node@v1
|
||||
# with:
|
||||
# node-version: 12.x
|
||||
# - name: Install dependencies
|
||||
# run: |
|
||||
# sudo apt-get install --quiet -y musl musl-tools libssl-dev sqlite3 libsqlite3-dev valgrind
|
||||
# - name: Build v
|
||||
# run: echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v
|
||||
# # - name: Test v binaries
|
||||
# # run: ./v build-vbinaries
|
||||
# ## - name: Test v->js
|
||||
# ## run: ./v -o hi.js examples/hello_v_js.v && node hi.js
|
||||
# - name: quick debug
|
||||
# run: ./v -stats vlib/strconv/format_test.v
|
||||
# - name: Self tests
|
||||
# run: ./v test-self
|
||||
|
|
|
@ -11,10 +11,11 @@ on:
|
|||
jobs:
|
||||
ubuntu:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 15
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
VFLAGS: -cc tcc -no-retry-compilation
|
||||
B_CFLAGS: -g -std=gnu11 -I ./thirdparty/stdatomic/nix -w
|
||||
B_CFLAGS: -g -std=gnu11 -w
|
||||
B_LFLAGS: -lm -lpthread
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -49,10 +50,11 @@ jobs:
|
|||
|
||||
macos:
|
||||
runs-on: macos-11
|
||||
timeout-minutes: 15
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
VFLAGS: -cc clang
|
||||
B_CFLAGS: -g -std=gnu11 -I ./thirdparty/stdatomic/nix -w
|
||||
B_CFLAGS: -g -std=gnu11 -w
|
||||
B_LFLAGS: -lm -lpthread
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
|
|
@ -12,7 +12,8 @@ jobs:
|
|||
|
||||
macos-cross:
|
||||
runs-on: macOS-latest
|
||||
timeout-minutes: 15
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 25
|
||||
env:
|
||||
VFLAGS: -cc clang
|
||||
steps:
|
||||
|
@ -43,7 +44,8 @@ jobs:
|
|||
|
||||
linux-cross:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 15
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 25
|
||||
env:
|
||||
VFLAGS: -cc tcc -no-retry-compilation
|
||||
steps:
|
||||
|
@ -57,6 +59,7 @@ jobs:
|
|||
sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev
|
||||
sudo apt-get install --quiet -y mingw-w64 wine-stable winetricks
|
||||
## sudo apt-get install --quiet -y wine32
|
||||
|
||||
- name: Turn off the wine crash dialog
|
||||
run: winetricks nocrashdialog
|
||||
|
||||
|
@ -66,14 +69,14 @@ jobs:
|
|||
- name: v.c can be compiled and run with -os cross
|
||||
run: |
|
||||
./v -os cross -o /tmp/v.c cmd/v
|
||||
gcc -g -std=gnu11 -I ./thirdparty/stdatomic/nix -w -o v_from_vc /tmp/v.c -lm -lpthread
|
||||
gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm -lpthread
|
||||
ls -lart v_from_vc
|
||||
./v_from_vc version
|
||||
|
||||
- name: v_win.c can be compiled and run with -os windows
|
||||
run: |
|
||||
./v -os windows -o /tmp/v_win.c cmd/v
|
||||
x86_64-w64-mingw32-gcc -I ./thirdparty/stdatomic/win /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe
|
||||
./v -cc msvc -os windows -o /tmp/v_win.c cmd/v
|
||||
x86_64-w64-mingw32-gcc /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe
|
||||
ls -lart v_from_vc.exe
|
||||
wine64 ./v_from_vc.exe version
|
||||
|
||||
|
@ -90,9 +93,8 @@ jobs:
|
|||
|
||||
windows-cross:
|
||||
runs-on: windows-2019
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
VFLAGS: -cc msvc
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 25
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build
|
||||
|
@ -102,8 +104,8 @@ jobs:
|
|||
.\make.bat -msvc
|
||||
- name: TODO v_win.c can be compiled and run with -os windows
|
||||
run: |
|
||||
.\v.exe -os windows -showcc -o v2.exe cmd\v
|
||||
.\v.exe -os windows -o v_win.c cmd\v
|
||||
.\v.exe -os windows -cc msvc -showcc -o v2.exe cmd\v
|
||||
.\v.exe -os windows -cc msvc -o v_win.c cmd\v
|
||||
dir v2.exe
|
||||
dir v_win.c
|
||||
.\v2.exe version
|
||||
|
|
|
@ -16,9 +16,14 @@ on:
|
|||
paths:
|
||||
- '!**'
|
||||
- 'cmd/tools/vtest*'
|
||||
- 'cmd/tools/builders/**.v'
|
||||
- 'vlib/builtin/**.v'
|
||||
- 'vlib/strconv/**.v'
|
||||
- 'vlib/strings/**.v'
|
||||
- 'vlib/math/**.v'
|
||||
- 'vlib/math/big/**.v'
|
||||
- 'vlib/arrays/**.v'
|
||||
- 'vlib/datatypes/**.v'
|
||||
- 'vlib/os/**.v'
|
||||
- 'vlib/sync/**.v'
|
||||
- 'vlib/v/tests/**.v'
|
||||
|
@ -27,18 +32,25 @@ on:
|
|||
- 'vlib/v/parser/**.v'
|
||||
- 'vlib/v/checker/**.v'
|
||||
- 'vlib/v/gen/c/**.v'
|
||||
- 'vlib/v/builder/**.v'
|
||||
- 'vlib/v/cflag/**.v'
|
||||
- 'vlib/v/live/**.v'
|
||||
- 'vlib/v/util/**.v'
|
||||
- 'vlib/v/markused/**.v'
|
||||
- 'vlib/v/preludes/**.v'
|
||||
- 'vlib/v/embed_file/**.v'
|
||||
pull_request:
|
||||
paths:
|
||||
- '!**'
|
||||
- 'cmd/tools/vtest*'
|
||||
- 'cmd/tools/builders/**.v'
|
||||
- 'vlib/builtin/**.v'
|
||||
- 'vlib/strconv/**.v'
|
||||
- 'vlib/strings/**.v'
|
||||
- 'vlib/math/**.v'
|
||||
- 'vlib/math/big/**.v'
|
||||
- 'vlib/arrays/**.v'
|
||||
- 'vlib/datatypes/**.v'
|
||||
- 'vlib/os/**.v'
|
||||
- 'vlib/sync/**.v'
|
||||
- 'vlib/v/tests/**.v'
|
||||
|
@ -47,19 +59,22 @@ on:
|
|||
- 'vlib/v/parser/**.v'
|
||||
- 'vlib/v/checker/**.v'
|
||||
- 'vlib/v/gen/c/**.v'
|
||||
- 'vlib/v/builder/**.v'
|
||||
- 'vlib/v/cflag/**.v'
|
||||
- 'vlib/v/live/**.v'
|
||||
- 'vlib/v/util/**.v'
|
||||
- 'vlib/v/markused/**.v'
|
||||
- 'vlib/v/preludes/**.v'
|
||||
- 'vlib/v/embed_file/**.v'
|
||||
|
||||
concurrency:
|
||||
group: build-${{ github.event.pull_request.number || github.sha }}
|
||||
group: build-sanitized-${{ github.event.pull_request.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
tests-sanitize-undefined-clang:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 180
|
||||
env:
|
||||
VFLAGS: -cc clang
|
||||
|
@ -77,7 +92,9 @@ jobs:
|
|||
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
||||
sudo apt-get install clang
|
||||
- name: Build V
|
||||
run: make -j4 && ./v -cg -cstrict -o v cmd/v
|
||||
run: make && ./v -cg -cstrict -o v cmd/v
|
||||
- name: Ensure code is well formatted
|
||||
run: ./v test-cleancode
|
||||
- name: Self tests (-fsanitize=undefined)
|
||||
run: ./v -cflags "-fsanitize=undefined" -o v2 cmd/v && ./v2 -cflags -fsanitize=undefined test-self
|
||||
- name: Build examples (V compiled with -fsanitize=undefined)
|
||||
|
@ -85,6 +102,7 @@ jobs:
|
|||
|
||||
tests-sanitize-undefined-gcc:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 180
|
||||
env:
|
||||
VFLAGS: -cc gcc
|
||||
|
@ -101,7 +119,9 @@ jobs:
|
|||
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
|
||||
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
||||
- name: Build V
|
||||
run: make -j4 && ./v -cg -cstrict -o v cmd/v
|
||||
run: make && ./v -cg -cstrict -o v cmd/v
|
||||
- name: Ensure code is well formatted
|
||||
run: ./v test-cleancode
|
||||
- name: Self tests (-fsanitize=undefined)
|
||||
run: ./v -cflags "-fsanitize=undefined" -o v2 cmd/v && ./v2 -cflags -fsanitize=undefined test-self
|
||||
- name: Build examples (V compiled with -fsanitize=undefined)
|
||||
|
@ -109,6 +129,7 @@ jobs:
|
|||
|
||||
tests-sanitize-address-clang:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 180
|
||||
env:
|
||||
VFLAGS: -cc clang
|
||||
|
@ -126,7 +147,9 @@ jobs:
|
|||
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
||||
sudo apt-get install clang
|
||||
- name: Build V
|
||||
run: make -j4 && ./v -cg -cstrict -o v cmd/v
|
||||
run: make && ./v -cg -cstrict -o v cmd/v
|
||||
- name: Ensure code is well formatted
|
||||
run: ./v test-cleancode
|
||||
- name: Self tests (-fsanitize=address)
|
||||
run: ASAN_OPTIONS=detect_leaks=0 ./v -cflags "-fsanitize=address,pointer-compare,pointer-subtract" test-self
|
||||
- name: Self tests (V compiled with -fsanitize=address)
|
||||
|
@ -138,6 +161,7 @@ jobs:
|
|||
|
||||
tests-sanitize-address-msvc:
|
||||
runs-on: windows-2019
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 180
|
||||
env:
|
||||
VFLAGS: -cc msvc
|
||||
|
@ -154,6 +178,11 @@ jobs:
|
|||
echo $VFLAGS
|
||||
.\make.bat -msvc
|
||||
.\v.exe self
|
||||
- name: Ensure code is well formatted
|
||||
run: |
|
||||
.\v.exe fmt -verify vlib/builtin/ vlib/v/scanner/ vlib/v/parser/ vlib/v/gen/
|
||||
## TODO: check to see why `v test-cleancode` does not work with msvc on windows
|
||||
|
||||
## - name: Install dependencies
|
||||
## run: |
|
||||
## .\v.exe setup-freetype
|
||||
|
@ -164,6 +193,7 @@ jobs:
|
|||
|
||||
tests-sanitize-address-gcc:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 180
|
||||
env:
|
||||
VFLAGS: -cc gcc
|
||||
|
@ -181,7 +211,9 @@ jobs:
|
|||
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
||||
sudo apt-get install clang
|
||||
- name: Build V
|
||||
run: make -j4 && ./v -cg -cstrict -o v cmd/v
|
||||
run: make && ./v -cg -cstrict -o v cmd/v
|
||||
- name: Ensure code is well formatted
|
||||
run: ./v test-cleancode
|
||||
- name: Self tests (-fsanitize=address)
|
||||
run: ASAN_OPTIONS=detect_leaks=0 ./v -cflags -fsanitize=address test-self
|
||||
- name: Self tests (V compiled with -fsanitize=address)
|
||||
|
@ -193,9 +225,10 @@ jobs:
|
|||
|
||||
tests-sanitize-memory-clang:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 180
|
||||
env:
|
||||
VFLAGS: -cc clang
|
||||
VFLAGS: -cc clang -gc none
|
||||
VJOBS: 1
|
||||
VTEST_SHOW_START: 1
|
||||
steps:
|
||||
|
@ -210,11 +243,14 @@ jobs:
|
|||
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
|
||||
sudo apt-get install clang
|
||||
- name: Build V
|
||||
run: make -j4 && ./v -cc clang -cg -cstrict -o v cmd/v
|
||||
run: make && ./v -cc clang -cg -cstrict -o v cmd/v
|
||||
- name: Ensure code is well formatted
|
||||
run: ./v test-cleancode
|
||||
- name: Self tests (-fsanitize=memory)
|
||||
run: ./v -cflags -fsanitize=memory test-self
|
||||
- name: Self tests (V compiled with -fsanitize=memory)
|
||||
run:
|
||||
./v -cflags -fsanitize=memory -o v cmd/v && ./v -cc tcc test-self -msan-compiler
|
||||
run: |
|
||||
./v -cflags -fsanitize=memory -o v cmd/v
|
||||
./v -cc tcc test-self -msan-compiler
|
||||
- name: Build examples (V compiled with -fsanitize=memory)
|
||||
run: ./v build-examples
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
name: vlang benchmarks
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
|
||||
jobs:
|
||||
run:
|
||||
name: Run
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Install google benchmark
|
||||
run: |
|
||||
git clone https://github.com/google/benchmark.git
|
||||
cd benchmark
|
||||
cmake -E make_directory "build"
|
||||
cmake -E chdir "build" cmake -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on -DCMAKE_BUILD_TYPE=Release ../
|
||||
sudo cmake --build "build" --config Release --target install
|
||||
- name: Run V benchmark
|
||||
run: |
|
||||
make
|
||||
sudo ./v symlink
|
||||
git clone https://github.com/vincenzopalazzo/benchmarks.git
|
||||
cd benchmarks
|
||||
make vdep && make v
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: vlang-benchmark
|
||||
path: benchmarks/vlang/*.json
|
|
@ -0,0 +1,82 @@
|
|||
name: Containers CI
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
|
||||
concurrency:
|
||||
group: build-containers-${{ github.event.pull_request.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
||||
alpine-docker-musl-gcc:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 181
|
||||
container:
|
||||
# Alpine docker pre-built container
|
||||
image: thevlang/vlang:alpine-build
|
||||
env:
|
||||
V_CI_MUSL: 1
|
||||
VFLAGS: -cc gcc
|
||||
volumes:
|
||||
- ${{github.workspace}}:/opt/vlang
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Show Environment
|
||||
run: |
|
||||
echo "PWD:"
|
||||
pwd
|
||||
echo "ENVIRONMENT:"
|
||||
env
|
||||
echo "C Compiler:"
|
||||
gcc --version
|
||||
|
||||
- name: Build V
|
||||
run: CC=gcc make
|
||||
|
||||
- name: All code is formatted
|
||||
run: ./v test-cleancode
|
||||
|
||||
- name: Run only essential tests
|
||||
run: VTEST_JUST_ESSENTIAL=1 ./v test-self
|
||||
|
||||
ubuntu-docker-musl:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
container:
|
||||
image: thevlang/vlang:ubuntu-build
|
||||
env:
|
||||
V_CI_MUSL: 1
|
||||
V_CI_UBUNTU_MUSL: 1
|
||||
VFLAGS: -cc musl-gcc -gc none
|
||||
volumes:
|
||||
- ${{github.workspace}}:/opt/vlang
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build V
|
||||
run: |
|
||||
echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v
|
||||
- name: Verify `v test` works
|
||||
run: |
|
||||
echo $VFLAGS
|
||||
./v cmd/tools/test_if_v_test_system_works.v
|
||||
./cmd/tools/test_if_v_test_system_works
|
||||
|
||||
- name: All code is formatted
|
||||
run: ./v test-cleancode
|
||||
|
||||
- name: Test V fixed tests
|
||||
run: ./v test-self
|
|
@ -25,16 +25,17 @@ jobs:
|
|||
.\v.exe setup-freetype
|
||||
.\.github\workflows\windows-install-sqlite.bat
|
||||
- name: v doctor
|
||||
run: |
|
||||
./v doctor
|
||||
run: ./v doctor
|
||||
- name: Verify `v test` works
|
||||
run: |
|
||||
./v cmd/tools/test_if_v_test_system_works.v
|
||||
./cmd/tools/test_if_v_test_system_works
|
||||
- name: All code is formatted
|
||||
run: ./v test-cleancode
|
||||
- name: Self tests
|
||||
run: |
|
||||
./v -cg cmd\tools\vtest-self.v
|
||||
./v -silent test-self
|
||||
./v test-self
|
||||
- name: Test v->js
|
||||
run: ./v -o hi.js examples/hello_v_js.v && node hi.js
|
||||
- name: Test v binaries
|
||||
|
@ -43,4 +44,3 @@ jobs:
|
|||
run: ./v build-examples
|
||||
- name: v2 self compilation
|
||||
run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v
|
||||
|
||||
|
|
|
@ -14,5 +14,25 @@ jobs:
|
|||
run: make
|
||||
- name: Check markdown line length & code examples
|
||||
run: ./v check-md -hide-warnings .
|
||||
## NB: -hide-warnings is used here, so that the output is less noisy,
|
||||
## thus real errors are easier to spot.
|
||||
## NB: -hide-warnings is used here, so that the output is less noisy,
|
||||
## thus real errors are easier to spot.
|
||||
|
||||
report-missing-fn-doc:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
MOPTIONS: --relative-paths --exclude /vlib/v/ --exclude /builtin/linux_bare/ --exclude /testdata/ --exclude /tests/
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build V
|
||||
run: make
|
||||
|
||||
- name: Checkout previous v
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: vlang/v
|
||||
path: pv
|
||||
|
||||
- name: Check against parent commit
|
||||
run: |
|
||||
./v missdoc --diff $MOPTIONS pv/vlib vlib
|
||||
|
|
|
@ -10,6 +10,7 @@ on:
|
|||
jobs:
|
||||
build-vc:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
env:
|
||||
VREPO: github.com/vlang/vc.git
|
||||
steps:
|
||||
|
@ -31,7 +32,7 @@ jobs:
|
|||
rm -rf vc/v.c vc/v_win.c
|
||||
|
||||
./v -o vc/v.c -os cross cmd/v
|
||||
./v -o vc/v_win.c -os windows cmd/v
|
||||
./v -o vc/v_win.c -os windows -cc msvc cmd/v
|
||||
|
||||
sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v.c
|
||||
sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v_win.c
|
||||
|
|
|
@ -11,6 +11,7 @@ on:
|
|||
jobs:
|
||||
gg-regressions:
|
||||
runs-on: ubuntu-18.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
VFLAGS: -cc tcc
|
||||
|
@ -20,25 +21,24 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build local v
|
||||
run: make -j4
|
||||
run: make
|
||||
|
||||
- uses: openrndr/setup-opengl@v1.1
|
||||
|
||||
- name: Setup dependencies
|
||||
run: |
|
||||
# imagemagick : convert, mogrify
|
||||
# xvfb : xvfb (installed by openrndr/setup-opengl@v1.1)
|
||||
# openimageio-tools : idiff
|
||||
# libxcursor-dev libxi-dev : V gfx deps
|
||||
# mesa-common-dev : For headless rendering
|
||||
# freeglut3-dev : Fixes graphic apps compilation with tcc
|
||||
sudo apt-get update
|
||||
sudo apt-get install imagemagick openimageio-tools mesa-common-dev libxcursor-dev libxi-dev freeglut3-dev
|
||||
wget https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh
|
||||
git clone https://github.com/Larpon/gg-regression-images gg-regression-images
|
||||
chmod +x ./imgur.sh
|
||||
|
||||
- uses: openrndr/setup-opengl@v1.1
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Larpon/gg-regression-images
|
||||
path: gg-regression-images
|
||||
|
||||
- name: Sample and compare
|
||||
id: compare
|
||||
continue-on-error: true
|
||||
|
@ -50,4 +50,5 @@ jobs:
|
|||
if: steps.compare.outcome != 'success'
|
||||
run: |
|
||||
./imgur.sh /tmp/fail.png
|
||||
./imgur.sh /tmp/diff.png
|
||||
exit 1
|
|
@ -0,0 +1,36 @@
|
|||
name: native backend CI
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
|
||||
concurrency:
|
||||
group: native-backend-ci-${{ github.event.pull_request.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
native-backend:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11, macos-12, windows-2016, windows-2019, windows-2022]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build V with make.bat
|
||||
if: ${{ startsWith(matrix.os, 'windows') }}
|
||||
run: |
|
||||
.\make.bat
|
||||
.\v.exe symlink -githubci
|
||||
- name: Build V with make
|
||||
if: ${{ !startsWith(matrix.os, 'windows') }}
|
||||
run: |
|
||||
make
|
||||
./v symlink -githubci
|
||||
|
||||
- name: Test the native backend
|
||||
run: v test vlib/v/gen/native/
|
|
@ -0,0 +1,153 @@
|
|||
name: Other CI
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
|
||||
concurrency:
|
||||
group: build-other-${{ github.event.pull_request.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
no-gpl-by-accident:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: No GPL licensed code, should be added accidentally
|
||||
run: |
|
||||
! grep -r --exclude="*.yml" "a GPL license" .
|
||||
|
||||
code-formatting:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
VFLAGS: -cc gcc
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Environment info
|
||||
run: echo $VFLAGS $GITHUB_SHA $GITHUB_REF
|
||||
- name: Build local v
|
||||
run: make -j4
|
||||
- name: v test-cleancode
|
||||
run: ./v test-cleancode
|
||||
- name: v test-fmt
|
||||
run: ./v test-fmt
|
||||
|
||||
performance-regressions:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
VFLAGS: -cc gcc
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Environment info
|
||||
run: echo $VFLAGS $GITHUB_SHA $GITHUB_REF
|
||||
- name: Build local v
|
||||
run: make -j4
|
||||
- name: Clone & Build previous vmaster/v
|
||||
run: |
|
||||
git clone --depth=1 https://github.com/vlang/v vmaster/
|
||||
(cd vmaster; make -j4)
|
||||
- name: V versions
|
||||
run: ./v version && ./vmaster/v version
|
||||
- name: Build the repeat tool
|
||||
run: ./v cmd/tools/repeat.v
|
||||
- name: Repeat -o hw.c examples/hello_world.v
|
||||
run: cmd/tools/repeat --max_time 251 --series 3 --count 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -show-timings -o hw.c examples/hello_world.v' . ./vmaster
|
||||
- name: Repeat -o v.c cmd/v
|
||||
run: cmd/tools/repeat --max_time 1501 --series 3 --count 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -show-timings -o v.c cmd/v' . ./vmaster
|
||||
|
||||
misc-tooling:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc tcc -no-retry-compilation
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 10
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install --quiet -y libsodium-dev libssl-dev sqlite3 libsqlite3-dev postgresql libpq-dev valgrind
|
||||
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev xfonts-75dpi xfonts-base
|
||||
sudo apt-get install --quiet -y g++-9
|
||||
|
||||
- name: Build v
|
||||
run: make
|
||||
|
||||
- name: g++ version
|
||||
run: g++-9 --version
|
||||
- name: V self compilation with g++
|
||||
run: ./v -cc g++-9 -no-std -cflags -std=c++11 -o v2 cmd/v && ./v2 -cc g++-9 -no-std -cflags -std=c++11 -o v3 cmd/v
|
||||
## - name: Running tests with g++
|
||||
## run: ./v -cc g++-9 test-self
|
||||
|
||||
- name: Ensure V can be compiled with -autofree
|
||||
run: ./v -autofree -o v2 cmd/v ## NB: this does not mean it runs, but at least keeps it from regressing
|
||||
|
||||
- name: Shader examples can be build
|
||||
run: |
|
||||
wget https://github.com/floooh/sokol-tools-bin/raw/33d2e4cc26088c6c28eaef5467990f8940d15aab/bin/linux/sokol-shdc
|
||||
chmod +x ./sokol-shdc
|
||||
for f in examples/sokol/02_cubes_glsl/cube_glsl \
|
||||
examples/sokol/03_march_tracing_glsl/rt_glsl \
|
||||
examples/sokol/04_multi_shader_glsl/rt_glsl_puppy \
|
||||
examples/sokol/04_multi_shader_glsl/rt_glsl_march \
|
||||
examples/sokol/05_instancing_glsl/rt_glsl_instancing \
|
||||
examples/sokol/06_obj_viewer/gouraud \
|
||||
; do \
|
||||
echo "compiling shader $f.glsl ..."; \
|
||||
./sokol-shdc --input $f.glsl --output $f.h --slang glsl330 ; \
|
||||
done
|
||||
./v should-compile-all examples/sokol/*.v examples/sokol/0?*/*.v
|
||||
|
||||
parser-silent:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install zzuf
|
||||
run: sudo apt install -qq zzuf
|
||||
- name: Build local v
|
||||
run: |
|
||||
make -j4
|
||||
./v -g cmd/tools/vtest-parser.v
|
||||
- name: Run test-parser
|
||||
run: |
|
||||
./v test-parser -S examples/hello_world.v
|
||||
./v test-parser -S examples/hanoi.v
|
||||
./v test-parser -S examples/fibonacci.v
|
||||
./v test-parser -S examples/cli.v
|
||||
./v test-parser -S examples/json.v
|
||||
./v test-parser -S examples/vmod.v
|
||||
./v test-parser -S examples/regex/regex_example.v
|
||||
./v test-parser -S examples/2048/2048.v
|
||||
|
||||
- name: Run test-parser over fuzzed files
|
||||
run: |
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hello_world.v > examples/hello_world_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hanoi.v > examples/hanoi_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/fibonacci.v > examples/fibonacci_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/cli.v > examples/cli_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/json.v > examples/json_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/vmod.v > examples/vmod_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/regex/regex_example.v > examples/regex_example_fuzz.v
|
||||
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/2048/2048.v > examples/2048/2048_fuzz.v
|
||||
./v test-parser -S examples/hello_world_fuzz.v
|
||||
./v test-parser -S examples/hanoi_fuzz.v
|
||||
./v test-parser -S examples/cli_fuzz.v
|
||||
./v test-parser -S examples/regex_example_fuzz.v
|
||||
./v test-parser -S examples/2048/2048_fuzz.v
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
name: Path Testing CI
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
|
||||
concurrency:
|
||||
group: build-paths-${{ github.event.pull_request.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
||||
space-paths-linux:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
MY_V_PATH: '你好 my $path, @с интервали'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: ${{env.MY_V_PATH}}
|
||||
- name: Build V
|
||||
run: |
|
||||
echo '${{env.MY_V_PATH}}'
|
||||
ls -la
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
ls -la
|
||||
make
|
||||
- name: v doctor
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v doctor
|
||||
- name: v tests
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v test vlib/builtin vlib/os
|
||||
|
||||
space-paths-macos:
|
||||
runs-on: macOS-latest
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
MY_V_PATH: '你好 my $path, @с интервали'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: ${{env.MY_V_PATH}}
|
||||
- name: Build V
|
||||
run: |
|
||||
echo '${{env.MY_V_PATH}}'
|
||||
ls -la
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
ls -la
|
||||
make
|
||||
## prebuild cmd/tools/builders/js_builder, to minimise the
|
||||
## chances of a sporadic "Killed" when running the tests later
|
||||
./v -b js run examples/hello_world.v
|
||||
- name: v doctor
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v doctor
|
||||
- name: v tests
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v test vlib/builtin vlib/os
|
||||
|
||||
space-paths-windows:
|
||||
runs-on: windows-2022
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
MY_V_PATH: 'path with some $punctuation, and some spaces'
|
||||
|
||||
## NB: the following paths do not work for now:
|
||||
##### MY_V_PATH: '你好 my $path, @с интервали'
|
||||
##### MY_V_PATH: 'path with some $punctuation, and some spaces '
|
||||
## tcc has a problem interpreting paths with non latin letters in them,
|
||||
## by default, but that can be solved with passing -Bthirdparty/tcc
|
||||
## but after that V fails self building with:
|
||||
####### builder error: cannot write to folder
|
||||
####### D:\a\v\v\你好 my $path, @с интервали: No such file or directory
|
||||
## and that happens even for gcc builds, not just tcc ones
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: ${{env.MY_V_PATH}}
|
||||
- name: Build V
|
||||
run: |
|
||||
echo '${{env.MY_V_PATH}}'
|
||||
dir
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
dir
|
||||
.\make.bat -tcc
|
||||
- name: v doctor
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v doctor
|
||||
- name: v tests
|
||||
run: |
|
||||
cd '${{env.MY_V_PATH}}'
|
||||
./v test vlib/builtin vlib/os
|
|
@ -2,57 +2,56 @@ name: Periodic
|
|||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 */2 * * *'
|
||||
- cron: '0 */6 * * *'
|
||||
|
||||
jobs:
|
||||
network-tests-ubuntu:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
V_CI_PERIODIC: 1
|
||||
V_CI_PERIODIC: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev valgrind
|
||||
- name: Build v
|
||||
run: make -j4
|
||||
- name: Symlink V
|
||||
run: sudo ./v symlink
|
||||
## - name: Run network tests
|
||||
## run: ./v -d network test vlib/net
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies 1
|
||||
run: sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev
|
||||
- name: Build v
|
||||
run: make
|
||||
- name: Symlink V
|
||||
run: sudo ./v symlink
|
||||
## - name: Run network tests
|
||||
## run: ./v -d network test vlib/net
|
||||
|
||||
|
||||
network-tests-macos:
|
||||
runs-on: macOS-latest
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
V_CI_PERIODIC: 1
|
||||
V_CI_PERIODIC: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup openssl library path
|
||||
run: export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
|
||||
- name: Build V
|
||||
run: make -j4
|
||||
- name: Symlink V
|
||||
run: sudo ./v symlink
|
||||
- name: Ensure thirdparty/cJSON/cJSON.o is compiled, before running tests.
|
||||
run: ./v examples/json.v
|
||||
## - name: Run network tests
|
||||
## run: ./v -d network test vlib/net
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup openssl library path
|
||||
run: export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
|
||||
- name: Build V
|
||||
run: make
|
||||
- name: Symlink V
|
||||
run: sudo ./v symlink
|
||||
- name: Ensure thirdparty/cJSON/cJSON.o is compiled, before running tests.
|
||||
run: ./v examples/json.v
|
||||
## - name: Run network tests
|
||||
## run: ./v -d network test vlib/net
|
||||
|
||||
network-windows-msvc:
|
||||
runs-on: windows-2019
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
V_CI_PERIODIC: 1
|
||||
VFLAGS: -cc msvc
|
||||
V_CI_PERIODIC: 1
|
||||
VFLAGS: -cc msvc
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: |
|
||||
echo %VFLAGS%
|
||||
echo $VFLAGS
|
||||
.\make.bat -msvc
|
||||
## - name: Run network tests
|
||||
## run: .\v.exe -d network test vlib/net
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: |
|
||||
echo %VFLAGS%
|
||||
echo $VFLAGS
|
||||
.\make.bat -msvc
|
||||
## - name: Run network tests
|
||||
## run: .\v.exe -d network test vlib/net
|
||||
|
|
|
@ -11,6 +11,7 @@ on:
|
|||
jobs:
|
||||
v-compiles-sdl-examples:
|
||||
runs-on: ubuntu-18.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
VFLAGS: -cc tcc
|
||||
|
@ -40,6 +41,7 @@ jobs:
|
|||
|
||||
- name: Build sdl examples
|
||||
run: |
|
||||
v shader sdl/examples/sdl_opengl_and_sokol
|
||||
for example in sdl/examples/*; do
|
||||
echo "v $example"
|
||||
v "$example";
|
||||
|
|
|
@ -11,32 +11,37 @@ on:
|
|||
jobs:
|
||||
toml-module-pass-external-test-suites:
|
||||
runs-on: ubuntu-18.04
|
||||
timeout-minutes: 10
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
TOML_BS_TESTS_PATH: vlib/toml/tests/testdata/burntsushi/toml-test
|
||||
TOML_BS_TESTS_PINNED_COMMIT: eb989e5
|
||||
TOML_BS_TESTS_PINNED_COMMIT: 4634fdf
|
||||
TOML_IARNA_TESTS_PATH: vlib/toml/tests/testdata/iarna/toml-test
|
||||
TOML_IARNA_TESTS_PINNED_COMMIT: 1880b1a
|
||||
TOML_ALEXCRICHTON_TESTS_PATH: vlib/toml/tests/testdata/alexcrichton/toml-test
|
||||
TOML_ALEXCRICHTON_TESTS_PINNED_COMMIT: 499e8c4
|
||||
TOML_AC_TESTS_PATH: vlib/toml/tests/testdata/alexcrichton/toml-test
|
||||
TOML_AC_TESTS_PINNED_COMMIT: 499e8c4
|
||||
VTEST_TOML_DO_LARGE_FILES: 1
|
||||
VTEST_TOML_DO_YAML_CONVERSION: 1
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install --quiet -y jq
|
||||
sudo apt-get install --quiet -y jq libgc-dev
|
||||
- name: Build V
|
||||
run: make -j2 && ./v -cc gcc -o v cmd/v
|
||||
|
||||
- name: Show JQ Version
|
||||
run: jq --version
|
||||
|
||||
- name: Run local TOML tests
|
||||
run: ./v test vlib/toml
|
||||
|
||||
# Tests found at https://github.com/BurntSushi/toml-test
|
||||
- name: Clone BurntSushi/toml-test
|
||||
run: |
|
||||
git clone https://github.com/BurntSushi/toml-test.git $TOML_BS_TESTS_PATH
|
||||
## TODO: update/remove this pinning once all our skip lists are empty:
|
||||
git clone -n https://github.com/BurntSushi/toml-test.git $TOML_BS_TESTS_PATH
|
||||
git -C $TOML_BS_TESTS_PATH checkout $TOML_BS_TESTS_PINNED_COMMIT
|
||||
|
||||
- name: Run BurntSushi TOML tests
|
||||
|
@ -52,19 +57,17 @@ jobs:
|
|||
# Tests found at https://github.com/iarna/toml-spec-tests
|
||||
- name: Clone iarna/toml-spec-tests
|
||||
run: |
|
||||
git clone https://github.com/iarna/toml-spec-tests.git $TOML_IARNA_TESTS_PATH
|
||||
## TODO: update/remove this pinning once all our skip lists are empty:
|
||||
git clone -n https://github.com/iarna/toml-spec-tests.git $TOML_IARNA_TESTS_PATH
|
||||
git -C $TOML_IARNA_TESTS_PATH checkout $TOML_IARNA_TESTS_PINNED_COMMIT
|
||||
|
||||
- name: Run iarna TOML tests
|
||||
run: ./v vlib/toml/tests/iarna.toml-spec-tests_test.v
|
||||
run: ./v -gc boehm vlib/toml/tests/iarna.toml-spec-tests_test.v
|
||||
|
||||
# Tests found at https://github.com/alexcrichton/toml-rs
|
||||
- name: Clone alexcrichton/toml-rs
|
||||
run: |
|
||||
git clone https://github.com/alexcrichton/toml-rs.git $TOML_ALEXCRICHTON_TESTS_PATH
|
||||
## TODO: update/remove this pinning once all our skip lists are empty:
|
||||
git -C $TOML_ALEXCRICHTON_TESTS_PATH checkout $TOML_ALEXCRICHTON_TESTS_PINNED_COMMIT
|
||||
git clone -n https://github.com/alexcrichton/toml-rs.git $TOML_AC_TESTS_PATH
|
||||
git -C $TOML_AC_TESTS_PATH checkout $TOML_AC_TESTS_PINNED_COMMIT
|
||||
|
||||
- name: Run alexcrichton TOML tests
|
||||
run: ./v vlib/toml/tests/alexcrichton.toml-rs-tests_test.v
|
||||
|
|
|
@ -0,0 +1,137 @@
|
|||
name: V Apps and Modules
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
|
||||
concurrency:
|
||||
group: build-v-apps-and-modules-${{ github.event.pull_request.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
v-apps-compile:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build V
|
||||
run: make && sudo ./v symlink
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install --quiet -y libgc-dev libsodium-dev libssl-dev sqlite3 libsqlite3-dev valgrind libfreetype6-dev libxi-dev libxcursor-dev libgl-dev xfonts-75dpi xfonts-base
|
||||
sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev
|
||||
|
||||
- name: Build V Language Server (VLS)
|
||||
run: |
|
||||
echo "Clone VLS"
|
||||
git clone --depth 1 https://github.com/vlang/vls /tmp/vls
|
||||
echo "Build VLS"
|
||||
v /tmp/vls/cmd/vls
|
||||
echo "Build VLS with -prod"
|
||||
v -prod /tmp/vls/cmd/vls
|
||||
echo "Build VLS with -gc boehm -skip-unused"
|
||||
v -gc boehm -skip-unused /tmp/vls/cmd/vls
|
||||
|
||||
- name: Build V Coreutils
|
||||
run: |
|
||||
echo "Clone Coreutils"
|
||||
git clone --depth 1 https://github.com/vlang/coreutils /tmp/coreutils
|
||||
echo "Build Coreutils"
|
||||
cd /tmp/coreutils; make
|
||||
|
||||
- name: Build VAB
|
||||
run: |
|
||||
echo "Install VAB"
|
||||
v install vab
|
||||
echo "Build vab"
|
||||
v ~/.vmodules/vab
|
||||
echo "Build vab with -gc boehm -skip-unused"
|
||||
v -gc boehm -skip-unused ~/.vmodules/vab
|
||||
|
||||
- name: Build Gitly
|
||||
run: |
|
||||
echo "Install markdown"
|
||||
v install markdown
|
||||
echo "Clone Gitly"
|
||||
git clone https://github.com/vlang/gitly /tmp/gitly
|
||||
echo "Build Gitly"
|
||||
v /tmp/gitly
|
||||
echo "Build Gitly with -autofree"
|
||||
v -autofree /tmp/gitly
|
||||
echo "Run first_run.v"
|
||||
v run /tmp/gitly/tests/first_run.v
|
||||
# /tmp/gitly/gitly -ci_run
|
||||
|
||||
- name: Build libsodium
|
||||
run: |
|
||||
echo "Install the libsodium wrapper"
|
||||
v install libsodium
|
||||
echo "Test libsodium"
|
||||
VJOBS=1 v test ~/.vmodules/libsodium
|
||||
|
||||
- name: Build VEX
|
||||
run: |
|
||||
echo "Install Vex"
|
||||
v install nedpals.vex
|
||||
echo "Compile all of the Vex examples"
|
||||
v should-compile-all ~/.vmodules/nedpals/vex/examples
|
||||
echo "Compile the simple Vex example with -gc boehm -skip-unused"
|
||||
v -gc boehm -skip-unused ~/.vmodules/nedpals/vex/examples/simple_example.v
|
||||
echo "Run Vex Tests"
|
||||
v test ~/.vmodules/nedpals/vex
|
||||
|
||||
- name: Build go2v
|
||||
run: |
|
||||
echo "Clone Go2V"
|
||||
git clone --depth=1 https://github.com/vlang/go2v /tmp/go2v/
|
||||
echo "Build Go2V"
|
||||
v /tmp/go2v/
|
||||
echo "Run Go2V tests"
|
||||
VJOBS=1 v -stats test /tmp/go2v/
|
||||
|
||||
- name: Build vlang/pdf
|
||||
run: |
|
||||
v install pdf
|
||||
echo "PDF examples should compile"
|
||||
v should-compile-all ~/.vmodules/pdf/examples
|
||||
|
||||
- name: Install UI through VPM
|
||||
run: |
|
||||
echo "Official VPM modules should be installable"
|
||||
v install ui
|
||||
echo "Examples of UI should compile"
|
||||
v ~/.vmodules/ui/examples/build_examples.vsh
|
||||
|
||||
- name: Build VSL
|
||||
run: |
|
||||
echo "Install VSL"
|
||||
v install vsl
|
||||
echo "Execute Tests using Pure V Backend"
|
||||
~/.vmodules/vsl/bin/test
|
||||
echo "Execute Tests using Pure V Backend with Pure V Math"
|
||||
~/.vmodules/vsl/bin/test --use-cblas
|
||||
echo "Execute Tests using Pure V Backend and Garbage Collection enabled"
|
||||
~/.vmodules/vsl/bin/test --use-gc boehm
|
||||
echo "Execute Tests using Pure V Backend with Pure V Math and Garbage Collection enabled"
|
||||
~/.vmodules/vsl/bin/test --use-cblas --use-gc boehm
|
||||
|
||||
- name: Build VTL
|
||||
run: |
|
||||
echo "Install VTL"
|
||||
v install vtl
|
||||
echo "Install dependencies"
|
||||
echo "Execute Tests using Pure V Backend"
|
||||
~/.vmodules/vtl/bin/test
|
||||
echo "Execute Tests using Pure V Backend with Pure V Math"
|
||||
~/.vmodules/vtl/bin/test --use-cblas
|
||||
echo "Execute Tests using Pure V Backend and Garbage Collection enabled"
|
||||
~/.vmodules/vtl/bin/test --use-gc boehm
|
||||
echo "Execute Tests using Pure V Backend with Pure V Math and Garbage Collection enabled"
|
||||
~/.vmodules/vtl/bin/test --use-cblas --use-gc boehm
|
|
@ -11,7 +11,10 @@ on:
|
|||
jobs:
|
||||
vab-compiles-v-examples:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VAB_FLAGS: --api 30 --build-tools 29.0.0 -v 3
|
||||
steps:
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
|
@ -20,33 +23,52 @@ jobs:
|
|||
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build V
|
||||
run: make -j2 && ./v -cc gcc -o v cmd/v
|
||||
run: make && sudo ./v symlink
|
||||
|
||||
- name: Clone vab
|
||||
run: git clone --depth 1 https://github.com/vlang/vab
|
||||
- name: Build vab
|
||||
run: cd vab; ../v ./vab.v ; cd ..
|
||||
- name: Install vab
|
||||
run: |
|
||||
v install vab
|
||||
v -g ~/.vmodules/vab
|
||||
sudo ln -s ~/.vmodules/vab/vab /usr/local/bin/vab
|
||||
|
||||
- name: Run tests
|
||||
run: ./v test vab
|
||||
|
||||
- name: Build vab
|
||||
run: ./v -g vab/vab.v
|
||||
run: v test ~/.vmodules/vab
|
||||
|
||||
- name: Run vab --help
|
||||
run: vab/vab --help
|
||||
run: vab --help
|
||||
|
||||
- name: Run vab doctor
|
||||
run: |
|
||||
export VEXE=./v
|
||||
vab/vab doctor
|
||||
run: vab doctor
|
||||
|
||||
- name: Build graphical V examples as APK
|
||||
run: |
|
||||
declare -a v_examples=('flappylearning' '2048' 'fireworks' 'tetris' 'sokol/particles' 'sokol/drawing.v' 'sokol/freetype_raven.v' 'gg/polygons.v' 'gg/raven_text_rendering.v' 'gg/rectangles.v' 'gg/stars.v' 'gg/worker_thread.v')
|
||||
mkdir apks
|
||||
export VEXE=./v
|
||||
for example in "${v_examples[@]}"; do
|
||||
safe_name=$(echo "$example" | sed 's%/%-%' | sed 's%\.%-%' )
|
||||
vab/vab --api 29 --build-tools '29.0.0' -v 3 examples/$example -o apks/$safe_name.apk
|
||||
vab examples/$example -o apks/$safe_name.apk
|
||||
done
|
||||
|
||||
v-compiles-os-android:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build V
|
||||
run: make && sudo ./v symlink
|
||||
|
||||
- name: Install vab
|
||||
run: |
|
||||
v install vab
|
||||
v -g ~/.vmodules/vab
|
||||
sudo ln -s ~/.vmodules/vab/vab /usr/local/bin/vab
|
||||
|
||||
- name: Run vab --help
|
||||
run: vab --help
|
||||
|
||||
- name: Run vab doctor
|
||||
run: vab doctor
|
||||
|
||||
- name: Check `v -os android` *without* -apk flag
|
||||
run: .github/workflows/android_cross_compile.vsh
|
||||
|
|
|
@ -13,22 +13,25 @@ on:
|
|||
jobs:
|
||||
vinix-build:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
env:
|
||||
VFLAGS: -gc none
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install build-essential meson -y
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install build-essential meson -y
|
||||
|
||||
- name: Build V
|
||||
run: make
|
||||
|
||||
- name: Clone current Vinix
|
||||
run: |
|
||||
git clone https://github.com/vlang/vinix.git --depth 1
|
||||
- name: Clone current mlibc
|
||||
run: git clone https://github.com/managarm/mlibc.git --depth=1
|
||||
- name: Patch mlibc for Vinix
|
||||
run: cd mlibc && patch -p1 < ../vinix/patches/mlibc/0001-Vinix-specific-changes.patch || true
|
||||
- name: Install mlibc headers
|
||||
run: mkdir mlibc-build && cd mlibc-build && meson --cross-file ../vinix/cross_file.txt --prefix=/ -Dheaders_only=true ../mlibc && ninja && mkdir ../mlibc-headers && DESTDIR=`realpath ../mlibc-headers` ninja install
|
||||
run: git clone https://github.com/vlang/vinix.git
|
||||
|
||||
- name: Attempt to build the Vinix kernel (debug)
|
||||
run: cd vinix/kernel && make PROD=false CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include" V="../../v" && make clean
|
||||
run: cd vinix/kernel && make PROD=false CFLAGS="-D__vinix__ -O2 -g -pipe" V="../../v" && make clean
|
||||
|
||||
- name: Attempt to build the Vinix kernel (prod)
|
||||
run: cd vinix/kernel && make PROD=true CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include" V="../../v" && make clean
|
||||
run: cd vinix/kernel && make PROD=true CFLAGS="-D__vinix__ -O2 -g -pipe" V="../../v" && make clean
|
||||
|
|
|
@ -11,6 +11,7 @@ on:
|
|||
jobs:
|
||||
websocket_tests:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||
timeout-minutes: 121
|
||||
env:
|
||||
VFLAGS: -cc tcc -no-retry-compilation
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
@echo off
|
||||
|
||||
curl -L https://www.sqlite.org/2020/sqlite-amalgamation-3320300.zip -o sqlite-amalgamation-3320300.zip
|
||||
curl -L https://www.sqlite.org/2022/sqlite-amalgamation-3380200.zip -o sqlite-amalgamation-3380200.zip
|
||||
|
||||
unzip sqlite-amalgamation-3320300.zip -d thirdparty\
|
||||
unzip sqlite-amalgamation-3380200.zip -d thirdparty\
|
||||
|
||||
del thirdparty\sqlite-amalgamation-3320300\shell.c
|
||||
del thirdparty\sqlite-amalgamation-3380200\shell.c
|
||||
|
||||
move /y thirdparty\sqlite-amalgamation-3320300 thirdparty\sqlite
|
||||
move /y thirdparty\sqlite-amalgamation-3380200 thirdparty\sqlite
|
||||
|
||||
dir thirdparty\sqlite
|
||||
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
platform: 'linux/amd64'
|
||||
branches: ['master']
|
||||
|
||||
pipeline:
|
||||
gen-vc:
|
||||
# This is what the official CI uses as well
|
||||
image: 'ubuntu:latest'
|
||||
secrets:
|
||||
- deploy_key
|
||||
commands:
|
||||
# Install necessary dependencies
|
||||
- apt-get update -y && apt-get install openssh-client git build-essential -y
|
||||
# Build the compiler
|
||||
- make
|
||||
# Run ssh-agent
|
||||
- eval $(ssh-agent -s)
|
||||
# Add ssh key
|
||||
- echo "$DEPLOY_KEY" | tr -d '\r' | ssh-add -
|
||||
# Create ssh dir with proper permissions
|
||||
- mkdir -p ~/.ssh
|
||||
- chmod 700 ~/.ssh
|
||||
# Configure git credentials
|
||||
- git config --global user.email 'vbot@rustybever.be'
|
||||
- git config --global user.name 'vbot'
|
||||
# Verify SSH keys
|
||||
- ssh-keyscan git.rustybever.be > ~/.ssh/known_hosts
|
||||
|
||||
# The following is copied over from the official repo's CI
|
||||
# https://github.com/vlang/v/blob/master/.github/workflows/gen_vc.yml
|
||||
- export "COMMIT_HASH=$(git rev-parse --short HEAD)"
|
||||
- export "COMMIT_MSG=$(git log -1 --oneline --pretty='%s' HEAD)"
|
||||
- rm -rf vc
|
||||
- git clone --depth=1 'git@git.rustybever.be:vieter/vc.git'
|
||||
- rm -rf vc/v.c vc/v_win.c
|
||||
- ./v -o vc/v.c -os cross cmd/v
|
||||
- ./v -o vc/v_win.c -os windows -cc msvc cmd/v
|
||||
- sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v.c
|
||||
- sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v_win.c
|
||||
# ensure the C files are over 5000 lines long, as a safety measure
|
||||
- '[ $(wc -l < vc/v.c) -gt 5000 ]'
|
||||
- '[ $(wc -l < vc/v_win.c) -gt 5000 ]'
|
||||
- git -C vc add v.c v_win.c
|
||||
- 'git -C vc commit -m "[v:master] $COMMIT_HASH - $COMMIT_MSG"'
|
||||
# in case there are recent commits:
|
||||
- git -C vc pull --rebase origin main
|
||||
- git -C vc push
|
||||
when:
|
||||
event: push
|
||||
|
||||
publish:
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
secrets: [ docker_username, docker_password ]
|
||||
settings:
|
||||
repo: chewingbever/vlang
|
||||
tag: latest
|
||||
dockerfile: Dockerfile.builder
|
||||
platforms: [ linux/arm64/v8, linux/amd64 ]
|
||||
# The build can run every time, because we should only push when there's
|
||||
# actual changes
|
||||
when:
|
||||
event: push
|
|
@ -0,0 +1,32 @@
|
|||
matrix:
|
||||
PLATFORM:
|
||||
- 'linux/amd64'
|
||||
- 'linux/arm64'
|
||||
|
||||
platform: ${PLATFORM}
|
||||
branches: ['master']
|
||||
depends_on:
|
||||
- 'vc'
|
||||
|
||||
pipeline:
|
||||
build:
|
||||
image: 'menci/archlinuxarm:base-devel'
|
||||
commands:
|
||||
# Update packages
|
||||
- pacman -Syu --noconfirm
|
||||
# Create non-root user to perform build & switch to their home
|
||||
- groupadd -g 1000 builder
|
||||
- useradd -mg builder builder
|
||||
- chown -R builder:builder "$PWD"
|
||||
- "echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"
|
||||
- su builder
|
||||
# Build the package
|
||||
- makepkg -s --noconfirm --needed
|
||||
|
||||
publish:
|
||||
image: 'curlimages/curl'
|
||||
secrets:
|
||||
- 'vieter_api_key'
|
||||
commands:
|
||||
# Publish the package
|
||||
- 'for pkg in $(ls -1 *.pkg*); do curl -f -XPOST -T "$pkg" -H "X-API-KEY: $VIETER_API_KEY" https://arch.r8r.be/vieter/publish; done'
|
|
@ -0,0 +1,18 @@
|
|||
platform: 'linux/amd64'
|
||||
branches: ['master']
|
||||
depends_on:
|
||||
- 'vc'
|
||||
|
||||
pipeline:
|
||||
build-publish:
|
||||
image: 'woodpeckerci/plugin-docker-buildx'
|
||||
secrets: [ docker_username, docker_password ]
|
||||
settings:
|
||||
repo: chewingbever/vlang
|
||||
tag: latest
|
||||
dockerfile: Dockerfile.builder
|
||||
platforms: [ linux/arm64/v8, linux/amd64 ]
|
||||
# The build can run every time, because we should only push when there's
|
||||
# actual changes
|
||||
when:
|
||||
event: push
|
|
@ -0,0 +1,48 @@
|
|||
platform: 'linux/amd64'
|
||||
branches: ['master']
|
||||
|
||||
pipeline:
|
||||
gen-vc:
|
||||
# This is what the official CI uses as well
|
||||
image: 'ubuntu:latest'
|
||||
secrets:
|
||||
- deploy_key
|
||||
commands:
|
||||
# Install necessary dependencies
|
||||
- apt-get update -y && apt-get install openssh-client git build-essential -y
|
||||
# Build the compiler
|
||||
- make
|
||||
# Run ssh-agent
|
||||
- eval $(ssh-agent -s)
|
||||
# Add ssh key
|
||||
- echo "$DEPLOY_KEY" | tr -d '\r' | ssh-add -
|
||||
# Create ssh dir with proper permissions
|
||||
- mkdir -p ~/.ssh
|
||||
- chmod 700 ~/.ssh
|
||||
# Configure git credentials
|
||||
- git config --global user.email 'vbot@rustybever.be'
|
||||
- git config --global user.name 'vbot'
|
||||
# Verify SSH keys
|
||||
- ssh-keyscan git.rustybever.be > ~/.ssh/known_hosts
|
||||
|
||||
# The following is copied over from the official repo's CI
|
||||
# https://github.com/vlang/v/blob/master/.github/workflows/gen_vc.yml
|
||||
- export "COMMIT_HASH=$(git rev-parse --short HEAD)"
|
||||
- export "COMMIT_MSG=$(git log -1 --oneline --pretty='%s' HEAD)"
|
||||
- rm -rf vc
|
||||
- git clone --depth=1 'git@git.rustybever.be:vieter-v/vc.git'
|
||||
- rm -rf vc/v.c vc/v_win.c
|
||||
- ./v -o vc/v.c -os cross cmd/v
|
||||
- ./v -o vc/v_win.c -os windows -cc msvc cmd/v
|
||||
- sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v.c
|
||||
- sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v_win.c
|
||||
# ensure the C files are over 5000 lines long, as a safety measure
|
||||
- '[ $(wc -l < vc/v.c) -gt 5000 ]'
|
||||
- '[ $(wc -l < vc/v_win.c) -gt 5000 ]'
|
||||
- git -C vc add v.c v_win.c
|
||||
- 'git -C vc commit -m "[v:master] $COMMIT_HASH - $COMMIT_MSG"'
|
||||
# in case there are recent commits:
|
||||
- git -C vc pull --rebase origin main
|
||||
- git -C vc push
|
||||
when:
|
||||
event: push
|
|
@ -1,6 +1,8 @@
|
|||
-## V 0.2.5
|
||||
-*Not yet released, changelog is not full*
|
||||
- Introduce `isize` and `usize` types, deprecate `size_t` in favor of `usize`
|
||||
- Introduce `isize` and `usize` types, deprecate `size_t` in favor of `usize`.
|
||||
- Add `datatypes` and `datatypes.fsm` modules.
|
||||
- Add `compile_error` and `compile_warn` comptime functions.
|
||||
|
||||
-## V 0.2.4
|
||||
-*Not yet released, changelog is not full*
|
||||
|
|
|
@ -35,32 +35,35 @@ The main files are:
|
|||
- Creates a parser object for each file and runs `parse()` on them.
|
||||
- The correct backend is called (C, JS, native), and a binary is compiled.
|
||||
|
||||
2. `v/scanner` The scanner's job is to parse a list of characters and convert
|
||||
2. `vlib/v/scanner` The scanner's job is to parse a list of characters and convert
|
||||
them to tokens.
|
||||
|
||||
3. `v/token` This is simply a list of all tokens, their string values, and a
|
||||
3. `vlib/v/token` This is simply a list of all tokens, their string values, and a
|
||||
couple of helper functions.
|
||||
|
||||
4. `v/parser` The parser. It converts a list of tokens into an AST.
|
||||
4. `vlib/v/parser` The parser. It converts a list of tokens into an AST.
|
||||
In V, objects can be used before declaration, so unknown types are marked as
|
||||
unresolved. They are resolved later in the type checker.
|
||||
|
||||
5. `v/table` V creates one table object that is shared by all parsers. It
|
||||
5. `vlib/v/table` V creates one table object that is shared by all parsers. It
|
||||
contains all types, consts, and functions, as well as several helpers to search
|
||||
for objects by name, register new objects, modify types' fields, etc.
|
||||
|
||||
6. `v/checker` Type checker and resolver. It processes the AST and makes sure
|
||||
6. `vlib/v/checker` Type checker and resolver. It processes the AST and makes sure
|
||||
the types are correct. Unresolved types are resolved, type information is added
|
||||
to the AST.
|
||||
|
||||
7. `v/gen/c` C backend. It simply walks the AST and generates C code that can be
|
||||
7. `vlib/v/gen/c` C backend. It simply walks the AST and generates C code that can be
|
||||
compiled with Clang, GCC, Visual Studio, and TCC.
|
||||
|
||||
8. `json.v` defines the json code generation. This file will be removed once V
|
||||
8. `vlib/v/gen/js` JavaScript backend. It simply walks the AST and generates JS code that can be
|
||||
executed on the browser or in NodeJS/Deno.
|
||||
|
||||
9. `vlib/v/gen/c/json.v` defines the json code generation. This file will be removed once V
|
||||
supports comptime code generation, and it will be possible to do this using the
|
||||
language's tools.
|
||||
|
||||
9. `v/gen/native` is the directory with all the machine code generation logic. It
|
||||
10. `vlib/v/gen/native` is the directory with all the machine code generation logic. It
|
||||
defines a set of functions that translate assembly instructions to machine code
|
||||
and build the binary from scratch byte by byte. It manually builds all headers,
|
||||
segments, sections, symtable, relocations, etc. Right now it only has basic
|
||||
|
@ -90,6 +93,7 @@ making pullrequests, and you can just do normal git operations such as:
|
|||
|
||||
5. When finished with a feature/bugfix/change, you can:
|
||||
`git checkout -b fix_alabala`
|
||||
- Don't forget to keep formatting standards, run `v fmt -w YOUR_MODIFIED_FILES` before committing
|
||||
6. `git push pullrequest` # (NOTE: the `pullrequest` remote was setup on step 4)
|
||||
7. On GitHub's web interface, go to: https://github.com/vlang/v/pulls
|
||||
|
||||
|
@ -187,7 +191,6 @@ to create a copy of the compiler rather than replacing it with `v self`.
|
|||
| `debug_codegen` | Prints automatically generated V code during the scanning phase |
|
||||
| `debug_interface_table` | Prints generated interfaces during C generation |
|
||||
| `debug_interface_type_implements` | Prints debug information when checking that a type implements in interface |
|
||||
| `debug_embed_file_in_prod` | Prints debug information about the embedded files with `$embed_file('somefile')` |
|
||||
| `print_vweb_template_expansions` | Prints vweb compiled HTML files |
|
||||
| `time_checking` | Prints the time spent checking files and other related information |
|
||||
| `time_parsing` | Prints the time spent parsing files and other related information |
|
||||
|
@ -199,3 +202,5 @@ to create a copy of the compiler rather than replacing it with `v self`.
|
|||
| `trace_parser` | Prints details about parsed statements and expressions |
|
||||
| `trace_thirdparty_obj_files` | Prints details about built thirdparty obj files |
|
||||
| `trace_usecache` | Prints details when -usecache is used |
|
||||
| `trace_embed_file` | Prints details when $embed_file is used |
|
||||
| `embed_only_metadata` | Embed only the metadata for the file(s) with `$embed_file('somefile')`; faster; for development, *not* distribution |
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
FROM alpine:3.16
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
WORKDIR /opt/vlang
|
||||
|
||||
ENV VVV /opt/vlang
|
||||
ENV PATH /opt/vlang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
ENV VFLAGS -cc gcc -gc none
|
||||
ENV V_PATH /opt/vlang/v
|
||||
|
||||
RUN ln -s /opt/vlang/v /usr/bin/v && \
|
||||
apk --no-cache add \
|
||||
git make gcc curl openssl \
|
||||
musl-dev \
|
||||
openssl-libs-static openssl-dev \
|
||||
zlib-static bzip2-static xz-dev expat-static zstd-static lz4-static \
|
||||
sqlite-static sqlite-dev \
|
||||
libx11-dev glfw-dev freetype-dev \
|
||||
libarchive-static libarchive-dev \
|
||||
diffutils \
|
||||
mandoc
|
||||
|
||||
RUN git clone https://git.rustybever.be/vieter/v /opt/vlang && \
|
||||
make && \
|
||||
v -version
|
||||
|
||||
RUN if [ "$TARGETPLATFORM" = 'linux/amd64' ]; then \
|
||||
wget -O /usr/local/bin/mc https://dl.min.io/client/mc/release/linux-amd64/mc && \
|
||||
chmod +x /usr/local/bin/mc ; \
|
||||
fi
|
||||
|
||||
CMD ["v"]
|
|
@ -1,10 +1,10 @@
|
|||
FROM mstorsjo/llvm-mingw
|
||||
|
||||
LABEL maintainer="Vitaly Takmazov <vitalyster@gmail.com>"
|
||||
LABEL maintainer="Delyan Angelov <delian66@gmail.com>"
|
||||
COPY . .
|
||||
RUN make
|
||||
RUN ./v -os windows -o v.c cmd/v
|
||||
RUN x86_64-w64-mingw32-gcc v.c -std=c99 -I ./thirdparty/stdatomic/win -w -municode -o v.exe
|
||||
RUN x86_64-w64-mingw32-gcc v.c -std=c99 -w -municode -o v.exe
|
||||
RUN file v.exe
|
||||
|
||||
CMD [ "bash" ]
|
||||
|
|
22
GNUmakefile
|
@ -5,7 +5,7 @@ TMPDIR ?= /tmp
|
|||
VROOT ?= .
|
||||
VC ?= ./vc
|
||||
V ?= ./v
|
||||
VCREPO ?= https://github.com/vlang/vc
|
||||
VCREPO ?= https://git.rustybever.be/vieter/vc
|
||||
TCCREPO ?= https://github.com/vlang/tccbin
|
||||
|
||||
VCFILE := v.c
|
||||
|
@ -28,6 +28,9 @@ endif
|
|||
ifeq ($(_SYS),Linux)
|
||||
LINUX := 1
|
||||
TCCOS := linux
|
||||
ifneq ($(shell ldd /bin/ls | grep musl),)
|
||||
TCCOS := linuxmusl
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(_SYS),Darwin)
|
||||
|
@ -76,7 +79,7 @@ endif
|
|||
endif
|
||||
endif
|
||||
|
||||
.PHONY: all clean fresh_vc fresh_tcc
|
||||
.PHONY: all clean check fresh_vc fresh_tcc check_for_working_tcc
|
||||
|
||||
ifdef prod
|
||||
VFLAGS+=-prod
|
||||
|
@ -84,17 +87,18 @@ endif
|
|||
|
||||
all: latest_vc latest_tcc
|
||||
ifdef WIN32
|
||||
$(CC) $(CFLAGS) -std=c99 -municode -w -I ./thirdparty/stdatomic/nix -o v1.exe $(VC)/$(VCFILE) $(LDFLAGS)
|
||||
$(CC) $(CFLAGS) -std=c99 -municode -w -o v1.exe $(VC)/$(VCFILE) $(LDFLAGS)
|
||||
v1.exe -no-parallel -o v2.exe $(VFLAGS) cmd/v
|
||||
v2.exe -o $(V) $(VFLAGS) cmd/v
|
||||
del v1.exe
|
||||
del v2.exe
|
||||
else
|
||||
$(CC) $(CFLAGS) -std=gnu99 -w -I ./thirdparty/stdatomic/nix -o v1.exe $(VC)/$(VCFILE) -lm -lpthread $(LDFLAGS)
|
||||
$(CC) $(CFLAGS) -std=gnu99 -w -o v1.exe $(VC)/$(VCFILE) -lm -lpthread $(LDFLAGS)
|
||||
./v1.exe -no-parallel -o v2.exe $(VFLAGS) cmd/v
|
||||
./v2.exe -o $(V) $(VFLAGS) cmd/v
|
||||
rm -rf v1.exe v2.exe
|
||||
endif
|
||||
@$(V) run cmd/tools/detect_tcc.v
|
||||
@echo "V has been successfully built"
|
||||
@$(V) -version
|
||||
|
||||
|
@ -110,6 +114,9 @@ latest_vc:
|
|||
@echo "Using local vc"
|
||||
endif
|
||||
|
||||
check_for_working_tcc:
|
||||
@$(TMPTCC)/tcc.exe --version > /dev/null 2> /dev/null || echo "The executable '$(TMPTCC)/tcc.exe' does not work."
|
||||
|
||||
fresh_vc:
|
||||
rm -rf $(VC)
|
||||
$(GITFASTCLONE) $(VCREPO) $(VC)
|
||||
|
@ -117,9 +124,11 @@ fresh_vc:
|
|||
ifndef local
|
||||
latest_tcc: $(TMPTCC)/.git/config
|
||||
cd $(TMPTCC) && $(GITCLEANPULL)
|
||||
@$(MAKE) --quiet check_for_working_tcc 2> /dev/null
|
||||
else
|
||||
latest_tcc:
|
||||
@echo "Using local tcc"
|
||||
@$(MAKE) --quiet check_for_working_tcc 2> /dev/null
|
||||
endif
|
||||
|
||||
fresh_tcc:
|
||||
|
@ -128,12 +137,15 @@ ifndef local
|
|||
# Check wether a TCC branch exists for the user's system configuration.
|
||||
ifneq (,$(findstring thirdparty-$(TCCOS)-$(TCCARCH), $(shell git ls-remote --heads $(TCCREPO) | sed 's/^[a-z0-9]*\trefs.heads.//')))
|
||||
$(GITFASTCLONE) --branch thirdparty-$(TCCOS)-$(TCCARCH) $(TCCREPO) $(TMPTCC)
|
||||
@$(MAKE) --quiet check_for_working_tcc 2> /dev/null
|
||||
else
|
||||
@echo 'Pre-built TCC not available for thirdparty-$(TCCOS)-$(TCCARCH) at $(TCCREPO), will use the system compiler: $(CC)'
|
||||
$(GITFASTCLONE) --branch thirdparty-unknown-unknown $(TCCREPO) $(TMPTCC)
|
||||
@$(MAKE) --quiet check_for_working_tcc 2> /dev/null
|
||||
endif
|
||||
else
|
||||
@echo "Using local tccbin"
|
||||
@$(MAKE) --quiet check_for_working_tcc 2> /dev/null
|
||||
endif
|
||||
|
||||
$(TMPTCC)/.git/config:
|
||||
|
@ -155,3 +167,5 @@ selfcompile-static:
|
|||
install:
|
||||
@echo 'Please use `sudo ./v symlink` instead.'
|
||||
|
||||
check:
|
||||
$(V) test-all
|
||||
|
|
12
Makefile
|
@ -1,11 +1,19 @@
|
|||
CC ?= cc
|
||||
VFLAGS ?=
|
||||
CFLAGS ?=
|
||||
LDFLAGS ?=
|
||||
|
||||
.PHONY: all check
|
||||
|
||||
all:
|
||||
rm -rf vc/
|
||||
git clone --depth 1 --quiet https://github.com/vlang/vc
|
||||
$(CC) -std=gnu11 -w -I ./thirdparty/stdatomic/nix -o v1 vc/v.c -lm -lexecinfo -lpthread
|
||||
git clone --depth 1 --quiet https://git.rustybever.be/vieter/vc
|
||||
$(CC) $(CFLAGS) -std=gnu11 -w -o v1 vc/v.c -lm -lexecinfo -lpthread $(LDFLAGS)
|
||||
./v1 -no-parallel -o v2 $(VFLAGS) cmd/v
|
||||
./v2 -o v $(VFLAGS) cmd/v
|
||||
rm -rf v1 v2 vc/
|
||||
@echo "V has been successfully built"
|
||||
./v run ./cmd/tools/detect_tcc.v
|
||||
|
||||
check:
|
||||
./v test-all
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
# Maintainer: Jef Roosens
|
||||
# This PKGBUILD is mostly copied over from the AUR
|
||||
# https://aur.archlinux.org/packages/vlang-git
|
||||
|
||||
pkgname=vieter-v
|
||||
pkgver=0.2.2.r796.gfbc02cbc5
|
||||
pkgrel=1
|
||||
pkgdesc='Simple, fast, safe, compiled language for developing maintainable software'
|
||||
arch=('x86_64' 'aarch64')
|
||||
url='https://vlang.io'
|
||||
license=('MIT')
|
||||
depends=('glibc')
|
||||
makedepends=('git')
|
||||
optdepends=('glfw: Needed for graphics support'
|
||||
'freetype2: Needed for graphics support'
|
||||
'openssl: Needed for http support')
|
||||
provides=('vlang')
|
||||
conflicts=('v' 'vlang' 'vlang-bin')
|
||||
source=('vlang::git+https://git.rustybever.be/Chewing_Bever/v')
|
||||
sha256sums=('SKIP')
|
||||
|
||||
pkgver() {
|
||||
cd "${srcdir}/vlang"
|
||||
# Weekly tags are considered older than semantic tags that are older than
|
||||
# them, so to prevent version resolution problems we exclude weekly tags.
|
||||
git describe --long --tags --exclude "weekly*" | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/vlang"
|
||||
# We don't require optimizations when compiling the bootstrap executable and
|
||||
# -O2 actually breaks `./v self` (resulting in "cgen error:"), so we empty
|
||||
# CFLAGS and LDFLAGS to ensure successful compilation.
|
||||
CFLAGS="" LDFLAGS="" prod=1 make
|
||||
|
||||
# vpm and vdoc fail to compile with "unsupported linker option" when LDFLAGS
|
||||
# is set
|
||||
LDFLAGS="" ./v build-tools
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/vlang"
|
||||
install -d "$pkgdir/usr/lib/vlang" "$pkgdir/usr/share/vlang" "$pkgdir/usr/bin"
|
||||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
install -Dm755 v "$pkgdir/usr/lib/vlang"
|
||||
cp -a cmd "$pkgdir/usr/lib/vlang/"
|
||||
cp -a examples "$pkgdir/usr/share/vlang/"
|
||||
cp -a thirdparty "$pkgdir/usr/lib/vlang/"
|
||||
cp -a vlib "$pkgdir/usr/lib/vlang/"
|
||||
cp v.mod "$pkgdir/usr/lib/vlang/"
|
||||
ln -s /usr/lib/vlang/v "$pkgdir/usr/bin/v"
|
||||
|
||||
touch "$pkgdir/usr/lib/vlang/cmd/tools/.disable_autorecompilation"
|
||||
}
|
33
README.md
|
@ -4,11 +4,7 @@
|
|||
</p>
|
||||
<h1>The V Programming Language</h1>
|
||||
|
||||
[vlang.io](https://vlang.io) |
|
||||
[Docs](https://github.com/vlang/v/blob/master/doc/docs.md) |
|
||||
[Changelog](https://github.com/vlang/v/blob/master/CHANGELOG.md) |
|
||||
[Speed](https://fast.vlang.io/) |
|
||||
[Contributing & compiler design](https://github.com/vlang/v/blob/master/CONTRIBUTING.md)
|
||||
[vlang.io](https://vlang.io) | [Docs](https://github.com/vlang/v/blob/master/doc/docs.md) | [Changelog](https://github.com/vlang/v/blob/master/CHANGELOG.md) | [Speed](https://fast.vlang.io/) | [Contributing & compiler design](https://github.com/vlang/v/blob/master/CONTRIBUTING.md)
|
||||
|
||||
</div>
|
||||
<div align="center">
|
||||
|
@ -31,7 +27,7 @@
|
|||
- Easy to develop: V compiles itself in less than a second
|
||||
- Performance: as fast as C (V's main backend compiles to human-readable C)
|
||||
- Safety: no null, no globals, no undefined behavior, immutability by default
|
||||
- C to V translation
|
||||
- C to V translation ([Translating DOOM demo video](https://www.youtube.com/watch?v=6oXrz3oRoEg))
|
||||
- Hot code reloading
|
||||
- [Innovative memory management](https://vlang.io/#memory) ([demo video](https://www.youtube.com/watch?v=gmB8ea8uLsM))
|
||||
- [Cross-platform UI library](https://github.com/vlang/ui)
|
||||
|
@ -60,23 +56,40 @@ Unlike many other languages, V is not going to be always changing, with new feat
|
|||
being introduced and old features modified. It is always going to be a small and simple
|
||||
language, very similar to the way it is right now.
|
||||
|
||||
## Installing V from source
|
||||
## Installing V - from source *(preferred method)*
|
||||
|
||||
### Linux, macOS, Windows, *BSD, Solaris, WSL, Android, Raspbian
|
||||
### Linux, macOS, Windows, *BSD, Solaris, WSL, Android, etc.
|
||||
|
||||
Usually installing V is quite simple if you have an environment that already has a
|
||||
functional `git` installation.
|
||||
|
||||
* *(* ***PLEASE NOTE:*** *If you run into any trouble or you have a different operating
|
||||
system or Linux distribution that doesn't install or work immediately, please see
|
||||
[Installation Issues](https://github.com/vlang/v/discussions/categories/installation-issues)
|
||||
and search for your OS and problem. If you can't find your problem, please add it to an
|
||||
existing discussion if one exists for your OS, or create a new one if a main discussion
|
||||
doesn't yet exist for your OS.)*
|
||||
|
||||
|
||||
To get started, simply try to execute the following in your terminal/shell:
|
||||
```bash
|
||||
git clone https://github.com/vlang/v
|
||||
cd v
|
||||
make
|
||||
# HINT: Using Windows?: run make.bat in the cmd.exe shell
|
||||
```
|
||||
|
||||
That's it! Now you have a V executable at `[path to V repo]/v`.
|
||||
That should be it and you should find your V executable at `[path to V repo]/v`.
|
||||
`[path to V repo]` can be anywhere.
|
||||
|
||||
(On Windows `make` means running `make.bat`, so make sure you use `cmd.exe`)
|
||||
(As in the hint above, on Windows `make` means running `make.bat`, so make sure you use
|
||||
the `cmd.exe` terminal.)
|
||||
|
||||
Now you can try `./v run examples/hello_world.v` (`v.exe` on Windows).
|
||||
|
||||
* *Trouble? Please see the note above and link to
|
||||
[Installation Issues](https://github.com/vlang/v/discussions/categories/installation-issues) for help.*
|
||||
|
||||
V is constantly being updated. To update V, simply run:
|
||||
|
||||
```bash
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
## [Version 0.3](https://github.com/vlang/v/projects/5)
|
||||
- [ ] [make `-autofree` the default](https://github.com/vlang/v/issues/6989)
|
||||
- [x] [gc option]
|
||||
- [ ] [coroutines](https://github.com/vlang/v/issues/561)
|
||||
- [ ] [coroutines](https://github.com/vlang/v/discussions/11582)
|
||||
- [x] channels
|
||||
- [x] lock{}
|
||||
- [x] thread safe arrays
|
||||
- [ ] [thread safe maps](https://github.com/vlang/v/issues/6992)
|
||||
- [ ] [thread safe maps](https://github.com/vlang/v/discussions/11729)
|
||||
- [ ] [C2V translator](https://github.com/vlang/v/issues/6985)
|
||||
- [ ] doom.v
|
||||
- [x] rune type
|
||||
|
|
256
TESTS.md
|
@ -1,104 +1,12 @@
|
|||
# Automated tests
|
||||
|
||||
TLDR: run `v test-all` locally, after making your changes,
|
||||
TLDR: do run `v test-all` locally, after making your changes,
|
||||
and before submitting PRs.
|
||||
|
||||
## Notes
|
||||
In the `v` repo there are several different tests. The main types are:
|
||||
|
||||
* `_test.v` tests - check that `test_` functions succeed. These can be
|
||||
run per directory or individually.
|
||||
* `.out` tests - run a `.vv` file and check the output matches the
|
||||
contents of the `.out` file with the same base name. This is
|
||||
particularly useful for checking that errors are printed.
|
||||
|
||||
Tip: use `v -cc tcc` when compiling tests for speed.
|
||||
|
||||
## `vlib/v/tests`
|
||||
|
||||
General runnable tests for different features of the V compiler.
|
||||
|
||||
* `vlib/v/tests/inout/compiler_test.v`
|
||||
|
||||
Test output of running a V program matches an expected .out file.
|
||||
Check the source for how to test panics.
|
||||
|
||||
* `vlib/v/gen/c/coutput_test.v`
|
||||
|
||||
This tests whether the generated C source code matches all expectations,
|
||||
specified in *.c.must_have files, in the folder vlib/v/gen/c/testdata/ .
|
||||
|
||||
Each `.c.must_have` file has to have a corresponding .vv file.
|
||||
|
||||
Each `.c.must_have` file, consists of multiple lines. Each of these
|
||||
lines, *should* be present *at least once* in the output, when the .vv
|
||||
file is compiled with `-o -` .
|
||||
|
||||
* `vlib/v/tests/run_project_folders_test.v`
|
||||
Tests whether whole project folders can be compiled, and run.
|
||||
NB: Each project in these folders, should finish with exit code 0,
|
||||
and it should output `OK` as its last stdout line.
|
||||
|
||||
## Test building of actual V programs (examples, tools, V itself)
|
||||
|
||||
* `v build-tools`
|
||||
* `v build-examples`
|
||||
* `v build-vbinaries`
|
||||
|
||||
## vfmt tests
|
||||
|
||||
In `vlib/v/fmt/` there are::
|
||||
|
||||
* `v vlib/v/fmt/fmt_test.v`
|
||||
|
||||
This checks `.out` tests.
|
||||
|
||||
* `v vlib/v/fmt/fmt_keep_test.v`
|
||||
|
||||
This verifies that `_keep.v` files would be unchanged by `vfmt -w`.
|
||||
|
||||
* `v vlib/v/fmt/fmt_vlib_test.v`
|
||||
|
||||
This checks all source files are formatted and prints a summary.
|
||||
This is not required.
|
||||
|
||||
* `v test-fmt`
|
||||
|
||||
Test all files in the current directory are formatted.
|
||||
|
||||
## Markdown
|
||||
|
||||
* `v check-md -hide-warnings .`
|
||||
|
||||
Ensure that all .md files in the project are formatted properly,
|
||||
and that the V code block examples in them can be compiled/formatted too.
|
||||
|
||||
## `.github/workflows/ci.yml`
|
||||
|
||||
This runs various CI tests, e.g.:
|
||||
|
||||
* `v vet vlib/v` - style checker
|
||||
* `v fmt -verify` on certain source files
|
||||
|
||||
## `v test-cleancode`
|
||||
|
||||
Check that most .v files, are invariant of `v fmt` runs.
|
||||
|
||||
## `v test-self`
|
||||
|
||||
Run `vlib` module tests, *including* the compiler tests.
|
||||
|
||||
## `v vlib/v/compiler_errors_test.v`
|
||||
|
||||
This runs tests for:
|
||||
* `vlib/v/checker/tests/*.vv`
|
||||
* `vlib/v/parser/tests/*.vv`
|
||||
|
||||
### Special folders that compiler_errors_test.v will try to
|
||||
run/compile with specific options:
|
||||
|
||||
vlib/v/checker/tests/globals_run/ - `-enable-globals run`;
|
||||
results stored in `.run.out` files, matching the .vv ones.
|
||||
Tip: use `v -cc tcc` when compiling tests, because TCC is much faster,
|
||||
compared to most other C compilers like clang/gcc/msvc. Most test commands
|
||||
will use the V compiler and the V tools many times, potentially
|
||||
hundreds/thousands of times.
|
||||
|
||||
## `v test-all`
|
||||
|
||||
|
@ -113,3 +21,157 @@ It works, by running these in succession:
|
|||
* `v build-examples`
|
||||
* `v check-md -hide-warnings .`
|
||||
* `v install nedpals.args`
|
||||
|
||||
# Details:
|
||||
In the `v` repo there are many tests. The main types are:
|
||||
|
||||
## `_test.v` tests - these are the normal V test files.
|
||||
All `test_` functions in these files, will be ran automatically by
|
||||
V's test framework.
|
||||
|
||||
NB 1: You can run test files one by one, with:
|
||||
`v file_test.v` - this will run the test_ functions in file_test.v,
|
||||
and will exit with a 0 exit code, if they all had 0 failing assertions.
|
||||
|
||||
`v -stats file_test.v` - this will run the test_ functions, and show a
|
||||
report about how much time it took to run each of them too.
|
||||
|
||||
NB 2: You can also run many test files at once (in parallel, depending on
|
||||
how many cores you have), with:
|
||||
`v test folder` - this will run *all* `_test.v` files in `folder`,
|
||||
recursively.
|
||||
|
||||
`v -stats test folder` - same, but will also produce timing reports
|
||||
about how fast each test_ function in each _test.v file ran.
|
||||
|
||||
|
||||
## `v test vlib/v/tests`:
|
||||
|
||||
This folder contains _test.v files, testing the different features of the V
|
||||
compiler. Each of them will be compiled, and all the features in them have
|
||||
to work (verified by assertions).
|
||||
|
||||
## `v vlib/v/tests/inout/compiler_test.v`
|
||||
|
||||
This is a *test runner*, that checks whether the output of running a V program,
|
||||
matches an expected .out file. You can also check for code that does panic
|
||||
using this test runner - just paste the start of the `panic()` output in the
|
||||
corresponding .out file.
|
||||
|
||||
NB: these tests, expect to find a pair of `.vv` and `.out` files, in the folder:
|
||||
vlib/v/tests/inout
|
||||
|
||||
The test runner will run each `.vv` file, and will check that its output, matches
|
||||
the contents of the `.out` file with the same base name. This is particularly useful
|
||||
for checking that errors and panics are printed.
|
||||
|
||||
## `v vlib/v/gen/c/coutput_test.v`
|
||||
|
||||
coutput_test.v is a *test runner*, that checks whether the generated C source
|
||||
code matches *all* expectations, specified in *.c.must_have files, in the
|
||||
folder vlib/v/gen/c/testdata/ .
|
||||
|
||||
Each `.c.must_have` file, *has* to have a corresponding `.vv` file.
|
||||
|
||||
Each `.c.must_have` file, consists of multiple lines. Each of these
|
||||
lines, *should* be present *at least once* in the output, when the .vv
|
||||
file is compiled with `-o -` .
|
||||
|
||||
## `v vlib/v/tests/run_project_folders_test.v`
|
||||
This *test runner*, checks whether whole project folders, can be compiled, and run.
|
||||
|
||||
NB: Each project in these folders, should finish with an exit code of 0,
|
||||
and it should output `OK` as its last stdout line.
|
||||
|
||||
## `v vlib/v/tests/known_errors/known_errors_test.v`
|
||||
This *test runner*, checks whether a known program, that was expected to compile,
|
||||
but did NOT, due to a buggy checker, parser or cgen, continues to fail.
|
||||
The negative programs are collected in the `vlib/v/tests/known_errors/testdata/` folder.
|
||||
Each of them should FAIL to compile, due to a known/confirmed compiler bug/limitation.
|
||||
|
||||
The intended use of this, is for providing samples, that currently do NOT compile,
|
||||
but that a future compiler improvement WILL be able to compile, and to
|
||||
track, whether they were not fixed incidentally, due to an unrelated
|
||||
change/improvement. For example, code that triggers generating invalid C code can go here,
|
||||
and later when a bug is fixed, can be moved to a proper _test.v or .vv/.out pair, outside of
|
||||
the `vlib/v/tests/known_errors/testdata/` folder.
|
||||
|
||||
|
||||
## Test building of actual V programs (examples, tools, V itself)
|
||||
|
||||
* `v build-tools`
|
||||
* `v build-examples`
|
||||
* `v build-vbinaries`
|
||||
|
||||
## Formatting tests
|
||||
|
||||
In `vlib/v/fmt/` there are:
|
||||
|
||||
* `v vlib/v/fmt/fmt_test.v`
|
||||
|
||||
This checks `.out` tests.
|
||||
|
||||
* `v vlib/v/fmt/fmt_keep_test.v`
|
||||
|
||||
This verifies that all `_keep.vv` files in the `vlib/v/fmt/tests/` folder,
|
||||
would be unchanged by `v fmt -w`, i.e. that the v source code formatter,
|
||||
generates a stable source output, that does not change, once it is already
|
||||
formatted once.
|
||||
|
||||
* `v vlib/v/fmt/fmt_vlib_test.v`
|
||||
|
||||
This checks that all V source files are formatted, and prints a summary.
|
||||
This is not required.
|
||||
|
||||
* `v test-cleancode`
|
||||
|
||||
Check that most .v files, are invariant of `v fmt` runs.
|
||||
|
||||
* `v test-fmt`
|
||||
|
||||
This tests that all .v files in the current folder are already formatted.
|
||||
It is useful for adding to CI jobs, to guarantee, that future contributions
|
||||
will keep the existing source nice and clean.
|
||||
|
||||
## Markdown/documentation checks:
|
||||
|
||||
* `v check-md -hide-warnings .`
|
||||
|
||||
Ensure that all .md files in the project are formatted properly,
|
||||
and that the V code block examples in them can be compiled/formatted too.
|
||||
|
||||
## `v test-self`
|
||||
|
||||
Run `vlib` module tests, *including* the compiler tests.
|
||||
|
||||
## `v vlib/v/compiler_errors_test.v`
|
||||
|
||||
This runs tests for:
|
||||
* `vlib/v/scanner/tests/*.vv`
|
||||
* `vlib/v/checker/tests/*.vv`
|
||||
* `vlib/v/parser/tests/*.vv`
|
||||
|
||||
NB: there are special folders, that compiler_errors_test.v will try to
|
||||
run/compile with specific options:
|
||||
|
||||
vlib/v/checker/tests/globals_run/ - `-enable-globals run`;
|
||||
results stored in `.run.out` files, matching the .vv ones.
|
||||
|
||||
NB 2: in case you need to modify many .out files, run *twice* in a row:
|
||||
`VAUTOFIX=1 ./v vlib/v/compiler_errors_test.v`
|
||||
This will fail the first time, but it will record the new output for each
|
||||
.vv file, and store it into the corresponding .out file. The second run
|
||||
should be now successfull, and so you can inspect the difference, and
|
||||
commit the new .out files with minimum manual effort.
|
||||
|
||||
NB 3: To run only some of the tests, use:
|
||||
`VTEST_ONLY=mismatch ./v vlib/v/compiler_errors_test.v`
|
||||
This will check only the .vv files, whose paths match the given filter.
|
||||
|
||||
## `.github/workflows/ci.yml`
|
||||
|
||||
This is a Github Actions configuration file, that runs various CI
|
||||
tests in the main V repository, for example:
|
||||
|
||||
* `v vet vlib/v` - run a style checker.
|
||||
* `v test-self` (run self tests) in various compilation modes.
|
||||
|
|
|
@ -14,13 +14,13 @@ fn main() {
|
|||
mut checksum := u64(0)
|
||||
mut start_pos := 0
|
||||
mut bgenerating := benchmark.start()
|
||||
mut bytepile := []byte{}
|
||||
mut bytepile := []u8{}
|
||||
for _ in 0 .. sample_size * max_str_len {
|
||||
bytepile << byte(rand.int_in_range(40, 125))
|
||||
bytepile << u8(rand.int_in_range(40, 125) or { 40 })
|
||||
}
|
||||
mut str_lens := []int{}
|
||||
for _ in 0 .. sample_size {
|
||||
str_lens << rand.int_in_range(min_str_len, max_str_len)
|
||||
str_lens << rand.int_in_range(min_str_len, max_str_len) or { min_str_len }
|
||||
}
|
||||
bgenerating.measure('generating strings')
|
||||
println('Hashing each of the generated strings...')
|
||||
|
@ -30,7 +30,7 @@ fn main() {
|
|||
checksum = 0
|
||||
for len in str_lens {
|
||||
end_pos := start_pos + len
|
||||
checksum ^= wyhash.wyhash_c(unsafe { &byte(bytepile.data) + start_pos }, u64(len),
|
||||
checksum ^= wyhash.wyhash_c(unsafe { &u8(bytepile.data) + start_pos }, u64(len),
|
||||
1)
|
||||
start_pos = end_pos
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ fn main() {
|
|||
vexe := pref.vexe_path()
|
||||
vroot := os.dir(vexe)
|
||||
util.set_vroot_folder(vroot)
|
||||
os.chdir(vroot) ?
|
||||
os.chdir(vroot)?
|
||||
cmd := diff.find_working_diff_command() or { '' }
|
||||
mut app := App{
|
||||
diff_cmd: cmd
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
fn main() {
|
||||
$if tinyc {
|
||||
println('Your `tcc` is working. Good - it is much faster at compiling C source code.')
|
||||
exit(0)
|
||||
}
|
||||
|
||||
$if !macos {
|
||||
println('
|
||||
Note: `tcc` was not used, so unless you install it yourself, your backend
|
||||
C compiler will be `cc`, which is usually either `clang`, `gcc` or `msvc`.
|
||||
|
||||
These C compilers, are several times slower at compiling C source code,
|
||||
compared to `tcc`. They do produce more optimised executables, but that
|
||||
is done at the cost of compilation speed.
|
||||
')
|
||||
}
|
||||
}
|
|
@ -1,11 +1,10 @@
|
|||
// Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved.
|
||||
// Copyright (c) 2019-2022 Alexander Medvednikov. All rights reserved.
|
||||
// Use of this source code is governed by an MIT license
|
||||
// that can be found in the LICENSE file.
|
||||
import os
|
||||
import time
|
||||
|
||||
// TODO -usecache
|
||||
const voptions = ' -skip-unused -show-timings -stats '
|
||||
const voptions = ' -usecache -skip-unused -show-timings -stats '
|
||||
|
||||
const exe = os.executable()
|
||||
|
||||
|
@ -16,7 +15,7 @@ const vdir = @VEXEROOT
|
|||
fn main() {
|
||||
dump(fast_dir)
|
||||
dump(vdir)
|
||||
os.chdir(fast_dir) ?
|
||||
os.chdir(fast_dir)?
|
||||
if !os.exists('$vdir/v') && !os.is_dir('$vdir/vlib') {
|
||||
println('fast.html generator needs to be located in `v/cmd/tools/fast`')
|
||||
}
|
||||
|
@ -29,37 +28,37 @@ fn main() {
|
|||
return
|
||||
}
|
||||
}
|
||||
// Fetch the last commit's hash
|
||||
|
||||
// fetch the last commit's hash
|
||||
commit := exec('git rev-parse HEAD')[..8]
|
||||
if !os.exists('table.html') {
|
||||
os.create('table.html') ?
|
||||
os.create('table.html')?
|
||||
}
|
||||
mut table := os.read_file('table.html') ?
|
||||
mut table := os.read_file('table.html')?
|
||||
if os.exists('website/index.html') {
|
||||
uploaded_index := os.read_file('website/index.html') ?
|
||||
uploaded_index := os.read_file('website/index.html')?
|
||||
if uploaded_index.contains('>$commit<') {
|
||||
println('nothing to benchmark')
|
||||
exit(1)
|
||||
return
|
||||
}
|
||||
}
|
||||
// for i, commit in commits {
|
||||
message := exec('git log --pretty=format:"%s" -n1 $commit')
|
||||
// println('\n${i + 1}/$commits.len Benchmarking commit $commit "$message"')
|
||||
println('\nBenchmarking commit $commit "$message"')
|
||||
// Build an optimized V
|
||||
// println('Checking out ${commit}...')
|
||||
// exec('git checkout $commit')
|
||||
|
||||
// build an optimized V
|
||||
println(' Building vprod...')
|
||||
os.chdir(vdir) ?
|
||||
os.chdir(vdir)?
|
||||
if os.args.contains('-noprod') {
|
||||
exec('./v -o vprod cmd/v') // for faster debugging
|
||||
} else {
|
||||
exec('./v -o vprod -prod -prealloc cmd/v')
|
||||
}
|
||||
|
||||
// cache vlib modules
|
||||
exec('$vdir/v wipe-cache')
|
||||
exec('$vdir/v -o v2 -prod cmd/v')
|
||||
|
||||
// measure
|
||||
diff1 := measure('$vdir/vprod $voptions -o v.c cmd/v', 'v.c')
|
||||
mut tcc_path := 'tcc'
|
||||
|
@ -72,23 +71,24 @@ fn main() {
|
|||
if os.args.contains('-clang') {
|
||||
tcc_path = 'clang'
|
||||
}
|
||||
|
||||
diff2 := measure('$vdir/vprod $voptions -cc $tcc_path -o v2 cmd/v', 'v2')
|
||||
diff3 := 0 // measure('$vdir/vprod -native $vdir/cmd/tools/1mil.v', 'native 1mil')
|
||||
diff4 := measure('$vdir/vprod -usecache $voptions -cc clang examples/hello_world.v',
|
||||
'hello.v')
|
||||
vc_size := os.file_size('v.c') / 1000
|
||||
// scan/parse/check/cgen
|
||||
scan, parse, check, cgen, vlines := measure_steps(vdir)
|
||||
// println('Building V took ${diff}ms')
|
||||
|
||||
commit_date := exec('git log -n1 --pretty="format:%at" $commit')
|
||||
date := time.unix(commit_date.int())
|
||||
//
|
||||
os.chdir(fast_dir) ?
|
||||
mut out := os.create('table.html') ?
|
||||
// Place the new row on top
|
||||
|
||||
os.chdir(fast_dir)?
|
||||
mut out := os.create('table.html')?
|
||||
|
||||
// place the new row on top
|
||||
html_message := message.replace_each(['<', '<', '>', '>'])
|
||||
table =
|
||||
'<tr>
|
||||
' <tr>
|
||||
<td>$date.format()</td>
|
||||
<td><a target=_blank href="https://github.com/vlang/v/commit/$commit">$commit</a></td>
|
||||
<td>$html_message</td>
|
||||
|
@ -105,26 +105,25 @@ fn main() {
|
|||
<td>${int(f64(vlines) / f64(diff1) * 1000.0)}</td>
|
||||
</tr>\n' +
|
||||
table.trim_space()
|
||||
out.writeln(table) ?
|
||||
out.writeln(table)?
|
||||
out.close()
|
||||
// Regenerate index.html
|
||||
header := os.read_file('header.html') ?
|
||||
footer := os.read_file('footer.html') ?
|
||||
mut res := os.create('index.html') ?
|
||||
res.writeln(header) ?
|
||||
res.writeln(table) ?
|
||||
res.writeln(footer) ?
|
||||
|
||||
// regenerate index.html
|
||||
header := os.read_file('header.html')?
|
||||
footer := os.read_file('footer.html')?
|
||||
mut res := os.create('index.html')?
|
||||
res.writeln(header)?
|
||||
res.writeln(table)?
|
||||
res.writeln(footer)?
|
||||
res.close()
|
||||
//}
|
||||
// exec('git checkout master')
|
||||
// os.write_file('last_commit.txt', commits[commits.len - 1]) ?
|
||||
// Upload the result to github pages
|
||||
|
||||
// upload the result to github pages
|
||||
if os.args.contains('-upload') {
|
||||
println('uploading...')
|
||||
os.chdir('website') ?
|
||||
os.chdir('website')?
|
||||
os.execute_or_exit('git checkout gh-pages')
|
||||
os.cp('../index.html', 'index.html') ?
|
||||
os.rm('../index.html') ?
|
||||
os.cp('../index.html', 'index.html')?
|
||||
os.rm('../index.html')?
|
||||
os.system('git commit -am "update benchmark"')
|
||||
os.system('git push origin gh-pages')
|
||||
}
|
||||
|
@ -135,7 +134,7 @@ fn exec(s string) string {
|
|||
return e.output.trim_right('\r\n')
|
||||
}
|
||||
|
||||
// returns milliseconds
|
||||
// measure returns milliseconds
|
||||
fn measure(cmd string, description string) int {
|
||||
println(' Measuring $description')
|
||||
println(' Warming up...')
|
||||
|
@ -187,7 +186,7 @@ fn measure_steps(vdir string) (int, int, int, int, int) {
|
|||
cgen = line[0].int()
|
||||
}
|
||||
} else {
|
||||
// Fetch number of V lines
|
||||
// fetch number of V lines
|
||||
if line[0].contains('V') && line[0].contains('source') && line[0].contains('size') {
|
||||
start := line[0].index(':') or { 0 }
|
||||
end := line[0].index('lines,') or { 0 }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved.
|
||||
// Copyright (c) 2019-2022 Alexander Medvednikov. All rights reserved.
|
||||
// Use of this source code is governed by an MIT license
|
||||
// that can be found in the LICENSE file.
|
||||
import os
|
||||
|
|
|
@ -10,9 +10,9 @@ fn generate_strings(str_len int, arr_len int) []string {
|
|||
}
|
||||
|
||||
fn fuzz1() {
|
||||
amount := 200000 - rand.intn(100000)
|
||||
amount2 := 200000 - rand.intn(100000)
|
||||
len := 25 - rand.intn(10)
|
||||
amount := 200000 - rand.intn(100000) or { 0 }
|
||||
amount2 := 200000 - rand.intn(100000) or { 0 }
|
||||
len := 25 - rand.intn(10) or { 0 }
|
||||
arr := generate_strings(len, amount)
|
||||
arr2 := generate_strings(len, amount2)
|
||||
mut m := map[string]int{}
|
||||
|
@ -34,8 +34,8 @@ fn fuzz1() {
|
|||
|
||||
fn fuzz2() {
|
||||
mut m := map[string]int{}
|
||||
amount := rand.intn(500000) + 1
|
||||
len := 25 - rand.intn(10)
|
||||
amount := rand.intn(500000) or { 0 } + 1
|
||||
len := 25 - rand.intn(10) or { 0 }
|
||||
arr := generate_strings(len, amount)
|
||||
for i, x in arr {
|
||||
m[x] = i
|
||||
|
@ -54,8 +54,8 @@ fn fuzz2() {
|
|||
|
||||
fn fuzz3() {
|
||||
mut m := map[string]int{}
|
||||
amount := rand.intn(500000) + 1
|
||||
len := 25 - rand.intn(10)
|
||||
amount := rand.intn(500000) or { 0 } + 1
|
||||
len := 25 - rand.intn(10) or { 0 }
|
||||
arr := generate_strings(len, amount)
|
||||
for i, x in arr {
|
||||
if (i % 10000) == 0 {
|
||||
|
@ -74,8 +74,8 @@ fn fuzz3() {
|
|||
}
|
||||
|
||||
fn fuzz4() {
|
||||
amount := rand.intn(500000)
|
||||
len := 25 - rand.intn(10)
|
||||
amount := rand.intn(500000) or { 0 }
|
||||
len := 25 - rand.intn(10) or { 0 }
|
||||
arr := generate_strings(len, amount)
|
||||
mut m := map[string]int{}
|
||||
for i in 0 .. amount {
|
||||
|
@ -93,7 +93,7 @@ fn fuzz4() {
|
|||
}
|
||||
|
||||
fn fuzz5() {
|
||||
amount := rand.intn(500000) + 1
|
||||
amount := rand.intn(500000) or { 0 } + 1
|
||||
arr := generate_strings(20, amount)
|
||||
mut m := map[string]int{}
|
||||
for i in 0 .. amount {
|
||||
|
@ -114,8 +114,8 @@ fn fuzz5() {
|
|||
|
||||
fn fuzz6() {
|
||||
mut m := map[string]int{}
|
||||
amount := rand.intn(500000) + 1
|
||||
len := 25 - rand.intn(10)
|
||||
amount := rand.intn(500000) or { 0 } + 1
|
||||
len := 25 - rand.intn(10) or { 0 }
|
||||
arr := generate_strings(len, amount)
|
||||
for i, x in arr {
|
||||
m[x]++
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
import os
|
||||
import time
|
||||
import v.ast
|
||||
import v.pref
|
||||
import v.parser
|
||||
import v.errors
|
||||
import v.scanner
|
||||
|
||||
fn main() {
|
||||
files := os.args#[1..]
|
||||
if files.len > 0 && files[0].starts_with('@') {
|
||||
lst_path := files[0].all_after('@')
|
||||
listed_files := os.read_file(lst_path)?.split('\n')
|
||||
process_files(listed_files)?
|
||||
return
|
||||
}
|
||||
process_files(files)?
|
||||
}
|
||||
|
||||
fn process_files(files []string) ? {
|
||||
mut table := ast.new_table()
|
||||
mut pref := pref.new_preferences()
|
||||
pref.is_fmt = true
|
||||
pref.skip_warnings = true
|
||||
pref.output_mode = .silent
|
||||
mut sw := time.new_stopwatch()
|
||||
mut total_us := i64(0)
|
||||
mut total_bytes := i64(0)
|
||||
mut total_tokens := i64(0)
|
||||
for f in files {
|
||||
if f == '' {
|
||||
continue
|
||||
}
|
||||
if f.ends_with('_test.v') {
|
||||
continue
|
||||
}
|
||||
// do not measure the scanning, but only the parsing:
|
||||
mut p := new_parser(f, .skip_comments, table, pref)
|
||||
///
|
||||
sw.restart()
|
||||
_ := p.parse()
|
||||
f_us := sw.elapsed().microseconds()
|
||||
///
|
||||
total_us += f_us
|
||||
total_bytes += p.scanner.text.len
|
||||
total_tokens += p.scanner.all_tokens.len
|
||||
println('${f_us:10}us ${p.scanner.all_tokens.len:10} ${p.scanner.text.len:10} ${(f64(p.scanner.text.len) / p.scanner.all_tokens.len):7.3} ${p.errors.len:4} $f')
|
||||
}
|
||||
println('${total_us:10}us ${total_tokens:10} ${total_bytes:10} ${(f64(total_tokens) / total_bytes):7.3} | speed: ${(f64(total_bytes) / total_us):2.5f} MB/s')
|
||||
}
|
||||
|
||||
fn new_parser(path string, comments_mode scanner.CommentsMode, table &ast.Table, pref &pref.Preferences) &parser.Parser {
|
||||
mut p := &parser.Parser{
|
||||
scanner: scanner.new_scanner_file(path, comments_mode, pref) or { panic(err) }
|
||||
comments_mode: comments_mode
|
||||
table: table
|
||||
pref: pref
|
||||
scope: &ast.Scope{
|
||||
start_pos: 0
|
||||
parent: table.global_scope
|
||||
}
|
||||
errors: []errors.Error{}
|
||||
warnings: []errors.Warning{}
|
||||
}
|
||||
p.set_path(path)
|
||||
return p
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
import os
|
||||
import time
|
||||
import v.scanner
|
||||
import v.pref
|
||||
|
||||
fn main() {
|
||||
files := os.args#[1..]
|
||||
if files.len > 0 && files[0].starts_with('@') {
|
||||
lst_path := files[0].all_after('@')
|
||||
listed_files := os.read_file(lst_path)?.split('\n')
|
||||
process_files(listed_files)?
|
||||
return
|
||||
}
|
||||
process_files(files)?
|
||||
}
|
||||
|
||||
fn process_files(files []string) ? {
|
||||
mut pref := pref.new_preferences()
|
||||
pref.is_fmt = true
|
||||
pref.skip_warnings = true
|
||||
pref.output_mode = .silent
|
||||
mut sw := time.new_stopwatch()
|
||||
mut total_us := i64(0)
|
||||
mut total_bytes := i64(0)
|
||||
mut total_tokens := i64(0)
|
||||
for f in files {
|
||||
if f == '' {
|
||||
continue
|
||||
}
|
||||
if f.ends_with('_test.v') {
|
||||
continue
|
||||
}
|
||||
sw.restart()
|
||||
s := scanner.new_scanner_file(f, .skip_comments, pref)?
|
||||
f_us := sw.elapsed().microseconds()
|
||||
total_us += f_us
|
||||
total_bytes += s.text.len
|
||||
total_tokens += s.all_tokens.len
|
||||
println('${f_us:10}us ${s.all_tokens.len:10} ${s.text.len:10} ${(f64(s.text.len) / s.all_tokens.len):7.3f} $f')
|
||||
}
|
||||
println('${total_us:10}us ${total_tokens:10} ${total_bytes:10} ${(f64(total_tokens) / total_bytes):7.3f} | speed: ${(f64(total_bytes) / total_us):2.5f} MB/s')
|
||||
}
|
|
@ -1,141 +0,0 @@
|
|||
// Copyright (c) 2020 Lars Pontoppidan. All rights reserved.
|
||||
// Use of this source code is governed by an MIT license
|
||||
// that can be found in the LICENSE file.
|
||||
import os
|
||||
import flag
|
||||
|
||||
const (
|
||||
tool_name = os.file_name(os.executable())
|
||||
tool_version = '0.0.2'
|
||||
tool_description = 'Prints all V functions in .v files under PATH/, that do not yet have documentation comments.'
|
||||
)
|
||||
|
||||
struct UndocumentedFN {
|
||||
line int
|
||||
signature string
|
||||
tags []string
|
||||
}
|
||||
|
||||
struct Options {
|
||||
show_help bool
|
||||
collect_tags bool
|
||||
deprecated bool
|
||||
}
|
||||
|
||||
fn collect(path string, mut l []string, f fn (string, mut []string)) {
|
||||
if !os.is_dir(path) {
|
||||
return
|
||||
}
|
||||
mut files := os.ls(path) or { return }
|
||||
for file in files {
|
||||
p := path + os.path_separator + file
|
||||
if os.is_dir(p) && !os.is_link(p) {
|
||||
collect(p, mut l, f)
|
||||
} else if os.exists(p) {
|
||||
f(p, mut l)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fn report_undocumented_functions_in_path(opt Options, path string) {
|
||||
mut files := []string{}
|
||||
collect_fn := fn (path string, mut l []string) {
|
||||
if os.file_ext(path) == '.v' {
|
||||
l << os.real_path(path)
|
||||
}
|
||||
}
|
||||
collect(path, mut files, collect_fn)
|
||||
for file in files {
|
||||
if file.ends_with('_test.v') {
|
||||
continue
|
||||
}
|
||||
report_undocumented_functions_in_file(opt, file)
|
||||
}
|
||||
}
|
||||
|
||||
fn report_undocumented_functions_in_file(opt Options, file string) {
|
||||
contents := os.read_file(file) or { panic(err) }
|
||||
lines := contents.split('\n')
|
||||
mut info := []UndocumentedFN{}
|
||||
for i, line in lines {
|
||||
if line.starts_with('pub fn') || (line.starts_with('fn ') && !(line.starts_with('fn C.')
|
||||
|| line.starts_with('fn main'))) {
|
||||
// println('Match: $line')
|
||||
if i > 0 && lines.len > 0 {
|
||||
mut line_above := lines[i - 1]
|
||||
if !line_above.starts_with('//') {
|
||||
mut tags := []string{}
|
||||
mut grab := true
|
||||
for j := i - 1; j >= 0; j-- {
|
||||
prev_line := lines[j]
|
||||
if prev_line.contains('}') { // We've looked back to the above scope, stop here
|
||||
break
|
||||
} else if prev_line.starts_with('[') {
|
||||
tags << collect_tags(prev_line)
|
||||
continue
|
||||
} else if prev_line.starts_with('//') { // Single-line comment
|
||||
grab = false
|
||||
break
|
||||
}
|
||||
}
|
||||
if grab {
|
||||
clean_line := line.all_before_last(' {')
|
||||
info << UndocumentedFN{i + 1, clean_line, tags}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if info.len > 0 {
|
||||
for undocumented_fn in info {
|
||||
tags_str := if opt.collect_tags && undocumented_fn.tags.len > 0 {
|
||||
'$undocumented_fn.tags'
|
||||
} else {
|
||||
''
|
||||
}
|
||||
if opt.deprecated {
|
||||
println('$file:$undocumented_fn.line:0:$undocumented_fn.signature $tags_str')
|
||||
} else {
|
||||
if 'deprecated' !in undocumented_fn.tags {
|
||||
println('$file:$undocumented_fn.line:0:$undocumented_fn.signature $tags_str')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn collect_tags(line string) []string {
|
||||
mut cleaned := line.all_before('/')
|
||||
cleaned = cleaned.replace_each(['[', '', ']', '', ' ', ''])
|
||||
return cleaned.split(',')
|
||||
}
|
||||
|
||||
fn main() {
|
||||
if os.args.len == 1 {
|
||||
println('Usage: $tool_name PATH \n$tool_description\n$tool_name -h for more help...')
|
||||
exit(1)
|
||||
}
|
||||
mut fp := flag.new_flag_parser(os.args[1..])
|
||||
fp.application(tool_name)
|
||||
fp.version(tool_version)
|
||||
fp.description(tool_description)
|
||||
fp.arguments_description('PATH [PATH]...')
|
||||
// Collect tool options
|
||||
opt := Options{
|
||||
show_help: fp.bool('help', `h`, false, 'Show this help text.')
|
||||
deprecated: fp.bool('deprecated', `d`, false, 'Include deprecated functions in output.')
|
||||
collect_tags: fp.bool('tags', `t`, false, 'Also print function tags if any is found.')
|
||||
}
|
||||
if opt.show_help {
|
||||
println(fp.usage())
|
||||
exit(0)
|
||||
}
|
||||
for path in os.args[1..] {
|
||||
if os.is_file(path) {
|
||||
report_undocumented_functions_in_file(opt, path)
|
||||
} else {
|
||||
report_undocumented_functions_in_path(opt, path)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,6 +24,7 @@ pub fn cprint(omessage string) {
|
|||
message = term.cyan(message)
|
||||
}
|
||||
print(message)
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
pub fn cprint_strong(omessage string) {
|
||||
|
@ -32,16 +33,19 @@ pub fn cprint_strong(omessage string) {
|
|||
message = term.bright_green(message)
|
||||
}
|
||||
print(message)
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
pub fn cprintln(omessage string) {
|
||||
cprint(omessage)
|
||||
println('')
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
pub fn cprintln_strong(omessage string) {
|
||||
cprint_strong(omessage)
|
||||
println('')
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
pub fn verbose_trace(label string, message string) {
|
||||
|
|
|
@ -19,6 +19,8 @@ pub const hide_oks = os.getenv('VTEST_HIDE_OK') == '1'
|
|||
|
||||
pub const fail_fast = os.getenv('VTEST_FAIL_FAST') == '1'
|
||||
|
||||
pub const fail_flaky = os.getenv('VTEST_FAIL_FLAKY') == '1'
|
||||
|
||||
pub const test_only = os.getenv('VTEST_ONLY').split_any(',')
|
||||
|
||||
pub const test_only_fn = os.getenv('VTEST_ONLY_FN').split_any(',')
|
||||
|
@ -35,7 +37,6 @@ pub mut:
|
|||
vroot string
|
||||
vtmp_dir string
|
||||
vargs string
|
||||
failed bool
|
||||
fail_fast bool
|
||||
benchmark benchmark.Benchmark
|
||||
rm_binaries bool = true
|
||||
|
@ -122,6 +123,7 @@ pub fn (mut ts TestSession) print_messages() {
|
|||
// progress mode, the last line is rewritten many times:
|
||||
if is_ok && !ts.silent_mode {
|
||||
print('\r$empty\r$msg')
|
||||
flush_stdout()
|
||||
} else {
|
||||
// the last \n is needed, so SKIP/FAIL messages
|
||||
// will not get overwritten by the OK ones
|
||||
|
@ -157,6 +159,7 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession {
|
|||
$if windows {
|
||||
skip_files << 'examples/database/mysql.v'
|
||||
skip_files << 'examples/database/orm.v'
|
||||
skip_files << 'examples/smtp/mail.v' // requires OpenSSL
|
||||
skip_files << 'examples/websocket/ping.v' // requires OpenSSL
|
||||
skip_files << 'examples/websocket/client-server/client.v' // requires OpenSSL
|
||||
skip_files << 'examples/websocket/client-server/server.v' // requires OpenSSL
|
||||
|
@ -164,9 +167,18 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession {
|
|||
skip_files << 'examples/database/orm.v' // try fix it
|
||||
}
|
||||
}
|
||||
$if windows {
|
||||
// TODO: remove when closures on windows are supported
|
||||
skip_files << 'examples/pendulum-simulation/animation.v'
|
||||
skip_files << 'examples/pendulum-simulation/full.v'
|
||||
skip_files << 'examples/pendulum-simulation/parallel.v'
|
||||
skip_files << 'examples/pendulum-simulation/parallel_with_iw.v'
|
||||
skip_files << 'examples/pendulum-simulation/sequential.v'
|
||||
}
|
||||
if testing.github_job != 'sokol-shaders-can-be-compiled' {
|
||||
// These examples need .h files that are produced from the supplied .glsl files,
|
||||
// using by the shader compiler tools in https://github.com/floooh/sokol-tools-bin/archive/pre-feb2021-api-changes.tar.gz
|
||||
skip_files << 'examples/sokol/simple_shader_glsl/simple_shader.v'
|
||||
skip_files << 'examples/sokol/02_cubes_glsl/cube_glsl.v'
|
||||
skip_files << 'examples/sokol/03_march_tracing_glsl/rt_glsl.v'
|
||||
skip_files << 'examples/sokol/04_multi_shader_glsl/rt_glsl.v'
|
||||
|
@ -176,6 +188,7 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession {
|
|||
}
|
||||
if testing.github_job != 'ubuntu-tcc' {
|
||||
skip_files << 'examples/c_interop_wkhtmltopdf.v' // needs installation of wkhtmltopdf from https://github.com/wkhtmltopdf/packaging/releases
|
||||
skip_files << 'examples/call_v_from_python/test.v' // the example only makes sense to be compiled, when python is installed
|
||||
// the ttf_test.v is not interactive, but needs X11 headers to be installed, which is done only on ubuntu-tcc for now
|
||||
skip_files << 'vlib/x/ttf/ttf_test.v'
|
||||
skip_files << 'vlib/vweb/vweb_app_test.v' // imports the `sqlite` module, which in turn includes sqlite3.h
|
||||
|
@ -275,7 +288,7 @@ pub fn (mut ts TestSession) test() {
|
|||
fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
||||
mut ts := &TestSession(p.get_shared_context())
|
||||
if ts.fail_fast {
|
||||
if ts.failed {
|
||||
if ts.failed_cmds.len > 0 {
|
||||
return pool.no_result
|
||||
}
|
||||
}
|
||||
|
@ -295,12 +308,14 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
|||
mut run_js := false
|
||||
|
||||
is_fmt := ts.vargs.contains('fmt')
|
||||
is_vet := ts.vargs.contains('vet')
|
||||
produces_file_output := !(is_fmt || is_vet)
|
||||
|
||||
if relative_file.ends_with('js.v') {
|
||||
if !is_fmt {
|
||||
if produces_file_output {
|
||||
cmd_options << ' -b js'
|
||||
run_js = true
|
||||
}
|
||||
run_js = true
|
||||
}
|
||||
|
||||
if relative_file.contains('global') && !is_fmt {
|
||||
|
@ -322,16 +337,16 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
|||
fname.replace('.v', '')
|
||||
}
|
||||
generated_binary_fpath := os.join_path_single(tmpd, generated_binary_fname)
|
||||
if os.exists(generated_binary_fpath) {
|
||||
if ts.rm_binaries {
|
||||
os.rm(generated_binary_fpath) or {}
|
||||
if produces_file_output {
|
||||
if os.exists(generated_binary_fpath) {
|
||||
if ts.rm_binaries {
|
||||
os.rm(generated_binary_fpath) or {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !ts.vargs.contains('fmt') {
|
||||
cmd_options << ' -o "$generated_binary_fpath"'
|
||||
cmd_options << ' -o ${os.quoted_path(generated_binary_fpath)}'
|
||||
}
|
||||
cmd := '"$ts.vexe" ' + cmd_options.join(' ') + ' "$file"'
|
||||
cmd := '${os.quoted_path(ts.vexe)} ' + cmd_options.join(' ') + ' ${os.quoted_path(file)}'
|
||||
ts.benchmark.step()
|
||||
tls_bench.step()
|
||||
if relative_file.replace('\\', '/') in ts.skip_files {
|
||||
|
@ -349,7 +364,7 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
|||
details := get_test_details(file)
|
||||
os.setenv('VTEST_RETRY_MAX', '$details.retry', true)
|
||||
for retry := 1; retry <= details.retry; retry++ {
|
||||
ts.append_message(.info, ' retrying $retry/$details.retry of $relative_file ...')
|
||||
ts.append_message(.info, ' [stats] retrying $retry/$details.retry of $relative_file ; known flaky: $details.flaky ...')
|
||||
os.setenv('VTEST_RETRY', '$retry', true)
|
||||
status = os.system(cmd)
|
||||
if status == 0 {
|
||||
|
@ -357,8 +372,14 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
|||
goto test_passed_system
|
||||
}
|
||||
}
|
||||
time.sleep(500 * time.millisecond)
|
||||
}
|
||||
if details.flaky && !testing.fail_flaky {
|
||||
ts.append_message(.info, ' *FAILURE* of the known flaky test file $relative_file is ignored, since VTEST_FAIL_FLAKY is 0 . Retry count: $details.retry .')
|
||||
unsafe {
|
||||
goto test_passed_system
|
||||
}
|
||||
}
|
||||
ts.failed = true
|
||||
ts.benchmark.fail()
|
||||
tls_bench.fail()
|
||||
ts.add_failed_cmd(cmd)
|
||||
|
@ -374,7 +395,6 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
|||
}
|
||||
mut r := os.execute(cmd)
|
||||
if r.exit_code < 0 {
|
||||
ts.failed = true
|
||||
ts.benchmark.fail()
|
||||
tls_bench.fail()
|
||||
ts.append_message(.fail, tls_bench.step_message_fail(normalised_relative_file))
|
||||
|
@ -385,7 +405,7 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
|||
details := get_test_details(file)
|
||||
os.setenv('VTEST_RETRY_MAX', '$details.retry', true)
|
||||
for retry := 1; retry <= details.retry; retry++ {
|
||||
ts.append_message(.info, ' retrying $retry/$details.retry of $relative_file ...')
|
||||
ts.append_message(.info, ' retrying $retry/$details.retry of $relative_file ; known flaky: $details.flaky ...')
|
||||
os.setenv('VTEST_RETRY', '$retry', true)
|
||||
r = os.execute(cmd)
|
||||
if r.exit_code == 0 {
|
||||
|
@ -394,7 +414,12 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
|||
}
|
||||
}
|
||||
}
|
||||
ts.failed = true
|
||||
if details.flaky && !testing.fail_flaky {
|
||||
ts.append_message(.info, ' *FAILURE* of the known flaky test file $relative_file is ignored, since VTEST_FAIL_FLAKY is 0 . Retry count: $details.retry .')
|
||||
unsafe {
|
||||
goto test_passed_execute
|
||||
}
|
||||
}
|
||||
ts.benchmark.fail()
|
||||
tls_bench.fail()
|
||||
ending_newline := if r.output.ends_with('\n') { '\n' } else { '' }
|
||||
|
@ -409,10 +434,8 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
|||
}
|
||||
}
|
||||
}
|
||||
if os.exists(generated_binary_fpath) {
|
||||
if ts.rm_binaries {
|
||||
os.rm(generated_binary_fpath) or {}
|
||||
}
|
||||
if produces_file_output && os.exists(generated_binary_fpath) && ts.rm_binaries {
|
||||
os.rm(generated_binary_fpath) or {}
|
||||
}
|
||||
return pool.no_result
|
||||
}
|
||||
|
@ -440,12 +463,12 @@ pub fn prepare_test_session(zargs string, folder string, oskipped []string, main
|
|||
mut skipped := oskipped.clone()
|
||||
next_file: for f in files {
|
||||
fnormalised := f.replace('\\', '/')
|
||||
// NB: a `testdata` folder, is the preferred name of a folder, containing V code,
|
||||
// Note: a `testdata` folder, is the preferred name of a folder, containing V code,
|
||||
// that you *do not want* the test framework to find incidentally for various reasons,
|
||||
// for example module import tests, or subtests, that are compiled/run by other parent tests
|
||||
// in specific configurations, etc.
|
||||
if fnormalised.contains('testdata/') || fnormalised.contains('modules/')
|
||||
|| f.contains('preludes/') {
|
||||
|| fnormalised.contains('preludes/') {
|
||||
continue
|
||||
}
|
||||
$if windows {
|
||||
|
@ -456,14 +479,15 @@ pub fn prepare_test_session(zargs string, folder string, oskipped []string, main
|
|||
}
|
||||
}
|
||||
c := os.read_file(f) or { panic(err) }
|
||||
maxc := if c.len > 300 { 300 } else { c.len }
|
||||
maxc := if c.len > 500 { 500 } else { c.len }
|
||||
start := c[0..maxc]
|
||||
if start.contains('module ') && !start.contains('module main') {
|
||||
skipped_f := f.replace(os.join_path_single(parent_dir, ''), '')
|
||||
skipped << skipped_f
|
||||
}
|
||||
for skip_prefix in oskipped {
|
||||
if f.starts_with(skip_prefix) {
|
||||
skip_folder := skip_prefix + '/'
|
||||
if fnormalised.starts_with(skip_folder) {
|
||||
continue next_file
|
||||
}
|
||||
}
|
||||
|
@ -483,7 +507,7 @@ pub fn v_build_failing_skipped(zargs string, folder string, oskipped []string, c
|
|||
cb(mut session)
|
||||
session.test()
|
||||
eprintln(session.benchmark.total_message(finish_label))
|
||||
return session.failed
|
||||
return session.failed_cmds.len > 0
|
||||
}
|
||||
|
||||
pub fn build_v_cmd_failed(cmd string) bool {
|
||||
|
@ -537,6 +561,7 @@ pub fn eheader(msg string) {
|
|||
|
||||
pub fn header(msg string) {
|
||||
println(term.header_left(msg, '-'))
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
pub fn setup_new_vtmp_folder() string {
|
||||
|
@ -550,6 +575,7 @@ pub fn setup_new_vtmp_folder() string {
|
|||
pub struct TestDetails {
|
||||
pub mut:
|
||||
retry int
|
||||
flaky bool // when flaky tests fail, the whole run is still considered successfull, unless VTEST_FAIL_FLAKY is 1
|
||||
}
|
||||
|
||||
pub fn get_test_details(file string) TestDetails {
|
||||
|
@ -559,6 +585,9 @@ pub fn get_test_details(file string) TestDetails {
|
|||
if line.starts_with('// vtest retry:') {
|
||||
res.retry = line.all_after(':').trim_space().int()
|
||||
}
|
||||
if line.starts_with('// vtest flaky:') {
|
||||
res.flaky = line.all_after(':').trim_space().bool()
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ pub fn prepare_vc_source(vcdir string, cdir string, commit string) (string, stri
|
|||
}
|
||||
|
||||
pub fn clone_or_pull(remote_git_url string, local_worktree_path string) {
|
||||
// NB: after clone_or_pull, the current repo branch is === HEAD === master
|
||||
// Note: after clone_or_pull, the current repo branch is === HEAD === master
|
||||
if os.is_dir(local_worktree_path) && os.is_dir(os.join_path_single(local_worktree_path, '.git')) {
|
||||
// Already existing ... Just pulling in this case is faster usually.
|
||||
scripting.run('git -C "$local_worktree_path" checkout --quiet master')
|
||||
|
|
|
@ -16,7 +16,7 @@ const (
|
|||
| git checkout known_good_commit
|
||||
| git bisect good
|
||||
| ## Now git will automatically checkout a middle commit between the bad and the good
|
||||
| cmd/tools/oldv HEAD --command="run commands in oldv folder, to verify if the commit is good or bad"
|
||||
| cmd/tools/oldv --bisect --command="run commands in oldv folder, to verify if the commit is good or bad"
|
||||
| ## See what the result is, and either do: ...
|
||||
| git bisect good
|
||||
| ## ... or do:
|
||||
|
@ -40,6 +40,7 @@ mut:
|
|||
cleanup bool // should the tool run a cleanup first
|
||||
use_cache bool // use local cached copies for --vrepo and --vcrepo in
|
||||
fresh_tcc bool // do use `make fresh_tcc`
|
||||
is_bisect bool // bisect mode; usage: `cmd/tools/oldv -b -c './v run bug.v'`
|
||||
}
|
||||
|
||||
fn (mut c Context) compile_oldv_if_needed() {
|
||||
|
@ -56,7 +57,7 @@ fn (mut c Context) compile_oldv_if_needed() {
|
|||
c.vgcontext.compile_oldv_if_needed()
|
||||
c.commit_v_hash = c.vgcontext.commit_v__hash
|
||||
if !os.exists(c.vgcontext.vexepath) && c.cmd_to_run.len > 0 {
|
||||
// NB: 125 is a special code, that git bisect understands as 'skip this commit'.
|
||||
// Note: 125 is a special code, that git bisect understands as 'skip this commit'.
|
||||
// it is used to inform git bisect that the current commit leads to a build failure.
|
||||
exit(125)
|
||||
}
|
||||
|
@ -122,8 +123,9 @@ fn main() {
|
|||
context.vgo.vc_repo_url = 'https://github.com/vlang/vc'
|
||||
}
|
||||
should_sync := fp.bool('cache-sync', `s`, false, 'Update the local cache')
|
||||
if !should_sync {
|
||||
fp.limit_free_args(1, 1) ?
|
||||
context.is_bisect = fp.bool('bisect', `b`, false, 'Bisect mode. Use the current commit in the repo where oldv is.')
|
||||
if !should_sync && !context.is_bisect {
|
||||
fp.limit_free_args(1, 1)?
|
||||
}
|
||||
////
|
||||
context.cleanup = fp.bool('clean', 0, false, 'Clean before running (slower).')
|
||||
|
@ -141,6 +143,10 @@ fn main() {
|
|||
}
|
||||
if commits.len > 0 {
|
||||
context.commit_v = commits[0]
|
||||
if context.is_bisect {
|
||||
eprintln('In bisect mode, you should not pass any commits, since oldv will use the current one.')
|
||||
exit(2)
|
||||
}
|
||||
} else {
|
||||
context.commit_v = scripting.run('git rev-list -n1 HEAD')
|
||||
}
|
||||
|
|
|
@ -194,7 +194,7 @@ fn main() {
|
|||
fp.description(tool_description)
|
||||
fp.arguments_description('COMMIT_BEFORE [COMMIT_AFTER]')
|
||||
fp.skip_executable()
|
||||
fp.limit_free_args(1, 2) ?
|
||||
fp.limit_free_args(1, 2)?
|
||||
context.vflags = fp.string('vflags', 0, '', 'Additional options to pass to the v commands, for example "-cc tcc"')
|
||||
context.hyperfineopts = fp.string('hyperfine_options', 0, '', 'Additional options passed to hyperfine.
|
||||
${flag.space}For example on linux, you may want to pass:
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
import os
|
||||
import term
|
||||
import flag
|
||||
|
||||
const tools_folder = os.real_path(os.dir(os.executable()))
|
||||
|
||||
const oldvexe = fullpath(tools_folder, 'oldv')
|
||||
|
||||
const oldv_source = fullpath(tools_folder, 'oldv.v')
|
||||
|
||||
const vroot = os.real_path(os.dir(os.dir(tools_folder)))
|
||||
|
||||
const vexe = fullpath(vroot, 'v')
|
||||
|
||||
fn fullpath(folder string, fname string) string {
|
||||
return os.real_path(os.join_path_single(folder, exename(fname)))
|
||||
}
|
||||
|
||||
fn exename(n string) string {
|
||||
if n.ends_with('.v') || os.user_os() != 'windows' {
|
||||
return n
|
||||
}
|
||||
return '${n}.exe'
|
||||
}
|
||||
|
||||
struct Context {
|
||||
mut:
|
||||
old_commit string
|
||||
new_commit string
|
||||
command string
|
||||
}
|
||||
|
||||
fn main() {
|
||||
mut fp := flag.new_flag_parser(os.args)
|
||||
mut context := Context{}
|
||||
fp.application(os.file_name(os.executable()))
|
||||
fp.version('0.0.2')
|
||||
fp.description('\n Find at what commit a regression occurred.
|
||||
To find when a regression happened (regression_bug.v should fail on master):
|
||||
./v run cmd/tools/regress.v --old a7019ac --command " ./v run /abs/path/to/regression_bug.v"
|
||||
To find when a feature was implemented (feature.v should succeed on master):
|
||||
./v run cmd/tools/regress.v --old a7019ac --command "! ./v run /abs/path/to/feature.v"')
|
||||
fp.skip_executable()
|
||||
//
|
||||
context.new_commit = fp.string('new', `n`, 'master', 'The new commit, by default: master.')
|
||||
context.old_commit = fp.string('old', `o`, '', 'A known old commit, required (for it, COMMAND should exit with 0).')
|
||||
context.command = fp.string('command', `c`, '', 'A command to execute. Should exit with 0 for the *old* commits.')
|
||||
fp.finalize() or {}
|
||||
if context.old_commit == '' {
|
||||
eprintln('--old COMMIT is required')
|
||||
exit(1)
|
||||
}
|
||||
if context.command == '' {
|
||||
eprintln('--command "COMMAND" is required')
|
||||
exit(2)
|
||||
}
|
||||
if !os.exists(oldvexe) {
|
||||
if 0 != execute('${os.quoted_path(vexe)} -o ${os.quoted_path(oldvexe)} ${os.quoted_path(oldv_source)}') {
|
||||
panic('can not compile $oldvexe')
|
||||
}
|
||||
}
|
||||
os.execute('git checkout master')
|
||||
os.execute('git bisect reset')
|
||||
os.execute('git checkout $context.new_commit')
|
||||
os.execute('git bisect start')
|
||||
os.execute('git bisect new')
|
||||
os.execute('git checkout $context.old_commit')
|
||||
os.execute('git bisect old')
|
||||
println(term.colorize(term.bright_yellow, term.header('', '-')))
|
||||
execute('git bisect run ${os.quoted_path(oldvexe)} --bisect -c "$context.command"')
|
||||
println(term.colorize(term.bright_yellow, term.header('', '-')))
|
||||
os.execute('git bisect reset')
|
||||
os.execute('git checkout master')
|
||||
}
|
||||
|
||||
fn execute(cmd string) int {
|
||||
eprintln('### $cmd')
|
||||
return os.system(cmd)
|
||||
}
|
|
@ -143,7 +143,7 @@ const (
|
|||
|
||||
fn main() {
|
||||
mut context := Context{}
|
||||
context.parse_options() ?
|
||||
context.parse_options()?
|
||||
context.run()
|
||||
context.show_diff_summary()
|
||||
}
|
||||
|
@ -152,16 +152,16 @@ fn (mut context Context) parse_options() ? {
|
|||
mut fp := flag.new_flag_parser(os.args)
|
||||
fp.application(os.file_name(os.executable()))
|
||||
fp.version('0.0.1')
|
||||
fp.description('Repeat command(s) and collect statistics. NB: you have to quote each command, if it contains spaces.')
|
||||
fp.description('Repeat command(s) and collect statistics. Note: you have to quote each command, if it contains spaces.')
|
||||
fp.arguments_description('CMD1 CMD2 ...')
|
||||
fp.skip_executable()
|
||||
fp.limit_free_args_to_at_least(1) ?
|
||||
fp.limit_free_args_to_at_least(1)?
|
||||
context.count = fp.int('count', `c`, 10, 'Repetition count.')
|
||||
context.series = fp.int('series', `s`, 2, 'Series count. `-s 2 -c 4 a b` => aaaabbbbaaaabbbb, while `-s 3 -c 2 a b` => aabbaabbaabb.')
|
||||
context.warmup = fp.int('warmup', `w`, 2, 'Warmup runs. These are done *only at the start*, and are ignored.')
|
||||
context.show_help = fp.bool('help', `h`, false, 'Show this help screen.')
|
||||
context.use_newline = fp.bool('newline', `n`, false, 'Use \\n, do not overwrite the last line. Produces more output, but easier to diagnose.')
|
||||
context.show_output = fp.bool('output', `O`, false, 'Show command stdout/stderr in the progress indicator for each command. NB: slower, for verbose commands.')
|
||||
context.show_output = fp.bool('output', `O`, false, 'Show command stdout/stderr in the progress indicator for each command. Note: slower, for verbose commands.')
|
||||
context.verbose = fp.bool('verbose', `v`, false, 'Be more verbose.')
|
||||
context.fail_on_maxtime = fp.int('max_time', `m`, max_time, 'Fail with exit code 2, when first cmd takes above M milliseconds (regression).')
|
||||
context.fail_on_regress_percent = fp.int('fail_percent', `f`, max_fail_percent, 'Fail with exit code 3, when first cmd is X% slower than the rest (regression).')
|
||||
|
@ -200,8 +200,13 @@ fn (mut context Context) parse_options() ? {
|
|||
}
|
||||
}
|
||||
|
||||
fn flushed_print(s string) {
|
||||
print(s)
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
fn (mut context Context) clear_line() {
|
||||
print(context.cline)
|
||||
flushed_print(context.cline)
|
||||
}
|
||||
|
||||
fn (mut context Context) expand_all_commands(commands []string) []string {
|
||||
|
@ -247,7 +252,7 @@ fn (mut context Context) run() {
|
|||
println('Series: ${si:4}/${context.series:-4}, command: $cmd')
|
||||
if context.warmup > 0 && run_warmups < context.commands.len {
|
||||
for i in 1 .. context.warmup + 1 {
|
||||
print('${context.cgoback}warming up run: ${i:4}/${context.warmup:-4} for ${cmd:-50s} took ${duration:6} ms ...')
|
||||
flushed_print('${context.cgoback}warming up run: ${i:4}/${context.warmup:-4} for ${cmd:-50s} took ${duration:6} ms ...')
|
||||
mut sw := time.new_stopwatch()
|
||||
res := os.execute(cmd)
|
||||
if res.exit_code != 0 {
|
||||
|
@ -260,9 +265,9 @@ fn (mut context Context) run() {
|
|||
context.clear_line()
|
||||
for i in 1 .. (context.count + 1) {
|
||||
avg := f64(sum) / f64(i)
|
||||
print('${context.cgoback}Average: ${avg:9.3f}ms | run: ${i:4}/${context.count:-4} | took ${duration:6} ms')
|
||||
flushed_print('${context.cgoback}Average: ${avg:9.3f}ms | run: ${i:4}/${context.count:-4} | took ${duration:6} ms')
|
||||
if context.show_output {
|
||||
print(' | result: ${oldres:s}')
|
||||
flushed_print(' | result: ${oldres:s}')
|
||||
}
|
||||
mut sw := time.new_stopwatch()
|
||||
res := scripting.exec(cmd) or { continue }
|
||||
|
@ -288,7 +293,7 @@ fn (mut context Context) run() {
|
|||
context.results[icmd].atiming = new_aints(context.results[icmd].timings, context.nmins,
|
||||
context.nmaxs)
|
||||
context.clear_line()
|
||||
print(context.cgoback)
|
||||
flushed_print(context.cgoback)
|
||||
mut m := map[string][]int{}
|
||||
ioutputs := context.results[icmd].outputs
|
||||
for o in ioutputs {
|
||||
|
@ -358,7 +363,7 @@ fn (mut context Context) show_diff_summary() {
|
|||
println('context: $context')
|
||||
}
|
||||
if int(base) > context.fail_on_maxtime {
|
||||
print(performance_regression_label)
|
||||
flushed_print(performance_regression_label)
|
||||
println('average time: ${base:6.1f} ms > $context.fail_on_maxtime ms threshold.')
|
||||
exit(2)
|
||||
}
|
||||
|
@ -367,7 +372,7 @@ fn (mut context Context) show_diff_summary() {
|
|||
}
|
||||
fail_threshold_max := f64(context.fail_on_regress_percent)
|
||||
if first_cmd_percentage > fail_threshold_max {
|
||||
print(performance_regression_label)
|
||||
flushed_print(performance_regression_label)
|
||||
println('${first_cmd_percentage:5.1f}% > ${fail_threshold_max:5.1f}% threshold.')
|
||||
exit(3)
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ fn cleanup_tdir() {
|
|||
|
||||
fn create_test(tname string, tcontent string) ?string {
|
||||
tpath := os.join_path(tdir, tname)
|
||||
os.write_file(tpath, tcontent) ?
|
||||
os.write_file(tpath, tcontent)?
|
||||
eprintln('>>>>>>>> tpath: $tpath | tcontent: $tcontent')
|
||||
return tpath
|
||||
}
|
||||
|
@ -52,17 +52,17 @@ fn main() {
|
|||
os.chdir(os.wd_at_startup) or {}
|
||||
}
|
||||
println('> vroot: $vroot | vexe: $vexe | tdir: $tdir')
|
||||
ok_fpath := create_test('a_single_ok_test.v', 'fn test_ok(){ assert true }') ?
|
||||
ok_fpath := create_test('a_single_ok_test.v', 'fn test_ok(){ assert true }')?
|
||||
check_ok('"$vexe" "$ok_fpath"')
|
||||
check_ok('"$vexe" test "$ok_fpath"')
|
||||
check_ok('"$vexe" test "$tdir"')
|
||||
fail_fpath := create_test('a_single_failing_test.v', 'fn test_fail(){ assert 1 == 2 }') ?
|
||||
fail_fpath := create_test('a_single_failing_test.v', 'fn test_fail(){ assert 1 == 2 }')?
|
||||
check_fail('"$vexe" "$fail_fpath"')
|
||||
check_fail('"$vexe" test "$fail_fpath"')
|
||||
check_fail('"$vexe" test "$tdir"')
|
||||
rel_dir := os.join_path(tdir, rand.ulid())
|
||||
os.mkdir(rel_dir) ?
|
||||
os.chdir(rel_dir) ?
|
||||
os.mkdir(rel_dir)?
|
||||
os.chdir(rel_dir)?
|
||||
check_ok('"$vexe" test "..${os.path_separator + os.base(ok_fpath)}"')
|
||||
println('> all done')
|
||||
}
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
// Copyright (c) 2019-2022 Alexander Medvednikov. All rights reserved.
|
||||
// Use of this source code is governed by an MIT license that can be found in the LICENSE file.
|
||||
module main
|
||||
|
||||
import os
|
||||
import v.util
|
||||
|
||||
const vexe = os.getenv('VEXE')
|
||||
|
||||
fn main() {
|
||||
vmodules := os.vmodules_dir()
|
||||
c2v_dir := os.join_path(vmodules, 'c2v')
|
||||
mut c2v_bin := os.join_path(c2v_dir, 'c2v')
|
||||
$if windows {
|
||||
c2v_bin += '.exe'
|
||||
}
|
||||
// Git clone c2v
|
||||
if !os.exists(c2v_dir) {
|
||||
println('C2V is not installed. Cloning C2V to $c2v_dir ...')
|
||||
os.chdir(vmodules)?
|
||||
res := os.execute('git clone https://github.com/vlang/c2v')
|
||||
if res.exit_code != 0 {
|
||||
eprintln('Failed to download C2V.')
|
||||
exit(1)
|
||||
}
|
||||
}
|
||||
// Compile c2v
|
||||
if !os.exists(c2v_bin) {
|
||||
os.chdir(c2v_dir)?
|
||||
println('Compiling c2v ...')
|
||||
res2 := os.execute('${os.quoted_path(vexe)} -o ${os.quoted_path(c2v_bin)} -keepc -g -experimental .')
|
||||
if res2.exit_code != 0 {
|
||||
eprintln(res2.output)
|
||||
eprintln('Failed to compile C2V. This should not happen. Please report it via GitHub.')
|
||||
exit(2)
|
||||
}
|
||||
}
|
||||
if os.args.len < 3 {
|
||||
eprintln('Wrong number of arguments. Use `v translate file.c` .')
|
||||
exit(3)
|
||||
}
|
||||
passed_args := util.args_quote_paths(os.args[2..])
|
||||
// println(passed_args)
|
||||
os.chdir(os.wd_at_startup)?
|
||||
res := os.system('$c2v_bin $passed_args')
|
||||
if res != 0 {
|
||||
eprintln('C2V failed to translate the C files. Please report it via GitHub.')
|
||||
exit(4)
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@ fn C.cJSON_CreateNull() &C.cJSON
|
|||
|
||||
// fn C.cJSON_CreateNumber() &C.cJSON
|
||||
// fn C.cJSON_CreateString() &C.cJSON
|
||||
fn C.cJSON_CreateRaw(&byte) &C.cJSON
|
||||
fn C.cJSON_CreateRaw(&u8) &C.cJSON
|
||||
|
||||
fn C.cJSON_IsInvalid(voidptr) bool
|
||||
|
||||
|
@ -45,13 +45,13 @@ fn C.cJSON_IsObject(voidptr) bool
|
|||
|
||||
fn C.cJSON_IsRaw(voidptr) bool
|
||||
|
||||
fn C.cJSON_AddItemToObject(voidptr, &byte, voidptr)
|
||||
fn C.cJSON_AddItemToObject(voidptr, &u8, voidptr)
|
||||
|
||||
fn C.cJSON_AddItemToArray(voidptr, voidptr)
|
||||
|
||||
fn C.cJSON_Delete(voidptr)
|
||||
|
||||
fn C.cJSON_Print(voidptr) &byte
|
||||
fn C.cJSON_Print(voidptr) &u8
|
||||
|
||||
[inline]
|
||||
fn create_object() &C.cJSON {
|
||||
|
|
|
@ -44,7 +44,7 @@ fn main() {
|
|||
for hf in hfields.split(',') {
|
||||
ctx.hide_names[hf] = true
|
||||
}
|
||||
fp.limit_free_args_to_at_least(1) ?
|
||||
fp.limit_free_args_to_at_least(1)?
|
||||
rest_of_args := fp.remaining_parameters()
|
||||
for vfile in rest_of_args {
|
||||
file := get_abs_path(vfile)
|
||||
|
@ -283,7 +283,7 @@ fn (t Tree) embed_file(node ast.EmbeddedFile) &Node {
|
|||
obj.add('compression_type', t.string_node(node.compression_type))
|
||||
obj.add('is_compressed', t.bool_node(node.is_compressed))
|
||||
obj.add('len', t.number_node(node.len))
|
||||
obj.add('bytes', t.array_node_byte(node.bytes))
|
||||
obj.add('bytes', t.array_node_u8(node.bytes))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -294,8 +294,8 @@ fn (t Tree) mod(node ast.Module) &Node {
|
|||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add('short_name', t.string_node(node.short_name))
|
||||
obj.add_terse('attrs', t.array_node_attr(node.attrs))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('name_pos', t.position(node.name_pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('name_pos', t.pos(node.name_pos))
|
||||
obj.add_terse('is_skipped', t.bool_node(node.is_skipped))
|
||||
return obj
|
||||
}
|
||||
|
@ -327,7 +327,7 @@ fn (t Tree) scope_struct_field(node ast.ScopeStructField) &Node {
|
|||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add_terse('orig_type', t.type_node(node.orig_type))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('smartcasts', t.array_node_type(node.smartcasts))
|
||||
return obj
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ fn (t Tree) errors(errors []errors.Error) &Node {
|
|||
obj := new_object()
|
||||
obj.add_terse('message', t.string_node(e.message))
|
||||
obj.add_terse('file_path', t.string_node(e.file_path))
|
||||
obj.add('pos', t.position(e.pos))
|
||||
obj.add('pos', t.pos(e.pos))
|
||||
obj.add_terse('backtrace', t.string_node(e.backtrace))
|
||||
obj.add_terse('reporter', t.enum_node(e.reporter))
|
||||
errs.add_item(obj)
|
||||
|
@ -379,7 +379,7 @@ fn (t Tree) warnings(warnings []errors.Warning) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add('message', t.string_node(w.message))
|
||||
obj.add('file_path', t.string_node(w.file_path))
|
||||
obj.add('pos', t.position(w.pos))
|
||||
obj.add('pos', t.pos(w.pos))
|
||||
obj.add('reporter', t.enum_node(w.reporter))
|
||||
warns.add_item(obj)
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ fn (t Tree) notices(notices []errors.Notice) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add('message', t.string_node(n.message))
|
||||
obj.add('file_path', t.string_node(n.file_path))
|
||||
obj.add('pos', t.position(n.pos))
|
||||
obj.add('pos', t.pos(n.pos))
|
||||
obj.add('reporter', t.enum_node(n.reporter))
|
||||
notice_array.add_item(obj)
|
||||
}
|
||||
|
@ -449,21 +449,21 @@ fn (t Tree) import_module(node ast.Import) &Node {
|
|||
obj.add_terse('syms', t.array_node_import_symbol(node.syms))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('next_comments', t.array_node_comment(node.next_comments))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('mod_pos', t.position(node.mod_pos))
|
||||
obj.add('alias_pos', t.position(node.alias_pos))
|
||||
obj.add('syms_pos', t.position(node.syms_pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('mod_pos', t.pos(node.mod_pos))
|
||||
obj.add('alias_pos', t.pos(node.alias_pos))
|
||||
obj.add('syms_pos', t.pos(node.syms_pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
fn (t Tree) import_symbol(node ast.ImportSymbol) &Node {
|
||||
mut obj := new_object()
|
||||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
fn (t Tree) position(p token.Position) &Node {
|
||||
fn (t Tree) pos(p token.Pos) &Node {
|
||||
mut obj := new_object()
|
||||
obj.add('line_nr', t.number_node(p.line_nr))
|
||||
obj.add('last_line', t.number_node(p.last_line))
|
||||
|
@ -478,7 +478,7 @@ fn (t Tree) comment(node ast.Comment) &Node {
|
|||
obj.add('text', t.string_node(node.text))
|
||||
obj.add('is_multi', t.bool_node(node.is_multi))
|
||||
obj.add('is_inline', t.bool_node(node.is_inline))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -490,7 +490,7 @@ fn (t Tree) const_decl(node ast.ConstDecl) &Node {
|
|||
obj.add_terse('fields', t.array_node_const_field(node.fields))
|
||||
obj.add_terse('attrs', t.array_node_attr(node.attrs))
|
||||
obj.add('end_comments', t.array_node_comment(node.end_comments))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -505,7 +505,7 @@ fn (t Tree) const_field(node ast.ConstField) &Node {
|
|||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('comptime_expr_value', t.comptime_expr_value(node.comptime_expr_value))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -542,9 +542,9 @@ fn (t Tree) fn_decl(node ast.FnDecl) &Node {
|
|||
obj.add('is_keep_alive', t.bool_node(node.is_keep_alive))
|
||||
obj.add_terse('is_unsafe', t.bool_node(node.is_unsafe))
|
||||
obj.add_terse('receiver', t.struct_field(node.receiver))
|
||||
obj.add('receiver_pos', t.position(node.receiver_pos))
|
||||
obj.add('receiver_pos', t.pos(node.receiver_pos))
|
||||
obj.add_terse('is_method', t.bool_node(node.is_method))
|
||||
obj.add('method_type_pos', t.position(node.method_type_pos))
|
||||
obj.add('method_type_pos', t.pos(node.method_type_pos))
|
||||
obj.add('method_idx', t.number_node(node.method_idx))
|
||||
obj.add_terse('rec_mut', t.bool_node(node.rec_mut))
|
||||
obj.add('rec_share', t.enum_node(node.rec_share))
|
||||
|
@ -554,9 +554,9 @@ fn (t Tree) fn_decl(node ast.FnDecl) &Node {
|
|||
obj.add('is_builtin', t.bool_node(node.is_builtin))
|
||||
obj.add('is_direct_arr', t.bool_node(node.is_direct_arr))
|
||||
obj.add('ctdefine_idx', t.number_node(node.ctdefine_idx))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('body_pos', t.position(node.body_pos))
|
||||
obj.add('return_type_pos', t.position(node.return_type_pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('body_pos', t.pos(node.body_pos))
|
||||
obj.add('return_type_pos', t.pos(node.return_type_pos))
|
||||
obj.add('file', t.string_node(node.file))
|
||||
obj.add('has_return', t.bool_node(node.has_return))
|
||||
obj.add('should_be_skipped', t.bool_node(node.should_be_skipped))
|
||||
|
@ -598,7 +598,7 @@ fn (t Tree) struct_decl(node ast.StructDecl) &Node {
|
|||
obj.add('module_pos', t.number_node(node.module_pos))
|
||||
obj.add_terse('language', t.enum_node(node.language))
|
||||
obj.add_terse('is_union', t.bool_node(node.is_union))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('fields', t.array_node_struct_field(node.fields))
|
||||
obj.add_terse('generic_types', t.array_node_type(node.generic_types))
|
||||
obj.add_terse('attrs', t.array_node_attr(node.attrs))
|
||||
|
@ -612,7 +612,7 @@ fn (t Tree) struct_field(node ast.StructField) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('StructField'))
|
||||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add('type_pos', t.position(node.type_pos))
|
||||
obj.add('type_pos', t.pos(node.type_pos))
|
||||
obj.add_terse('has_default_expr', t.bool_node(node.has_default_expr))
|
||||
obj.add_terse('default_expr_typ', t.type_node(node.default_expr_typ))
|
||||
obj.add_terse('default_expr', t.expr(node.default_expr))
|
||||
|
@ -622,14 +622,14 @@ fn (t Tree) struct_field(node ast.StructField) &Node {
|
|||
obj.add_terse('is_volatile', t.bool_node(node.is_volatile))
|
||||
obj.add_terse('attrs', t.array_node_attr(node.attrs))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
fn (t Tree) embed(node ast.Embed) &Node {
|
||||
mut obj := new_object()
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
return obj
|
||||
}
|
||||
|
@ -641,7 +641,7 @@ fn (t Tree) enum_decl(node ast.EnumDecl) &Node {
|
|||
obj.add_terse('is_pub', t.bool_node(node.is_pub))
|
||||
obj.add_terse('is_flag', t.bool_node(node.is_flag))
|
||||
obj.add_terse('is_multi_allowed', t.bool_node(node.is_multi_allowed))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('fields', t.array_node_enum_field(node.fields))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add_terse('attrs', t.array_node_attr(node.attrs))
|
||||
|
@ -654,7 +654,7 @@ fn (t Tree) enum_field(node ast.EnumField) &Node {
|
|||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add_terse('has_expr', t.bool_node(node.has_expr))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('next_comments', t.array_node_comment(node.next_comments))
|
||||
return obj
|
||||
|
@ -671,11 +671,11 @@ fn (t Tree) interface_decl(node ast.InterfaceDecl) &Node {
|
|||
obj.add_terse('methods', t.array_node_fn_decl(node.methods))
|
||||
obj.add_terse('fields', t.array_node_struct_field(node.fields))
|
||||
obj.add('pre_comments', t.array_node_comment(node.pre_comments))
|
||||
obj.add('name_pos', t.position(node.name_pos))
|
||||
obj.add('name_pos', t.pos(node.name_pos))
|
||||
obj.add_terse('language', t.enum_node(node.language))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('are_ifaces_expanded', t.bool_node(node.are_ifaces_expanded))
|
||||
obj.add_terse('ifaces', t.array_node_interface_embedding(node.ifaces))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('are_embeds_expanded', t.bool_node(node.are_embeds_expanded))
|
||||
obj.add_terse('embeds', t.array_node_interface_embedding(node.embeds))
|
||||
obj.add_terse('attrs', t.array_node_attr(node.attrs))
|
||||
return obj
|
||||
}
|
||||
|
@ -685,7 +685,7 @@ fn (t Tree) interface_embedding(node ast.InterfaceEmbedding) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('InterfaceEmbedding'))
|
||||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
return obj
|
||||
}
|
||||
|
@ -714,7 +714,7 @@ fn (t Tree) hash_stmt(node ast.HashStmt) &Node {
|
|||
obj.add_terse('msg', t.string_node(node.msg))
|
||||
obj.add_terse('ct_conds', t.array_node_expr(node.ct_conds))
|
||||
obj.add_terse('source_file', t.string_node(node.source_file))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -724,8 +724,8 @@ fn (t Tree) comptime_for(node ast.ComptimeFor) &Node {
|
|||
obj.add_terse('val_var', t.string_node(node.val_var))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add_terse('kind', t.enum_node(node.kind))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('typ_pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('typ_pos', t.pos(node.pos))
|
||||
obj.add_terse('stmts', t.array_node_stmt(node.stmts))
|
||||
return obj
|
||||
}
|
||||
|
@ -734,7 +734,7 @@ fn (t Tree) global_decl(node ast.GlobalDecl) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('GlobalDecl'))
|
||||
obj.add_terse('mod', t.string_node(node.mod))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('is_block', t.bool_node(node.is_block))
|
||||
obj.add_terse('fields', t.array_node_global_field(node.fields))
|
||||
obj.add('end_comments', t.array_node_comment(node.end_comments))
|
||||
|
@ -751,8 +751,8 @@ fn (t Tree) global_field(node ast.GlobalField) &Node {
|
|||
obj.add_terse('has_expr', t.bool_node(node.has_expr))
|
||||
obj.add_terse('is_markused', t.bool_node(node.is_markused))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('typ_pos', t.position(node.typ_pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('typ_pos', t.pos(node.typ_pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -763,7 +763,7 @@ fn (t Tree) defer_stmt(node ast.DeferStmt) &Node {
|
|||
obj.add_terse('defer_vars', t.array_node_ident(node.defer_vars))
|
||||
obj.add_terse('ifdef', t.string_node(node.ifdef))
|
||||
obj.add('idx_in_fn', t.number_node(node.idx_in_fn))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -782,7 +782,7 @@ fn (t Tree) alias_type_decl(node ast.AliasTypeDecl) &Node {
|
|||
obj.add_terse('is_pub', t.bool_node(node.is_pub))
|
||||
obj.add_terse('parent_type', t.type_node(node.parent_type))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -791,7 +791,7 @@ fn (t Tree) sum_type_decl(node ast.SumTypeDecl) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('SumTypeDecl'))
|
||||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add_terse('is_pub', t.bool_node(node.is_pub))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add_terse('generic_types', t.array_node_type(node.generic_types))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
|
@ -805,7 +805,7 @@ fn (t Tree) fn_type_decl(node ast.FnTypeDecl) &Node {
|
|||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add_terse('is_pub', t.bool_node(node.is_pub))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
return obj
|
||||
}
|
||||
|
@ -823,7 +823,7 @@ fn (t Tree) goto_label(node ast.GotoLabel) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('GotoLabel'))
|
||||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -831,7 +831,7 @@ fn (t Tree) goto_stmt(node ast.GotoStmt) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('GotoStmt'))
|
||||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -847,7 +847,7 @@ fn (t Tree) assign_stmt(node ast.AssignStmt) &Node {
|
|||
obj.add_terse('is_volatile', t.bool_node(node.is_volatile))
|
||||
obj.add_terse('is_simple', t.bool_node(node.is_simple))
|
||||
obj.add_terse('has_cross_var', t.bool_node(node.has_cross_var))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('end_comments', t.array_node_comment(node.end_comments))
|
||||
return obj
|
||||
|
@ -872,7 +872,7 @@ fn (t Tree) var(node ast.Var) &Node {
|
|||
obj.add('is_auto_heap', t.bool_node(node.is_auto_heap))
|
||||
obj.add('is_stack_obj', t.bool_node(node.is_stack_obj))
|
||||
obj.add_terse('share', t.enum_node(node.share))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('smartcasts', t.array_node_type(node.smartcasts))
|
||||
return obj
|
||||
}
|
||||
|
@ -882,7 +882,7 @@ fn (t Tree) return_(node ast.Return) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('Return'))
|
||||
obj.add_terse('exprs', t.array_node_expr(node.exprs))
|
||||
obj.add_terse('types', t.array_node_type(node.types))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -897,7 +897,7 @@ fn (t Tree) for_c_stmt(node ast.ForCStmt) &Node {
|
|||
obj.add_terse('inc', t.stmt(node.inc))
|
||||
obj.add_terse('is_multi', t.bool_node(node.is_multi))
|
||||
obj.add_terse('label', t.string_node(node.label))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('scope', t.number_node(int(node.scope)))
|
||||
obj.add_terse('stmts', t.array_node_stmt(node.stmts))
|
||||
return obj
|
||||
|
@ -909,7 +909,7 @@ fn (t Tree) for_stmt(node ast.ForStmt) &Node {
|
|||
obj.add_terse('cond', t.expr(node.cond))
|
||||
obj.add_terse('is_inf', t.bool_node(node.is_inf))
|
||||
obj.add_terse('label', t.string_node(node.label))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('scope', t.number_node(int(node.scope)))
|
||||
obj.add_terse('stmts', t.array_node_stmt(node.stmts))
|
||||
return obj
|
||||
|
@ -929,7 +929,7 @@ fn (t Tree) for_in_stmt(node ast.ForInStmt) &Node {
|
|||
obj.add_terse('kind', t.enum_node(node.kind))
|
||||
obj.add_terse('val_is_mut', t.bool_node(node.val_is_mut))
|
||||
obj.add_terse('label', t.string_node(node.label))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('scope', t.number_node(int(node.scope)))
|
||||
obj.add_terse('stmts', t.array_node_stmt(node.stmts))
|
||||
return obj
|
||||
|
@ -940,7 +940,7 @@ fn (t Tree) branch_stmt(node ast.BranchStmt) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('BranchStmt'))
|
||||
obj.add_terse('kind', t.token_node(node.kind))
|
||||
obj.add_terse('label', t.string_node(node.label))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -949,7 +949,7 @@ fn (t Tree) assert_stmt(node ast.AssertStmt) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('AssertStmt'))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add_terse('is_used', t.bool_node(node.is_used))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -958,7 +958,7 @@ fn (t Tree) block(node ast.Block) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('Block'))
|
||||
obj.add_terse('stmts', t.array_node_stmt(node.stmts))
|
||||
obj.add_terse('is_unsafe', t.bool_node(node.is_unsafe))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -973,12 +973,12 @@ fn (t Tree) comptime_call(node ast.ComptimeCall) &Node {
|
|||
obj.add_terse('has_parens', t.bool_node(node.has_parens))
|
||||
obj.add_terse('is_embed', t.bool_node(node.is_embed))
|
||||
obj.add_terse('embed_file', t.embed_file(node.embed_file))
|
||||
obj.add('method_pos', t.position(node.method_pos))
|
||||
obj.add('method_pos', t.pos(node.method_pos))
|
||||
obj.add_terse('left_type', t.type_node(node.left_type))
|
||||
obj.add_terse('result_type', t.type_node(node.result_type))
|
||||
obj.add('scope', t.scope(node.scope))
|
||||
obj.add_terse('env_value', t.string_node(node.env_value))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('args', t.array_node_call_arg(node.args))
|
||||
return obj
|
||||
}
|
||||
|
@ -991,7 +991,7 @@ fn (t Tree) comptime_selector(node ast.ComptimeSelector) &Node {
|
|||
obj.add_terse('field_expr', t.expr(node.field_expr))
|
||||
obj.add_terse('left_type', t.type_node(node.left_type))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1001,7 +1001,7 @@ fn (t Tree) expr_stmt(node ast.ExprStmt) &Node {
|
|||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add_terse('is_expr', t.bool_node(node.is_expr))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
return obj
|
||||
}
|
||||
|
@ -1167,7 +1167,7 @@ fn (t Tree) integer_literal(node ast.IntegerLiteral) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('IntegerLiteral'))
|
||||
obj.add_terse('val', t.string_node(node.val))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1175,7 +1175,7 @@ fn (t Tree) float_literal(node ast.FloatLiteral) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('FloatLiteral'))
|
||||
obj.add_terse('val', t.string_node(node.val))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1185,7 +1185,7 @@ fn (t Tree) string_literal(node ast.StringLiteral) &Node {
|
|||
obj.add_terse('val', t.string_node(node.val))
|
||||
obj.add_terse('is_raw', t.bool_node(node.is_raw))
|
||||
obj.add_terse('language', t.enum_node(node.language))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1193,7 +1193,7 @@ fn (t Tree) char_literal(node ast.CharLiteral) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('CharLiteral'))
|
||||
obj.add_terse('val', t.string_node(node.val))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1201,7 +1201,7 @@ fn (t Tree) bool_literal(node ast.BoolLiteral) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('BoolLiteral'))
|
||||
obj.add_terse('val', t.bool_node(node.val))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1216,9 +1216,9 @@ fn (t Tree) string_inter_literal(node ast.StringInterLiteral) &Node {
|
|||
obj.add_terse('pluss', t.array_node_bool(node.pluss))
|
||||
obj.add_terse('fills', t.array_node_bool(node.fills))
|
||||
obj.add_terse('fmt_poss', t.array_node_position(node.fmt_poss))
|
||||
obj.add_terse('fmts', t.array_node_byte(node.fmts))
|
||||
obj.add_terse('fmts', t.array_node_u8(node.fmts))
|
||||
obj.add_terse('need_fmts', t.array_node_bool(node.need_fmts))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1229,7 +1229,7 @@ fn (t Tree) enum_val(node ast.EnumVal) &Node {
|
|||
obj.add_terse('mod', t.string_node(node.mod))
|
||||
obj.add_terse('val', t.string_node(node.val))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1240,7 +1240,7 @@ fn (t Tree) assoc(node ast.Assoc) &Node {
|
|||
obj.add_terse('fields', t.array_node_string(node.fields))
|
||||
obj.add_terse('exprs', t.array_node_expr(node.exprs))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('scope', t.number_node(int(node.scope)))
|
||||
return obj
|
||||
}
|
||||
|
@ -1249,7 +1249,7 @@ fn (t Tree) at_expr(node ast.AtExpr) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('AtExpr'))
|
||||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('kind', t.enum_node(node.kind))
|
||||
obj.add_terse('val', t.string_node(node.val))
|
||||
return obj
|
||||
|
@ -1265,7 +1265,7 @@ fn (t Tree) cast_expr(node ast.CastExpr) &Node {
|
|||
obj.add_terse('arg', t.expr(node.arg))
|
||||
obj.add_terse('expr_type', t.type_node(node.expr_type))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1275,7 +1275,7 @@ fn (t Tree) as_cast(node ast.AsCast) &Node {
|
|||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add_terse('expr_type', t.type_node(node.expr_type))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1283,7 +1283,7 @@ fn (t Tree) type_expr(node ast.TypeNode) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('TypeNode'))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1293,7 +1293,7 @@ fn (t Tree) size_of(node ast.SizeOf) &Node {
|
|||
obj.add_terse('is_type', t.bool_node(node.is_type))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1303,7 +1303,7 @@ fn (t Tree) is_ref_type(node ast.IsRefType) &Node {
|
|||
obj.add_terse('is_type', t.bool_node(node.is_type))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1315,7 +1315,7 @@ fn (t Tree) prefix_expr(node ast.PrefixExpr) &Node {
|
|||
obj.add_terse('right_type', t.type_node(node.right_type))
|
||||
obj.add_terse('or_block', t.or_expr(node.or_block))
|
||||
obj.add_terse('is_option', t.bool_node(node.is_option))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1334,7 +1334,7 @@ fn (t Tree) infix_expr(node ast.InfixExpr) &Node {
|
|||
obj.add_terse('ct_left_value', t.comptime_expr_value(node.ct_left_value))
|
||||
obj.add_terse('ct_right_value_evaled', t.bool_node(node.ct_right_value_evaled))
|
||||
obj.add_terse('ct_right_value', t.comptime_expr_value(node.ct_right_value))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1347,7 +1347,7 @@ fn (t Tree) index_expr(node ast.IndexExpr) &Node {
|
|||
obj.add_terse('is_setter', t.bool_node(node.is_setter))
|
||||
obj.add_terse('is_direct', t.bool_node(node.is_direct))
|
||||
obj.add_terse('or_expr', t.or_expr(node.or_expr))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1357,7 +1357,8 @@ fn (t Tree) postfix_expr(node ast.PostfixExpr) &Node {
|
|||
obj.add_terse('op', t.token_node(node.op))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add('auto_locked', t.string_node(node.auto_locked))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('is_c2v_prefix', t.bool_node(node.is_c2v_prefix))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1372,7 +1373,7 @@ fn (t Tree) selector_expr(node ast.SelectorExpr) &Node {
|
|||
obj.add_terse('gkind_field', t.enum_node(node.gkind_field))
|
||||
obj.add_terse('from_embed_types', t.array_node_type(node.from_embed_types))
|
||||
obj.add_terse('next_token', t.token_node(node.next_token))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('scope', t.number_node(int(node.scope)))
|
||||
return obj
|
||||
}
|
||||
|
@ -1384,7 +1385,7 @@ fn (t Tree) range_expr(node ast.RangeExpr) &Node {
|
|||
obj.add_terse('high', t.expr(node.high))
|
||||
obj.add_terse('has_high', t.bool_node(node.has_high))
|
||||
obj.add_terse('has_low', t.bool_node(node.has_low))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1398,7 +1399,7 @@ fn (t Tree) if_expr(node ast.IfExpr) &Node {
|
|||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add_terse('has_else', t.bool_node(node.has_else))
|
||||
obj.add_terse('is_expr', t.bool_node(node.is_expr))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('post_comments', t.array_node_comment(node.post_comments))
|
||||
return obj
|
||||
}
|
||||
|
@ -1407,8 +1408,8 @@ fn (t Tree) if_branch(node ast.IfBranch) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('IfBranch'))
|
||||
obj.add_terse('cond', t.expr(node.cond))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('body_pos', t.position(node.body_pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('body_pos', t.pos(node.body_pos))
|
||||
obj.add_terse('pkg_exist', t.bool_node(node.pkg_exist))
|
||||
obj.add_terse('stmts', t.array_node_stmt(node.stmts))
|
||||
obj.add('scope', t.number_node(int(node.scope)))
|
||||
|
@ -1427,8 +1428,8 @@ fn (t Tree) ident(node ast.Ident) &Node {
|
|||
obj.add_terse('tok_kind', t.token_node(node.tok_kind))
|
||||
obj.add_terse('kind', t.enum_node(node.kind))
|
||||
obj.add_terse('info', t.ident_info(node.info))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('mut_pos', t.position(node.mut_pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('mut_pos', t.pos(node.mut_pos))
|
||||
obj.add('obj', t.scope_object(node.obj))
|
||||
obj.add('scope', t.number_node(int(node.scope)))
|
||||
return obj
|
||||
|
@ -1481,11 +1482,11 @@ fn (t Tree) call_expr(node ast.CallExpr) &Node {
|
|||
obj.add_terse('expected_arg_types', t.array_node_type(node.expected_arg_types))
|
||||
obj.add_terse('concrete_types', t.array_node_type(node.concrete_types))
|
||||
obj.add_terse('or_block', t.or_expr(node.or_block))
|
||||
obj.add('concrete_list_pos', t.position(node.concrete_list_pos))
|
||||
obj.add('concrete_list_pos', t.pos(node.concrete_list_pos))
|
||||
obj.add_terse('from_embed_types', t.array_node_type(node.from_embed_types))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('name_pos', t.position(node.name_pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('name_pos', t.pos(node.name_pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1497,7 +1498,7 @@ fn (t Tree) call_arg(node ast.CallArg) &Node {
|
|||
obj.add_terse('share', t.enum_node(node.share))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add('is_tmp_autofree', t.bool_node(node.is_tmp_autofree))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
return obj
|
||||
}
|
||||
|
@ -1507,7 +1508,7 @@ fn (t Tree) or_expr(node ast.OrExpr) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('OrExpr'))
|
||||
obj.add_terse('stmts', t.array_node_stmt(node.stmts))
|
||||
obj.add_terse('kind', t.enum_node(node.kind))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1520,8 +1521,8 @@ fn (t Tree) struct_init(node ast.StructInit) &Node {
|
|||
obj.add_terse('has_update_expr', t.bool_node(node.has_update_expr))
|
||||
obj.add_terse('update_expr', t.expr(node.update_expr))
|
||||
obj.add_terse('update_expr_type', t.type_node(node.update_expr_type))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('name_pos', t.position(node.name_pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('name_pos', t.pos(node.name_pos))
|
||||
obj.add('update_expr_comments', t.array_node_comment(node.update_expr_comments))
|
||||
obj.add_terse('fields', t.array_node_struct_init_field(node.fields))
|
||||
obj.add_terse('embeds', t.array_node_struct_init_embed(node.embeds))
|
||||
|
@ -1539,8 +1540,8 @@ fn (t Tree) struct_init_field(node ast.StructInitField) &Node {
|
|||
obj.add_terse('parent_type', t.type_node(node.parent_type))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('next_comments', t.array_node_comment(node.next_comments))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('name_pos', t.position(node.name_pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add('name_pos', t.pos(node.name_pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1553,7 +1554,7 @@ fn (t Tree) struct_init_embed(node ast.StructInitEmbed) &Node {
|
|||
obj.add_terse('expected_type', t.type_node(node.expected_type))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('next_comments', t.array_node_comment(node.next_comments))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1565,7 +1566,7 @@ fn (t Tree) array_init(node ast.ArrayInit) &Node {
|
|||
obj.add_terse('exprs', t.array_node_expr(node.exprs))
|
||||
obj.add('ecmnts', t.two_dimension_comment(node.ecmnts))
|
||||
obj.add('pre_cmnts', t.array_node_comment(node.pre_cmnts))
|
||||
obj.add('elem_type_pos', t.position(node.elem_type_pos))
|
||||
obj.add('elem_type_pos', t.pos(node.elem_type_pos))
|
||||
obj.add_terse('is_fixed', t.bool_node(node.is_fixed))
|
||||
obj.add_terse('has_val', t.bool_node(node.has_val))
|
||||
obj.add_terse('mod', t.string_node(node.mod))
|
||||
|
@ -1577,7 +1578,7 @@ fn (t Tree) array_init(node ast.ArrayInit) &Node {
|
|||
obj.add_terse('has_default', t.bool_node(node.has_default))
|
||||
obj.add_terse('has_it', t.bool_node(node.has_it))
|
||||
obj.add_terse('expr_types', t.array_node_type(node.expr_types))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1589,16 +1590,17 @@ fn (t Tree) map_init(node ast.MapInit) &Node {
|
|||
obj.add_terse('value_type', t.type_node(node.value_type))
|
||||
obj.add_terse('keys', t.array_node_expr(node.keys))
|
||||
obj.add_terse('vals', t.array_node_expr(node.vals))
|
||||
obj.add_terse('val_types', t.array_node_type(node.val_types))
|
||||
obj.add('comments', t.two_dimension_comment(node.comments))
|
||||
obj.add('pre_cmnts', t.array_node_comment(node.pre_cmnts))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
fn (t Tree) none_expr(node ast.None) &Node {
|
||||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('None'))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1606,17 +1608,25 @@ fn (t Tree) par_expr(node ast.ParExpr) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('ParExpr'))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
fn (t Tree) if_guard_expr(node ast.IfGuardExpr) &Node {
|
||||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('IfGuardExpr'))
|
||||
obj.add_terse('var_name', t.string_node(node.var_name))
|
||||
obj.add_terse('vars', t.array_node_if_guard_var(node.vars))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add_terse('expr_type', t.type_node(node.expr_type))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
fn (t Tree) if_guard_var(node ast.IfGuardVar) &Node {
|
||||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('IfGuardVar'))
|
||||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add_terse('is_mut', t.bool_node(node.is_mut))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1630,7 +1640,7 @@ fn (t Tree) match_expr(node ast.MatchExpr) &Node {
|
|||
obj.add_terse('expected_type', t.type_node(node.expected_type))
|
||||
obj.add_terse('is_sum_type', t.bool_node(node.is_sum_type))
|
||||
obj.add_terse('is_expr', t.bool_node(node.is_expr))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('branches', t.array_node_match_branch(node.branches))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
return obj
|
||||
|
@ -1642,9 +1652,9 @@ fn (t Tree) match_branch(node ast.MatchBranch) &Node {
|
|||
obj.add('ecmnts', t.two_dimension_comment(node.ecmnts))
|
||||
obj.add_terse('stmts', t.array_node_stmt(node.stmts))
|
||||
obj.add_terse('is_else', t.bool_node(node.is_else))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('post_comments', t.array_node_comment(node.post_comments))
|
||||
obj.add('branch_pos', t.position(node.branch_pos))
|
||||
obj.add('branch_pos', t.pos(node.branch_pos))
|
||||
obj.add_terse('exprs', t.array_node_expr(node.exprs))
|
||||
obj.add('scope', t.number_node(int(node.scope)))
|
||||
return obj
|
||||
|
@ -1655,7 +1665,7 @@ fn (t Tree) concat_expr(node ast.ConcatExpr) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('ConcatExpr'))
|
||||
obj.add_terse('vals', t.array_node_expr(node.vals))
|
||||
obj.add_terse('return_type', t.type_node(node.return_type))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1664,7 +1674,7 @@ fn (t Tree) type_of(node ast.TypeOf) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('TypeOf'))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add_terse('expr_type', t.type_node(node.expr_type))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1673,7 +1683,7 @@ fn (t Tree) likely(node ast.Likely) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('Likely'))
|
||||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add_terse('is_likely', t.bool_node(node.is_likely))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1690,7 +1700,7 @@ fn (t Tree) sql_expr(node ast.SqlExpr) &Node {
|
|||
obj.add_terse('order_expr', t.expr(node.order_expr))
|
||||
obj.add_terse('has_desc', t.bool_node(node.has_desc))
|
||||
obj.add_terse('is_array', t.bool_node(node.is_array))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('has_limit', t.bool_node(node.has_limit))
|
||||
obj.add_terse('limit_expr', t.expr(node.limit_expr))
|
||||
obj.add_terse('has_offset', t.bool_node(node.has_offset))
|
||||
|
@ -1708,7 +1718,7 @@ fn (t Tree) sql_stmt(node ast.SqlStmt) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('SqlStmt'))
|
||||
obj.add_terse('db_expr', t.expr(node.db_expr))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('lines', t.array_node_sql_stmt_line(node.lines))
|
||||
return obj
|
||||
}
|
||||
|
@ -1723,7 +1733,7 @@ fn (t Tree) sql_stmt_line(node ast.SqlStmtLine) &Node {
|
|||
obj.add_terse('fields', t.array_node_struct_field(node.fields))
|
||||
obj.add_terse('updated_columns', t.array_node_string(node.updated_columns))
|
||||
obj.add_terse('update_exprs', t.array_node_expr(node.update_exprs))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
|
||||
sub_struct_map := new_object()
|
||||
for key, val in node.sub_structs {
|
||||
|
@ -1738,7 +1748,7 @@ fn (t Tree) lock_expr(expr ast.LockExpr) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('LockExpr'))
|
||||
obj.add_terse('is_expr', t.bool_node(expr.is_expr))
|
||||
obj.add_terse('typ', t.type_node(expr.typ))
|
||||
obj.add('pos', t.position(expr.pos))
|
||||
obj.add('pos', t.pos(expr.pos))
|
||||
obj.add_terse('stmts', t.array_node_stmt(expr.stmts))
|
||||
obj.add_terse('lockeds', t.array_node_expr(expr.lockeds))
|
||||
obj.add_terse('r_lock', t.array_node_bool(expr.is_rlock))
|
||||
|
@ -1749,7 +1759,7 @@ fn (t Tree) unsafe_expr(expr ast.UnsafeExpr) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('UnsafeExpr'))
|
||||
obj.add_terse('expr', t.expr(expr.expr))
|
||||
obj.add('pos', t.position(expr.pos))
|
||||
obj.add('pos', t.pos(expr.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1760,7 +1770,7 @@ fn (t Tree) chan_init(expr ast.ChanInit) &Node {
|
|||
obj.add_terse('cap_expr', t.expr(expr.cap_expr))
|
||||
obj.add_terse('typ', t.type_node(expr.typ))
|
||||
obj.add_terse('elem_type', t.type_node(expr.elem_type))
|
||||
obj.add('pos', t.position(expr.pos))
|
||||
obj.add('pos', t.pos(expr.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1771,7 +1781,7 @@ fn (t Tree) select_expr(expr ast.SelectExpr) &Node {
|
|||
obj.add_terse('is_expr', t.bool_node(expr.is_expr))
|
||||
obj.add_terse('has_exception', t.bool_node(expr.has_exception))
|
||||
obj.add_terse('expected_type', t.type_node(expr.expected_type))
|
||||
obj.add('pos', t.position(expr.pos))
|
||||
obj.add('pos', t.pos(expr.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1780,7 +1790,7 @@ fn (t Tree) select_branch(expr ast.SelectBranch) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('SelectBranch'))
|
||||
obj.add_terse('stmt', t.stmt(expr.stmt))
|
||||
obj.add_terse('stmts', t.array_node_stmt(expr.stmts))
|
||||
obj.add('pos', t.position(expr.pos))
|
||||
obj.add('pos', t.pos(expr.pos))
|
||||
obj.add('comment', t.comment(expr.comment))
|
||||
obj.add_terse('is_else', t.bool_node(expr.is_else))
|
||||
obj.add_terse('is_timeout', t.bool_node(expr.is_timeout))
|
||||
|
@ -1794,7 +1804,7 @@ fn (t Tree) array_decompose(expr ast.ArrayDecompose) &Node {
|
|||
obj.add_terse('expr', t.expr(expr.expr))
|
||||
obj.add_terse('expr_type', t.type_node(expr.expr_type))
|
||||
obj.add_terse('arg_type', t.type_node(expr.arg_type))
|
||||
obj.add('pos', t.position(expr.pos))
|
||||
obj.add('pos', t.pos(expr.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1803,7 +1813,7 @@ fn (t Tree) go_expr(expr ast.GoExpr) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('GoExpr'))
|
||||
obj.add_terse('call_expr', t.call_expr(expr.call_expr))
|
||||
obj.add_terse('is_expr', t.bool_node(expr.is_expr))
|
||||
obj.add('pos', t.position(expr.pos))
|
||||
obj.add('pos', t.pos(expr.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1812,7 +1822,7 @@ fn (t Tree) offset_of(expr ast.OffsetOf) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('OffsetOf'))
|
||||
obj.add_terse('struct_type', t.type_node(expr.struct_type))
|
||||
obj.add_terse('field', t.string_node('field'))
|
||||
obj.add('pos', t.position(expr.pos))
|
||||
obj.add('pos', t.pos(expr.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1821,7 +1831,7 @@ fn (t Tree) dump_expr(expr ast.DumpExpr) &Node {
|
|||
obj.add_terse('ast_type', t.string_node('DumpExpr'))
|
||||
obj.add_terse('expr', t.expr(expr.expr))
|
||||
obj.add_terse('expr_type', t.type_node(expr.expr_type))
|
||||
obj.add('pos', t.position(expr.pos))
|
||||
obj.add('pos', t.pos(expr.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1829,7 +1839,7 @@ fn (t Tree) node_error(expr ast.NodeError) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('NodeError'))
|
||||
obj.add_terse('idx', t.number_node(expr.idx))
|
||||
obj.add('pos', t.position(expr.pos))
|
||||
obj.add('pos', t.pos(expr.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1843,7 +1853,7 @@ fn (t Tree) empty_expr(expr ast.EmptyExpr) &Node {
|
|||
fn (t Tree) empty_stmt(node ast.EmptyStmt) &Node {
|
||||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('EmptyStmt'))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1856,7 +1866,7 @@ fn (t Tree) asm_stmt(node ast.AsmStmt) &Node {
|
|||
obj.add_terse('is_goto', t.bool_node(node.is_goto))
|
||||
obj.add('scope', t.scope(node.scope))
|
||||
// obj.add('scope', t.number_node(int(node.scope)))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
obj.add_terse('clobbered', t.array_node_asm_clobbered(node.clobbered))
|
||||
obj.add_terse('templates', t.array_node_asm_template(node.templates))
|
||||
obj.add_terse('output', t.array_node_asm_io(node.output))
|
||||
|
@ -1883,7 +1893,7 @@ fn (t Tree) asm_template(node ast.AsmTemplate) &Node {
|
|||
obj.add_terse('is_directive', t.bool_node(node.is_directive))
|
||||
obj.add_terse('args', t.array_node_asm_arg(node.args))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1896,7 +1906,7 @@ fn (t Tree) asm_addressing(node ast.AsmAddressing) &Node {
|
|||
obj.add_terse('displacement', t.asm_arg(node.displacement))
|
||||
obj.add_terse('base', t.asm_arg(node.base))
|
||||
obj.add_terse('index', t.asm_arg(node.index))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1936,7 +1946,7 @@ fn (t Tree) asm_alias(node ast.AsmAlias) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('AsmAlias'))
|
||||
obj.add_terse('name', t.string_node(node.name))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1944,7 +1954,7 @@ fn (t Tree) asm_disp(node ast.AsmDisp) &Node {
|
|||
mut obj := new_object()
|
||||
obj.add_terse('ast_type', t.string_node('AsmDisp'))
|
||||
obj.add_terse('val', t.string_node(node.val))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -1964,7 +1974,7 @@ fn (t Tree) asm_io(node ast.AsmIO) &Node {
|
|||
obj.add_terse('expr', t.expr(node.expr))
|
||||
obj.add_terse('typ', t.type_node(node.typ))
|
||||
obj.add('comments', t.array_node_comment(node.comments))
|
||||
obj.add('pos', t.position(node.pos))
|
||||
obj.add('pos', t.pos(node.pos))
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -2024,10 +2034,10 @@ fn (t Tree) array_node_string(nodes []string) &Node {
|
|||
return arr
|
||||
}
|
||||
|
||||
fn (t Tree) array_node_position(nodes []token.Position) &Node {
|
||||
fn (t Tree) array_node_position(nodes []token.Pos) &Node {
|
||||
mut arr := new_array()
|
||||
for node in nodes {
|
||||
arr.add_item(t.position(node))
|
||||
arr.add_item(t.pos(node))
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
@ -2200,7 +2210,7 @@ fn (t Tree) array_node_int(nodes []int) &Node {
|
|||
return arr
|
||||
}
|
||||
|
||||
fn (t Tree) array_node_byte(nodes []byte) &Node {
|
||||
fn (t Tree) array_node_u8(nodes []u8) &Node {
|
||||
mut arr := new_array()
|
||||
for node in nodes {
|
||||
arr.add_item(t.number_node(node))
|
||||
|
@ -2224,6 +2234,14 @@ fn (t Tree) array_node_struct_init_field(nodes []ast.StructInitField) &Node {
|
|||
return arr
|
||||
}
|
||||
|
||||
fn (t Tree) array_node_if_guard_var(nodes []ast.IfGuardVar) &Node {
|
||||
mut arr := new_array()
|
||||
for node in nodes {
|
||||
arr.add_item(t.if_guard_var(node))
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
||||
fn (t Tree) array_node_struct_init_embed(nodes []ast.StructInitEmbed) &Node {
|
||||
mut arr := new_array()
|
||||
for node in nodes {
|
||||
|
|
|
@ -46,12 +46,12 @@ fn (context Context) footer() string {
|
|||
return ')\n'
|
||||
}
|
||||
|
||||
fn (context Context) file2v(bname string, fbytes []byte, bn_max int) string {
|
||||
fn (context Context) file2v(bname string, fbytes []u8, bn_max int) string {
|
||||
mut sb := strings.new_builder(1000)
|
||||
bn_diff_len := bn_max - bname.len
|
||||
sb.write_string('\t${bname}_len' + ' '.repeat(bn_diff_len - 4) + ' = $fbytes.len\n')
|
||||
fbyte := fbytes[0]
|
||||
bnmae_line := '\t$bname' + ' '.repeat(bn_diff_len) + ' = [byte($fbyte), '
|
||||
bnmae_line := '\t$bname' + ' '.repeat(bn_diff_len) + ' = [u8($fbyte), '
|
||||
sb.write_string(bnmae_line)
|
||||
mut line_len := bnmae_line.len + 3
|
||||
for i := 1; i < fbytes.len; i++ {
|
||||
|
@ -73,11 +73,11 @@ fn (context Context) file2v(bname string, fbytes []byte, bn_max int) string {
|
|||
return sb.str()
|
||||
}
|
||||
|
||||
fn (context Context) bname_and_bytes(file string) ?(string, []byte) {
|
||||
fn (context Context) bname_and_bytes(file string) ?(string, []u8) {
|
||||
fname := os.file_name(file)
|
||||
fname_escaped := fname.replace_each(['.', '_', '-', '_'])
|
||||
byte_name := '$context.prefix$fname_escaped'.to_lower()
|
||||
fbytes := os.read_bytes(file) or { return error('Error: $err.msg') }
|
||||
fbytes := os.read_bytes(file) or { return error('Error: $err.msg()') }
|
||||
return byte_name, fbytes
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ fn main() {
|
|||
exit(0)
|
||||
}
|
||||
files := fp.finalize() or {
|
||||
eprintln('Error: $err.msg')
|
||||
eprintln('Error: $err.msg()')
|
||||
exit(1)
|
||||
}
|
||||
real_files := files.filter(it != 'bin2v')
|
||||
|
@ -120,22 +120,22 @@ fn main() {
|
|||
if context.write_file != '' && os.file_ext(context.write_file) !in ['.vv', '.v'] {
|
||||
context.write_file += '.v'
|
||||
}
|
||||
mut file_byte_map := map[string][]byte{}
|
||||
mut file_byte_map := map[string][]u8{}
|
||||
for file in real_files {
|
||||
bname, fbytes := context.bname_and_bytes(file) or {
|
||||
eprintln(err.msg)
|
||||
eprintln(err.msg())
|
||||
exit(1)
|
||||
}
|
||||
file_byte_map[bname] = fbytes
|
||||
}
|
||||
max_bname := context.max_bname_len(file_byte_map.keys())
|
||||
if context.write_file.len > 0 {
|
||||
mut out_file := os.create(context.write_file) ?
|
||||
out_file.write_string(context.header()) ?
|
||||
mut out_file := os.create(context.write_file)?
|
||||
out_file.write_string(context.header())?
|
||||
for bname, fbytes in file_byte_map {
|
||||
out_file.write_string(context.file2v(bname, fbytes, max_bname)) ?
|
||||
out_file.write_string(context.file2v(bname, fbytes, max_bname))?
|
||||
}
|
||||
out_file.write_string(context.footer()) ?
|
||||
out_file.write_string(context.footer())?
|
||||
} else {
|
||||
print(context.header())
|
||||
for bname, fbytes in file_byte_map {
|
||||
|
|
|
@ -8,7 +8,7 @@ const vroot = @VMODROOT
|
|||
fn get_vdoctor_output(is_verbose bool) string {
|
||||
vexe := os.getenv('VEXE')
|
||||
verbose_flag := if is_verbose { '-v' } else { '' }
|
||||
result := os.execute('$vexe $verbose_flag doctor')
|
||||
result := os.execute('${os.quoted_path(vexe)} $verbose_flag doctor')
|
||||
if result.exit_code != 0 {
|
||||
eprintln('unable to get `v doctor` output: $result.output')
|
||||
return ''
|
||||
|
@ -24,7 +24,7 @@ fn get_v_build_output(is_verbose bool, is_yes bool, file_path string) string {
|
|||
os.chdir(vroot) or {}
|
||||
verbose_flag := if is_verbose { '-v' } else { '' }
|
||||
vdbg_path := $if windows { '$vroot/vdbg.exe' } $else { '$vroot/vdbg' }
|
||||
vdbg_compilation_cmd := '"$vexe" $verbose_flag -g -o "$vdbg_path" cmd/v'
|
||||
vdbg_compilation_cmd := '${os.quoted_path(vexe)} $verbose_flag -g -o ${os.quoted_path(vdbg_path)} cmd/v'
|
||||
vdbg_result := os.execute(vdbg_compilation_cmd)
|
||||
os.chdir(wd) or {}
|
||||
if vdbg_result.exit_code == 0 {
|
||||
|
@ -33,7 +33,7 @@ fn get_v_build_output(is_verbose bool, is_yes bool, file_path string) string {
|
|||
eprintln('unable to compile V in debug mode: $vdbg_result.output\ncommand: $vdbg_compilation_cmd\n')
|
||||
}
|
||||
//
|
||||
mut result := os.execute('"$vexe" $verbose_flag "$file_path"')
|
||||
mut result := os.execute('${os.quoted_path(vexe)} $verbose_flag ${os.quoted_path(file_path)}')
|
||||
defer {
|
||||
os.rm(vdbg_path) or {
|
||||
if is_verbose {
|
||||
|
@ -56,7 +56,7 @@ fn get_v_build_output(is_verbose bool, is_yes bool, file_path string) string {
|
|||
run := is_yes
|
||||
|| ask('It looks like the compilation went well, do you want to run the file?')
|
||||
if run {
|
||||
result = os.execute('"$vexe" $verbose_flag run "$file_path"')
|
||||
result = os.execute('${os.quoted_path(vexe)} $verbose_flag run ${os.quoted_path(file_path)}')
|
||||
if result.exit_code == 0 && !is_yes {
|
||||
confirm_or_exit('It looks like the file ran correctly as well, are you sure you want to continue?')
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ fn main() {
|
|||
build_output := get_v_build_output(is_verbose, is_yes, file_path)
|
||||
// ask the user if he wants to submit even after an error
|
||||
if !is_yes && (vdoctor_output == '' || file_content == '' || build_output == '') {
|
||||
confirm_or_exit('An error occured retrieving the information, do you want to continue?')
|
||||
confirm_or_exit('An error occurred retrieving the information, do you want to continue?')
|
||||
}
|
||||
|
||||
expected_result := readline.read_line('What did you expect to see? ') or {
|
||||
|
|
|
@ -12,7 +12,8 @@ const efolders = [
|
|||
fn main() {
|
||||
args_string := os.args[1..].join(' ')
|
||||
params := args_string.all_before('build-examples')
|
||||
skip_prefixes := efolders.map(os.real_path(os.join_path_single(vroot, it)))
|
||||
skip_prefixes := efolders.map(os.real_path(os.join_path_single(vroot, it)).replace('\\',
|
||||
'/'))
|
||||
res := testing.v_build_failing_skipped(params, 'examples', skip_prefixes, fn (mut session testing.TestSession) {
|
||||
for x in efolders {
|
||||
pathsegments := x.split_any('/')
|
||||
|
|
|
@ -4,7 +4,7 @@ import os
|
|||
import testing
|
||||
import v.util
|
||||
|
||||
// NB: tools like vdoc are compiled in their own subfolder
|
||||
// Note: tools like vdoc are compiled in their own subfolder
|
||||
// => cmd/tools/vdoc/vdoc.exe
|
||||
// Usually, they have several top level .v files in the subfolder,
|
||||
// that cannot be compiled separately, but instead, the whole folder,
|
||||
|
@ -23,7 +23,7 @@ fn main() {
|
|||
args_string := os.args[1..].join(' ')
|
||||
vexe := os.getenv('VEXE')
|
||||
vroot := os.dir(vexe)
|
||||
os.chdir(vroot) ?
|
||||
os.chdir(vroot)?
|
||||
folder := os.join_path('cmd', 'tools')
|
||||
tfolder := os.join_path(vroot, 'cmd', 'tools')
|
||||
main_label := 'Building $folder ...'
|
||||
|
@ -31,7 +31,7 @@ fn main() {
|
|||
//
|
||||
mut skips := []string{}
|
||||
for stool in tools_in_subfolders {
|
||||
skips << os.join_path(tfolder, stool)
|
||||
skips << os.join_path(tfolder, stool).replace('\\', '/')
|
||||
}
|
||||
buildopts := args_string.all_before('build-tools')
|
||||
mut session := testing.prepare_test_session(buildopts, folder, skips, main_label)
|
||||
|
@ -43,11 +43,11 @@ fn main() {
|
|||
// eprintln('> session.skip_files: $session.skip_files')
|
||||
session.test()
|
||||
eprintln(session.benchmark.total_message(finish_label))
|
||||
if session.failed {
|
||||
if session.failed_cmds.len > 0 {
|
||||
exit(1)
|
||||
}
|
||||
//
|
||||
mut executables := os.ls(session.vtmp_dir) ?
|
||||
mut executables := os.ls(session.vtmp_dir)?
|
||||
executables.sort()
|
||||
for texe in executables {
|
||||
tname := texe.replace(os.file_ext(texe), '')
|
||||
|
@ -66,8 +66,9 @@ fn main() {
|
|||
}
|
||||
target_path := os.join_path(tfolder, texe)
|
||||
os.mv_by_cp(tpath, target_path) or {
|
||||
if !err.msg.contains('vbuild-tools') && !err.msg.contains('vtest-all') {
|
||||
eprintln('error while moving $tpath to $target_path: $err.msg')
|
||||
emsg := err.msg()
|
||||
if !emsg.contains('vbuild-tools') && !emsg.contains('vtest-all') {
|
||||
eprintln('error while moving $tpath to $target_path: $emsg')
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2019-2021 Subhomoy Haldar. All rights reserved.
|
||||
// Copyright (c) 2019-2022 Subhomoy Haldar. All rights reserved.
|
||||
// Use of this source code is governed by an MIT license that can be found in the LICENSE file.
|
||||
module main
|
||||
|
||||
|
@ -20,7 +20,7 @@ const (
|
|||
tool_version = \'1.2.1\'
|
||||
version: \'0.2.42\'
|
||||
VERSION = "1.23.8"
|
||||
|
||||
|
||||
Examples:
|
||||
Bump the patch version in v.mod if it exists
|
||||
v bump --patch
|
||||
|
|
|
@ -68,24 +68,21 @@ fn run_individual_test(case BumpTestCase) ? {
|
|||
test_file := os.join_path_single(temp_dir, case.file_name)
|
||||
|
||||
os.rm(test_file) or {}
|
||||
os.write_file(test_file, case.contents) ?
|
||||
os.write_file(test_file, case.contents)?
|
||||
//
|
||||
os.execute_or_exit('${os.quoted_path(vexe)} bump --patch ${os.quoted_path(test_file)}')
|
||||
patch_lines := os.read_lines(test_file)?
|
||||
assert patch_lines[case.line] == case.expected_patch
|
||||
|
||||
{
|
||||
os.execute_or_exit('$vexe bump --patch $test_file')
|
||||
patch_lines := os.read_lines(test_file) ?
|
||||
assert patch_lines[case.line] == case.expected_patch
|
||||
}
|
||||
{
|
||||
os.execute_or_exit('$vexe bump --minor $test_file')
|
||||
minor_lines := os.read_lines(test_file) ?
|
||||
assert minor_lines[case.line] == case.expected_minor
|
||||
}
|
||||
{
|
||||
os.execute_or_exit('$vexe bump --major $test_file')
|
||||
major_lines := os.read_lines(test_file) ?
|
||||
assert major_lines[case.line] == case.expected_major
|
||||
}
|
||||
os.rm(test_file) ?
|
||||
os.execute_or_exit('${os.quoted_path(vexe)} bump --minor ${os.quoted_path(test_file)}')
|
||||
minor_lines := os.read_lines(test_file)?
|
||||
assert minor_lines[case.line] == case.expected_minor
|
||||
|
||||
os.execute_or_exit('${os.quoted_path(vexe)} bump --major ${os.quoted_path(test_file)}')
|
||||
major_lines := os.read_lines(test_file)?
|
||||
assert major_lines[case.line] == case.expected_major
|
||||
//
|
||||
os.rm(test_file)?
|
||||
}
|
||||
|
||||
fn test_all_bump_cases() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved.
|
||||
// Copyright (c) 2019-2022 Alexander Medvednikov. All rights reserved.
|
||||
// Use of this source code is governed by an MIT license
|
||||
// that can be found in the LICENSE file.
|
||||
module main
|
||||
|
@ -21,6 +21,8 @@ const (
|
|||
hide_warnings = '-hide-warnings' in os.args || '-w' in os.args
|
||||
show_progress = os.getenv('GITHUB_JOB') == '' && '-silent' !in os.args
|
||||
non_option_args = cmdline.only_non_options(os.args[2..])
|
||||
is_verbose = os.getenv('VERBOSE') != ''
|
||||
vcheckfolder = os.join_path_single(os.temp_dir(), 'vcheck_$os.getuid()')
|
||||
)
|
||||
|
||||
struct CheckResult {
|
||||
|
@ -56,6 +58,10 @@ fn main() {
|
|||
if term_colors {
|
||||
os.setenv('VCOLORS', 'always', true)
|
||||
}
|
||||
os.mkdir_all(vcheckfolder) or {}
|
||||
defer {
|
||||
os.rmdir_all(vcheckfolder) or {}
|
||||
}
|
||||
for i := 0; i < files_paths.len; i++ {
|
||||
file_path := files_paths[i]
|
||||
if os.is_dir(file_path) {
|
||||
|
@ -75,7 +81,7 @@ fn main() {
|
|||
res += mdfile.check()
|
||||
}
|
||||
if res.errors == 0 && show_progress {
|
||||
term.clear_previous_line()
|
||||
clear_previous_line()
|
||||
}
|
||||
if res.warnings > 0 || res.errors > 0 || res.oks > 0 {
|
||||
println('\nWarnings: $res.warnings | Errors: $res.errors | OKs: $res.oks')
|
||||
|
@ -131,9 +137,7 @@ fn eline(file_path string, lnumber int, column int, message string) string {
|
|||
return btext('$file_path:${lnumber + 1}:${column + 1}:') + btext(rtext(' error: $message'))
|
||||
}
|
||||
|
||||
const (
|
||||
default_command = 'compile'
|
||||
)
|
||||
const default_command = 'compile'
|
||||
|
||||
struct VCodeExample {
|
||||
mut:
|
||||
|
@ -160,7 +164,7 @@ mut:
|
|||
|
||||
fn (mut f MDFile) progress(message string) {
|
||||
if show_progress {
|
||||
term.clear_previous_line()
|
||||
clear_previous_line()
|
||||
println('File: ${f.path:-30s}, Lines: ${f.lines.len:5}, $message')
|
||||
}
|
||||
}
|
||||
|
@ -172,30 +176,30 @@ fn (mut f MDFile) check() CheckResult {
|
|||
// f.progress('line: $j')
|
||||
if f.state == .vexample {
|
||||
if line.len > too_long_line_length_example {
|
||||
wprintln(wline(f.path, j, line.len, 'long V example line'))
|
||||
wprintln(wline(f.path, j, line.len, 'example lines must be less than $too_long_line_length_example characters'))
|
||||
wprintln(line)
|
||||
res.warnings++
|
||||
}
|
||||
} else if f.state == .codeblock {
|
||||
if line.len > too_long_line_length_codeblock {
|
||||
wprintln(wline(f.path, j, line.len, 'long code block line'))
|
||||
wprintln(wline(f.path, j, line.len, 'code lines must be less than $too_long_line_length_codeblock characters'))
|
||||
wprintln(line)
|
||||
res.warnings++
|
||||
}
|
||||
} else if line.starts_with('|') {
|
||||
if line.len > too_long_line_length_table {
|
||||
wprintln(wline(f.path, j, line.len, 'long table'))
|
||||
wprintln(wline(f.path, j, line.len, 'table lines must be less than $too_long_line_length_table characters'))
|
||||
wprintln(line)
|
||||
res.warnings++
|
||||
}
|
||||
} else if line.contains('http') {
|
||||
if line.all_after('https').len > too_long_line_length_link {
|
||||
wprintln(wline(f.path, j, line.len, 'long link'))
|
||||
wprintln(wline(f.path, j, line.len, 'link lines must be less than $too_long_line_length_link characters'))
|
||||
wprintln(line)
|
||||
res.warnings++
|
||||
}
|
||||
} else if line.len > too_long_line_length_other {
|
||||
eprintln(eline(f.path, j, line.len, 'line too long'))
|
||||
eprintln(eline(f.path, j, line.len, 'must be less than $too_long_line_length_other characters'))
|
||||
eprintln(line)
|
||||
res.errors++
|
||||
}
|
||||
|
@ -394,6 +398,7 @@ fn (mut f MDFile) debug() {
|
|||
}
|
||||
|
||||
fn cmdexecute(cmd string) int {
|
||||
verbose_println(cmd)
|
||||
res := os.execute(cmd)
|
||||
if res.exit_code < 0 {
|
||||
return 1
|
||||
|
@ -405,12 +410,13 @@ fn cmdexecute(cmd string) int {
|
|||
}
|
||||
|
||||
fn silent_cmdexecute(cmd string) int {
|
||||
verbose_println(cmd)
|
||||
res := os.execute(cmd)
|
||||
return res.exit_code
|
||||
}
|
||||
|
||||
fn get_fmt_exit_code(vfile string, vexe string) int {
|
||||
return silent_cmdexecute('"$vexe" fmt -verify $vfile')
|
||||
return silent_cmdexecute('${os.quoted_path(vexe)} fmt -verify ${os.quoted_path(vfile)}')
|
||||
}
|
||||
|
||||
fn (mut f MDFile) check_examples() CheckResult {
|
||||
|
@ -426,7 +432,9 @@ fn (mut f MDFile) check_examples() CheckResult {
|
|||
}
|
||||
fname := os.base(f.path).replace('.md', '_md')
|
||||
uid := rand.ulid()
|
||||
vfile := os.join_path(os.temp_dir(), 'check_${fname}_example_${e.sline}__${e.eline}__${uid}.v')
|
||||
cfile := os.join_path(vcheckfolder, '${uid}.c')
|
||||
vfile := os.join_path(vcheckfolder, 'check_${fname}_example_${e.sline}__${e.eline}__${uid}.v')
|
||||
efile := os.join_path(vcheckfolder, 'check_${fname}_example_${e.sline}__${e.eline}__${uid}.exe')
|
||||
mut should_cleanup_vfile := true
|
||||
// eprintln('>>> checking example $vfile ...')
|
||||
vcontent := e.text.join('\n') + '\n'
|
||||
|
@ -438,8 +446,7 @@ fn (mut f MDFile) check_examples() CheckResult {
|
|||
fmt_res := if nofmt { 0 } else { get_fmt_exit_code(vfile, vexe) }
|
||||
match command {
|
||||
'compile' {
|
||||
res := cmdexecute('"$vexe" -w -Wfatal-errors -o x.c $vfile')
|
||||
os.rm('x.c') or {}
|
||||
res := cmdexecute('${os.quoted_path(vexe)} -w -Wfatal-errors -o ${os.quoted_path(efile)} ${os.quoted_path(vfile)}')
|
||||
if res != 0 || fmt_res != 0 {
|
||||
if res != 0 {
|
||||
eprintln(eline(f.path, e.sline, 0, 'example failed to compile'))
|
||||
|
@ -454,9 +461,24 @@ fn (mut f MDFile) check_examples() CheckResult {
|
|||
}
|
||||
oks++
|
||||
}
|
||||
'cgen' {
|
||||
res := cmdexecute('${os.quoted_path(vexe)} -w -Wfatal-errors -o ${os.quoted_path(cfile)} ${os.quoted_path(vfile)}')
|
||||
if res != 0 || fmt_res != 0 {
|
||||
if res != 0 {
|
||||
eprintln(eline(f.path, e.sline, 0, 'example failed to generate C code'))
|
||||
}
|
||||
if fmt_res != 0 {
|
||||
eprintln(eline(f.path, e.sline, 0, 'example is not formatted'))
|
||||
}
|
||||
eprintln(vcontent)
|
||||
should_cleanup_vfile = false
|
||||
errors++
|
||||
continue
|
||||
}
|
||||
oks++
|
||||
}
|
||||
'globals' {
|
||||
res := cmdexecute('"$vexe" -w -Wfatal-errors -enable-globals -o x.c $vfile')
|
||||
os.rm('x.c') or {}
|
||||
res := cmdexecute('${os.quoted_path(vexe)} -w -Wfatal-errors -enable-globals -o ${os.quoted_path(cfile)} ${os.quoted_path(vfile)}')
|
||||
if res != 0 || fmt_res != 0 {
|
||||
if res != 0 {
|
||||
eprintln(eline(f.path, e.sline, 0, '`example failed to compile with -enable-globals'))
|
||||
|
@ -472,7 +494,7 @@ fn (mut f MDFile) check_examples() CheckResult {
|
|||
oks++
|
||||
}
|
||||
'live' {
|
||||
res := cmdexecute('"$vexe" -w -Wfatal-errors -live -o x.c $vfile')
|
||||
res := cmdexecute('${os.quoted_path(vexe)} -w -Wfatal-errors -live -o ${os.quoted_path(cfile)} ${os.quoted_path(vfile)}')
|
||||
if res != 0 || fmt_res != 0 {
|
||||
if res != 0 {
|
||||
eprintln(eline(f.path, e.sline, 0, 'example failed to compile with -live'))
|
||||
|
@ -488,8 +510,7 @@ fn (mut f MDFile) check_examples() CheckResult {
|
|||
oks++
|
||||
}
|
||||
'failcompile' {
|
||||
res := silent_cmdexecute('"$vexe" -w -Wfatal-errors -o x.c $vfile')
|
||||
os.rm('x.c') or {}
|
||||
res := silent_cmdexecute('${os.quoted_path(vexe)} -w -Wfatal-errors -o ${os.quoted_path(cfile)} ${os.quoted_path(vfile)}')
|
||||
if res == 0 || fmt_res != 0 {
|
||||
if res == 0 {
|
||||
eprintln(eline(f.path, e.sline, 0, '`failcompile` example compiled'))
|
||||
|
@ -505,7 +526,7 @@ fn (mut f MDFile) check_examples() CheckResult {
|
|||
oks++
|
||||
}
|
||||
'oksyntax' {
|
||||
res := cmdexecute('"$vexe" -w -Wfatal-errors -check-syntax $vfile')
|
||||
res := cmdexecute('${os.quoted_path(vexe)} -w -Wfatal-errors -check-syntax ${os.quoted_path(vfile)}')
|
||||
if res != 0 || fmt_res != 0 {
|
||||
if res != 0 {
|
||||
eprintln(eline(f.path, e.sline, 0, '`oksyntax` example with invalid syntax'))
|
||||
|
@ -521,7 +542,7 @@ fn (mut f MDFile) check_examples() CheckResult {
|
|||
oks++
|
||||
}
|
||||
'badsyntax' {
|
||||
res := silent_cmdexecute('"$vexe" -w -Wfatal-errors -check-syntax $vfile')
|
||||
res := silent_cmdexecute('${os.quoted_path(vexe)} -w -Wfatal-errors -check-syntax ${os.quoted_path(vfile)}')
|
||||
if res == 0 {
|
||||
eprintln(eline(f.path, e.sline, 0, '`badsyntax` example can be parsed fine'))
|
||||
eprintln(vcontent)
|
||||
|
@ -533,12 +554,14 @@ fn (mut f MDFile) check_examples() CheckResult {
|
|||
}
|
||||
'nofmt' {}
|
||||
else {
|
||||
eprintln(eline(f.path, e.sline, 0, 'unrecognized command: "$command", use one of: wip/ignore/compile/failcompile/oksyntax/badsyntax'))
|
||||
eprintln(eline(f.path, e.sline, 0, 'unrecognized command: "$command", use one of: wip/ignore/compile/cgen/failcompile/oksyntax/badsyntax/nofmt'))
|
||||
should_cleanup_vfile = false
|
||||
errors++
|
||||
}
|
||||
}
|
||||
}
|
||||
os.rm(cfile) or {}
|
||||
os.rm(efile) or {}
|
||||
if should_cleanup_vfile {
|
||||
os.rm(vfile) or { panic(err) }
|
||||
}
|
||||
|
@ -548,3 +571,16 @@ fn (mut f MDFile) check_examples() CheckResult {
|
|||
oks: oks
|
||||
}
|
||||
}
|
||||
|
||||
fn verbose_println(message string) {
|
||||
if is_verbose {
|
||||
println(message)
|
||||
}
|
||||
}
|
||||
|
||||
fn clear_previous_line() {
|
||||
if is_verbose {
|
||||
return
|
||||
}
|
||||
term.clear_previous_line()
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved.
|
||||
// Copyright (c) 2019-2022 Alexander Medvednikov. All rights reserved.
|
||||
// Use of this source code is governed by an MIT license
|
||||
// that can be found in the LICENSE file.
|
||||
//
|
||||
|
@ -44,11 +44,39 @@ import os
|
|||
const (
|
||||
auto_complete_shells = ['bash', 'fish', 'zsh', 'powershell'] // list of supported shells
|
||||
vexe = os.getenv('VEXE')
|
||||
help_text = "Usage:
|
||||
v complete [options] [SUBCMD] QUERY...
|
||||
|
||||
Description:
|
||||
Tool for bridging auto completion between various shells and v
|
||||
|
||||
Supported shells:
|
||||
bash, fish, zsh, powershell
|
||||
|
||||
Examples:
|
||||
Echo auto-detected shell install script to STDOUT
|
||||
v complete
|
||||
Echo specific shell install script to STDOUT
|
||||
v complete setup bash
|
||||
Auto complete input `v tes`*USER PUSHES TAB* (in Bash compatible format).
|
||||
This is not meant for manual invocation - it's called by the relevant
|
||||
shell via the script installed with `v complete` or `v complete setup SHELL`.
|
||||
v complete bash v tes
|
||||
|
||||
Options:
|
||||
-h, --help Show this help text.
|
||||
|
||||
SUBCMD:
|
||||
setup : setup [SHELL] - returns the code for completion setup for SHELL
|
||||
bash : [QUERY] - returns Bash compatible completion code with completions computed from QUERY
|
||||
fish : [QUERY] - returns Fish compatible completion code with completions computed from QUERY
|
||||
zsh : [QUERY] - returns ZSH compatible completion code with completions computed from QUERY
|
||||
powershell: [QUERY] - returns PowerShell compatible completion code with completions computed from QUERY"
|
||||
)
|
||||
|
||||
// Snooped from cmd/v/v.v, vlib/v/pref/pref.v
|
||||
const (
|
||||
auto_complete_commands = [
|
||||
auto_complete_commands = [
|
||||
// simple_cmd
|
||||
'ast',
|
||||
'doc',
|
||||
|
@ -86,7 +114,6 @@ const (
|
|||
'help',
|
||||
'new',
|
||||
'init',
|
||||
'complete',
|
||||
'translate',
|
||||
'self',
|
||||
'search',
|
||||
|
@ -102,8 +129,13 @@ const (
|
|||
'run',
|
||||
'build',
|
||||
'build-module',
|
||||
'missdoc',
|
||||
]
|
||||
auto_complete_flags = [
|
||||
// Entries in the flag arrays below should be entered as is:
|
||||
// * Short flags, e.g.: "-v", should be entered: '-v'
|
||||
// * Long flags, e.g.: "--version", should be entered: '--version'
|
||||
// * Single-dash flags, e.g.: "-version", should be entered: '-version'
|
||||
auto_complete_flags = [
|
||||
'-apk',
|
||||
'-show-timings',
|
||||
'-check-syntax',
|
||||
|
@ -122,6 +154,7 @@ const (
|
|||
'-autofree',
|
||||
'-compress',
|
||||
'-freestanding',
|
||||
'-no-parallel',
|
||||
'-no-preludes',
|
||||
'-prof',
|
||||
'-profile',
|
||||
|
@ -162,7 +195,7 @@ const (
|
|||
'-version',
|
||||
'--version',
|
||||
]
|
||||
auto_complete_flags_doc = [
|
||||
auto_complete_flags_doc = [
|
||||
'-all',
|
||||
'-f',
|
||||
'-h',
|
||||
|
@ -175,12 +208,13 @@ const (
|
|||
'-pos',
|
||||
'-no-timestamp',
|
||||
'-inline-assets',
|
||||
'-theme-dir',
|
||||
'-open',
|
||||
'-p',
|
||||
'-s',
|
||||
'-l',
|
||||
]
|
||||
auto_complete_flags_fmt = [
|
||||
auto_complete_flags_fmt = [
|
||||
'-c',
|
||||
'-diff',
|
||||
'-l',
|
||||
|
@ -188,7 +222,7 @@ const (
|
|||
'-debug',
|
||||
'-verify',
|
||||
]
|
||||
auto_complete_flags_bin2v = [
|
||||
auto_complete_flags_bin2v = [
|
||||
'-h',
|
||||
'--help',
|
||||
'-m',
|
||||
|
@ -198,22 +232,46 @@ const (
|
|||
'-w',
|
||||
'--write',
|
||||
]
|
||||
auto_complete_flags_shader = [
|
||||
'help',
|
||||
'h',
|
||||
'force-update',
|
||||
'u',
|
||||
'verbose',
|
||||
'v',
|
||||
'slang',
|
||||
'l',
|
||||
'output',
|
||||
'o',
|
||||
auto_complete_flags_shader = [
|
||||
'--help',
|
||||
'-h',
|
||||
'--force-update',
|
||||
'-u',
|
||||
'--verbose',
|
||||
'-v',
|
||||
'--slang',
|
||||
'-l',
|
||||
'--output',
|
||||
'-o',
|
||||
]
|
||||
auto_complete_flags_self = [
|
||||
auto_complete_flags_missdoc = [
|
||||
'--help',
|
||||
'-h',
|
||||
'--tags',
|
||||
'-t',
|
||||
'--deprecated',
|
||||
'-d',
|
||||
'--private',
|
||||
'-p',
|
||||
'--no-line-numbers',
|
||||
'-n',
|
||||
'--exclude',
|
||||
'-e',
|
||||
'--relative-paths',
|
||||
'-r',
|
||||
'--js',
|
||||
'--verify',
|
||||
'--diff',
|
||||
]
|
||||
auto_complete_flags_bump = [
|
||||
'--patch',
|
||||
'--minor',
|
||||
'--major',
|
||||
]
|
||||
auto_complete_flags_self = [
|
||||
'-prod',
|
||||
]
|
||||
auto_complete_compilers = [
|
||||
auto_complete_compilers = [
|
||||
'cc',
|
||||
'gcc',
|
||||
'tcc',
|
||||
|
@ -229,6 +287,16 @@ const (
|
|||
fn auto_complete(args []string) {
|
||||
if args.len <= 1 || args[0] != 'complete' {
|
||||
if args.len == 1 {
|
||||
shell_path := os.getenv('SHELL')
|
||||
if shell_path.len > 0 {
|
||||
shell_name := os.file_name(shell_path).to_lower()
|
||||
if shell_name in auto_complete_shells {
|
||||
println(setup_for_shell(shell_name))
|
||||
exit(0)
|
||||
}
|
||||
eprintln('Unknown shell ${shell_name}. Supported shells are: $auto_complete_shells')
|
||||
exit(1)
|
||||
}
|
||||
eprintln('auto completion require arguments to work.')
|
||||
} else {
|
||||
eprintln('auto completion failed for "$args".')
|
||||
|
@ -244,62 +312,7 @@ fn auto_complete(args []string) {
|
|||
exit(1)
|
||||
}
|
||||
shell := sub_args[1]
|
||||
mut setup := ''
|
||||
match shell {
|
||||
'bash' {
|
||||
setup = '
|
||||
_v_completions() {
|
||||
local src
|
||||
local limit
|
||||
# Send all words up to the word the cursor is currently on
|
||||
let limit=1+\$COMP_CWORD
|
||||
src=\$($vexe complete bash \$(printf "%s\\n" \${COMP_WORDS[@]: 0:\$limit}))
|
||||
if [[ \$? == 0 ]]; then
|
||||
eval \${src}
|
||||
#echo \${src}
|
||||
fi
|
||||
}
|
||||
|
||||
complete -o nospace -F _v_completions v
|
||||
'
|
||||
}
|
||||
'fish' {
|
||||
setup = '
|
||||
function __v_completions
|
||||
# Send all words up to the one before the cursor
|
||||
$vexe complete fish (commandline -cop)
|
||||
end
|
||||
complete -f -c v -a "(__v_completions)"
|
||||
'
|
||||
}
|
||||
'zsh' {
|
||||
setup = '
|
||||
#compdef v
|
||||
_v() {
|
||||
local src
|
||||
# Send all words up to the word the cursor is currently on
|
||||
src=\$($vexe complete zsh \$(printf "%s\\n" \${(@)words[1,\$CURRENT]}))
|
||||
if [[ \$? == 0 ]]; then
|
||||
eval \${src}
|
||||
#echo \${src}
|
||||
fi
|
||||
}
|
||||
compdef _v v
|
||||
'
|
||||
}
|
||||
'powershell' {
|
||||
setup = '
|
||||
Register-ArgumentCompleter -Native -CommandName v -ScriptBlock {
|
||||
param(\$commandName, \$wordToComplete, \$cursorPosition)
|
||||
$vexe complete powershell "\$wordToComplete" | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new(\$_, \$_, \'ParameterValue\', \$_)
|
||||
}
|
||||
}
|
||||
'
|
||||
}
|
||||
else {}
|
||||
}
|
||||
println(setup)
|
||||
println(setup_for_shell(shell))
|
||||
}
|
||||
'bash' {
|
||||
if sub_args.len <= 1 {
|
||||
|
@ -334,6 +347,9 @@ Register-ArgumentCompleter -Native -CommandName v -ScriptBlock {
|
|||
}
|
||||
println(lines.join('\n'))
|
||||
}
|
||||
'-h', '--help' {
|
||||
println(help_text)
|
||||
}
|
||||
else {}
|
||||
}
|
||||
exit(0)
|
||||
|
@ -348,12 +364,26 @@ fn append_separator_if_dir(path string) string {
|
|||
return path
|
||||
}
|
||||
|
||||
// nearest_path_or_root returns the nearest valid path searching
|
||||
// backwards from `path`.
|
||||
fn nearest_path_or_root(path string) string {
|
||||
mut fixed_path := path
|
||||
if !os.is_dir(fixed_path) {
|
||||
fixed_path = path.all_before_last(os.path_separator)
|
||||
if fixed_path == '' {
|
||||
fixed_path = '/'
|
||||
}
|
||||
}
|
||||
return fixed_path
|
||||
}
|
||||
|
||||
// auto_complete_request retuns a list of completions resolved from a full argument list.
|
||||
fn auto_complete_request(args []string) []string {
|
||||
// Using space will ensure a uniform input in cases where the shell
|
||||
// returns the completion input as a string (['v','run'] vs. ['v run']).
|
||||
split_by := ' '
|
||||
request := args.join(split_by)
|
||||
mut do_home_expand := false
|
||||
mut list := []string{}
|
||||
// new_part := request.ends_with('\n\n')
|
||||
mut parts := request.trim_right(' ').split(split_by)
|
||||
|
@ -362,7 +392,7 @@ fn auto_complete_request(args []string) []string {
|
|||
list << command
|
||||
}
|
||||
} else {
|
||||
part := parts.last().trim(' ')
|
||||
mut part := parts.last().trim(' ')
|
||||
mut parent_command := ''
|
||||
for i := parts.len - 1; i >= 0; i-- {
|
||||
if parts[i].starts_with('-') {
|
||||
|
@ -371,12 +401,17 @@ fn auto_complete_request(args []string) []string {
|
|||
parent_command = parts[i]
|
||||
break
|
||||
}
|
||||
get_flags := fn (base []string, flag string) []string {
|
||||
if flag.len == 1 { return base
|
||||
} else { return base.filter(it.starts_with(flag))
|
||||
}
|
||||
}
|
||||
if part.starts_with('-') { // 'v -<tab>' -> flags.
|
||||
if part.starts_with('-') { // 'v [subcmd] -<tab>' or 'v [subcmd] --<tab>'-> flags.
|
||||
get_flags := fn (base []string, flag string) []string {
|
||||
mut results := []string{}
|
||||
for entry in base {
|
||||
if entry.starts_with(flag) {
|
||||
results << entry
|
||||
}
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
match parent_command {
|
||||
'bin2v' { // 'v bin2v -<tab>'
|
||||
list = get_flags(auto_complete_flags_bin2v, part)
|
||||
|
@ -396,6 +431,12 @@ fn auto_complete_request(args []string) []string {
|
|||
'shader' { // 'v shader -<tab>' -> flags.
|
||||
list = get_flags(auto_complete_flags_shader, part)
|
||||
}
|
||||
'missdoc' { // 'v missdoc -<tab>' -> flags.
|
||||
list = get_flags(auto_complete_flags_missdoc, part)
|
||||
}
|
||||
'bump' { // 'v bump -<tab>' -> flags.
|
||||
list = get_flags(auto_complete_flags_bump, part)
|
||||
}
|
||||
else {
|
||||
for flag in auto_complete_flags {
|
||||
if flag == part {
|
||||
|
@ -413,6 +454,11 @@ fn auto_complete_request(args []string) []string {
|
|||
}
|
||||
}
|
||||
}
|
||||
// Clear the list if the result is identical to the part examined
|
||||
// (the flag must have already been completed)
|
||||
if list.len == 1 && part == list[0] {
|
||||
list.clear()
|
||||
}
|
||||
} else {
|
||||
match part {
|
||||
'help' { // 'v help <tab>' -> top level commands except "help".
|
||||
|
@ -435,17 +481,34 @@ fn auto_complete_request(args []string) []string {
|
|||
mut ls_path := '.'
|
||||
mut collect_all := part in auto_complete_commands
|
||||
mut path_complete := false
|
||||
do_home_expand = part.starts_with('~')
|
||||
if do_home_expand {
|
||||
add_sep := if part == '~' { os.path_separator } else { '' }
|
||||
part = part.replace_once('~', os.home_dir().trim_right(os.path_separator)) + add_sep
|
||||
}
|
||||
is_abs_path := part.starts_with(os.path_separator) // TODO Windows support for drive prefixes
|
||||
if part.ends_with(os.path_separator) || part == '.' || part == '..' {
|
||||
// 'v <command>(.*/$|.|..)<tab>' -> output full directory list
|
||||
ls_path = '.' + os.path_separator + part
|
||||
if is_abs_path {
|
||||
ls_path = nearest_path_or_root(part)
|
||||
}
|
||||
collect_all = true
|
||||
} else if !collect_all && part.contains(os.path_separator) && os.is_dir(os.dir(part)) {
|
||||
// 'v <command>(.*/.* && os.is_dir)<tab>' -> output completion friendly directory list
|
||||
ls_path = os.dir(part)
|
||||
if is_abs_path {
|
||||
ls_path = nearest_path_or_root(part)
|
||||
} else {
|
||||
ls_path = os.dir(part)
|
||||
}
|
||||
path_complete = true
|
||||
}
|
||||
|
||||
entries := os.ls(ls_path) or { return list }
|
||||
last := part.all_after_last(os.path_separator)
|
||||
mut last := part.all_after_last(os.path_separator)
|
||||
if is_abs_path && os.is_dir(part) {
|
||||
last = ''
|
||||
}
|
||||
if path_complete {
|
||||
path := part.all_before_last(os.path_separator)
|
||||
for entry in entries {
|
||||
|
@ -453,27 +516,80 @@ fn auto_complete_request(args []string) []string {
|
|||
list << append_separator_if_dir(os.join_path(path, entry))
|
||||
}
|
||||
}
|
||||
// If only one possible file - send full path to completion system.
|
||||
// Please note that this might be bash specific - needs more testing.
|
||||
if list.len == 1 {
|
||||
list = [list[0]]
|
||||
}
|
||||
} else {
|
||||
for entry in entries {
|
||||
if collect_all {
|
||||
if collect_all || entry.starts_with(last) {
|
||||
list << append_separator_if_dir(entry)
|
||||
} else {
|
||||
if entry.starts_with(last) {
|
||||
list << append_separator_if_dir(entry)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if do_home_expand {
|
||||
return list.map(it.replace_once(os.home_dir().trim_right(os.path_separator), '~'))
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
fn setup_for_shell(shell string) string {
|
||||
mut setup := ''
|
||||
match shell {
|
||||
'bash' {
|
||||
setup = '
|
||||
_v_completions() {
|
||||
local src
|
||||
local limit
|
||||
# Send all words up to the word the cursor is currently on
|
||||
let limit=1+\$COMP_CWORD
|
||||
src=\$($vexe complete bash \$(printf "%s\\n" \${COMP_WORDS[@]: 0:\$limit}))
|
||||
if [[ \$? == 0 ]]; then
|
||||
eval \${src}
|
||||
#echo \${src}
|
||||
fi
|
||||
}
|
||||
|
||||
complete -o nospace -F _v_completions v
|
||||
'
|
||||
}
|
||||
'fish' {
|
||||
setup = '
|
||||
function __v_completions
|
||||
# Send all words up to the one before the cursor
|
||||
$vexe complete fish (commandline -cop)
|
||||
end
|
||||
complete -f -c v -a "(__v_completions)"
|
||||
'
|
||||
}
|
||||
'zsh' {
|
||||
setup = '
|
||||
#compdef v
|
||||
_v() {
|
||||
local src
|
||||
# Send all words up to the word the cursor is currently on
|
||||
src=\$($vexe complete zsh \$(printf "%s\\n" \${(@)words[1,\$CURRENT]}))
|
||||
if [[ \$? == 0 ]]; then
|
||||
eval \${src}
|
||||
#echo \${src}
|
||||
fi
|
||||
}
|
||||
compdef _v v
|
||||
'
|
||||
}
|
||||
'powershell' {
|
||||
setup = '
|
||||
Register-ArgumentCompleter -Native -CommandName v -ScriptBlock {
|
||||
param(\$commandName, \$wordToComplete, \$cursorPosition)
|
||||
$vexe complete powershell "\$wordToComplete" | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new(\$_, \$_, \'ParameterValue\', \$_)
|
||||
}
|
||||
}
|
||||
'
|
||||
}
|
||||
else {}
|
||||
}
|
||||
return setup
|
||||
}
|
||||
|
||||
fn main() {
|
||||
args := os.args[1..]
|
||||
// println('"$args"')
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved.
|
||||
// Copyright (c) 2019-2022 Alexander Medvednikov. All rights reserved.
|
||||
// Use of this source code is governed by an MIT license that can be found in the LICENSE file.
|
||||
module main
|
||||
|
||||
|
@ -42,49 +42,57 @@ fn check_name(name string) string {
|
|||
}
|
||||
|
||||
fn vmod_content(c Create) string {
|
||||
return [
|
||||
'Module {',
|
||||
" name: '$c.name'",
|
||||
" description: '$c.description'",
|
||||
" version: '$c.version'",
|
||||
" license: '$c.license'",
|
||||
' dependencies: []',
|
||||
'}',
|
||||
'',
|
||||
].join_lines()
|
||||
return "Module {
|
||||
name: '$c.name'
|
||||
description: '$c.description'
|
||||
version: '$c.version'
|
||||
license: '$c.license'
|
||||
dependencies: []
|
||||
}
|
||||
"
|
||||
}
|
||||
|
||||
fn main_content() string {
|
||||
return [
|
||||
'module main\n',
|
||||
'fn main() {',
|
||||
" println('Hello World!')",
|
||||
'}',
|
||||
'',
|
||||
].join_lines()
|
||||
return "module main
|
||||
|
||||
fn main() {
|
||||
println('Hello World!')
|
||||
}
|
||||
"
|
||||
}
|
||||
|
||||
fn gen_gitignore(name string) string {
|
||||
return [
|
||||
'# Binaries for programs and plugins',
|
||||
'main',
|
||||
'$name',
|
||||
'*.exe',
|
||||
'*.exe~',
|
||||
'*.so',
|
||||
'*.dylib',
|
||||
'*.dll',
|
||||
'vls.log',
|
||||
'',
|
||||
].join_lines()
|
||||
return '# Binaries for programs and plugins
|
||||
main
|
||||
$name
|
||||
*.exe
|
||||
*.exe~
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
vls.log
|
||||
'
|
||||
}
|
||||
|
||||
fn gitattributes_content() string {
|
||||
return [
|
||||
'*.v linguist-language=V text=auto eol=lf',
|
||||
'*.vv linguist-language=V text=auto eol=lf',
|
||||
'',
|
||||
].join_lines()
|
||||
return '*.v linguist-language=V text=auto eol=lf
|
||||
*.vv linguist-language=V text=auto eol=lf
|
||||
*.vsh linguist-language=V text=auto eol=lf
|
||||
**/v.mod linguist-language=V text=auto eol=lf
|
||||
'
|
||||
}
|
||||
|
||||
fn editorconfig_content() string {
|
||||
return '[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.v]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
'
|
||||
}
|
||||
|
||||
fn (c &Create) write_vmod(new bool) {
|
||||
|
@ -102,9 +110,20 @@ fn (c &Create) write_main(new bool) {
|
|||
|
||||
fn (c &Create) write_gitattributes(new bool) {
|
||||
gitattributes_path := if new { '$c.name/.gitattributes' } else { '.gitattributes' }
|
||||
if !new && os.exists(gitattributes_path) {
|
||||
return
|
||||
}
|
||||
os.write_file(gitattributes_path, gitattributes_content()) or { panic(err) }
|
||||
}
|
||||
|
||||
fn (c &Create) write_editorconfig(new bool) {
|
||||
editorconfig_path := if new { '$c.name/.editorconfig' } else { '.editorconfig' }
|
||||
if !new && os.exists(editorconfig_path) {
|
||||
return
|
||||
}
|
||||
os.write_file(editorconfig_path, editorconfig_content()) or { panic(err) }
|
||||
}
|
||||
|
||||
fn (c &Create) create_git_repo(dir string) {
|
||||
// Create Git Repo and .gitignore file
|
||||
if !os.is_dir('$dir/.git') {
|
||||
|
@ -141,7 +160,7 @@ fn create(args []string) {
|
|||
if c.version == '' {
|
||||
c.version = default_version
|
||||
}
|
||||
default_license := 'MIT'
|
||||
default_license := os.getenv_opt('VLICENSE') or { 'MIT' }
|
||||
c.license = os.input('Input your project license: ($default_license) ')
|
||||
if c.license == '' {
|
||||
c.license = default_license
|
||||
|
@ -151,23 +170,22 @@ fn create(args []string) {
|
|||
c.write_vmod(true)
|
||||
c.write_main(true)
|
||||
c.write_gitattributes(true)
|
||||
c.write_editorconfig(true)
|
||||
c.create_git_repo(c.name)
|
||||
}
|
||||
|
||||
fn init_project() {
|
||||
if os.exists('v.mod') {
|
||||
cerror('`v init` cannot be run on existing v modules')
|
||||
exit(3)
|
||||
}
|
||||
mut c := Create{}
|
||||
c.name = check_name(os.file_name(os.getwd()))
|
||||
c.description = ''
|
||||
c.write_vmod(false)
|
||||
if !os.exists('v.mod') {
|
||||
c.description = ''
|
||||
c.write_vmod(false)
|
||||
println('Change the description of your project in `v.mod`')
|
||||
}
|
||||
c.write_main(false)
|
||||
c.write_gitattributes(false)
|
||||
c.write_editorconfig(false)
|
||||
c.create_git_repo('.')
|
||||
|
||||
println('Change the description of your project in `v.mod`')
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -3,10 +3,9 @@ import os
|
|||
const test_path = 'vcreate_test'
|
||||
|
||||
fn init_and_check() ? {
|
||||
vexe := @VEXE
|
||||
os.execute_or_exit('$vexe init')
|
||||
os.execute_or_exit('${os.quoted_path(@VEXE)} init')
|
||||
|
||||
assert os.read_file('vcreate_test.v') ? == [
|
||||
assert os.read_file('vcreate_test.v')? == [
|
||||
'module main\n',
|
||||
'fn main() {',
|
||||
" println('Hello World!')",
|
||||
|
@ -14,7 +13,7 @@ fn init_and_check() ? {
|
|||
'',
|
||||
].join_lines()
|
||||
|
||||
assert os.read_file('v.mod') ? == [
|
||||
assert os.read_file('v.mod')? == [
|
||||
'Module {',
|
||||
" name: 'vcreate_test'",
|
||||
" description: ''",
|
||||
|
@ -25,7 +24,7 @@ fn init_and_check() ? {
|
|||
'',
|
||||
].join_lines()
|
||||
|
||||
assert os.read_file('.gitignore') ? == [
|
||||
assert os.read_file('.gitignore')? == [
|
||||
'# Binaries for programs and plugins',
|
||||
'main',
|
||||
'vcreate_test',
|
||||
|
@ -38,9 +37,24 @@ fn init_and_check() ? {
|
|||
'',
|
||||
].join_lines()
|
||||
|
||||
assert os.read_file('.gitattributes') ? == [
|
||||
assert os.read_file('.gitattributes')? == [
|
||||
'*.v linguist-language=V text=auto eol=lf',
|
||||
'*.vv linguist-language=V text=auto eol=lf',
|
||||
'*.vsh linguist-language=V text=auto eol=lf',
|
||||
'**/v.mod linguist-language=V text=auto eol=lf',
|
||||
'',
|
||||
].join_lines()
|
||||
|
||||
assert os.read_file('.editorconfig')? == [
|
||||
'[*]',
|
||||
'charset = utf-8',
|
||||
'end_of_line = lf',
|
||||
'insert_final_newline = true',
|
||||
'trim_trailing_whitespace = true',
|
||||
'',
|
||||
'[*.v]',
|
||||
'indent_style = tab',
|
||||
'indent_size = 4',
|
||||
'',
|
||||
].join_lines()
|
||||
}
|
||||
|
@ -52,9 +66,9 @@ fn test_v_init() ? {
|
|||
defer {
|
||||
os.rmdir_all(dir) or {}
|
||||
}
|
||||
os.chdir(dir) ?
|
||||
os.chdir(dir)?
|
||||
|
||||
init_and_check() ?
|
||||
init_and_check()?
|
||||
}
|
||||
|
||||
fn test_v_init_in_git_dir() ? {
|
||||
|
@ -64,23 +78,51 @@ fn test_v_init_in_git_dir() ? {
|
|||
defer {
|
||||
os.rmdir_all(dir) or {}
|
||||
}
|
||||
os.chdir(dir) ?
|
||||
os.chdir(dir)?
|
||||
os.execute_or_exit('git init .')
|
||||
init_and_check() ?
|
||||
init_and_check()?
|
||||
}
|
||||
|
||||
fn test_v_init_no_overwrite_gitignore() ? {
|
||||
dir := os.join_path(os.temp_dir(), test_path)
|
||||
os.rmdir_all(dir) or {}
|
||||
os.mkdir(dir) or {}
|
||||
os.write_file('$dir/.gitignore', 'blah') ?
|
||||
os.write_file('$dir/.gitignore', 'blah')?
|
||||
defer {
|
||||
os.rmdir_all(dir) or {}
|
||||
}
|
||||
os.chdir(dir) ?
|
||||
os.chdir(dir)?
|
||||
|
||||
vexe := @VEXE
|
||||
os.execute_or_exit('$vexe init')
|
||||
os.execute_or_exit('${os.quoted_path(@VEXE)} init')
|
||||
|
||||
assert os.read_file('.gitignore') ? == 'blah'
|
||||
assert os.read_file('.gitignore')? == 'blah'
|
||||
}
|
||||
|
||||
fn test_v_init_no_overwrite_gitattributes_and_editorconfig() ? {
|
||||
git_attributes_content := '*.v linguist-language=V text=auto eol=lf'
|
||||
editor_config_content := '[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.v]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
'
|
||||
|
||||
dir := os.join_path(os.temp_dir(), test_path)
|
||||
os.rmdir_all(dir) or {}
|
||||
os.mkdir(dir) or {}
|
||||
os.write_file('$dir/.gitattributes', git_attributes_content)?
|
||||
os.write_file('$dir/.editorconfig', editor_config_content)?
|
||||
defer {
|
||||
os.rmdir_all(dir) or {}
|
||||
}
|
||||
os.chdir(dir)?
|
||||
|
||||
os.execute_or_exit('${os.quoted_path(@VEXE)} init')
|
||||
|
||||
assert os.read_file('.gitattributes')? == git_attributes_content
|
||||
assert os.read_file('.editorconfig')? == editor_config_content
|
||||
}
|
||||
|
|
|
@ -12,70 +12,13 @@ import v.doc
|
|||
import v.pref
|
||||
|
||||
const (
|
||||
css_js_assets = ['doc.css', 'normalize.css', 'doc.js', 'dark-mode.js']
|
||||
res_path = os.resource_abs_path('resources')
|
||||
favicons_path = os.join_path(res_path, 'favicons')
|
||||
link_svg = '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>'
|
||||
html_content = '<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="x-ua-compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ title }} | vdoc</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono&display=swap" rel="stylesheet">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
|
||||
<link rel="manifest" href="site.webmanifest">
|
||||
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
{{ head_assets }}
|
||||
</head>
|
||||
<body>
|
||||
<div><a id="skip-to-content-link" href="#main-content">Skip to content</a></div>
|
||||
<div id="page">
|
||||
<header class="doc-nav hidden">
|
||||
<div class="heading-container">
|
||||
<div class="heading">
|
||||
<div class="info">
|
||||
<div class="module">{{ head_name }}</div>
|
||||
<div class="toggle-version-container">
|
||||
<span>{{ version }}</span>
|
||||
<div id="dark-mode-toggle" role="switch" aria-checked="false" aria-label="Toggle dark mode">{{ light_icon }}{{ dark_icon }}</div>
|
||||
</div>
|
||||
{{ menu_icon }}
|
||||
</div>
|
||||
<input type="text" id="search" placeholder="Search... (beta)" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<nav class="search hidden"></nav>
|
||||
<nav class="content hidden">
|
||||
<ul>
|
||||
{{ toc_links }}
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="doc-scrollview" id="main-content">
|
||||
<div class="doc-container">
|
||||
<div class="doc-content">
|
||||
{{ contents }}
|
||||
<div class="footer">
|
||||
{{ footer_content }}
|
||||
</div>
|
||||
</div>
|
||||
{{ right_content }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer_assets }}
|
||||
<script async src="search_index.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>'
|
||||
css_js_assets = ['doc.css', 'normalize.css', 'doc.js', 'dark-mode.js']
|
||||
default_theme = os.resource_abs_path('theme')
|
||||
link_svg = '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>'
|
||||
|
||||
single_quote = "'"
|
||||
double_quote = '"'
|
||||
no_quotes_replacement = [single_quote, '', double_quote, '']
|
||||
)
|
||||
|
||||
enum HighlightTokenTyp {
|
||||
|
@ -150,7 +93,7 @@ fn (mut vd VDoc) render_static_html(out Output) {
|
|||
|
||||
fn (vd VDoc) get_resource(name string, out Output) string {
|
||||
cfg := vd.cfg
|
||||
path := os.join_path(res_path, name)
|
||||
path := os.join_path(cfg.theme_dir, name)
|
||||
mut res := os.read_file(path) or { panic('vdoc: could not read $path') }
|
||||
/*
|
||||
if minify {
|
||||
|
@ -254,7 +197,8 @@ fn (vd VDoc) gen_html(d doc.Doc) string {
|
|||
write_toc(cn, mut symbols_toc)
|
||||
} // write head
|
||||
// write css
|
||||
version := if vd.manifest.version.len != 0 { vd.manifest.version } else { '' }
|
||||
mut version := if vd.manifest.version.len != 0 { vd.manifest.version } else { '' }
|
||||
version = [version, @VHASH].join(' ')
|
||||
header_name := if cfg.is_multi && vd.docs.len > 1 {
|
||||
os.file_name(os.real_path(cfg.input_path))
|
||||
} else {
|
||||
|
@ -300,8 +244,9 @@ fn (vd VDoc) gen_html(d doc.Doc) string {
|
|||
}
|
||||
modules_toc_str := modules_toc.str()
|
||||
symbols_toc_str := symbols_toc.str()
|
||||
result := html_content.replace('{{ title }}', d.head.name).replace('{{ head_name }}',
|
||||
header_name).replace('{{ version }}', version).replace('{{ light_icon }}', vd.assets['light_icon']).replace('{{ dark_icon }}',
|
||||
result := (os.read_file(os.join_path(cfg.theme_dir, 'index.html')) or { panic(err) }).replace('{{ title }}',
|
||||
d.head.name).replace('{{ head_name }}', header_name).replace('{{ version }}',
|
||||
version).replace('{{ light_icon }}', vd.assets['light_icon']).replace('{{ dark_icon }}',
|
||||
vd.assets['dark_icon']).replace('{{ menu_icon }}', vd.assets['menu_icon']).replace('{{ head_assets }}',
|
||||
if cfg.inline_assets {
|
||||
'\n${tabs[0]}<style>' + vd.assets['doc_css'] + '</style>\n${tabs[0]}<style>' +
|
||||
|
@ -357,6 +302,8 @@ fn html_highlight(code string, tb &ast.Table) string {
|
|||
"'$tok.lit'"
|
||||
} else if typ == .char {
|
||||
'`$tok.lit`'
|
||||
} else if typ == .comment {
|
||||
if tok.lit != '' && tok.lit[0] == 1 { '//${tok.lit[1..]}' } else { '//$tok.lit' }
|
||||
} else {
|
||||
tok.lit
|
||||
}
|
||||
|
@ -379,7 +326,8 @@ fn html_highlight(code string, tb &ast.Table) string {
|
|||
tok_typ = .builtin
|
||||
} else if next_tok.kind == .lcbr {
|
||||
tok_typ = .symbol
|
||||
} else if next_tok.kind == .lpar {
|
||||
} else if next_tok.kind == .lpar || (!tok.lit[0].is_capital()
|
||||
&& next_tok.kind == .lt && next_tok.pos == tok.pos + tok.lit.len) {
|
||||
tok_typ = .function
|
||||
} else {
|
||||
tok_typ = .name
|
||||
|
@ -400,14 +348,15 @@ fn html_highlight(code string, tb &ast.Table) string {
|
|||
.key_true, .key_false {
|
||||
tok_typ = .boolean
|
||||
}
|
||||
.lpar, .lcbr, .rpar, .rcbr, .lsbr, .rsbr, .semicolon, .colon, .comma, .dot {
|
||||
.lpar, .lcbr, .rpar, .rcbr, .lsbr, .rsbr, .semicolon, .colon, .comma, .dot,
|
||||
.dotdot, .ellipsis {
|
||||
tok_typ = .punctuation
|
||||
}
|
||||
else {
|
||||
if token.is_key(tok.lit) || token.is_decl(tok.kind) {
|
||||
tok_typ = .keyword
|
||||
} else if tok.kind == .decl_assign || tok.kind.is_assign() || tok.is_unary()
|
||||
|| tok.kind.is_relational() || tok.kind.is_infix() {
|
||||
|| tok.kind.is_relational() || tok.kind.is_infix() || tok.kind.is_postfix() {
|
||||
tok_typ = .operator
|
||||
}
|
||||
}
|
||||
|
@ -421,7 +370,7 @@ fn html_highlight(code string, tb &ast.Table) string {
|
|||
break
|
||||
}
|
||||
} else {
|
||||
buf.write_b(code[i])
|
||||
buf.write_u8(code[i])
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
@ -444,8 +393,9 @@ fn doc_node_html(dn doc.DocNode, link string, head bool, include_examples bool,
|
|||
highlighted_code := html_highlight(dn.content, tb)
|
||||
node_class := if dn.kind == .const_group { ' const' } else { '' }
|
||||
sym_name := get_sym_name(dn)
|
||||
has_deprecated := 'deprecated' in dn.tags
|
||||
mut tags := dn.tags.filter(it != 'deprecated')
|
||||
mut deprecated_tags := dn.tags.filter(it.starts_with('deprecated'))
|
||||
deprecated_tags.sort()
|
||||
mut tags := dn.tags.filter(!it.starts_with('deprecated'))
|
||||
tags.sort()
|
||||
mut node_id := get_node_id(dn)
|
||||
mut hash_link := if !head { ' <a href="#$node_id">#</a>' } else { '' }
|
||||
|
@ -465,13 +415,12 @@ fn doc_node_html(dn doc.DocNode, link string, head bool, include_examples bool,
|
|||
}
|
||||
dnw.write_string('</div>')
|
||||
}
|
||||
if tags.len > 0 || has_deprecated {
|
||||
mut attributes := if has_deprecated {
|
||||
'<div class="attribute attribute-deprecated">deprecated</div>'
|
||||
} else {
|
||||
''
|
||||
}
|
||||
attributes += tags.map('<div class="attribute">$it</div>').join('')
|
||||
if deprecated_tags.len > 0 {
|
||||
attributes := deprecated_tags.map('<div class="attribute attribute-deprecated">${no_quotes(it)}</div>').join('')
|
||||
dnw.writeln('<div class="attributes">$attributes</div>')
|
||||
}
|
||||
if tags.len > 0 {
|
||||
attributes := tags.map('<div class="attribute">$it</div>').join('')
|
||||
dnw.writeln('<div class="attributes">$attributes</div>')
|
||||
}
|
||||
if !head && dn.content.len > 0 {
|
||||
|
@ -485,8 +434,8 @@ fn doc_node_html(dn doc.DocNode, link string, head bool, include_examples bool,
|
|||
example_title := if examples.len > 1 { 'Examples' } else { 'Example' }
|
||||
dnw.writeln('<section class="doc-node examples"><h4>$example_title</h4>')
|
||||
for example in examples {
|
||||
// hl_example := html_highlight(example, tb)
|
||||
dnw.writeln('<pre><code class="language-v">$example</code></pre>')
|
||||
hl_example := html_highlight(example, tb)
|
||||
dnw.writeln('<pre><code class="language-v">$hl_example</code></pre>')
|
||||
}
|
||||
dnw.writeln('</section>')
|
||||
}
|
||||
|
@ -553,3 +502,7 @@ fn write_toc(dn doc.DocNode, mut toc strings.Builder) {
|
|||
}
|
||||
toc.writeln('</li>')
|
||||
}
|
||||
|
||||
fn no_quotes(s string) string {
|
||||
return s.replace_each(no_quotes_replacement)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
module main
|
||||
|
||||
const (
|
||||
source_root = 'temp'
|
||||
source_root = 'temp' // some const
|
||||
another = int(5) //
|
||||
)
|
||||
const (
|
||||
windowpos_undefined_mask = C.SDL_WINDOWPOS_UNDEFINED_MASK // 0x1FFF0000u
|
||||
windowpos_undefined = C.SDL_WINDOWPOS_UNDEFINED //
|
||||
)
|
||||
Used to indicate that you don't care what the window position is.
|
||||
fn funky()
|
||||
funky - comment for function below
|
||||
funky - comment for function below
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
module main
|
||||
|
||||
const (
|
||||
source_root = 'temp'
|
||||
source_root = 'temp' // some const
|
||||
another = int(5) //
|
||||
)
|
||||
fn funky()
|
||||
const (
|
||||
windowpos_undefined_mask = C.SDL_WINDOWPOS_UNDEFINED_MASK // 0x1FFF0000u
|
||||
windowpos_undefined = C.SDL_WINDOWPOS_UNDEFINED //
|
||||
)
|
||||
fn funky()
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
pub const (
|
||||
source_root = 'temp'
|
||||
source_root = 'temp' // some const
|
||||
another = int(5) //
|
||||
)
|
||||
|
||||
// Used to indicate that you don't care what the window position is.
|
||||
pub const (
|
||||
windowpos_undefined_mask = C.SDL_WINDOWPOS_UNDEFINED_MASK // 0x1FFF0000u
|
||||
windowpos_undefined = C.SDL_WINDOWPOS_UNDEFINED //
|
||||
)
|
||||
|
||||
// funky - comment for function below
|
||||
|
|
|
@ -16,7 +16,7 @@ fn find_diff_cmd() string {
|
|||
|
||||
fn test_vet() ? {
|
||||
os.setenv('VCOLORS', 'never', true)
|
||||
os.chdir(vroot) ?
|
||||
os.chdir(vroot)?
|
||||
test_dir := 'cmd/tools/vdoc/tests/testdata'
|
||||
main_files := get_main_files_in_dir(test_dir)
|
||||
fails := check_path(vexe, test_dir, main_files)
|
||||
|
@ -35,7 +35,7 @@ fn check_path(vexe string, dir string, tests []string) int {
|
|||
for path in paths {
|
||||
program := path
|
||||
print(path + ' ')
|
||||
res := os.execute('$vexe doc $program')
|
||||
res := os.execute('${os.quoted_path(vexe)} doc ${os.quoted_path(program)}')
|
||||
if res.exit_code < 0 {
|
||||
panic(res.output)
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ fn check_path(vexe string, dir string, tests []string) int {
|
|||
print_compare(expected, found)
|
||||
}
|
||||
|
||||
res_comments := os.execute('$vexe doc -comments $program')
|
||||
res_comments := os.execute('${os.quoted_path(vexe)} doc -comments ${os.quoted_path(program)}')
|
||||
if res_comments.exit_code < 0 {
|
||||
panic(res_comments.output)
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 175 B After Width: | Height: | Size: 175 B |
Before Width: | Height: | Size: 642 B After Width: | Height: | Size: 642 B |
|
@ -24,18 +24,18 @@
|
|||
--menu-search-badge-background-hover-color: #0000004d;
|
||||
--toc-text-color: #2779bd;
|
||||
--toc-indicator-color: #4299e1;
|
||||
--code-default-text-color: #5c6e74;
|
||||
--code-default-text-color: #2c3e64;
|
||||
--code-background-color: #edf2f7;
|
||||
--code-keyword-text-color: #2b6cb0;
|
||||
--code-builtin-text-color: #0a0a0a;
|
||||
--code-function-text-color: #319795;
|
||||
--code-builtin-text-color: #219321;
|
||||
--code-function-text-color: #288341;
|
||||
--code-comment-text-color: #93a1a1;
|
||||
--code-punctuation-text-color: #999999;
|
||||
--code-punctuation-text-color: #696969;
|
||||
--code-symbol-text-color: #702459;
|
||||
--code-operator-text-color: #a67f59;
|
||||
--code-operator-text-color: #864f29;
|
||||
--attribute-deprecated-background-color: #f59f0b48;
|
||||
--attribute-deprecated-text-color: #92400e;
|
||||
--attribute-text-color: #000000af;
|
||||
--attribute-text-color: #000000cf;
|
||||
}
|
||||
:root.dark .dark-icon {
|
||||
display: none;
|
||||
|
@ -76,6 +76,7 @@
|
|||
--code-comment-text-color: #a0aec0;
|
||||
--code-punctuation-text-color: #a0aec0;
|
||||
--code-symbol-text-color: #ed64a6;
|
||||
--code-operator-text-color: #a67f59;
|
||||
--attribute-background-color: #ffffff20;
|
||||
--attribute-text-color: #ffffffaf;
|
||||
--attribute-deprecated-text-color: #fef3c7;
|
||||
|
@ -417,6 +418,8 @@ body {
|
|||
background-color: var(--code-background-color);
|
||||
color: var(--attribute-text-color);
|
||||
margin-right: 0.8rem;
|
||||
font-family: "Jetbrains Mono", monospace;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.doc-content > .doc-node > .attributes > .attribute-deprecated {
|
||||
background-color: var(--attribute-deprecated-background-color);
|
||||
|
@ -612,6 +615,7 @@ pre {
|
|||
.token.keyword {
|
||||
color: #2b6cb0;
|
||||
color: var(--code-keyword-text-color);
|
||||
font-weight: bold;
|
||||
}
|
||||
.token.function {
|
||||
color: #319795;
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 853 B After Width: | Height: | Size: 853 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
@ -0,0 +1,63 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="x-ua-compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ title }} | vdoc</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono&display=swap" rel="stylesheet">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
|
||||
<link rel="manifest" href="site.webmanifest">
|
||||
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
{{ head_assets }}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div><a id="skip-to-content-link" href="#main-content">Skip to content</a></div>
|
||||
<div id="page">
|
||||
<header class="doc-nav hidden">
|
||||
<div class="heading-container">
|
||||
<div class="heading">
|
||||
<div class="info">
|
||||
<div class="module">{{ head_name }}</div>
|
||||
<div class="toggle-version-container">
|
||||
<span>{{ version }}</span>
|
||||
<div id="dark-mode-toggle" role="switch" aria-checked="false" aria-label="Toggle dark mode">{{ light_icon }}{{ dark_icon }}</div>
|
||||
</div>
|
||||
{{ menu_icon }}
|
||||
</div>
|
||||
<input type="text" id="search" placeholder="Search... (beta)" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<nav class="search hidden"></nav>
|
||||
<nav class="content hidden">
|
||||
<ul>
|
||||
{{ toc_links }}
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="doc-scrollview" id="main-content">
|
||||
<div class="doc-container">
|
||||
<div class="doc-content">
|
||||
{{ contents }}
|
||||
<div class="footer">
|
||||
{{ footer_content }}
|
||||
</div>
|
||||
</div>
|
||||
{{ right_content }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer_assets }}
|
||||
<script async src="search_index.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 499 B |
Before Width: | Height: | Size: 350 B After Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |