Commit Graph

82 Commits

Author SHA1 Message Date
Xi Ge
9cdffd2b28 [SyntaxColoring] Highlight specifier words in infix operator decls.
When used inside infix operator decls, associativity, precedence and
assignment are highlighted as keywords.

rdar://18833967

Swift SVN r26188
2015-03-16 20:02:44 +00:00
Chris Lattner
01f3e81aa5 Work on VarDecl:
- Rename getParentPattern() -> getParentPatternBinding(), since
   it returns the pattern binding, not the pattern.
 - Introduce new getParentPattern()/getParentInitializer() methods,
   covering the most common uses of getParentPatternBinding().

NFC.



Swift SVN r26175
2015-03-16 01:54:20 +00:00
Xi Ge
405936e0fc [SyntaxColoring] Address Argyrios' comments
Swift SVN r26035
2015-03-12 07:17:41 +00:00
Xi Ge
6d92cf022c [SyntaxColoring] Highlight platform names.
When used in an availability checking, platform names, such as iOS and OSX,
 are highlighted as keywords.

Swift SVN r26028
2015-03-12 03:29:47 +00:00
Argyrios Kyrtzidis
f55a15066e [IDE] Avoid adding ErrorExprs to the document structure model.
Swift SVN r25895
2015-03-09 23:02:54 +00:00
Argyrios Kyrtzidis
da2e6ad04a [IDE] Add array/dictionary literals in the document structure.
rdar:/19999295

Swift SVN r25874
2015-03-09 01:30:39 +00:00
Argyrios Kyrtzidis
8d4b0ed470 [IDE] Include control-flow statements in the syntax structure model.
rdar://19988592

Swift SVN r25868
2015-03-09 00:42:42 +00:00
Argyrios Kyrtzidis
f0cab99961 [IDE] Simplify ModelASTWalker::walkTo*Post() functions.
Swift SVN r25867
2015-03-09 00:42:40 +00:00
Argyrios Kyrtzidis
865719c2b8 [IDE] Introduce SyntaxStructureElements which will provide more info about a syntactic structure.
Swift SVN r25866
2015-03-09 00:42:39 +00:00
Argyrios Kyrtzidis
f15d56b8aa [IDE] Mark the parens for string interpolation with a special syntax annotation.
Part of rdar://19655729

Swift SVN r24983
2015-02-05 00:53:57 +00:00
Argyrios Kyrtzidis
c41569c7a7 [IDE] Enhance SyntaxStructureKind with global/static/class variable nodes.
Swift SVN r24497
2015-01-18 03:47:26 +00:00
Denis Vnukov
448822b1c4 Fixed an issue in IfConfigStmt parsing leading to source ranges verification assertions (rdar://problem/18251200).
The change also includes replacing BraceStmt* reference in IfConfigStmtClause structure with a simple list of clause elements.




Swift SVN r22868
2014-10-21 22:48:20 +00:00
John McCall
16cb523c3a AST support for accessors.
Swift SVN r22228
2014-09-23 20:34:19 +00:00
John McCall
75050f8166 Generate an implicit 'materializeForSet' accessor
along with getters and setters.

Just generate it for now.

Swift SVN r22011
2014-09-17 08:08:03 +00:00
Argyrios Kyrtzidis
9d7f29b2d7 [IDE] Use std::regex to match the syntax that the comment URL regex strings are using.
rdar://17782541

Swift SVN r20810
2014-07-31 05:04:06 +00:00
Doug Gregor
a0bc9274db Change parsing and representation of extensions to accommodate generic parameters.
The eventual goal for extensions of generic types is to require them
to specify their generic parameters, e.g.,

  extension Array<T> { ... }

rather than today's

  extension Array { ... }

Start parsing (optional) generic parameters here, and update the
representation of ExtensionDecl to accomodate this new grammar
production. Aside from the parser changes, there's no intended
functionality change here.

Swift SVN r20682
2014-07-29 19:17:00 +00:00
Chris Lattner
195a4b38a3 Reapply r20101: switch 'convenience' from being a specially handles contextual keyword to being a decl modifier just like the rest, this elimiantes a bunch of special case code for handling it.
Swift SVN r20103
2014-07-17 17:27:54 +00:00
Chris Lattner
d2315f2bd8 revert r20101, I built one tree and tested another.
Swift SVN r20102
2014-07-17 17:12:31 +00:00
Chris Lattner
9b0d88e800 switch 'convenience' from being a specially handles contextual keyword
to being a decl modifier just like the rest, this elimiantes a bunch of
special case code for handling it.


Swift SVN r20101
2014-07-17 17:08:32 +00:00
Chris Lattner
6fb46992f2 move the utility functions that map a string to a type/decl attribute ID out of ParseDecl into Attr.cpp,
allowing us to give them a better name and dox comment them.  This elimiantes a duplicate copy from the IDE layer as well, ensuring consistency.


Swift SVN r20075
2014-07-17 05:28:34 +00:00
Chris Lattner
a9ed3303a6 rip out "AtLoc" in DeclAttributes, now that each individual attribute tracks the location of its associated @ (if present)
Swift SVN r20072
2014-07-17 05:02:01 +00:00
Chris Lattner
fdaa28ce16 fix a warning about a zero length array, by ripping out all of the old declattributes code. :-)
Swift SVN r20071
2014-07-17 04:48:34 +00:00
Chris Lattner
f21bcae0bc remove support for attribute inversion (i.e. @!foo). This doesn't work with
decl modifiers and our direction has been established to use "nonfoo" or 
foo(not_for_you) style of attributes.


Swift SVN r20007
2014-07-16 05:40:23 +00:00
Chris Lattner
57cd2506ff Change "operator infix" to "infix operator" for consistency with the rest of the declaration
modifiers and with the func implementations of the operators.  This resolves the rest of:
<rdar://problem/17527000> change operator declarations from "operator prefix" to "prefix operator" & make operator a keyword




Swift SVN r19931
2014-07-14 16:39:10 +00:00
Sonny Falk
6b053e6252 [IDE] Add support for Swift extension declarations to the document substructure.
Add tests for struct, protocol and extension.
This addresses the first part of <rdar://problem/15818966>.

Swift SVN r19766
2014-07-10 00:23:00 +00:00
Chris Lattner
29421227e1 mark some global variables const, fix trivial coding standards issue.
Swift SVN r19554
2014-07-04 05:55:27 +00:00
Argyrios Kyrtzidis
cff07de44e [IDE] Search for URLs in comments and report them in the syntax model.
Swift SVN r19424
2014-07-01 19:21:17 +00:00
Argyrios Kyrtzidis
e64821d268 [IDE] Search all comments for 'FIXME:', 'TODO:', 'MARK:' and report them in the syntax model.
Swift SVN r19423
2014-07-01 19:21:16 +00:00
Argyrios Kyrtzidis
d67b3d5b08 [IDE] Provide the type source range for parameters in the syntax model.
rdar://17074991

Swift SVN r19249
2014-06-26 20:59:44 +00:00
Jordan Rose
deaa0a1497 Parse @private, @internal, @public, and the (set) variants of each.
This does no validation of the access control modifiers.

As part of this commit, note that "virtual" attributes may actually be
written in the source under another spelling. Update a few other parts of
the source to account for that.

Swift SVN r19140
2014-06-24 21:32:03 +00:00
Argyrios Kyrtzidis
2fe6987c5a [IDE] Annotate 'convenience' in an initializer as keyword.
rdar://16855149

Swift SVN r18065
2014-05-14 05:51:09 +00:00
Sonny Falk
75d06575b6 [IDE] Pass the correct range in the document structure for keyword arguments
with parameters that have both API and local name.
Add a test for the above.
This addresses <rdar://problem/16905994>.

Swift SVN r18053
2014-05-14 01:51:06 +00:00
Sonny Falk
35ca554de1 [IDE] Don't include name range in the structure for non-api parameters.
Update the test accordingly.

Swift SVN r17893
2014-05-11 22:18:01 +00:00
Sonny Falk
7949d17021 [IDE] Provide call structure data and keyword arguments in document structure.
This will be used to highlight function calls and declarations for
QuickHelp and Jump-to-definition.
Add test for the above.
<rdar://problem/16862981>.

Swift SVN r17824
2014-05-10 02:54:55 +00:00
Argyrios Kyrtzidis
7de8d31c7a [IDE] Syntax color operator decls.
rdar://16530692

Swift SVN r17692
2014-05-08 08:11:38 +00:00
Ted Kremenek
196cdc3b22 Place -Wconditional-uninitialized by storing 'Length' in an optional.
Swift SVN r17616
2014-05-07 07:37:56 +00:00
Argyrios Kyrtzidis
84ae58d7d7 [IDE] For the syntax structure walker report ParamDecls as well.
Swift SVN r17442
2014-05-05 15:14:32 +00:00
Argyrios Kyrtzidis
2442d063ef [IDE] Fix syntax annotation crash with #if blocks that are missing an #endif.
rdar://16785562

Swift SVN r17231
2014-05-02 06:12:05 +00:00
Chris Lattner
0c390777ba Implement <rdar://problem/16204675> Need #elseif
This restructures IfConfigDecl/Stmt to be a list of clauses controlled
by a condition.  This makes it straight-forward to drop in #elseif support.

While I'm in here, this patch moves checking for extraneous stuff at the
end of the #if line from the lexer to the parser.  This means that you can
now put a comment on the same line as a #if/#else/#elseif/#endif.



Swift SVN r16912
2014-04-27 04:51:36 +00:00
Argyrios Kyrtzidis
2db90e9105 [IDE] For the syntax node of functions, set the name range to the range of the function signature.
Swift SVN r16680
2014-04-23 00:24:11 +00:00
Chris Lattner
7eb2a79d90 remove dead variable
Swift SVN r16546
2014-04-18 20:31:51 +00:00
Dmitri Hrybenko
e2e8db5f38 Migrate IB attributes to new decl attribute representation and fix a few bugs
along the way


Swift SVN r16542
2014-04-18 20:00:09 +00:00
Argyrios Kyrtzidis
a0b97196f1 [IDE] Provide the declaration along with the SyntaxStructureNode.
Swift SVN r16504
2014-04-18 07:07:15 +00:00
Dmitri Hrybenko
810afec04d Fix coding style and formatting
Swift SVN r16210
2014-04-11 10:06:00 +00:00
Sonny Falk
407e538d85 [IDE] Make sure to handle the case of virtual-only attributes
for syntax coloring.
Add a test for the above.
This addresses <rdar://problem/16584438>.

Swift SVN r16194
2014-04-11 02:15:16 +00:00
Argyrios Kyrtzidis
b7a85f2af9 [IDE] Do syntax annotation for '#if' constructs.
Swift SVN r15447
2014-03-25 03:55:32 +00:00
Sonny Falk
7d37543b1e [IDE] Don't try to pass context sensitive keyword token for accessor
function unless it has a dedicated source location.
This addresses <rdar://problem/15530448>.

Swift SVN r15262
2014-03-20 02:50:11 +00:00
Argyrios Kyrtzidis
1173c4e6a0 [IDE] Annotate 'inout' in parameters as keyword.
Swift SVN r15137
2014-03-17 16:01:32 +00:00
Sonny Falk
e60c59892b [IDE] Pass a brace structure node for switch body.
This addresses <rdar://problem/16256501>.

Swift SVN r14767
2014-03-07 02:02:18 +00:00
Sonny Falk
6158003552 [IDE] Don't pass brace structure node for implicit brace in CaseStmt.
This addresses <rdar://problem/16253769>.

Swift SVN r14766
2014-03-07 02:02:18 +00:00