ECMAScript code generator that transforms Mozilla's Parser API ASTs back into executable JavaScript code
95
{
"context": "This criteria evaluates how effectively an engineer uses the escodegen package to generate JavaScript regular expression literals from AST nodes, with particular focus on proper Unicode line terminator handling and escape sequence generation.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses escodegen.generate",
"description": "Uses escodegen's generate() function to transform AST nodes containing regular expression literals into JavaScript code strings.",
"max_score": 30
},
{
"name": "Handles Literal nodes",
"description": "Correctly processes AST Literal nodes with regex property (node.regex containing pattern and flags properties) as per Mozilla Parser API specification.",
"max_score": 20
},
{
"name": "Unicode escaping applied",
"description": "Ensures Unicode line terminator characters (U+2028 and U+2029) in regex patterns are properly escaped as \\u2028 and \\u2029 in the generated code, preventing JavaScript syntax errors.",
"max_score": 30
},
{
"name": "Preserves flags correctly",
"description": "Correctly appends regex flags from node.regex.flags to the generated regular expression literal after the closing delimiter.",
"max_score": 20
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-escodegendocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10