console.log('Here!')
document.querySelector('div').?????
node.apendChild(newChildNode);
if(something) {doSomething(); console.log('Did something!')}
else {
doNothing()
}
// Property 'apendChild' does
// not exist on type 'Node'.
// Did you mean 'log'?(2551)
node.apendChild(newChildNode);
if (something) {
doSomething();
console.log("Did something!");
} else {
doNothing();
}
child:p
idnex-of(('a', 'b'), 'a')
trace($var, 'I am here!')
if ($something) then (util:log('info', 'Did something!'), local:do-something()) else
local:do-nothing()
if ($something) then (util:log('info', 'Did something!'), local:do-something()) else
local:do-nothing()
<table>{
for $i in 1 to xs:int($data?rows)
return <tr>{for $j in 1 to xs:int($data?cols) return
<td>
<p>cell at {$i},{$j}</p></td>
}</tr>
}</table>
let $node := <root><a/></root>
return
update insert <b/> into $node/a
<xsl:template match="Author">
- <xsl:value-of select="1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27" />
</xsl:template>
| Filesize | line count after formatting | Prettify in ms |
|---|---|---|
| 183B | 4 | ~10ms |
| 6KB | 161 | ~34ms |
| 24KB | 641 | 170ms |
| 94KB | 2663 | ~600ms |
let $a :=
ancestor-or-self::(div|section) otherwise
descendant-or-self::(div|section)
return $a => exists()
Plugin for Prettier
Gunther Rademacher's REx parser generator
Some JS to 'amend' grammars for 'dialects'
Verifies correctness using QT3 / QT4 test set plus additional tests
'A very very very long string' || ' That is sure to go over the limit'
const stringConcatExpression = join([
leftHandSide,
space,
'||',
break(indent(rightHandSide))
])
'A very very very long string' || ' That is sure to go over the limit'
^ ^
/ '- if break: newline+indent,
space otherwise space
'A very very very long string' ||
' That is sure to go over the limit'
const existDBMutations = [
{
where: 'ExprSingle',
name: 'ExistDB_UpdateExpr',
additionalRule: `ExistDB_UpdateExpr ::= 'update' (
ExistDB_UpdateInsertExpr |
ExistDB_UpdateReplaceExpr |
ExistDB_UpdateDeleteExpr |
ExistDB_UpdateRenameExpr |
ExistDB_UpdateValueExpr
)`,
},
];
ExprSingle ::= ExistDB_UpdateExpr | ( FLWORExpr | QuantifiedExpr | SwitchExpr | TypeswitchExpr | IfExpr | TryCatchExpr | OrExpr )
ExistDB_UpdateExpr ::= 'update' ( ExistDB_UpdateInsertExpr | ExistDB_UpdateReplaceExpr | ExistDB_UpdateDeleteExpr | ExistDB_UpdateRenameExpr | ExistDB_UpdateValueExpr )
ExistDB_UpdateInsertExpr ::= 'insert' Expr (
'into' | 'following' | 'preceding'
) ExprSingle
ExistDB_UpdateReplaceExpr ::= 'replace' Expr 'with' ExprSingle
ExistDB_UpdateValueExpr ::= 'value' Expr 'with' ExprSingle
ExistDB_UpdateDeleteExpr ::= 'delete' Expr
ExistDB_UpdateRenameExpr ::= 'rename' Expr 'as' ExprSingle