Commit caf5fc8d authored by Dick Hollenbeck's avatar Dick Hollenbeck

DSNLEXER::NextTok() organizes the specctraMode code better, into one if block mostly.

This keeps it out of the KiCad mode path, making that leaner and less confusing about
what is supported in KiCad mode.  Within KiCad mode, treat quoted vs. non-quoted tokens
as the two general categories, with non-quoted having sub-categories.  Eliminate  
an unimplemented, unused function declaration in DSNLEXER.
 
Improve the output formatting of THROW_PARSE_ERROR().
parent 44d31a18
This diff is collapsed.
......@@ -134,19 +134,6 @@ protected:
return 0;
}
/**
* Function readLineOrCmt
* reads a line from the LINE_READER and returns either:
* <ol>
* <li> a positive line length (a +1 if empty line)
* <li> zero of end of file.
* <li> DSN_COMMENT if the line is a comment
* </ol>
*/
int readLineOrCmt();
/**
* Function findToken
* takes a string and looks up the string in the list of expected
......@@ -154,7 +141,8 @@ protected:
*
* @param tok A string holding the token text to lookup, in an
* unpredictable case: uppercase or lowercase
* @return int - DSN_T or -1 if argument string is not a recognized token.
* @return int - DSN_T matching the keyword text, or DSN_SYMBOL if argument
* string is not a recognized token.
*/
int findToken( const std::string& tok );
......@@ -168,6 +156,8 @@ protected:
return false;
}
#endif
public:
......
......@@ -45,7 +45,7 @@
#define IO_FORMAT _( "IO_ERROR: %s\nfrom %s : %s" )
#define PARSE_FORMAT _( "PARSE_ERROR: %s in input/source \"%s\", line %d, offset %d\nfrom %s : %s" )
#define PARSE_FORMAT _( "PARSE_ERROR: %s in input/source\n'%s'\nline %d\noffset %d\nfrom %s : %s" )
// references:
// http://stackoverflow.com/questions/2670816/how-can-i-use-the-compile-time-constant-line-in-a-string
......
......@@ -50,6 +50,9 @@
#include <class_board.h>
#include <build_version.h> // LEGACY_BOARD_FILE_VERSION
//#define USE_INSTRUMENTATION true
#define USE_INSTRUMENTATION false
static const wxString backupFileExtensionSuffix( wxT( "-bak" ) );
static const wxString autosaveFilePrefix( wxT( "_autosave-" ) );
......@@ -283,7 +286,7 @@ bool PCB_EDIT_FRAME::LoadOnePcbFile( const wxString& aFileName, bool aAppend,
props["page_width"] = wxString::Format( wxT( "%d" ), GetPageSizeIU().x );
props["page_height"] = wxString::Format( wxT( "%d" ), GetPageSizeIU().y );
#if 0
#if USE_INSTRUMENTATION
// measure the time to load a BOARD.
unsigned startTime = GetRunningMicroSecs();
#endif
......@@ -291,7 +294,7 @@ bool PCB_EDIT_FRAME::LoadOnePcbFile( const wxString& aFileName, bool aAppend,
// load or append either:
loadedBoard = pi->Load( GetBoard()->GetFileName(), aAppend ? GetBoard() : NULL, &props );
#if 0
#if USE_INSTRUMENTATION
unsigned stopTime = GetRunningMicroSecs();
printf( "PLUGIN::Load(): %u usecs\n", stopTime - startTime );
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment