Skip to content

Commit

Permalink
add comment, fix typos
Browse files Browse the repository at this point in the history
- also fix pgsql markup test
  • Loading branch information
joshgoebel committed Nov 15, 2020
1 parent 9d9f82b commit 8acfeeb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/languages/bash.js
Expand Up @@ -25,7 +25,10 @@ export default function(hljs) {
Object.assign(VAR,{
className: 'variable',
variants: [
{begin: regex.concat(/\$[\w\d#@][\w\d_]*/, `(?![\\w\\d])(?![$])`) },
{begin: regex.concat(/\$[\w\d#@][\w\d_]*/,
// negative look-ahead tries to avoid matching patterns that are not
// Perl at all like $ident$, @ident@, etc.
`(?![\\w\\d])(?![$])`) },
BRACED_VAR
]
});
Expand Down
5 changes: 4 additions & 1 deletion src/languages/php.js
Expand Up @@ -13,7 +13,10 @@ Category: common
export default function(hljs) {
const VARIABLE = {
className: 'variable',
begin: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' + `(?![A-Za-z0-9])(?![$])`
begin: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' +
// negative look-ahead tries to avoid matching patterns that are not
// Perl at all like $ident$, @ident@, etc.
`(?![A-Za-z0-9])(?![$])`
};
const PREPROCESSOR = {
className: 'meta',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/vbscript.js
Expand Up @@ -25,7 +25,7 @@ export default function(hljs) {
"server",
"response",
"request",
// take no arguments so can be caleld without ()
// take no arguments so can be called without ()
"scriptengine",
"scriptenginebuildversion",
"scriptengineminorversion",
Expand Down
8 changes: 4 additions & 4 deletions test/markup/pgsql/dollar_strings.expect.txt
@@ -1,9 +1,9 @@
<span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">OR REPLACE</span> <span class="hljs-keyword">FUNCTION</span> hello_world(param_your_name <span class="hljs-type">text</span>)
<span class="hljs-keyword">RETURNS</span> <span class="hljs-type">text</span> <span class="hljs-keyword">AS</span>
$$<span class="ruby">
SELECT <span class="hljs-string">&#x27;Hello world. My name is &#x27;</span> <span class="hljs-params">||</span> param_your_name <span class="hljs-params">||</span> <span class="hljs-string">&#x27;.&#x27;</span>;
$$<span class="pgsql">
<span class="hljs-keyword">SELECT</span> <span class="hljs-string">&#x27;Hello world. My name is &#x27;</span> || param_your_name || <span class="hljs-string">&#x27;.&#x27;</span>;
$$</span>
<span class="hljs-keyword">language</span> <span class="hljs-keyword">sql</span> <span class="hljs-keyword">STRICT</span>;

<span class="hljs-keyword">SELECT</span> sql_expression($sql$<span class="ruby">SELECT hello_world($phrase$Regina<span class="hljs-string">&#x27;s elephant&#x27;</span>s dog$phrase$)
<span class="hljs-params">||</span> $phrase$ I made a cat<span class="hljs-string">&#x27;s meow today.$phrase$ $sql$</span></span>);
<span class="hljs-keyword">SELECT</span> sql_expression($sql$<span class="tcl">SELECT hello_world($phrase$Regina&#x27;s elephant&#x27;s dog$phrase$)
|| $phrase$ I made a cat&#x27;s meow today.$phrase$ $sql$</span>);

0 comments on commit 8acfeeb

Please sign in to comment.