diff --git a/build-aux/bootstrap/prebirth.js b/build-aux/bootstrap/prebirth.js index 21bf389..c16de94 100644 --- a/build-aux/bootstrap/prebirth.js +++ b/build-aux/bootstrap/prebirth.js @@ -97,6 +97,10 @@ class Parser // a very simple bootstrap lisp) switch ( type ) { + // ignore comments + case 'comment': + return result; + // closing parenthesis (end of sexp) case 'close': if ( depth === 0 ) { @@ -197,6 +201,12 @@ class Parser return []; } + // comment until end of line + if ( trim[ 0 ] === ';' ) { + const eol = trim.match( /^(.*?)(\n|$)/ ); + return this._token( 'comment', eol[ 1 ], trim, pos ); + } + // left and right parenthesis are handled in the same manner: they // produce distinct tokens with single-character lexemes if ( trim[ 0 ] === '(' ) {