From 00cfccd6f10158000655783da4266978b74bb736 Mon Sep 17 00:00:00 2001 From: Gemma Lamont Date: Fri, 23 Feb 2024 14:32:26 +0100 Subject: [PATCH 1/2] Add docs on multiline comments --- modules/ROOT/pages/syntax/comments.adoc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/ROOT/pages/syntax/comments.adoc b/modules/ROOT/pages/syntax/comments.adoc index efc1624c5..9db8cfd1a 100644 --- a/modules/ROOT/pages/syntax/comments.adoc +++ b/modules/ROOT/pages/syntax/comments.adoc @@ -1,11 +1,13 @@ -:description: This section describes how how to use comments in Cypher. +:description: This section describes how to use comments in Cypher. [[cypher-comments]] = Comments -This page describes how how to use comments in Cypher. +This page describes how to use comments in Cypher. -A comment begin with double slash (`//`) and continue to the end of the line. +A single line comment begins with double slash (`//`) and continues to the end of the line. +A multi-line comment begins with a slash and asterisk (`/*`) and continues until the closing of the comment, which is done with an asterisk and a slash ('*/' +) Comments do not execute, they are for humans to read. Examples: @@ -22,6 +24,14 @@ MATCH (n) RETURN n ---- +[source, cypher, indent=0] +---- +MATCH (n) /* This is a multi line comment, +the comment is still going on this line as well +but we are closing it on this line */ +RETURN n +---- + [source, cypher, indent=0] ---- MATCH (n) WHERE n.property = '//This is NOT a comment' RETURN n From 95a0260c0ceb433fa2e0756f7053c1156a3a37be Mon Sep 17 00:00:00 2001 From: Gem Lamont <106068376+gem-neo4j@users.noreply.github.com> Date: Mon, 26 Feb 2024 16:23:20 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Richard Sill <156673635+rsill-neo4j@users.noreply.github.com> --- modules/ROOT/pages/syntax/comments.adoc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/ROOT/pages/syntax/comments.adoc b/modules/ROOT/pages/syntax/comments.adoc index 9db8cfd1a..138654aef 100644 --- a/modules/ROOT/pages/syntax/comments.adoc +++ b/modules/ROOT/pages/syntax/comments.adoc @@ -6,8 +6,7 @@ This page describes how to use comments in Cypher. A single line comment begins with double slash (`//`) and continues to the end of the line. -A multi-line comment begins with a slash and asterisk (`/*`) and continues until the closing of the comment, which is done with an asterisk and a slash ('*/' -) +A multi-line comment begins with a slash and asterisk (`/*`) and continues until it ends with an asterisk and a slash ('*/'). Comments do not execute, they are for humans to read. Examples: @@ -27,8 +26,8 @@ RETURN n [source, cypher, indent=0] ---- MATCH (n) /* This is a multi line comment, -the comment is still going on this line as well -but we are closing it on this line */ +the comment continues on this line +but it ends on this line. */ RETURN n ----