Flex does not recognize patterns of type (?r-s:pattern) - flex-lexer

I have flex version 2.5.4 installed.
Whenever i input a flex program of the form:
%{
#include<stdio.h>
%}
%%
(?i:foo) printf("foo found");
%%
I get unrecognized rule error on the line (?i:foo) ...
Please let me know what I am doing wrong.
Thanks

If you want to use pattern flags, you need to upgrade your version of flex. The pattern syntax (?i:...) was added in version 2.5.35 (but you might as well update to the current version, 2.5.39).
Note: ubuntu has two flex packages: flex and flex-old. Logically, flex-old is an older version of flex (2.5.4, in fact). I don't know under what circumstances an ubuntu installation will contain the outdated flex, but if you find yourself with flex-old installed, you should be able to replace it with flex using apt-get install.

Related

Importing lua modules and using them with lua pandoc filter

Pandoc natively supports lua filter by its --lua-filter argument.
However, I am wondering however what version of lua is it using and whether it is possible to import lua modules such as luacom (which i believe relies on C code) into it.
This is part of my investigation to create a filter that reads excel worksheet and converts them to pandoc table.
It is generally possible to check the Lua version by running print(_VERSION). I.e., running this in your shell should work:
pandoc --lua-filter <(echo 'print(_VERSION)') <<< ''
Older pandoc versions could be compiled with any of Lua 5.1, Lua 5.2, Lua 5.3, or LuaJIT. However, maintaining compatibility was burdensome, so the maintainer of the HsLua package used by pandoc (i.e., I), stopped supporting older versions about a year ago. If you are using pandoc 2.3.1 or later, pandoc is guaranteed to contain Lua 5.3.x.
Loading pure Lua libraries will be no problem and should work just as with a plain Lua executable. The only problem can be that the default LUA_PATH set in pandoc differs from that used in other programs. This can happen if pandoc has not been compiled against the system-wide Lua version. LuaRocks can help there, just run eval "$(luarocks path)".
Same as with pure Lua libraries, C Lua libraries should just work if pandoc has been compiled as a non-static binary. However, non-Windows binaries provided on the pandoc website and on GitHub are static, and dynamic loading of C libraries will not work.
We maintain Alpine-based Docker images, pandoc/core and pandoc/latex, which are compiled against the system-wide Lua version. This can be a good option if your platform's package manager doesn't ship a recent pandoc version, can't use the statically compiled binary, and you don't want to compile pandoc yourself. If you'd like to see support for other base image like Ubuntu, just raise a ticket.

Prompt-toolkit version issue- incompatible with rasa-core and spyder

I am training a question answering model with rasa-nlu and rasa-core from terminal, wherein it requires the version of prompt-toolkit to be less than version 2.0.0 and when I try to open spyder IDEfrom Anaconda prompt, it is throwing error as it is expecting the prompt-toolkit version to be greater than 2. If I upgrade the version of prompt-toolkit the rasa-core code throws error in terminal. Is there any way to overcome this problem?
This was due to the not maintained dependency for PyInquirer in Rasa Core.
The library PyInquirer is replaced in the new Rasa Core release 0.13.0 with the library questionary. If you already want to have the latest release you can use the latest alpha version, by doing pip install rasa_core==0.13.0a5.

how do you set your version of dart via pub?

I wasnt sure if i need to update it through their website or something, or if it is possible do call some sort of dart version command which will update DART to be a particular version.
Example: Dart is either 1.14, or 1.16. If i want to do it through pub, is there a way to do something like: pub set dart 1.15 or something. I know set isnt a valid command, but i think you get the jist.
This depends on your operating system and what system you use to install Dart.
For Debian you can use apt-get install dart. apt-get allows to pass a specific version number.
For installation options see https://www.dartlang.org/downloads/
In pubspec.yaml you can only specify what DART SDK version and dependency versions are supported by a package but it doesn't have and influence which Dart SDK version gets installed.

Any conflict if Luarocks is compiled w/a different Lua than the target?

If I compile Luarocks with a Lua (eg PUC 5.3), then use Luarocks to install rocks to be used by a different Lua (eg Luajit, Luarocks --tree my/lua-project-5.1), would there be any conflict down the line?
Yes. You shouldn't mix Lua versions like that, because when building modules written in C, they will use the header files for the specific Lua version that LuaRocks was configured for. This will result in modules that will either fail to build or fail to load in other versions of the interpreter.
Note however that you can have multiple simultaneous installations of LuaRocks, each for one Lua version.

Building Clang, libstdc++4.6 to libstdc++4.7

I am trying to build Clang following this: http://clang.llvm.org/get_started.html
At step 6 the command ../llvm/configure runs a series of checks and one tells me:
checking whether Clang will select a modern C++ standard library... no
configure: error:
We detected a missing feature in the standard C++ library that was known to be
missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
than 4.7. You will need to update your system and ensure Clang uses the newer
standard library.
If this error is incorrect or you need to force things to work, you may pass
'--disable-compiler-version-checks' to configure to bypass this test.
I don't know how to resolve this and google searches for libstdc++4.7 did not produce anything useful to me or something I understand. How do I go about replacing / upgrading this? I am on a Mac (10.7.5)
I ran into the same problem. The easiest way to build Clang is to use libc++ instead of libstdc++. If you don't have libc++, you can obtain it by installing XCode 4.2 (or newer) or you can build it yourself by following the instructions here: http://libcxx.llvm.org/
After you have libc++ installed, you can use the --enable-libcpp=yes flag with the configure command.
Just this week, the LLVM & Clang project upped the minimal compiler version requirement to gcc 4.7, with its libstdc++. You'll need to install or build a newer gcc.
Here's a blog post I wrote earlier today about building gcc 4.8 on Ubuntu 12.04 and using that to compile trunk LLVM & Clang. Hope this helps!
i have the same error on mac 10.8.5 xcode 5.0
configure option --enable-libcpp resolve my problem
../llvm/configure --enable-cxx11 --enable-optimized --enable-libcpp
For me this happened because I had the old clang and clang++ that I'd previously built from source (the one I was attempting to build to replace) coming first in my PATH. These were too old. Removing those two files so that the build process would use the clang and clang++ that comes with XCode's Command Line Tools and then rebuilding worked fine.

Resources