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

Infinite loop with embedded comments in an instruction #69

Closed
rcjsuen opened this issue Jun 11, 2020 · 4 comments
Closed

Infinite loop with embedded comments in an instruction #69

rcjsuen opened this issue Jun 11, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Jun 11, 2020

ENV \
# common variables:
  ENV1=something
  ENV2=999
import { DockerfileLanguageServiceFactory } from 'dockerfile-language-service'
let content = "ENV \\\n# common variables:\n  ENV1=something \\\n  ENV2=999";
const service = DockerfileLanguageServiceFactory.createLanguageService();
service.computeSemanticTokens(content);
/dockerfile-language-service/out/src/dockerSemanticTokens.js:274
    createToken(instruction, range, tokenType, tokenModifiers = [], checkVariables = true, checkStrings = false, checkNewline = true) {
               ^

RangeError: Maximum call stack size exceeded
    at DockerSemanticTokens.createToken (/dockerfile-language-service/out/src/dockerSemanticTokens.js:274:16)
    at DockerSemanticTokens.createToken (/dockerfile-language-service/out/src/dockerSemanticTokens.js:451:18)
    at DockerSemanticTokens.createToken (/dockerfile-language-service/out/src/dockerSemanticTokens.js:451:18)
    at DockerSemanticTokens.createToken (/dockerfile-language-service/out/src/dockerSemanticTokens.js:451:18)
    at DockerSemanticTokens.createToken (/dockerfile-language-service/out/src/dockerSemanticTokens.js:451:18)
    at DockerSemanticTokens.createToken (/dockerfile-language-service/out/src/dockerSemanticTokens.js:451:18)
    at DockerSemanticTokens.createToken (/dockerfile-language-service/out/src/dockerSemanticTokens.js:451:18)
    at DockerSemanticTokens.createToken (/dockerfile-language-service/out/src/dockerSemanticTokens.js:451:18)
    at DockerSemanticTokens.createToken (/dockerfile-language-service/out/src/dockerSemanticTokens.js:451:18)
    at DockerSemanticTokens.createToken (/dockerfile-language-service/out/src/dockerSemanticTokens.js:451:18)
@rcjsuen
Copy link
Owner Author

rcjsuen commented Jun 17, 2020

This is likely due to a bug in the parser. See rcjsuen/dockerfile-ast#80.

rcjsuen added a commit that referenced this issue Jun 18, 2020
Signed-off-by: Remy Suen <[email protected]>
@luismanuelmontoro
Copy link

I have the same problem, and I solved changing a character. Space " " has something strange.

@rcjsuen
Copy link
Owner Author

rcjsuen commented Mar 4, 2021

@luismanuelmontoro Maybe you encountered #74? Do you still have your original Dockerfile that you can share with me?

@luismanuelmontoro
Copy link

Not, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants