Commit Graph

13 Commits

Author SHA1 Message Date
Rintaro Ishizaki
4c6ece6fe0 [Parse] Don't invalidate compilation condition with invalid platform condition argument (#10221)
It's just a warning.
2017-06-14 15:09:24 +09:00
Joe Groff
9222960df5 Update ConditionalCompilation test. 2017-04-21 12:16:30 -07:00
Jacob Bandes-Storch
e1fd8aa6c7 [Parse] Fix crash in conditional compilation parsing (#7331) 2017-02-08 23:10:26 -08:00
Rintaro Ishizaki
b950f06f3e [Parse] Disallow unsupported condition expression in #if directive
In non-Swift3 mode.

Previously:

  #if FOO = false
  #elseif FOO ? false : true
  #endif

were silently accepted.
i.e. '= false' and '? false : true' were silently ignored.
2017-01-17 22:11:11 +09:00
Jacob Bandes-Storch
49f5251c73 [QoI] offer typo correction for platform conditionals 2017-01-12 09:07:53 -08:00
Robert Widmann
d2570cb964 Restore local type declarations list 2017-01-06 16:16:39 -07:00
practicalswift
9e60bdbffa [gardening] Fix typos. 2016-12-21 21:33:30 +01:00
Robert Widmann
9fd7b5a29c Validate the entire #if configuration
Being lazy here just means we don’t validate the entire if
configuration.  We need to be able to emit diagnostics even in
condition clauses with indeterminate expressions.
2016-12-19 02:32:47 -05:00
Robert Widmann
72beb9d80d Extract common code into StmtTransformer 2016-12-14 14:59:47 -05:00
Rintaro Ishizaki
ec53b6885f [Parse] Let #if diretives be parsed in parseBraceItems()
parseBraceItems() has specific logic for pasing conditional compilation blocks.
Withoutout that, decralations in the block cannot be propagated to outside.
For instance:

  FOO: #if true
  func foo() {}
  #endif
  foo() // error: use of unresolved identifier 'foo'
2016-12-06 22:28:53 +09:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Bryan Chan
bb3486df93 Add new _endian() platform condition check; valid values are "little" and "big". 2016-05-24 19:39:15 -04:00
Jordan Rose
7954be4d87 [test] Move BuildConfigurations/ to Parse/ConditionalCompilation/.
Also move a Parse test that's really about conditional compilation
directives into the new folder.
2016-02-12 11:10:32 -08:00