Skip to content

Commit

Permalink
renderer: restructure and extend documentation
Browse files Browse the repository at this point in the history
 - Introduce virtual uCentral class hierarchy
 - Add documentation for toplevel helper functions

Signed-off-by: Jo-Philipp Wich <[email protected]>
  • Loading branch information
jow- committed Dec 1, 2021
1 parent 5a2eb44 commit 08851ba
Show file tree
Hide file tree
Showing 2 changed files with 303 additions and 51 deletions.
28 changes: 25 additions & 3 deletions jsdoc/ucode-transpiler.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* ucode-transpiler.js - JSDoc plugin to naively transpile ucode into JS.
*
* Copyright (C) 2021 Jo-Philipp Wich <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

'use strict';

function skipString(s) {
Expand Down Expand Up @@ -445,8 +463,6 @@ Transpiler.prototype = {
while (true) {
let off = tokens.length;

this.check_token(tokens, 'comment');

if (this.check_token(tokens, 'if')) {
this.skip_paren(tokens);

Expand Down Expand Up @@ -594,7 +610,13 @@ Transpiler.prototype = {
else if (this.check_token(tokens, '{')) {
this.skip_block(tokens, ['}']);
}
else if (!this.check_token(tokens, 'text')) {
else if (this.check_token(tokens, 'text')) {
/* pass */
}
else if (this.check_token(tokens, 'comment')) {
/* pass */
}
else {
this.skip_statement(tokens, ends);
}

Expand Down
Loading

0 comments on commit 08851ba

Please sign in to comment.