Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

JDL - Comments not ignored #117

Closed
ricardocosta opened this issue Jan 23, 2016 · 2 comments
Closed

JDL - Comments not ignored #117

ricardocosta opened this issue Jan 23, 2016 · 2 comments

Comments

@ricardocosta
Copy link

Comments made with //are not being ignored (jhipster-uml 1.6.0).

The following content of the domain.jh file:

enum ValidationType {
    REQUIRED, NOT_EMPTY, MAX, MIN, REGEX
}

// Validation to apply on a Field
// entity FieldValidation {
//     type ValidationType
//     required Boolean
//     notEmpty Boolean
//     maxValue Integer
//     minValue Integer
//     regex String
// }

Produces this error when running jhipster-uml domain.jh:

Expected "entity" or a space but "/" found.
SyntaxError: Expected "entity" or a space but "/" found.
    at peg$buildException (/usr/local/lib/node_modules/jhipster-uml/lib/dsl/jhGrammar.js:362:14)
    at Object.peg$parse [as parse] (/usr/local/lib/node_modules/jhipster-uml/lib/dsl/jhGrammar.js:3787:13)
    at DSLParser.parse (/usr/local/lib/node_modules/jhipster-uml/lib/dsl/dsl_parser.js:36:27)
    at Object.<anonymous> (/usr/local/lib/node_modules/jhipster-uml/jhipster-uml.js:77:27)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:430:10)
    at startup (node.js:141:18)

Removing the commented lines, the output is:
No entity has to be generated.

Also, why can't the enums be generated even if there are no entities yet?

Best regards.

@MathieuAA
Copy link
Member

This is a bug... I'll fix it some time tomorrow. Thanks for reporting it!

@MathieuAA MathieuAA added this to the 1.6.1 milestone Jan 23, 2016
MathieuAA pushed a commit that referenced this issue Jan 26, 2016
@MathieuAA
Copy link
Member

The bug is fixed (with some delay, sorry about that) and the comments should be properly ignored from now on.
Also, you can't generate an enum alone as it is a type. You must create an entity to have an enum.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants