Skip to content

Commit

Permalink
Fix: can't require after annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite authored and ysbaddaden committed May 23, 2018
1 parent 6cef3d2 commit df279d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions spec/compiler/parser/parser_spec.cr
Expand Up @@ -1689,6 +1689,8 @@ describe "Parser" do
it_parses "annotation Foo\n\nend", AnnotationDef.new("Foo".path)
it_parses "annotation Foo::Bar\n\nend", AnnotationDef.new(Path.new(["Foo", "Bar"]))

it_parses %(annotation Foo\nend\nrequire "bar"), [AnnotationDef.new("Foo".path), Require.new("bar")]

it "gets corrects of ~" do
node = Parser.parse("\n ~1")
loc = node.location.not_nil!
Expand Down
2 changes: 0 additions & 2 deletions src/compiler/crystal/syntax/parser.cr
Expand Up @@ -1604,8 +1604,6 @@ module Crystal
end

def parse_annotation_def
@type_nest += 1

location = @token.location
doc = @token.doc

Expand Down

0 comments on commit df279d1

Please sign in to comment.