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

Continued newline into an EOF comment confuses PropertyInstruction #40

Closed
rcjsuen opened this issue May 28, 2018 · 0 comments
Closed

Continued newline into an EOF comment confuses PropertyInstruction #40

rcjsuen opened this issue May 28, 2018 · 0 comments
Assignees
Labels

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented May 28, 2018

If an escaped newline ends up extending to a comment that leads to an EOF, the parser will think that there are two properties when there should only be one.

import { DockerfileParser } from 'dockerfile-ast';

const content = "ARG var=value \\\n # comment";

let dockerfile = DockerfileParser.parse(content);
let instruction = dockerfile.getInstructions()[0];
console.log((instruction as any).getPropertyArguments().length);
console.log((instruction as any).getProperties().length);
2
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant