Merge branch 'master' into issue1840
This commit is contained in:
commit
80b6bd516e
15 changed files with 59 additions and 2815 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -9,7 +9,6 @@ Makefile
|
|||
objects
|
||||
.gdbinit
|
||||
.qmake.stash
|
||||
parser_yacc.h
|
||||
**/#*#
|
||||
/.dir-locals.el
|
||||
testdata/scad/2D/features/import_dxf-tests.scad
|
||||
|
|
@ -36,8 +35,6 @@ testdata/scad/misc/use-tests.scad
|
|||
/*.h
|
||||
/*.dump
|
||||
/*.pl
|
||||
/lexer_lex.cpp
|
||||
/parser_yacc.cpp
|
||||
/OpenSCAD.app
|
||||
/openscad.appdata.xml
|
||||
/openscad.pro.user
|
||||
|
|
|
|||
39
bison.pri
39
bison.pri
|
|
@ -1,45 +1,10 @@
|
|||
{
|
||||
bison.name = Bison ${QMAKE_FILE_IN}
|
||||
bison.input = BISONSOURCES
|
||||
bison.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.cpp
|
||||
bison.commands = bison -d -p ${QMAKE_FILE_BASE} -o ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.cpp ${QMAKE_FILE_IN}
|
||||
bison.commands += && if [[ -e ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ]] ; then mv ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.h ; fi
|
||||
bison.output = ${OBJECTS_DIR}/${QMAKE_FILE_BASE}.cxx
|
||||
bison.commands = bison -d -p ${QMAKE_FILE_BASE} -o ${OBJECTS_DIR}/${QMAKE_FILE_BASE}.cxx --defines=${OBJECTS_DIR}/${QMAKE_FILE_BASE}.hxx ${QMAKE_FILE_IN}
|
||||
bison.CONFIG += target_predeps
|
||||
bison.variable_out = GENERATED_SOURCES
|
||||
silent:bison.commands = @echo Bison ${QMAKE_FILE_IN} && $$bison.commands
|
||||
QMAKE_EXTRA_COMPILERS += bison
|
||||
bison_header.input = BISONSOURCES
|
||||
bison_header.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.h
|
||||
bison_header.commands = bison -d -p ${QMAKE_FILE_BASE} -o ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.cpp ${QMAKE_FILE_IN}
|
||||
bison_header.commands += && if [ -e ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ]; then mv ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.h ; fi
|
||||
bison_header.CONFIG += target_predeps no_link
|
||||
silent:bison_header.commands = @echo Bison ${QMAKE_FILE_IN} && $$bison.commands
|
||||
QMAKE_EXTRA_COMPILERS += bison_header
|
||||
}
|
||||
|
||||
unix:linux* {
|
||||
exists(/usr/bin/bison) {
|
||||
QMAKE_YACC = /usr/bin/bison
|
||||
}
|
||||
}
|
||||
|
||||
freebsd* {
|
||||
# on some BSD, /usr/local/bin/bison is newer than
|
||||
# /usr/bin/bison, so try to prefer it.
|
||||
exists(/usr/local/bin/bison) {
|
||||
QMAKE_YACC = /usr/local/bin/bison
|
||||
} else { # look in $PATH
|
||||
QMAKE_YACC = bison
|
||||
}
|
||||
}
|
||||
|
||||
netbsd* {
|
||||
exists(/usr/pkg/bin/bison) {
|
||||
QMAKE_YACC = /usr/pkg/bin/bison
|
||||
} else { # look in $PATH
|
||||
QMAKE_YACC = bison
|
||||
}
|
||||
}
|
||||
|
||||
win32*msvc* {
|
||||
}
|
||||
|
|
|
|||
23
common.pri
23
common.pri
|
|
@ -3,6 +3,29 @@ MOC_DIR = objects
|
|||
UI_DIR = objects
|
||||
RCC_DIR = objects
|
||||
|
||||
# Handle custom library location.
|
||||
# Used when manually installing 3rd party libraries
|
||||
isEmpty(OPENSCAD_LIBDIR) OPENSCAD_LIBDIR = $$(OPENSCAD_LIBRARIES)
|
||||
macx:isEmpty(OPENSCAD_LIBDIR) {
|
||||
exists(/opt/local):exists(/usr/local/Cellar) {
|
||||
error("It seems you might have libraries in both /opt/local and /usr/local. Please specify which one to use with qmake OPENSCAD_LIBDIR=<prefix>")
|
||||
} else {
|
||||
exists(/opt/local) {
|
||||
#Default to MacPorts on Mac OS X
|
||||
message("Automatically searching for libraries in /opt/local. To override, use qmake OPENSCAD_LIBDIR=<prefix>")
|
||||
OPENSCAD_LIBDIR = /opt/local
|
||||
} else:exists(/usr/local/Cellar) {
|
||||
message("Automatically searching for libraries in /usr/local. To override, use qmake OPENSCAD_LIBDIR=<prefix>")
|
||||
OPENSCAD_LIBDIR = /usr/local
|
||||
}
|
||||
}
|
||||
}
|
||||
!isEmpty(OPENSCAD_LIBDIR) {
|
||||
QMAKE_INCDIR = $$OPENSCAD_LIBDIR/include
|
||||
QMAKE_LIBDIR = $$OPENSCAD_LIBDIR/lib
|
||||
}
|
||||
|
||||
|
||||
include(win.pri)
|
||||
include(flex.pri)
|
||||
include(bison.pri)
|
||||
|
|
|
|||
19
flex.pri
19
flex.pri
|
|
@ -1,25 +1,10 @@
|
|||
{
|
||||
flex.name = Flex ${QMAKE_FILE_IN}
|
||||
flex.input = FLEXSOURCES
|
||||
flex.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.lexer.cpp
|
||||
flex.commands = flex -P ${QMAKE_FILE_BASE} -o${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.lexer.cpp ${QMAKE_FILE_IN}
|
||||
flex.output = ${OBJECTS_DIR}/${QMAKE_FILE_BASE}.cxx
|
||||
flex.commands = flex -P ${QMAKE_FILE_BASE} -o ${OBJECTS_DIR}/${QMAKE_FILE_BASE}.cxx --header-file=${OBJECTS_DIR}/${QMAKE_FILE_BASE}.hxx ${QMAKE_FILE_IN}
|
||||
flex.CONFIG += target_predeps
|
||||
flex.variable_out = GENERATED_SOURCES
|
||||
silent:flex.commands = @echo Lex ${QMAKE_FILE_IN} && $$flex.commands
|
||||
QMAKE_EXTRA_COMPILERS += flex
|
||||
}
|
||||
|
||||
unix:linux* {
|
||||
exists(/usr/bin/flex) {
|
||||
QMAKE_LEX = /usr/bin/flex
|
||||
}
|
||||
}
|
||||
|
||||
freebsd* {
|
||||
QMAKE_LEX = /usr/local/bin/flex
|
||||
}
|
||||
|
||||
netbsd* {
|
||||
QMAKE_LEX = /usr/pkg/bin/flex
|
||||
}
|
||||
|
||||
|
|
|
|||
62
openscad.pro
62
openscad.pro
|
|
@ -49,28 +49,6 @@ TEMPLATE = app
|
|||
INCLUDEPATH += src
|
||||
DEPENDPATH += src
|
||||
|
||||
# Handle custom library location.
|
||||
# Used when manually installing 3rd party libraries
|
||||
isEmpty(OPENSCAD_LIBDIR) OPENSCAD_LIBDIR = $$(OPENSCAD_LIBRARIES)
|
||||
macx:isEmpty(OPENSCAD_LIBDIR) {
|
||||
exists(/opt/local):exists(/usr/local/Cellar) {
|
||||
error("It seems you might have libraries in both /opt/local and /usr/local. Please specify which one to use with qmake OPENSCAD_LIBDIR=<prefix>")
|
||||
} else {
|
||||
exists(/opt/local) {
|
||||
#Default to MacPorts on Mac OS X
|
||||
message("Automatically searching for libraries in /opt/local. To override, use qmake OPENSCAD_LIBDIR=<prefix>")
|
||||
OPENSCAD_LIBDIR = /opt/local
|
||||
} else:exists(/usr/local/Cellar) {
|
||||
message("Automatically searching for libraries in /usr/local. To override, use qmake OPENSCAD_LIBDIR=<prefix>")
|
||||
OPENSCAD_LIBDIR = /usr/local
|
||||
}
|
||||
}
|
||||
}
|
||||
!isEmpty(OPENSCAD_LIBDIR) {
|
||||
QMAKE_INCDIR = $$OPENSCAD_LIBDIR/include
|
||||
QMAKE_LIBDIR = $$OPENSCAD_LIBDIR/lib
|
||||
}
|
||||
|
||||
# add CONFIG+=deploy to the qmake command-line to make a deployment build
|
||||
deploy {
|
||||
message("Building deployment version")
|
||||
|
|
@ -230,13 +208,8 @@ FORMS += src/MainWindow.ui \
|
|||
src/parameter/ParameterEntryWidget.ui
|
||||
|
||||
# AST nodes
|
||||
win* {
|
||||
FLEXSOURCES = src/lexer.l
|
||||
BISONSOURCES = src/parser.y
|
||||
} else {
|
||||
LEXSOURCES += src/lexer.l
|
||||
YACCSOURCES += src/parser.y
|
||||
}
|
||||
FLEXSOURCES += src/lexer.l
|
||||
BISONSOURCES += src/parser.y
|
||||
|
||||
HEADERS += src/AST.h \
|
||||
src/ModuleInstantiation.h \
|
||||
|
|
@ -257,35 +230,8 @@ SOURCES += src/AST.cc \
|
|||
src/assignment.cc
|
||||
|
||||
# Comment parser
|
||||
FLEX = src/comment_lexer.l
|
||||
BISON = src/comment_parser.y
|
||||
|
||||
flexs.name = Flex ${QMAKE_FILE_IN}
|
||||
flexs.input = FLEX
|
||||
flexs.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}.cpp
|
||||
flexs.commands = flex -o${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}.cpp ${QMAKE_FILE_IN}
|
||||
flexs.CONFIG += target_predeps
|
||||
flexs.variable_out = GENERATED_SOURCES
|
||||
silent:flexs.commands = @echo Lex ${QMAKE_FILE_IN} && $$flexs.commands
|
||||
QMAKE_EXTRA_COMPILERS += flexs
|
||||
|
||||
bison.name = Bison ${QMAKE_FILE_IN}
|
||||
biso.input = BISON
|
||||
biso.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}.cpp
|
||||
biso.commands = bison -d -o ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}.cpp ${QMAKE_FILE_IN}
|
||||
biso.commands += && if [[ -e ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}_yacc.hpp ]] ; then mv ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.hpp ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.h ; fi
|
||||
biso.CONFIG += target_predeps
|
||||
biso.variable_out = GENERATED_SOURCES
|
||||
silent:biso.commands = @echo Bison ${QMAKE_FILE_IN} && $$biso.commands
|
||||
QMAKE_EXTRA_COMPILERS += biso
|
||||
|
||||
biso_header.input = BISON
|
||||
biso_header.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}.h
|
||||
biso_header.commands = bison -d -o ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}.cpp ${QMAKE_FILE_IN}
|
||||
biso_header.commands += && if [ -e ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}.hpp ]; then mv ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}.hpp ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}.h ; fi
|
||||
biso_header.CONFIG += target_predeps no_link
|
||||
silent:biso_header.commands = @echo Bison ${QMAKE_FILE_IN} && $$biso.commands
|
||||
QMAKE_EXTRA_COMPILERS += biso_header
|
||||
FLEXSOURCES += src/comment_lexer.l
|
||||
BISONSOURCES += src/comment_parser.y
|
||||
|
||||
HEADERS += src/version_check.h \
|
||||
src/ProgressWidget.h \
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ OPTION_CXX11=true
|
|||
|
||||
PACKAGES=(
|
||||
# NB! For eigen, also update the path in the function
|
||||
"eigen 3.2.8"
|
||||
"eigen 3.3.1"
|
||||
"gmp 6.1.1"
|
||||
"mpfr 3.1.4"
|
||||
"boost 1.61.0"
|
||||
|
|
@ -451,29 +451,11 @@ build_eigen()
|
|||
cd $BASEDIR/src
|
||||
rm -rf eigen-$version
|
||||
|
||||
EIGENDIR="none"
|
||||
if [ $version = "3.1.2" ]; then EIGENDIR=eigen-eigen-5097c01bcdc4;
|
||||
elif [ $version = "3.1.3" ]; then EIGENDIR=eigen-eigen-2249f9c22fe8;
|
||||
elif [ $version = "3.1.4" ]; then EIGENDIR=eigen-eigen-36bf2ceaf8f5;
|
||||
elif [ $version = "3.2.0" ]; then EIGENDIR=eigen-eigen-ffa86ffb5570;
|
||||
elif [ $version = "3.2.1" ]; then EIGENDIR=eigen-eigen-6b38706d90a9;
|
||||
elif [ $version = "3.2.2" ]; then EIGENDIR=eigen-eigen-1306d75b4a21;
|
||||
elif [ $version = "3.2.3" ]; then EIGENDIR=eigen-eigen-36fd1ba04c12;
|
||||
elif [ $version = "3.2.4" ]; then EIGENDIR=eigen-eigen-10219c95fe65;
|
||||
elif [ $version = "3.2.6" ]; then EIGENDIR=eigen-eigen-c58038c56923;
|
||||
elif [ $version = "3.2.8" ]; then EIGENDIR=eigen-eigen-07105f7124f9;
|
||||
fi
|
||||
|
||||
if [ $EIGENDIR = "none" ]; then
|
||||
echo Unknown eigen version. Please edit script.
|
||||
exit 1
|
||||
fi
|
||||
rm -rf ./$EIGENDIR
|
||||
|
||||
if [ ! -f eigen-$version.tar.bz2 ]; then
|
||||
curl -LO http://bitbucket.org/eigen/eigen/get/$version.tar.bz2
|
||||
mv $version.tar.bz2 eigen-$version.tar.bz2
|
||||
fi
|
||||
EIGENDIR=`tar tjf eigen-$version.tar.bz2 | head -1 | cut -f1 -d"/"`
|
||||
tar xjf eigen-$version.tar.bz2
|
||||
ln -s ./$EIGENDIR eigen-$version
|
||||
cd eigen-$version
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
</p>
|
||||
|
||||
<p>
|
||||
Copyright (C) 2009-2015 The OpenSCAD Developers
|
||||
Copyright (C) 2009-2017 The OpenSCAD Developers
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -221,6 +221,10 @@ Response CSGTreeEvaluator::visit(State &state, const CsgOpNode &node)
|
|||
Response CSGTreeEvaluator::visit(State &state, const TransformNode &node)
|
||||
{
|
||||
if (state.isPrefix()) {
|
||||
if (matrix_contains_infinity(node.matrix) || matrix_contains_nan(node.matrix)) {
|
||||
PRINT("WARNING: Transformation matrix contains Not-a-Number and/or Infinity - removing object.");
|
||||
return PruneTraversal;
|
||||
}
|
||||
state.setMatrix(state.matrix() * node.matrix);
|
||||
}
|
||||
if (state.isPostfix()) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include "Assignment.h"
|
||||
#include "expression.h"
|
||||
#include "value.h"
|
||||
#include "comment_parser.h"
|
||||
#include "comment_parser.hxx"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
YY_BUFFER_STATE yy_scan_string ( const char *str ) ;
|
||||
std::string stringcon;
|
||||
|
|
@ -26,7 +26,7 @@ UNICODE {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
|
|||
[+-]?{D}*\.{D}+{E}? |
|
||||
[+-]?{D}+\.{D}*{E}? {
|
||||
try {
|
||||
yylval.num = boost::lexical_cast<double>(yytext);
|
||||
comment_parserlval.num = boost::lexical_cast<double>(yytext);
|
||||
return NUM;
|
||||
} catch (boost::bad_lexical_cast) {}
|
||||
}
|
||||
|
|
@ -48,15 +48,15 @@ UNICODE {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
|
|||
{UNICODE} { stringcon += yytext; }
|
||||
[^\\\n\"] { stringcon += yytext; }
|
||||
\" { BEGIN(INITIAL);
|
||||
yylval.text = strdup(stringcon.c_str());
|
||||
comment_parserlval.text = strdup(stringcon.c_str());
|
||||
return WORD; }
|
||||
<<EOF>> { BEGIN(INITIAL);
|
||||
yylval.text = strdup(stringcon.c_str());
|
||||
comment_parserlval.text = strdup(stringcon.c_str());
|
||||
return WORD; }
|
||||
}
|
||||
|
||||
|
||||
[^(\[ \] \, \" \:)]* { yylval.text=strdup(yytext); return WORD;}
|
||||
[^(\[ \] \, \" \:)]* { comment_parserlval.text=strdup(yytext); return WORD;}
|
||||
|
||||
. { }
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@
|
|||
#include "value.h"
|
||||
#include "comment.h"
|
||||
void yyerror(char *);
|
||||
int yylex(void);
|
||||
extern void yy_scan_string ( const char *str );
|
||||
int comment_lexerlex(void);
|
||||
int comment_parserlex(void);
|
||||
extern void comment_lexer_scan_string ( const char *str );
|
||||
Expression *params;
|
||||
%}
|
||||
%union {
|
||||
|
|
@ -121,6 +122,11 @@ word:
|
|||
}
|
||||
%%
|
||||
|
||||
int comment_parserlex(void)
|
||||
{
|
||||
return comment_lexerlex();
|
||||
}
|
||||
|
||||
void yyerror(char *msg) {
|
||||
PRINTD("ERROR IN PARAMETER: Parser error in comments of file \n ");
|
||||
params = NULL;
|
||||
|
|
@ -128,8 +134,8 @@ void yyerror(char *msg) {
|
|||
|
||||
shared_ptr<Expression> CommentParser::parser(const char *text)
|
||||
{
|
||||
yy_scan_string(text);
|
||||
int parserretval = yyparse();
|
||||
comment_lexer_scan_string(text);
|
||||
int parserretval = comment_parserparse();
|
||||
if (parserretval != 0) return NULL;
|
||||
return shared_ptr<Expression>(params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include "printutils.h"
|
||||
#include "parsersettings.h"
|
||||
#include "Assignment.h"
|
||||
#include "parser_yacc.h"
|
||||
#include "parser.hxx"
|
||||
#include "FileModule.h"
|
||||
#include <assert.h>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@
|
|||
unsigned int GuiLocker::gui_locked = 0;
|
||||
|
||||
static char copyrighttext[] =
|
||||
"Copyright (C) 2009-2015 The OpenSCAD Developers\n"
|
||||
"Copyright (C) 2009-2017 The OpenSCAD Developers\n"
|
||||
"\n"
|
||||
"This program is free software; you can redistribute it and/or modify "
|
||||
"it under the terms of the GNU General Public License as published by "
|
||||
|
|
@ -211,11 +211,11 @@ MainWindow::MainWindow(const QString &filename)
|
|||
|
||||
#ifdef USE_SCINTILLA_EDITOR
|
||||
if (useScintilla) {
|
||||
connect(editor, SIGNAL(previewRequest()), this, SLOT(actionRenderPreview()));
|
||||
connect(Preferences::inst(), SIGNAL(editorConfigChanged()), editor, SLOT(applySettings()));
|
||||
Preferences::inst()->fireEditorConfigChanged();
|
||||
}
|
||||
#endif
|
||||
connect(editor, SIGNAL(previewRequest()), this, SLOT(actionRenderPreview()));
|
||||
|
||||
editorDockContents->layout()->addWidget(editor);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ ScadLexer::ScadLexer(QObject *parent) : QsciLexerCPP(parent)
|
|||
// -> Style: GlobalClass
|
||||
keywordSet[3] =
|
||||
"cube sphere cylinder polyhedron square circle polygon text "
|
||||
"minkowski hull resize child echo union difference "
|
||||
"minkowski hull resize child children echo union difference "
|
||||
"intersection linear_extrude rotate_extrude import group "
|
||||
"projection render surface scale rotate mirror translate "
|
||||
"multmatrix color offset ";
|
||||
|
|
|
|||
|
|
@ -442,8 +442,8 @@ find_package(FLEX REQUIRED)
|
|||
if (WIN32)
|
||||
set(FLEX_UNISTD_FLAG "-DYY_NO_UNISTD_H")
|
||||
endif()
|
||||
FLEX_TARGET(OpenSCADlexer ../src/lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp COMPILE_FLAGS "-Plexer ${FLEX_UNISTD_FLAG}")
|
||||
BISON_TARGET(OpenSCADparser ../src/parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser_yacc.c COMPILE_FLAGS "-p parser")
|
||||
FLEX_TARGET(OpenSCADlexer ../src/lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cxx COMPILE_FLAGS "-Plexer ${FLEX_UNISTD_FLAG}")
|
||||
BISON_TARGET(OpenSCADparser ../src/parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cxx COMPILE_FLAGS "-p parser")
|
||||
ADD_FLEX_BISON_DEPENDENCY(OpenSCADlexer OpenSCADparser)
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/parser_yacc.c PROPERTIES LANGUAGE "CXX")
|
||||
|
||||
|
|
|
|||
2664
virtualfb.log
2664
virtualfb.log
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue