Comments in M7 Script

Overview

M7 Script supports single-line and multi-line comments, allowing developers to document their code and temporarily disable parts of it without affecting execution.


1. Single-Line Comments

  • Use // to create a comment that spans a single line.
  • Everything after // on the same line is ignored by the interpreter.
// This is a single-line comment
var x = 42; // This is also a valid comment

2. Multi-Line Comments

  • Use /* ... */ to create multi-line comments.
  • Can span across multiple lines.
/*
This is a multi-line comment.
It can be used to document complex logic or temporarily disable code blocks.
*/
var y = 100; /* This variable stores a value */

3. Nesting Comments (Not Supported)

  • M7 does not support nested /* ... */ comments.
  • Attempting to nest them will result in syntax errors.
/*
    This is a multi-line comment
    /* This will cause an error */
*/

4. Planned Feature: Doc Comments

  • M7 does not yet support documentation-style comments (e.g., /** ... */ for auto-generated docs).
  • Future updates may introduce structured doc comments for API documentation.

This document provides an overview of comments in M7 Script, including single-line and multi-line comment syntax, limitations, and planned features.