Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
grammar + AST for #6872
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Jan 20, 2017
1 parent 638ac21 commit cf165b0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
4 changes: 4 additions & 0 deletions typechecker/antlr/Ceylon.nodes
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
^(MODULE_DESCRIPTOR:STATEMENT_OR_ARGUMENT
ANNOTATION_LIST?
IMPORT_PATH
IDENTIFIER? namespace
IMPORT_PATH? groupImportPath
QUOTED_LITERAL? groupQuotedLiteral
QUOTED_LITERAL? artifact
QUOTED_LITERAL? version
IMPORT_MODULE_LIST)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,28 @@ moduleDescriptor returns [ModuleDescriptor moduleDescriptor]
{ $moduleDescriptor = new ModuleDescriptor($MODULE);
$moduleDescriptor.setAnnotationList($annotations.annotationList);
$moduleDescriptor.getCompilerAnnotations().addAll($compilerAnnotations.annotations); }
packagePath
{ $moduleDescriptor.setImportPath($packagePath.importPath); }
p0=packagePath
{ $moduleDescriptor.setImportPath($p0.importPath); }
(
ins=importNamespace
{ $moduleDescriptor.setNamespace($ins.identifier); }
SEGMENT_OP
(
s1=STRING_LITERAL
{ $moduleDescriptor.setGroupQuotedLiteral(new QuotedLiteral($s1)); }
|
p1=packagePath
{ $moduleDescriptor.setGroupImportPath($p1.importPath); }
)
(
SEGMENT_OP
s2=STRING_LITERAL
{ $moduleDescriptor.setArtifact(new QuotedLiteral($s2)); }
)?
)?
(
STRING_LITERAL
{ $moduleDescriptor.setVersion(new QuotedLiteral($STRING_LITERAL)); }
s3=STRING_LITERAL
{ $moduleDescriptor.setVersion(new QuotedLiteral($s3)); }
)?
importModuleList
{ $moduleDescriptor.setImportModuleList($importModuleList.importModuleList); }
Expand Down Expand Up @@ -311,7 +328,7 @@ packagePath returns [ImportPath importPath]
(
m=MEMBER_OP
{ $importPath.setEndToken($m); }
(
((LIDENTIFIER) =>
pn2=packageName
{ $importPath.addIdentifier($pn2.identifier);
$importPath.setEndToken(null); }
Expand Down

0 comments on commit cf165b0

Please sign in to comment.