From: Jérémie Astor Date: Wed, 18 May 2022 20:02:38 +0000 (+0200) Subject: Squashed commit of the following: X-Git-Tag: nightly~269 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=1dd15a1997b6807ae7312454f8bb47ab223f0e89;p=gwion.git Squashed commit of the following: commit 5dc4428bb64710981abce3ea26aa9b4506a9894b Author: Jérémie Astor Date: Wed May 18 22:02:11 2022 +0200 Update commit e2a2f631d43eb9f609944f6787e46cde20baf8d2 Author: Jérémie Astor Date: Tue May 17 15:13:28 2022 +0200 :art: signature parser commit 93e516b527630549436aee29088886850df76cae Author: Jérémie Astor Date: Tue May 17 11:10:20 2022 +0200 :art: Update plugs commit 5a930ae1a16b357127c063d0a66785dec901f347 Author: Jérémie Astor Date: Mon May 16 21:20:48 2022 +0200 clean commit 66de1087b9e3bdcf3c92ea0776717f99eab5cf00 Author: Jérémie Astor Date: Mon May 16 17:47:44 2022 +0200 :art: Fix STK commit ac2dd499de7518877a899e04c19ad026f5dffead Author: Jérémie Astor Date: Mon May 16 10:00:20 2022 +0200 :art: Remove @internal commit db23a57694366d5a4fff3017eaeb1846e967e73c Author: Jérémie Astor Date: Mon May 16 00:52:03 2022 +0200 :wrench: Test ctor commit d2e474f11071f5d1f08b6df2b9cd6199b8ba3ca5 Author: Jérémie Astor Date: Mon May 16 00:51:36 2022 +0200 :art: Improve Evdev commit 3fa05203d33996069d7a0696156ea49a3b68ca07 Author: Jérémie Astor Date: Sun May 15 20:50:09 2022 +0200 :art: Improve return handling commit fc66a973244c84d6c38aedc1ae749c4a3c7baf74 Author: Jérémie Astor Date: Sun May 15 20:28:10 2022 +0200 :bug: Fix uncurry commit 38445380d1e0428e738784e7990db3c1180d79a9 Author: Jérémie Astor Date: Sun May 15 18:44:33 2022 +0200 :art: Improve gack not printing error commit 94cfcdeb81452b4406442a674e625bd530bdc997 Author: Jérémie Astor Date: Sun May 15 18:44:02 2022 +0200 clean commit 2acff6c9b459b413a5a08b9ce4e652f2bcfd71cf Author: Jérémie Astor Date: Sun May 15 16:16:53 2022 +0200 :art: error if @gack does not print anything commit 2098cc4b6620b2b782ab1d44385b9b126f10f26d Author: Jérémie Astor Date: Sat May 14 15:43:31 2022 +0200 :art: Use is_func commit 8488df8795458f2a9ab038cfceef6ed76f0b57dd Author: Jérémie Astor Date: Sat May 14 01:21:37 2022 +0200 :wrench: Improve git recursive warning commit 1b80ef7f6950d1a8c9b692f9d75a4ca3392793d3 Merge: b4fff0a1 5f203eb7 Author: Jérémie Astor Date: Sat May 14 01:20:23 2022 +0200 Merge branch 'master' into dev commit b4fff0a1fd2ccb60e5debac63d1c6f165c6b1aa7 Author: Jérémie Astor Date: Sat May 14 01:20:16 2022 +0200 Revert ":wrench: Fix Makefile for CMD" This reverts commit 63e807d3b83d771749304fff3c40df13a39b9e51. commit 63e807d3b83d771749304fff3c40df13a39b9e51 Author: Jérémie Astor Date: Fri May 13 20:49:29 2022 +0200 :wrench: Fix Makefile for CMD commit d4cd99fd262216cc56b7e3c625c93d425ca95935 Author: Jérémie Astor Date: Fri May 13 17:48:13 2022 +0200 :bug: Fix perform in recursive funcs commit 7dbaa330e23648be41f3bea296306d9236ac3479 Author: Jérémie Astor Date: Fri May 13 16:37:56 2022 +0200 :art: test chuck_rewrite commit 87e4ce72d5777c42ce2430d0af933cbbd7ca7489 Author: Jérémie Astor Date: Fri May 13 16:37:42 2022 +0200 :art: Improve local error commit 8da844a7def70f62b612d5aaf9e053a97d9ef5c5 Author: Jérémie Astor Date: Fri May 13 15:57:11 2022 +0200 :art: Uncurry commit 220747ee19587f72b3e88ef4b3149ca197f818f5 Author: Jérémie Astor Date: Fri May 13 15:56:43 2022 +0200 :art: improve enum gack commit 700c827f79fdada656444055061175ed7157ac72 Author: Jérémie Astor Date: Fri May 13 11:04:19 2022 +0200 :bug: Fix constant fold code commit 2c68d7bc3bfe1d937f1113fab8c32e271bb93eec Author: Jérémie Astor Date: Thu May 12 22:46:12 2022 +0200 :art: Update BMI again commit 13857cef34584c99850385529ed7dfae5c915330 Author: Jérémie Astor Date: Thu May 12 22:12:25 2022 +0200 :bug: Add # and b to locales commit 1bc571823dd89b98d9ef31b42aab8337a0e93051 Author: Jérémie Astor Date: Thu May 12 22:09:09 2022 +0200 :bug fix partial ambiguity commit dfbd2753b29346712327075fac2579804ac52a6d Author: Jérémie Astor Date: Thu May 12 21:43:34 2022 +0200 :art: More on BMI commit 452ead875cbc8110dc6e138c37727e22fd31fd4c Author: Jérémie Astor Date: Thu May 12 20:56:58 2022 +0200 :bug: Fix locale exp lexing commit 670e633d00d849f9bdad39a40e104e573752cfdf Author: Jérémie Astor Date: Thu May 12 20:56:12 2022 +0200 :bug: Fix builtin static item access commit b812ca6f259c7b54036857d031def6da8eb2bac3 Author: Jérémie Astor Date: Thu May 12 20:55:36 2022 +0200 :bug: Use full path in ref_type commit 8dc08c4408c718478820d5125847af391ac76648 Author: Jérémie Astor Date: Wed May 11 20:34:39 2022 +0200 :wrench: Make install target more POSIX compliant commit 79d2c30999068ebe50aa322bbb6a5eaca5c4e3cd Author: Jérémie Astor Date: Wed May 11 20:33:53 2022 +0200 :bug: Abort compilation on locale error commit 1e347817dc39c6a4df44aa5cf888819a554360b0 Author: Jérémie Astor Date: Wed May 11 20:32:51 2022 +0200 :bug: Fix signature's storage commit 05ce38003f130daed1cf7c9eb297e8ae64f70751 Author: Jérémie Astor Date: Wed May 11 20:29:34 2022 +0200 :art: Allow complex => rewrites. Thanks Mort :) commit 50cd3d1e7ff9a947b77bbb5367fd3f01027f3058 Author: Jérémie Astor Date: Wed May 11 20:18:35 2022 +0200 :art: Use constructors for SinOsc yet mark the type as non abstract to allow var SinOsc foo and new SinOsc commit 71da7adff210a9323ee8e1e516f775b1a5c3b5f9 Author: Jérémie Astor Date: Tue May 10 21:06:24 2022 +0200 :art: Update soundpipe commit 375fc2720a064801856a82d6339e05bca466b5d1 Author: Jérémie Astor Date: Tue May 10 17:04:21 2022 +0200 :bug: fix char usage commit ec01b6ed6e57f62dc99ab4b3ebb2f7820a54d49c Author: Jérémie Astor Date: Mon May 9 14:04:37 2022 +0200 :art: Improve vm cleaning and fptr type check commit e03c0c19094c810a195b923cc9cd4880717eb815 Author: Jérémie Astor Date: Fri May 6 13:35:54 2022 +0200 :art: Improve resolve security --- diff --git a/.all-contributorsrc b/.all-contributorsrc deleted file mode 100644 index 3243955f..00000000 --- a/.all-contributorsrc +++ /dev/null @@ -1,171 +0,0 @@ -{ - "files": [ - "README.md" - ], - "imageSize": 100, - "commit": false, - "contributors": [ - { - "login": "PaulBatchelor", - "name": "Paul Batchelor", - "avatar_url": "https://avatars3.githubusercontent.com/u/8139389?v=4", - "profile": "http://paulbatchelor.github.io", - "contributions": [ - "question", - "bug", - "code", - "ideas" - ] - }, - { - "login": "originalsouth", - "name": "Benny", - "avatar_url": "https://avatars1.githubusercontent.com/u/5300799?v=4", - "profile": "https://github.com/originalsouth", - "contributions": [ - "question", - "bug", - "code" - ] - }, - { - "login": "scalarwaves", - "name": "Andrew Prentice", - "avatar_url": "https://avatars1.githubusercontent.com/u/4212896?v=4", - "profile": "https://github.com/scalarwaves", - "contributions": [ - "question", - "bug", - "code", - "ideas" - ] - }, - { - "login": "Aleserche", - "name": "aleserche", - "avatar_url": "https://avatars3.githubusercontent.com/u/2920837?v=4", - "profile": "https://github.com/Aleserche", - "contributions": [ - "code" - ] - }, - { - "login": "Pranav2612000", - "name": "Pranav Joglekar", - "avatar_url": "https://avatars3.githubusercontent.com/u/20909078?v=4", - "profile": "https://github.com/Pranav2612000", - "contributions": [ - "userTesting", - "doc" - ] - }, - { - "login": "amberisvibin", - "name": "Amber", - "avatar_url": "https://avatars3.githubusercontent.com/u/63863236?v=4", - "profile": "http://dev.to/amberisvibin", - "contributions": [ - "question", - "doc", - "ideas" - ] - }, - { - "login": "TotallyNotChase", - "name": "Chase", - "avatar_url": "https://avatars0.githubusercontent.com/u/44284917?v=4", - "profile": "https://github.com/TotallyNotChase", - "contributions": [ - "code" - ] - }, - { - "login": "nithin-pankaj", - "name": "Nithin Pankaj", - "avatar_url": "https://avatars2.githubusercontent.com/u/15152472?v=4", - "profile": "https://github.com/nithin-pankaj", - "contributions": [ - "code" - ] - }, - { - "login": "evayde", - "name": "Enrico Gruner", - "avatar_url": "https://avatars1.githubusercontent.com/u/25255815?v=4", - "profile": "https://github.com/evayde", - "contributions": [ - "code" - ] - }, - { - "login": "umer2001", - "name": "Muhammad Umer Farooq", - "avatar_url": "https://avatars2.githubusercontent.com/u/35496058?v=4", - "profile": "https://github.com/umer2001", - "contributions": [ - "code" - ] - }, - { - "login": "a", - "name": "Shuvalov Anton", - "avatar_url": "https://avatars2.githubusercontent.com/u/1410106?v=4", - "profile": "http://shuvalov.info", - "contributions": [ - "doc" - ] - }, - { - "login": "ry-v1", - "name": "ry-v1", - "avatar_url": "https://avatars1.githubusercontent.com/u/72290009?v=4", - "profile": "https://github.com/ry-v1", - "contributions": [ - "doc" - ] - }, - { - "login": "deekts", - "name": "deekts", - "avatar_url": "https://avatars0.githubusercontent.com/u/51462833?v=4", - "profile": "https://github.com/deekts", - "contributions": [ - "code" - ] - }, - { - "login": "forrcaho", - "name": "Forrest Cahoon", - "avatar_url": "https://avatars3.githubusercontent.com/u/492742?v=4", - "profile": "https://github.com/forrcaho", - "contributions": [ - "ideas" - ] - }, - { - "login": "SenorGrande", - "name": "Connor Hewett", - "avatar_url": "https://avatars2.githubusercontent.com/u/22025776?v=4", - "profile": "https://github.com/SenorGrande", - "contributions": [ - "code" - ] - } - { - "login": "euppal", - "name": "Ethan Uppal", - "avatar_url": "https://avatars2.githubusercontent.com/u/?v=67026187?v=4", - "profile": "https://github.com/euppal", - "contributions": [ - "ideas" - ] - } - ], - "contributorsPerLine": 7, - "badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg)](#contributors)", - "projectName": "Gwion", - "projectOwner": "fennecdjay", - "repoType": "github", - "repoHost": "https://github.com", - "skipCi": true -} diff --git a/plug b/plug index c9d54806..2377a71d 160000 --- a/plug +++ b/plug @@ -1 +1 @@ -Subproject commit c9d548067f33207ba9b92eda3b9699498752ba65 +Subproject commit 2377a71db5f6a711ee2eedbd074f013863694ec8 diff --git a/src/import/import_checker.c b/src/import/import_checker.c index 14e615eb..d2c47714 100644 --- a/src/import/import_checker.c +++ b/src/import/import_checker.c @@ -167,8 +167,67 @@ ANN static inline uint get_n(struct td_checker *tdc, const char c) { return n; } +ANN static Arg_List fptr_args(const Gwion gwion, struct td_checker *tdc) { + if(tdc->str[1] == ')') + return NULL; + Arg_List args = new_mp_vector(gwion->mp, sizeof(Arg), 0); + do { + Type_Decl *td = _str2td(gwion, tdc); + if(!td) { + free_arg_list(gwion->mp, args); + return (Arg_List)GW_ERROR; + } + mp_vector_add(gwion->mp, &args, Arg, (Arg){ .td = td }); + } while(*tdc->str == ',' && tdc->str++); + return args; +} + +ANN static Type_Decl *str2td_fptr(const Gwion gwion, struct td_checker *tdc) { + const m_str base = tdc->str; + tdc->str++; + Type_Decl *const ret_td = _str2td(gwion, tdc); + const Type_List tl = td_tmpl(gwion, tdc); + if (tl == (Type_List)GW_ERROR) { + free_type_decl(gwion->mp, ret_td); + return NULL; + } + const uint option = get_n(tdc, '?'); + tdc->str++; + Arg_List args = fptr_args(gwion, tdc); + if (args == (Arg_List)GW_ERROR) { + if(tl) free_type_list(gwion->mp, tl); + free_type_decl(gwion->mp, ret_td); + return NULL; + } + if(tdc->str[0] != ')' || tdc->str[1] != ')') { + if(tl) free_type_list(gwion->mp, tl); + if(args) free_arg_list(gwion->mp, args); + return NULL; + } + tdc->str += 2; + struct AC ac = {.str = tdc->str, .pos = tdc->pos}; + if(ac_run(gwion, &ac) < 0 ) { + if(tl) free_type_list(gwion->mp, tl); + if(args) free_arg_list(gwion->mp, args); + return NULL; + } + Func_Base *fbase = new_func_base(gwion->mp, ret_td, insert_symbol(gwion->st, base), args, ae_flag_none, tdc->pos); + const Fptr_Def fptr = new_fptr_def(gwion->mp, fbase); + Type_Decl *td = new_type_decl(gwion->mp, insert_symbol(gwion->st, base), tdc->pos); + td->fptr = fptr; + if (ac.depth) td->array = mk_array(gwion->mp, &ac); + tdc->str = ac.str; + td->option = option; + return td; +} + ANN static Type_Decl *_str2td(const Gwion gwion, struct td_checker *tdc) { const uint ref = get_n(tdc, '&'); + if(*tdc->str == '(') { + Type_Decl *const td = str2td_fptr(gwion, tdc); + td->ref = ref; + return td; + } DECL_OO(const Symbol, sym, = __str2sym(gwion, tdc)); struct AC ac = {.str = tdc->str, .pos = tdc->pos}; CHECK_BO(ac_run(gwion, &ac));