You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use them in my code when I define a function:
function_definition = _ "def" _ name:variable _ "(" args:(variable _ ","? _)* ")" _ body:statement* _ "end" _ {
const fn_name = name.name.replace(/\$_/, '');
console.log(adapter_async_strings); // this is undefined
// need to hardcode the array of strings
if (["echo", "ask", "get", "post"].includes(fn_name)) {
const error = new Error(`invalid function name, '${fn_name}' is reseved command`);
error.location = move_location(location(), 4, fn_name.length + 1);
throw error;
}
var args = args.map(function(arg) { return arg[0]; });
return {
"type": "FunctionDeclaration",
"id": name,
"params": args,
"async": true,
"body": {
"type": "BlockStatement",
"body": body
}
};
}
It would be nice if possible to not have to use an array with hardcoded strings to validate and show a proper error message.
but use already defined commands.
Software
PEG.js: 0.10.0
Node.js: v16.4.2
NPM or Yarn: 7.18.1
Browser:
OS: Fedora GNU/Linux
Editor:
The text was updated successfully, but these errors were encountered:
Issue type
Prerequisites
Description
I want to use rules as an array or have one place where I define my rules.
Steps to Reproduce
I have rules:
I would like to use them in my code when I define a function:
It would be nice if possible to not have to use an array with hardcoded strings to validate and show a proper error message.
but use already defined commands.
Software
The text was updated successfully, but these errors were encountered: