Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler error - can't use single line comments in scriptlets #1270

Closed
StarpTech opened this issue Feb 24, 2019 · 0 comments
Closed

Compiler error - can't use single line comments in scriptlets #1270

StarpTech opened this issue Feb 24, 2019 · 0 comments

Comments

@StarpTech
Copy link
Contributor

StarpTech commented Feb 24, 2019

Marko Version: 4.15.2

Details

I would like to use inline-javascript in a single-file-component. As soon as I use // single-line comments the compiler will throw an error. Multi-line comments are fine.

$ {
    const { i18n, locale } = out.global;
    const { key } = input;
    let message = '';

    // isn't
    if (i18n) {
        message = i18n.__(key);
    }
}

-- ${message}

Expected Behavior

I can use single line comments in scriptlets

Actual Behavior

An error is thrown

Possible Fix

Additional Info

Your Environment

  • Ubuntu 18.04, Node 8.10.0

Stack Trace

1) [src/components/i18n-message/index.marko:1:1] EOF reached while parsing scriptet

    at handleErrors (/mnt/ssd/repositories/project/demo/node_modules/marko/src/compiler/Compiler.js:94:21)
    at Compiler.compile (/mnt/ssd/repositories/project/demo/node_modules/marko/src/compiler/Compiler.js:177:9)
    at _compile (/mnt/ssd/repositories/project/demo/node_modules/marko/src/compiler/index.js:94:33)
    at compileFile (/mnt/ssd/repositories/project/demo/node_modules/marko/src/compiler/index.js:149:16)
    at Object.compileFileForBrowser (/mnt/ssd/repositories/project/demo/node_modules/marko/src/compiler/index.js:163:12)
    at Promise (/mnt/ssd/repositories/project/demo/node_modules/lasso-marko/lasso-marko-plugin.js:34:34)
    at new Promise (<anonymous>)
    at compile (/mnt/ssd/repositories/project/demo/node_modules/lasso-marko/lasso-marko-plugin.js:32:16)
    at Ctor.<anonymous> (/mnt/ssd/repositories/project/demo/node_modules/lasso-marko/lasso-marko-plugin.js:78:28)
    at Ctor.doInit (/mnt/ssd/repositories/project/demo/node_modules/callbackify/index.js:16:15)
Creation stack trace: Error
    at AsyncStream.beginAsync (/mnt/ssd/repositories/project/demo/node_modules/marko/src/runtime/html/AsyncStream.js:192:56)
    at render (/mnt/ssd/repositories/project/demo/node_modules/@lasso/marko-taglib/taglib/slot-tag.js:128:24)
    at render (/mnt/ssd/repositories/project/demo/node_modules/@lasso/marko-taglib/taglib/head-tag.js:16:3)
    at wrappedRenderer (/mnt/ssd/repositories/project/demo/node_modules/marko/src/runtime/helpers.js:273:13)
    at renderBody (/mnt/ssd/repositories/project/demo/src/pages/home/index.marko.js:40:13)
    at dynamicTag (/mnt/ssd/repositories/project/demo/node_modules/marko/src/runtime/helpers.js:243:33)
    at render (/mnt/ssd/repositories/project/demo/src/components/app-layout/index.marko.js:28:3)
    at Template.renderer (/mnt/ssd/repositories/project/demo/node_modules/marko/src/components/renderer.js:217:9)
    at hotReloadProxy (/mnt/ssd/repositories/project/demo/node_modules/marko/src/hot-reload.js:97:31)
    at wrappedRenderer (/mnt/ssd/repositories/project/demo/node_modules/marko/src/runtime/helpers.js:273:13)
    at AsyncStream.error (/mnt/ssd/repositories/project/demo/node_modules/marko/src/runtime/html/AsyncStream.js:441:13)
    at process.nextTick (/mnt/ssd/repositories/project/demo/node_modules/@lasso/marko-taglib/taglib/slot-tag.js:139:20)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
@StarpTech StarpTech changed the title Compiler error - can't consume single quotes in single line comments Compiler error - can't use single line comments in scriptlets Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant