Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
ba78287b
Commit
ba78287b
authored
Dec 11, 2009
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments, minor fixes
parent
ceb6ad1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
dsnlexer.cpp
common/dsnlexer.cpp
+11
-11
No files found.
common/dsnlexer.cpp
View file @
ba78287b
...
@@ -107,6 +107,9 @@ const char* DSNLEXER::Syntax( int aTok )
...
@@ -107,6 +107,9 @@ const char* DSNLEXER::Syntax( int aTok )
case
DSN_NONE
:
case
DSN_NONE
:
ret
=
"NONE"
;
ret
=
"NONE"
;
break
;
break
;
case
DSN_STRING_QUOTE
:
ret
=
"string_quote"
;
// a special DSN syntax token, see specctra spec.
break
;
case
DSN_QUOTE_DEF
:
case
DSN_QUOTE_DEF
:
ret
=
"quoted text delimiter"
;
ret
=
"quoted text delimiter"
;
break
;
break
;
...
@@ -160,6 +163,7 @@ const char* DSNLEXER::GetTokenText( int aTok )
...
@@ -160,6 +163,7 @@ const char* DSNLEXER::GetTokenText( int aTok )
void
DSNLEXER
::
ThrowIOError
(
wxString
aText
,
int
charOffset
)
throw
(
IOError
)
void
DSNLEXER
::
ThrowIOError
(
wxString
aText
,
int
charOffset
)
throw
(
IOError
)
{
{
// append to aText, do not overwrite
aText
<<
wxT
(
" "
)
<<
_
(
"in file"
)
<<
wxT
(
"
\"
"
)
<<
filename
aText
<<
wxT
(
" "
)
<<
_
(
"in file"
)
<<
wxT
(
"
\"
"
)
<<
filename
<<
wxT
(
"
\"
"
)
<<
_
(
"on line"
)
<<
wxT
(
" "
)
<<
reader
.
LineNumber
()
<<
wxT
(
"
\"
"
)
<<
_
(
"on line"
)
<<
wxT
(
" "
)
<<
reader
.
LineNumber
()
<<
wxT
(
" "
)
<<
_
(
"at offset"
)
<<
wxT
(
" "
)
<<
charOffset
;
<<
wxT
(
" "
)
<<
_
(
"at offset"
)
<<
wxT
(
" "
)
<<
charOffset
;
...
@@ -192,6 +196,8 @@ int DSNLEXER::NextTok() throw (IOError)
...
@@ -192,6 +196,8 @@ int DSNLEXER::NextTok() throw (IOError)
if
(
cur
>=
limit
)
if
(
cur
>=
limit
)
{
{
L_read
:
L_read
:
// blank lines are returned as "\n" and will have a len of 1.
// EOF will have a len of 0 and so is detectable.
int
len
=
readLine
();
int
len
=
readLine
();
if
(
len
==
0
)
if
(
len
==
0
)
{
{
...
@@ -235,8 +241,7 @@ L_read:
...
@@ -235,8 +241,7 @@ L_read:
ThrowIOError
(
errtxt
,
CurOffset
()
);
ThrowIOError
(
errtxt
,
CurOffset
()
);
}
}
curText
.
clear
();
curText
=
cc
;
curText
+=
cc
;
head
=
cur
+
1
;
head
=
cur
+
1
;
...
@@ -251,9 +256,7 @@ L_read:
...
@@ -251,9 +256,7 @@ L_read:
if
(
*
cur
==
'('
)
if
(
*
cur
==
'('
)
{
{
curText
.
clear
();
curText
=
*
cur
;
curText
+=
*
cur
;
curTok
=
DSN_LEFT
;
curTok
=
DSN_LEFT
;
head
=
cur
+
1
;
head
=
cur
+
1
;
goto
exit
;
goto
exit
;
...
@@ -261,9 +264,7 @@ L_read:
...
@@ -261,9 +264,7 @@ L_read:
if
(
*
cur
==
')'
)
if
(
*
cur
==
')'
)
{
{
curText
.
clear
();
curText
=
*
cur
;
curText
+=
*
cur
;
curTok
=
DSN_RIGHT
;
curTok
=
DSN_RIGHT
;
head
=
cur
+
1
;
head
=
cur
+
1
;
goto
exit
;
goto
exit
;
...
@@ -275,10 +276,9 @@ L_read:
...
@@ -275,10 +276,9 @@ L_read:
*/
*/
if
(
*
cur
==
'-'
&&
cur
>
start
&&
!
isSpace
(
cur
[
-
1
]
)
)
if
(
*
cur
==
'-'
&&
cur
>
start
&&
!
isSpace
(
cur
[
-
1
]
)
)
{
{
head
=
cur
+
1
;
curText
=
'-'
;
curText
.
clear
();
curText
+=
'-'
;
curTok
=
DSN_DASH
;
curTok
=
DSN_DASH
;
head
=
cur
+
1
;
goto
exit
;
goto
exit
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment