1e484b35bSopenharmony_ci/*
2e484b35bSopenharmony_ci * Licensed to the Apache Software Foundation (ASF) under one
3e484b35bSopenharmony_ci * or more contributor license agreements.  See the NOTICE file
4e484b35bSopenharmony_ci * distributed with this work for additional information
5e484b35bSopenharmony_ci * regarding copyright ownership.  The ASF licenses this file
6e484b35bSopenharmony_ci * to you under the Apache License, Version 2.0 (the
7e484b35bSopenharmony_ci * "License"); you may not use this file except in compliance
8e484b35bSopenharmony_ci * with the License.  You may obtain a copy of the License at
9e484b35bSopenharmony_ci *
10e484b35bSopenharmony_ci *   http://www.apache.org/licenses/LICENSE-2.0
11e484b35bSopenharmony_ci *
12e484b35bSopenharmony_ci * Unless required by applicable law or agreed to in writing,
13e484b35bSopenharmony_ci * software distributed under the License is distributed on an
14e484b35bSopenharmony_ci * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15e484b35bSopenharmony_ci * KIND, either express or implied.  See the License for the
16e484b35bSopenharmony_ci * specific language governing permissions and limitations
17e484b35bSopenharmony_ci * under the License.
18e484b35bSopenharmony_ci */
19e484b35bSopenharmony_ci
20e484b35bSopenharmony_ciimport Node from './Node';
21e484b35bSopenharmony_ci
22e484b35bSopenharmony_ci/**
23e484b35bSopenharmony_ci * Comment Node of vdom, which is used as separator between blocks.
24e484b35bSopenharmony_ci * @extends Node
25e484b35bSopenharmony_ci */
26e484b35bSopenharmony_ciclass Comment extends Node {
27e484b35bSopenharmony_ci  private _content: string;
28e484b35bSopenharmony_ci
29e484b35bSopenharmony_ci  constructor(content) {
30e484b35bSopenharmony_ci    super();
31e484b35bSopenharmony_ci    this._nodeType = Node.NodeType.Comment;
32e484b35bSopenharmony_ci    this._type = 'comment';
33e484b35bSopenharmony_ci    this._content = content;
34e484b35bSopenharmony_ci  }
35e484b35bSopenharmony_ci
36e484b35bSopenharmony_ci  /**
37e484b35bSopenharmony_ci  * Convert to HML comment string.
38e484b35bSopenharmony_ci  * @return {string} HML string.
39e484b35bSopenharmony_ci  */
40e484b35bSopenharmony_ci  public toString() {
41e484b35bSopenharmony_ci    return `<!-- ${this._content} -->`;
42e484b35bSopenharmony_ci  }
43e484b35bSopenharmony_ci}
44e484b35bSopenharmony_ci
45e484b35bSopenharmony_ciexport default Comment;
46