Commit Graph

61 Commits

Author SHA1 Message Date
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
Sonny Falk
a79aeb66ec [IDE] Don't pass brace structure node for implicit brace in top level code.
Swift SVN r14577
2014-03-02 23:30:54 +00:00
Sonny Falk
4eb7f99d08 [IDE] Consolidate code checking whether to pass brace structure node into a new function. NFC.
Swift SVN r14576
2014-03-02 23:30:48 +00:00
Dmitri Hrybenko
28412712b7 ModelASTWalker: don't attempt to walk implict declarations, they don't have
source information


Swift SVN r14513
2014-02-28 12:08:56 +00:00
Sonny Falk
9e7d522950 [IDE] Add BraceStatement to SyntaxStructure.
Add a test for the above.

Swift SVN r14449
2014-02-27 04:57:28 +00:00
Sonny Falk
d7caa10d65 [IDE] Add BodyRange to SyntaxStructureNode, and vend the inner body
range for appropriate structure nodes.

Swift SVN r14448
2014-02-27 04:57:26 +00:00
John McCall
10ac15ed0d Lex $notAllDigits as an identifier and diagnose it in the lexer
outside of debugger-support mode.  Rip out the existing special-case
code when parsing expr-identifier.

This means that the Lexer needs a LangOptions.  Doug and I
talked about just adding that as a field of SourceMgr, but
decided that it was worth it to preserve the possibility of
parsing different dialects in different source files.

By design, the lexer doesn't tokenize fundamentally differently
in different language modes; it might decide something is invalid,
or it might (eventually) use a different token kind for the
same consumed text, but we don't want it deciding to consume more or
less of the stream per token.

Note that SIL mode does make that kind of difference, and that
arguably means that various APIs for tokenizing need to take a
"is SIL mode" flag, but we're getting away with it because we
just don't really care about fidelity of SIL source files.

rdar://14899000

Swift SVN r13896
2014-02-14 01:54:17 +00:00
Argyrios Kyrtzidis
48023490de [AST] Move AccessorKind enum to top-level so it can be forward declared.
No functionality change.

Swift SVN r13299
2014-02-01 08:50:15 +00:00
Argyrios Kyrtzidis
55c02e0cf0 [IDE] Handle observing accessors for syntax and semantic annotations.
Swift SVN r13295
2014-02-01 06:22:21 +00:00
Argyrios Kyrtzidis
84e20a0620 [AST] Break down IdentTypeRepr to different subtypes.
This makes memory allocation for it more efficient and it's more convenient to handle.

Swift SVN r12541
2014-01-18 20:19:09 +00:00
Argyrios Kyrtzidis
b49950fa80 [IDE] Enhance attribute annotation by splitting the related syntax nodes to:
AttributeId: Any occurence of '@<attribute-name>' anywhere.
AttributeBuiltin: A "resolved/active" attribute. Mis-applied attributes will be AttributeId.

This provides more options for coloring attributes in a way that one can easily spot
attributes that are not applied correctly.

Swift SVN r12194
2014-01-11 02:17:09 +00:00
Argyrios Kyrtzidis
952ac3cd3d [IDE] ModelASTWalker already has a SourceManager object to use.
Swift SVN r12184
2014-01-11 01:09:33 +00:00
Argyrios Kyrtzidis
a17b8a2d15 [IDE] SyntaxModelContext is intended to be used on a SourceFile not a module.
Swift SVN r12183
2014-01-11 01:09:32 +00:00
Sonny Falk
d1f0d9f7c6 [IDE] Give @attributes their own dedicated SyntaxNodeKind::Attribute.
Swift SVN r12138
2014-01-10 22:23:42 +00:00
Sonny Falk
e55342165f [IDE] Teach the syntax model about known @attributes, and treat them as keyword token nodes for syntax coloring.
This addresses <rdar://problem/15599911>.

Swift SVN r12109
2014-01-10 00:46:15 +00:00
Sonny Falk
2c3e2d469f [IDE] Add TypeRange to SyntaxStructureNode, and vend the type name for instance variables.
Swift SVN r12028
2014-01-08 01:33:33 +00:00
Sonny Falk
7eb5b62154 [IDE] Skip out of order non-token nodes.
This fixes <rdar://problem/15535058> and a crash in Xcode <rdar://problem/15642501>.

Swift SVN r11609
2013-12-23 20:52:26 +00:00
Jordan Rose
417b5d3982 Merge TranslationUnit into Module, and eliminate the term "translation unit".
This completes the FileUnit refactoring. A module consists of multiple
FileUnits, which provide decls from various file-like sources. I say
"file-like" because the Builtin module is implemented with a single
BuiltinUnit, and imported Clang modules are just a single FileUnit source
within a module.

Most modules, therefore, contain a single file unit; only the main module
will contain multiple source files (and eventually partial AST files).

The term "translation unit" has been scrubbed from the project. To refer
to the context of declarations outside of any other declarations, use
"top-level" or "module scope". To refer to a .swift file or its DeclContext,
use "source file". To refer to a single unit of compilation, use "module",
since the model is that an entire module will be compiled with a single
driver call. (It will still be possible to compile a single source file
through the direct-to-frontend interface, but only in the context of the
whole module.)

Swift SVN r10837
2013-12-05 01:51:15 +00:00
Sonny Falk
c350114862 [IDE] Fix a typo that caused a crash. <rdar://problem/15580756> Crash in ModelASTWalker::walkToDeclPre() when opening a document in Xcode
Swift SVN r10775
2013-12-04 02:45:33 +00:00
Sonny Falk
69a4cfb866 [IDE] Add InheritedTypeRanges to SyntaxStructureNode.
Add tests to cover name source range and inherited types to the structure tests.

Swift SVN r10767
2013-12-04 00:00:23 +00:00
Sonny Falk
ebddf906cd [IDE] Update the character source ranges for structure nodes so they properly span the entire end token.
Swift SVN r10729
2013-12-02 19:31:07 +00:00
Sonny Falk
1ec5094eee [IDE] Add a structure test for property in the syntax model. Adjust the range to include the type.
Swift SVN r10728
2013-12-02 19:31:07 +00:00