Will Klein
Source: https://en.wikipedia.org/wiki/Die_(manufacturing)
Source: http://studentshop.pratt.duke.edu/lab+space
function addTen(value) {
var sum = 0;
return value + 10
}
if (someCondition) {
if (someOtherCondition) {
added = addTen(someValue);
}
}
function addTen(value) {
return value + 10;
}
if (someCondition &&
someOtherCondition) {
added = addTen(someValue);
}
function addTen(value) {
var sum = 0;
return value + 10
}
no-unused-vars
semi
if (someCondition) {
if (someOtherCondition) {
added = addTen(someValue);
}
}
???
if (someCondition) {}
if (someCondition) {}
{
"type": "Program",
"body": [
{
"type": "IfStatement",
"test": {
"type": "Identifier",
"name": "someCondition"
},
"consequent": {
"type": "BlockStatement",
"body": []
},
"alternate": null
}
]
}
if (someCondition) {
if (someOtherCondition) {
added = addTen(someValue);
}
}
{
"type": "IfStatement",
"test": {
"type": "Identifier",
"name": "someCondition"
},
"consequent": {
"type": "BlockStatement",
"body": [
{
"type": "IfStatement",
"test": {
"type": "Identifier",
"name": "someOtherCondition"
},
"consequent": {
"type": "BlockStatement",
"body": [ ... ] } } ] } }
module.exports = function(context) {
return {
};
};
module.exports = function(context) {
return {
"IfStatement": function(node) {
}
};
};
module.exports = function(context) {
return {
"IfStatement": function(node) {
if (/* test some things */) {
context.report(node,
"Unexpected bad code.");
}
}
};
};
module.exports = function(context) {
return {
"IfStatement": function(node) {
var ancestors = context.getAncestors(),
parent = ancestors.pop(),
grandparent = ancestors.pop();
if (/* test some things */) {
context.report(node,
"Unexpected bad code.");
}
}
};
};
if (someCondition)
if (someOtherCondition) {}
if (someCondition)
if (someOtherCondition) {}
var ancestors = context.getAncestors(),
parent = ancestors.pop(),
grandparent = ancestors.pop();
if (parent.type === "IfStatement") {
context.report(node, "Unexpected bad code.");
}
if (someCondition) {
if (someOtherCondition) {}
}
var ancestors = context.getAncestors(),
parent = ancestors.pop(),
grandparent = ancestors.pop();
if (parent.type === "IfStatement" ||
(parent.type === "BlockStatement" &&
grandparent.type === "IfStatement")) {
context.report(node, "Unexpected bad code.");
}
if (someCondition) {
if (someOtherCondition) {}
}
var ancestors = context.getAncestors(),
parent = ancestors.pop(),
grandparent = ancestors.pop();
if (parent.type === "IfStatement" ||
(parent.type === "BlockStatement" &&
parent.body.length === 1 &&
grandparent.type === "IfStatement")) {
context.report(node, "Unexpected bad code.");
}
if (someCondition) {
doSomething();
if (someOtherCondition) {}
}
var ancestors = context.getAncestors(),
parent = ancestors.pop(),
grandparent = ancestors.pop();
if (parent.type === "IfStatement" ||
(parent.type === "BlockStatement" &&
parent.body.length === 1 &&
grandparent.type === "IfStatement" &&
parent === grandparent.consequent)) {
context.report(node, "Unexpected bad code.");
}
if (someCondition) {
doSomething();
} else {
if (someOtherCondition) {}
}
module.exports = function(context) {
return {
"IfStatement": function(node) {
var ancestors = context.getAncestors(),
parent = ancestors.pop(),
grandparent = ancestors.pop();
if (parent.type === "IfStatement" ||
(parent.type === "BlockStatement" &&
parent.body.length === 1 &&
grandparent.type === "IfStatement" &&
parent === grandparent.consequent)) {
context.report(node, "Unexpected bad code.");
}
}
};
};
Source: https://en.wikipedia.org/wiki/Numerical_control
Source: https://github.com/grbl/grbl/wiki/G-Code-Examples
( RUN IN VISE ON PARALLELS )
(Z OFFSET: TOP OF MATERIAL WITH )
( 0.375" MATERIAL ABOVE VISE JAWS )
(X0,Y0,Z0= Center, Center, Top)
(STOCK ORIGIN = X0. Y0. Z.01)
(MATERIAL TYPE= ALUMINUM inch - 6061)
(MATERIAL SIZE= X1.75 Y1.75 Z.5)
(TOOL= 1/4 2-FLUTE HSS END MILL)