PageSourceSearch

https://noir-lang.org/docs/assets/js/af537c40.7d3c097f.js

js noir-lang.org collected 2026-10-03 22:55:03 UTC 3,585 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkdocs=globalThis.webpackChunkdocs||[]).push([[3980],{67841(e,n,o){o.r(n),o.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>t,toc:()=>m});const t=JSON.parse('{"id":"language/comments","title":"Comments","description":"Learn how to write comments in Noir programming language. A comment is a line of code that is ignored by the compiler, but it can be read by programmers. Single-line and multi-line comments are supported in Noir.","source":"@site/versioned_docs/version-v1.0.0-rc.2/language/comments.md","sourceDirName":"language","slug":"/language/comments","permalink":"/docs/language/comments","draft":false,"unlisted":false,"editUrl":"https://github.com/noir-lang/noir/edit/master/docs/versioned_docs/version-v1.0.0-rc.2/language/comments.md","tags":[],"version":"v1.0.0-rc.2","frontMatter":{"title":"Comments","description":"Learn how to write comments in Noir programming language. A comment is a line of code that is ignored by the compiler, but it can be read by programmers. Single-line and multi-line comments are supported in Noir.","keywords":["Noir programming language","comments","single-line comments","multi-line comments"]},"sidebar":"sidebar","previous":{"title":"Lambdas","permalink":"/docs/language/lambdas"},"next":{"title":"Shadowing","permalink":"/docs/language/shadowing"}}');var i=o(74848),r=o(28453);const s={title:"Comments",description:"Learn how to write comments in Noir programming language. A comment is a line of code that is ignored by the compiler, but it can be read by programmers. Single-line and multi-line comments are supported in Noir.",keywords:["Noir programming language","comments","single-line comments","multi-line comments"]},a=void 0,c={},m=[];function l(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"A comment is a line in your codebase which the compiler ignores, however it can be read by\nprogrammers."}),"\n",(0,i.jsx)(n.p,{children:"Here is a single line comment:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-rust",children:"// This is a comment and is ignored\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"//"})," is used to tell the compiler to ignore the rest of the line."]}),"\n",(0,i.jsxs)(n.p,{children:["Noir also supports multi-line block comments. Start a block comment with ",(0,i.jsx)(n.code,{children:"/*"})," and end the block with ",(0,i.jsx)(n.code,{children:"*/"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["Noir does not natively support doc comments. You may be able to use ",(0,i.jsx)(n.a,{href:"https://doc.rust-lang.org/reference/comments.html",children:"Rust doc comments"})," in your code to leverage some Rust documentation build tools with Noir code."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-rust",children:"/*\n  This is a block comment describing a complex function.\n*/\nfn main(x : Field, y : pub Field) {\n    assert(x != y);\n}\n"})})]})}function d(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},28453(e,n,o){o.d(n,{R:()=>s,x:()=>a});var t=o(96540);const i={},r=t.createContext(i);function s(e){const n=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.