Commit graph

9 commits

Author SHA1 Message Date
Olly Betts
6d29260a1a Eliminate C++11 from constant_expr test
This was introduced by a recent commit adding a testcase matching
an example in the manual.  There doesn't seem to be a suitable
termplate in the standard library before C++11, so instead use
a dummy version of std::array defined in the testcase.
2022-03-06 14:21:12 +13:00
Olly Betts
8f54f6180a Update docs for expression parsing improvements 2022-03-04 16:36:04 +13:00
William S Fulton
5e85cf617a Fix linker error in constant_expr testcase 2022-02-20 17:57:38 +00:00
Olly Betts
a7ff0da1f3 Improve parsing of % followed immediately by identifier
If it's not a recognised directive the scanner now emits MODULO and then
rescans what follows, and if the parser then gives a syntax error we
report it as an unknown directive. This means that `a%b` is now allowed
in an expression, and that things like `%std::vector<std::string>` now
give an error rather than being quietly ignored.

Fixes #300
Fixes #368
2022-02-15 15:09:44 +13:00
Olly Betts
ccd313ac64 Move new testcase which needs C++11
I don't see how to easily write this without constexpr.
2022-01-26 13:25:36 +13:00
Olly Betts
e03ef3ecb6 Support foo.bar in constant expressions 2022-01-26 12:43:45 +13:00
Olly Betts
f2de21eb83 Parse common cases of < and > comparisons
Adding full support for these in expressions seems hard to do without
introducing conflicts into the parser grammar, but in fact all reported
cases have had parentheses around the comparison and we can support that
with a few restrictions on the left side of `<`.

Fixes #80 and #635.  Also https://sourceforge.net/p/swig/bugs/1139/
2022-01-25 14:09:41 +13:00
William S Fulton
edd0a06409 fix 0 sized array compile error in test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11981 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-04-08 20:22:03 +00:00
Olly Betts
02eb6a81d1 Fix handling of modulo operator (%) in constant expressions (SF#2818562).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11774 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-04 05:46:31 +00:00