Commit Graph

519 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
0a3fc1b195 Print source ranges of the AST nodes when dumping the AST.
Swift SVN r5959
2013-07-02 00:42:01 +00:00
Joe Groff
1013781bcc Parse: Allow Unicode identifier characters.
Extend the character set for identifiers according to WG14 N1518, which recommends an extended character set for identifier start and continuation characters in C. Mangle identifiers containing non-ASCII characters by borrowing the Punycode encoding used for international domain names.

No Unicode operators just yet.

Swift SVN r4968
2013-04-28 21:39:02 +00:00
Joe Groff
ddb7ead55c REPL: Contextual completions.
If the completion prefix has a '.' behind it, guesstimate a context expression by lexing backward through an identifier(.identifier)* dotted path, then attempt to parse and typecheck that expression to decide on a base type in which to find completions.

Swift SVN r4063
2013-02-16 20:07:50 +00:00
Chris Lattner
7055cfe43a move DiverseList and DiverseStack to swift/Basic, out of IRGen.
Swift SVN r2784
2012-08-26 20:10:10 +00:00
Chris Lattner
482fce9379 further improvements to SLoc printing: actually print line and column #'s now. This depends on llvm r156243
Swift SVN r1754
2012-05-05 21:40:58 +00:00
Chris Lattner
3ae29d8c82 provide facilities to elide the filename for a sourceloc if it matches the previous sourceloc. We now
print ranges as: [t.swift:22 - :23] instead of [t.swift:22 - t.swift:23].


Swift SVN r1753
2012-05-05 21:14:36 +00:00
Chris Lattner
d77d0d3fe3 refactor SourceRange printing out of Verifier.cpp into methods on SourceRange and SourceLoc.
Swift SVN r1752
2012-05-05 21:08:44 +00:00
Doug Gregor
725298a2da Introduce a DiagnosticConsumer abstract interface that is used to
actually render emitted diagnostics. This is both a useful
generalization (we expect to have a number of other
DiagnosticConsumers down the road, as Clang does) and is also
important now to avoid a layering violation when adjusting the source
location at the end of a SourceRange to the end of the token.

 


Swift SVN r850
2011-11-09 18:59:39 +00:00
Chris Lattner
30b6007b61 move the diagnostics stuff from Basic -> AST to fix layering.
Swift SVN r781
2011-10-22 00:41:24 +00:00
Chris Lattner
2f434d98fb straighten out identifiers in diagnostics a bit.
Swift SVN r780
2011-10-22 00:39:28 +00:00
Chris Lattner
dfd529ce3a rename diags::foo to diag::foo
Swift SVN r779
2011-10-22 00:36:19 +00:00
Chris Lattner
0c0e65e553 violate diagnostic layering harder, making it fine to cram types into diagnostics.
Lets here it for non-pod's in unions.


Swift SVN r773
2011-10-21 23:25:29 +00:00
Chris Lattner
9f906da738 sink (a copy of) HadError into DiagnosticEngine, so that errors produced by it trigger error returns from main().
Swift SVN r768
2011-10-20 20:55:22 +00:00
Chris Lattner
f149ab5527 make Identifiers default to be quoted in diagnostic output.
Swift SVN r761
2011-10-19 01:07:31 +00:00
Chris Lattner
a7c7d64fa0 Switch swift to use SourceLoc instead of SMLoc.
Also use the new getAdvancedLoc() method instead of hacking
on SMLoc directly.

Also fix the warning/note/error methods to forward through ASTContext
instead of being replicated everywhere.



Swift SVN r750
2011-10-18 01:22:29 +00:00
Chris Lattner
2d43b8812f update for mainline API changes.
Swift SVN r745
2011-10-16 06:17:27 +00:00
Doug Gregor
f97641d84c Add support for %select{option1|option2}idx to the diagnostic formatter, and use it in the parser
Swift SVN r739
2011-09-27 00:56:09 +00:00
Doug Gregor
a60a77bb8e C99 variadic macros suck. Use template metaprogramming tricks so we
aren't forced to rely on extensions.


Swift SVN r738
2011-09-27 00:25:56 +00:00
Doug Gregor
3d15bf3d55 Introduce a diagnostic-formatting engine and port most of the parser's
diagnostics over to it.

There are a few differences between this diagnostic engine and Clang's
engine:
  - Diagnostics are specified by a .def file (Diagnostics.def), rather
  than via tblgen, which drastically simplifies the build and makes
  code completion work when you add a new diagnostic.
  - Calls to the "diagnose()" method are safely typed based on the
  argument types specified in the .def file, so it's harder to write a
  diagnostic whose expected arguments (in the string) and whose actual
  arguments (in the code) don't match.
  - It uses variadic templates, so it hangs with the cool kids.



Swift SVN r734
2011-09-26 23:46:28 +00:00