Skip to content

Add support for function attributes - #338

Merged
jeparlefrancais merged 7 commits into
mainfrom
ast-attributes
Feb 20, 2026
Merged

jeparlefrancais merged 7 commits into
mainfrom
ast-attributes

Conversation

@jeparlefrancais

@jeparlefrancais jeparlefrancais commented Feb 1, 2026 •

Copy link
Copy Markdown
Contributor

Related #265

This PR adds support for function attributes 🎉 It includes a bunch of new AST nodes and also a new simple rule to remove attributes from the AST ("remove_attribute").

I went ahead and also included the parameterized function attributes, which as far as I'm aware aren't supported in full-moon yet.

  • add entry to the changelog

@github-actions

github-actions Bot commented Feb 1, 2026

Copy link
Copy Markdown

Coverage after merging ast-attributes into main will be

85.45%

Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines
src
   ast_converter.rs88.42%100%91.23%88.28%1051, 1075, 1095–1097, 1118, 1133–1135, 1183, 1187–1190, 1223, 1243, 1258, 1283, 1321, 1340–1342, 1387, 1421, 1436, 1452–1454, 1464, 1469–1471, 1486–1487, 1506, 1653–1655, 1716–1718, 1769–1771, 1795, 1833–1835, 1863–1865, 1869–1871, 1932–1934, 1959–1961, 1968–1970, 1988–1990, 2014–2016, 2086, 2091–2093, 2113, 2119–2121, 2126–2128, 2153–2155, 2175, 218–220, 2232–2234, 2258–2261, 2291–2293, 2299–2301, 2304–2306, 235–236, 2368–2369, 237, 2370, 2382–2384, 2388–2390, 2404–2405, 2411–2412, 2426–2427, 2455, 2538–2540, 2568–2570, 2591–2593, 2623–2626, 2641–2642, 2645, 265–266, 2669, 267, 2670–2671, 2683–2685, 2705–2707, 2783–2785, 2817, 2832–2838, 3159–3166, 3168–3169, 3171–3172, 3177–3188, 3197, 3199–3201, 3206–3208, 3214, 3240–3242, 3253–3255, 3273–3275, 488–490, 494–496, 513, 547, 608, 624–626, 661–664, 671, 685, 700–702, 706–708, 723–726, 729, 738–740, 781–782, 792–794, 800–802, 845, 870, 965, 969–971, 992
   parser.rs90.63%100%94.12%90.09%24, 32, 576–577, 581, 73–77, 89
src/generator
   dense.rs86.14%100%91.58%85.61%1001–1004, 1010–1017, 1019–1020, 1022, 1024–1032, 1034, 1048, 1065, 1092–1099, 1125–1131, 1145–1147, 1165–1169, 1177, 1186–1187, 1192, 1198, 1207–1215, 1232, 1254, 1267–1270, 1274–1277, 159–160, 162, 176–177, 179, 250, 290–302, 304–310, 312–313, 324–326, 405, 455, 50–53, 546, 55, 57–59, 61–63, 65, 653–655, 66–68, 689, 69, 710, 760, 780, 80, 963
   mod.rs92.28%100%95%92.04%100, 102, 110–115, 422, 438, 442, 92, 94–99
   readable.rs94.86%100%97.22%94.64%1208, 1241–1248, 1250–1251, 1253, 1256, 1258–1266, 1269–1270, 1278–1282, 1307–1311, 1331–1332, 1363, 1416–1418, 1485, 1512, 1542, 182, 187–188, 192, 205–206, 211, 216, 234–235, 311, 455, 48, 50–53, 55, 698–699
   token_based.rs90.54%100%92.09%90.39%1031–1033, 1104–1105, 1114–1115, 1122, 1137, 1142–1146, 1165–1166, 1179–1180, 1201–1202, 1216–1218, 1241–1242, 1251–1253, 1272–1273, 1282–1284, 1335–1340, 139–140, 1494, 156–157, 1591, 1628–1636, 169–170, 1747–1749, 1781–1790, 1835–1841, 1843–1845, 1869, 191–192, 1927, 212–214, 2305–2311, 2313–2323, 2325–2327, 2329, 2333, 2431–2432, 2491–2495, 254, 2750, 2754, 2767, 306–310, 380–381, 387, 399, 425, 462–463, 470–471, 473–480, 483–484, 486–494, 505–512, 568–569, 591–592, 608–609, 651, 740–741, 774–775, 809–810, 872–873, 89, 912–916, 964–968, 985
src/nodes
   attributes.rs39.07%100%44.12%37.92%112–115, 117, 120–123, 125, 130, 137, 141–144, 146, 211–213, 24, 243–245, 25, 253–255, 258–259, 26, 260–261, 264–266, 27, 274–276, 289–293, 297–299, 302–308, 312–314, 316–322, 324, 328–330, 332–338, 340, 37, 393–395, 403–405, 408–410, 413–415, 438–442, 444, 447–451, 453, 455–459, 461, 463–467, 469, 471–475, 477, 481–483, 487–489, 506–509, 511–513, 515, 517–524, 527–531, 533–537, 539, 547–549, 557–559, 567–569, 572–575, 59–61, 64–66, 69–74, 78–80, 82–83
   function_body.rs100%100%100%100%
   literal_expression.rs0%100%0%0%100, 106–108, 112–114, 120–122, 126–129, 133–136, 140–143, 149–151, 157–159, 165–167, 173–175, 179–181, 185–187, 191–193, 197–200, 202, 206–213, 215, 229–234, 237–240, 243–245, 248–254, 257–259, 262–264, 267–269, 272–275, 278–280, 283–285, 288–290, 293–295, 30–31, 311–313, 316–319, 32, 321, 324–327, 329, 331–334, 336, 338–341, 343, 345–348, 350, 354–356, 36, 360–362, 37, 377–379, 38, 380, 383–385, 388–390, 393–395, 398–400, 403–405, 408–410, 413–415, 42, 424–429, 43, 430–434, 436–437, 439, 44, 440, 442–447, 48–50, 52, 54, 60–63, 65–66, 70, 72, 75–78, 80–85, 87–90, 92–94, 96
   mod.rs82.22%100%100%80%114–115, 66–67
src/nodes/expressions
   function.rs78.92%100%79.55%78.77%142, 192–194, 264–266, 285–288, 292–295, 297–310, 312–313, 80–83
src/nodes/statements
   function.rs90.13%100%92.98%89.47%119–121, 230–232, 397–399, 423–426, 430–442
   local_function.rs94.64%100%93.75%94.84%123–125, 142–146, 285–287
src/process
   node_processor.rs93.40%100%93.27%93.52%116, 30–31, 48, 71, 94–95
   post_visitor.rs86.80%100%95.31%85.92%146–147, 149–152, 165–167,

@jeparlefrancais
jeparlefrancais merged commit 8d25b3c into main Feb 20, 2026
@jeparlefrancais
jeparlefrancais deleted the ast-attributes branch February 20, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant