Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 400
    • Issues 400
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !420

Improve pragma safe

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Quinten Cabo requested to merge pragma-safe-improvements into develop Jun 15, 2025
  • Overview 0
  • Commits 17
  • Changes 32

This mr improves the parsing of pragma and brings it inline with the current grammer specification.

  • Move #pragma safe for blocks to the start of the block instead of behind. You now write:
{ #pragma safe

}
  • Add #pragma safe to the with loop scope, this is the same as block but it is parsed and traversed separately.
with {
        #pragma safe // this is new and is a shortcut for marking ccc is safe
        ([0] <= [i] < [ccc(15)]): arr[i];
    } : fold(+, 0) // But not a shortcut for the plus!
  • Improve parse error when you try to mark an infix function as safe (#2496 (closed))
  • Improve the printing of pragma safe
Edited Jun 16, 2025 by Quinten Cabo
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: pragma-safe-improvements