@@ -31,6 +31,8 @@ function stringify(node, prec) {
3131 let str = '' ;
3232 if ( left . type === 'MathExpression' && order [ op ] < order [ left . operator ] ) {
3333 str += `(${ stringify ( left , prec ) } )` ;
34+ } else if ( left . type === 'CalcKeyword' ) {
35+ str += left . value ;
3436 } else {
3537 str += stringify ( left , prec ) ;
3638 }
@@ -42,6 +44,8 @@ function stringify(node, prec) {
4244 order [ op ] < order [ right . operator ]
4345 ) {
4446 str += `(${ stringify ( right , prec ) } )` ;
47+ } else if ( right . type === 'CalcKeyword' ) {
48+ str += right . value ;
4549 } else {
4650 str += stringify ( right , prec ) ;
4751 }
@@ -54,6 +58,8 @@ function stringify(node, prec) {
5458 return node . value . toString ( ) ;
5559 case 'ParenthesizedExpression' :
5660 return `(${ stringify ( node . content , prec ) } )` ;
61+ case 'CalcKeyword' :
62+ return node . value ;
5763 default :
5864 return round ( node . value , prec ) + node . unit ;
5965 }
@@ -74,7 +80,7 @@ module.exports = function (calc, node, originalValue, options, result, item) {
7480
7581 const shouldPrintCalc =
7682 node . type === 'MathExpression' || node . type === 'Function' ||
77- node . type === 'ParenthesizedExpression' ;
83+ node . type === 'ParenthesizedExpression' || node . type === 'CalcKeyword' ;
7884
7985 if ( shouldPrintCalc ) {
8086 // if calc expression couldn't be resolved to a single value, re-wrap it as
0 commit comments