Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 0ffb223

Browse files
committed
remove comments related code
1 parent e14cf9e commit 0ffb223

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

packages/lu/src/parser/lufile/luParser.js

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const NEWLINE = require('os').EOL;
2121

2222
const defaultConfig = {
2323
enableModelDescription: true,
24-
enableComments: true
24+
enableComments: true // Temporarily enabled by default, cannot be configured
2525
}
2626

2727
class LUParser {
@@ -61,23 +61,7 @@ class LUParser {
6161
static extractFileContent(fileContent, content, errors, sectionEnabled, config) {
6262
let sections = [];
6363
let modelInfoSections = [];
64-
/*
65-
let comments = [];
66-
try {
67-
comments = this.extractCommentDefinition(fileContent);
68-
} catch (err) {
69-
errors.push(BuildDiagnostic({
70-
message: `Error happened when parsing comments: ${err.message}`
71-
}))
72-
}
7364

74-
if (comments.length > 0 && !config.enableComments) {
75-
const error = BuildDiagnostic({
76-
message: 'Do not support Comments. Please make sure enableComments is set to true.',
77-
});
78-
throw (new exception(retCode.errorCode.INVALID_INPUT, error.toString(), [error]));
79-
}
80-
*/
8165
try {
8266
modelInfoSections = this.extractModelInfoSections(fileContent);
8367
} catch (err) {
@@ -374,24 +358,6 @@ class LUParser {
374358
return modelInfoSectionList;
375359
}
376360

377-
/**
378-
* @param {FileContext} fileContext
379-
*/
380-
381-
static extractCommentDefinition(fileContext) {
382-
if (fileContext === undefined
383-
|| fileContext === null) {
384-
return [];
385-
}
386-
387-
let comments = fileContext.paragraph()
388-
.map(x => x.commentSection())
389-
.filter(x => x !== undefined && x !== null)
390-
.map(x => x.text);
391-
392-
return comments;
393-
}
394-
395361
/**
396362
* @param {any[]} sections
397363
*/

0 commit comments

Comments
 (0)