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

Commit

Permalink
Merge pull request #31 from standardhealth/fix_grammar_27
Browse files Browse the repository at this point in the history
 Support "value is type $primitive" for constraining choices
  • Loading branch information
Abhijay authored Dec 12, 2017
2 parents 53acd30 + 5ece7ab commit 24707a9
Show file tree
Hide file tree
Showing 6 changed files with 311 additions and 201 deletions.
6 changes: 4 additions & 2 deletions lib/dataElementListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class DataElementImporter extends SHRDataElementParserListener {
enterEntryDef(ctx) {
const id = new Identifier(this._currentNs, ctx.entryHeader().simpleName().getText());
this._currentDef = new DataElement(id, true).withGrammarVersion(this._currentGrammarVersion);

if (ctx.entryHeader().simpleName().LOWER_WORD()) { logger.error('Entry Element name "%s" should begin with a capital letter. ERROR_CODE:11002', ctx.entryHeader().simpleName().getText()); }
}

Expand Down Expand Up @@ -460,7 +460,9 @@ class DataElementImporter extends SHRDataElementParserListener {
return this.resolveToIdentifier(ctx.simpleOrFQName().getText());
} else if (typeof ctx.ref === 'function' && ctx.ref()) {
return this.resolveToIdentifier(ctx.ref().simpleOrFQName().getText());
}else if (ctx.tbd() && ctx.tbd().STRING()) {
} else if (typeof ctx.primitive === 'function' && ctx.primitive()) {
return new PrimitiveIdentifier(ctx.primitive().getText());
} else if (ctx.tbd() && ctx.tbd().STRING()) {
return new TBD(stripDelimitersFromToken(ctx.tbd().STRING()));
} else {
return new TBD();
Expand Down
Loading

0 comments on commit 24707a9

Please sign in to comment.