Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
981fbedf
Commit
981fbedf
authored
Jun 01, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved position reporting of script errors
parent
52454bf4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
25 deletions
+36
-25
data/en.mse-locale/locale
data/en.mse-locale/locale
+4
-0
src/gui/set/keywords_panel.cpp
src/gui/set/keywords_panel.cpp
+5
-5
src/resource/common/expected_locale_keys
src/resource/common/expected_locale_keys
+3
-1
src/script/parser.cpp
src/script/parser.cpp
+20
-18
tools/msw-installer/installer.iss
tools/msw-installer/installer.iss
+4
-1
No files found.
data/en.mse-locale/locale
View file @
981fbedf
...
...
@@ -399,6 +399,7 @@ label:
mode
:
Mode
uses
:
Uses
reminder
:
Reminder
text
rules
:
Additional
rules
standard
keyword
:
This
is
a
standard
%
s
keyword
,
you
can
not
edit
it
.
If
you
make
a
copy
of
the
keyword
your
copy
will
take
precedent
.
...
...
@@ -691,6 +692,9 @@ error:
in
function
%
s
in
parameter
:
Parameter
%
s
:
%
s
in
keyword
reminder
:
%
s
in
reminder
text
of
keyword
'%s'
#
Image
stuff
coordinates
for
blending
overlap
:
Coordinates
for
blending
overlap
...
...
src/gui/set/keywords_panel.cpp
View file @
981fbedf
...
...
@@ -59,20 +59,20 @@ KeywordsPanel::KeywordsPanel(Window* parent, int id)
sp
=
new
wxBoxSizer
(
wxVERTICAL
);
sp
->
Add
(
fixed
,
0
,
wxEXPAND
);
sp
->
Show
(
fixed
,
false
);
wxSizer
*
s1
=
new
wxBoxSizer
(
wxVERTICAL
);
s1
->
Add
(
new
wxStaticText
(
panel
,
wxID_ANY
,
_
(
"Keyword
:"
)),
0
);
s1
->
Add
(
new
wxStaticText
(
panel
,
wxID_ANY
,
_
LABEL_
(
"keyword"
)
+
_
(
"
:"
)),
0
);
s1
->
Add
(
keyword
,
0
,
wxEXPAND
|
wxTOP
,
2
);
s1
->
Add
(
new
wxStaticText
(
panel
,
wxID_ANY
,
_
(
"Mode
:"
)),
0
,
wxTOP
,
2
);
s1
->
Add
(
new
wxStaticText
(
panel
,
wxID_ANY
,
_
LABEL_
(
"mode"
)
+
_
(
"
:"
)),
0
,
wxTOP
,
2
);
s1
->
Add
(
mode
,
0
,
wxEXPAND
|
wxTOP
,
2
);
sp
->
Add
(
s1
,
0
,
wxEXPAND
|
wxLEFT
,
2
);
sp
->
Add
(
new
wxStaticLine
(
panel
),
0
,
wxEXPAND
|
wxTOP
|
wxBOTTOM
,
8
);
wxSizer
*
s2
=
new
wxBoxSizer
(
wxVERTICAL
);
s2
->
Add
(
new
wxStaticText
(
panel
,
wxID_ANY
,
_
(
"Match
:"
)),
0
);
s2
->
Add
(
new
wxStaticText
(
panel
,
wxID_ANY
,
_
LABEL_
(
"match"
)
+
_
(
"
:"
)),
0
);
s2
->
Add
(
match
,
0
,
wxEXPAND
|
wxTOP
,
2
);
s2
->
Add
(
add_param
,
0
,
wxALIGN_LEFT
|
wxTOP
,
2
);
sp
->
Add
(
s2
,
0
,
wxEXPAND
|
wxLEFT
,
2
);
sp
->
Add
(
new
wxStaticLine
(
panel
),
0
,
wxEXPAND
|
wxTOP
|
wxBOTTOM
,
8
);
wxSizer
*
s3
=
new
wxBoxSizer
(
wxVERTICAL
);
s3
->
Add
(
new
wxStaticText
(
panel
,
wxID_ANY
,
_
(
"Reminder
:"
)),
0
);
s3
->
Add
(
new
wxStaticText
(
panel
,
wxID_ANY
,
_
LABEL_
(
"reminder"
)
+
_
(
"
:"
)),
0
);
s3
->
Add
(
reminder
,
1
,
wxEXPAND
|
wxTOP
,
2
);
s3
->
Add
(
ref_param
,
0
,
wxALIGN_LEFT
|
wxTOP
,
2
);
s3
->
Add
(
errors
,
0
,
wxEXPAND
|
wxTOP
,
4
);
...
...
@@ -80,7 +80,7 @@ KeywordsPanel::KeywordsPanel(Window* parent, int id)
sp
->
Add
(
s3
,
1
,
wxEXPAND
|
wxLEFT
,
2
);
sp
->
Add
(
new
wxStaticLine
(
panel
),
0
,
wxEXPAND
|
wxTOP
|
wxBOTTOM
,
8
);
wxSizer
*
s4
=
new
wxBoxSizer
(
wxVERTICAL
);
s4
->
Add
(
new
wxStaticText
(
panel
,
wxID_ANY
,
_
(
"Rules
:"
)),
0
);
s4
->
Add
(
new
wxStaticText
(
panel
,
wxID_ANY
,
_
LABEL_
(
"rules"
)
+
_
(
"
:"
)),
0
);
s4
->
Add
(
rules
,
1
,
wxEXPAND
|
wxTOP
,
2
);
sp
->
Add
(
s4
,
1
,
wxEXPAND
|
wxLEFT
,
2
);
panel
->
SetSizer
(
sp
);
...
...
src/resource/common/expected_locale_keys
View file @
981fbedf
#
This
file
contains
the
keys
expected
to
be
in
MSE
locales
#
It
was
automatically
generated
by
tools
/
locale
/
locale
.
pl
#
Generated
on
S
at
May
31
21
:
42
:
0
9
2008
#
Generated
on
S
un
Jun
1
02
:
54
:
5
9
2008
action
:
add
control
point
:
0
...
...
@@ -104,6 +104,7 @@ error:
has
no
member
value
:
2
images
used
for
blending
must
have
the
same
size
:
0
in
function
:
2
in
keyword
reminder
:
2
in
parameter
:
2
install
packages
successful
:
1
installing
updates
:
0
...
...
@@ -291,6 +292,7 @@ label:
reminder
:
0
remove
package
:
0
result
:
0
rules
:
0
save
changes
:
1
select
cards
print
:
0
select
columns
:
0
...
...
src/script/parser.cpp
View file @
981fbedf
...
...
@@ -41,6 +41,7 @@ struct Token {
TokenType
type
;
String
value
;
bool
newline
;
///< Is there a newline between this token and the previous one?
size_t
pos
;
///< Start position of the token
inline
bool
operator
==
(
TokenType
t
)
const
{
return
type
==
t
;
}
inline
bool
operator
!=
(
TokenType
t
)
const
{
return
type
!=
t
;
}
...
...
@@ -92,7 +93,7 @@ class TokenIterator {
stack
<
MoreInput
>
more
;
///< Read tokens from here when we are done with the current input
/// Add a token to the buffer, with the current newline value, resets newline
void
addToken
(
TokenType
type
,
const
String
&
value
);
void
addToken
(
TokenType
type
,
const
String
&
value
,
size_t
start
);
/// Read the next token, and add it to the buffer
void
readToken
();
/// Read the next token which is a string (after the opening ")
...
...
@@ -154,8 +155,8 @@ void TokenIterator::putBack() {
buffer
.
insert
(
buffer
.
begin
(),
t
);
}
void
TokenIterator
::
addToken
(
TokenType
type
,
const
String
&
value
)
{
Token
t
=
{
type
,
value
,
newline
};
void
TokenIterator
::
addToken
(
TokenType
type
,
const
String
&
value
,
size_t
start
)
{
Token
t
=
{
type
,
value
,
newline
,
start
};
buffer
.
push_back
(
t
);
newline
=
false
;
}
...
...
@@ -170,7 +171,7 @@ void TokenIterator::readToken() {
more
.
pop
();
}
else
{
// EOF
addToken
(
TOK_EOF
,
_
(
"end of input"
));
addToken
(
TOK_EOF
,
_
(
"end of input"
)
,
input
.
size
()
);
}
return
;
}
...
...
@@ -200,7 +201,7 @@ void TokenIterator::readToken() {
// name
size_t
start
=
pos
-
1
;
while
(
pos
<
input
.
size
()
&&
isAlnum_
(
input
.
GetChar
(
pos
)))
++
pos
;
addToken
(
TOK_NAME
,
cannocial_name_form
(
input
.
substr
(
start
,
pos
-
start
)));
// convert name to cannocial form
addToken
(
TOK_NAME
,
cannocial_name_form
(
input
.
substr
(
start
,
pos
-
start
))
,
start
);
// convert name to cannocial form
}
else
if
(
isDigit
(
c
))
{
// number
size_t
start
=
pos
-
1
;
...
...
@@ -208,16 +209,16 @@ void TokenIterator::readToken() {
String
num
=
input
.
substr
(
start
,
pos
-
start
);
addToken
(
num
.
find_first_of
(
'.'
)
==
String
::
npos
?
TOK_INT
:
TOK_DOUBLE
,
num
num
,
start
);
}
else
if
(
isOper
(
c
))
{
// operator
if
(
pos
<
input
.
size
()
&&
isLongOper
(
input
.
substr
(
pos
-
1
,
2
)))
{
// long operator
addToken
(
TOK_OPER
,
input
.
substr
(
pos
-
1
,
2
));
addToken
(
TOK_OPER
,
input
.
substr
(
pos
-
1
,
2
)
,
pos
-
1
);
pos
+=
1
;
}
else
{
addToken
(
TOK_OPER
,
input
.
substr
(
pos
-
1
,
1
));
addToken
(
TOK_OPER
,
input
.
substr
(
pos
-
1
,
1
)
,
pos
-
1
);
}
}
else
if
(
c
==
_
(
'"'
))
{
// string
...
...
@@ -226,16 +227,16 @@ void TokenIterator::readToken() {
}
else
if
(
c
==
_
(
'}'
)
&&
!
open_braces
.
empty
()
&&
open_braces
.
top
()
!=
BRACE_PAREN
)
{
// closing smart string, resume to string parsing
// "a{e}b" --> "a" "{ e }" "b"
addToken
(
TOK_RPAREN
,
_
(
"}
\"
"
));
addToken
(
TOK_RPAREN
,
_
(
"}
\"
"
)
,
pos
-
1
);
readStringToken
();
}
else
if
(
isLparen
(
c
))
{
// paranthesis/brace
open_braces
.
push
(
BRACE_PAREN
);
addToken
(
TOK_LPAREN
,
String
(
1
,
c
));
addToken
(
TOK_LPAREN
,
String
(
1
,
c
)
,
pos
-
1
);
}
else
if
(
isRparen
(
c
))
{
// paranthesis/brace
if
(
!
open_braces
.
empty
())
open_braces
.
pop
();
addToken
(
TOK_RPAREN
,
String
(
1
,
c
));
addToken
(
TOK_RPAREN
,
String
(
1
,
c
)
,
pos
-
1
);
}
else
if
(
c
==
_
(
'#'
))
{
// comment untill end of line
while
(
pos
<
input
.
size
()
&&
input
[
pos
]
!=
_
(
'\n'
))
++
pos
;
...
...
@@ -246,17 +247,18 @@ void TokenIterator::readToken() {
}
void
TokenIterator
::
readStringToken
()
{
size_t
start
=
max
((
size_t
)
1
,
pos
)
-
1
;
String
str
;
while
(
true
)
{
if
(
pos
>=
input
.
size
())
{
if
(
!
open_braces
.
empty
()
&&
open_braces
.
top
()
==
BRACE_STRING_MODE
)
{
// in string mode: end of input = end of string
addToken
(
TOK_STRING
,
str
);
addToken
(
TOK_STRING
,
str
,
start
);
return
;
}
else
{
add_error
(
_
(
"Unexpected end of input in string constant"
));
// fix up
addToken
(
TOK_STRING
,
str
);
addToken
(
TOK_STRING
,
str
,
start
);
return
;
}
}
...
...
@@ -264,7 +266,7 @@ void TokenIterator::readStringToken() {
// parse the string constant
if
(
c
==
_
(
'"'
)
&&
!
open_braces
.
empty
()
&&
open_braces
.
top
()
==
BRACE_STRING
)
{
// end of string
addToken
(
TOK_STRING
,
str
);
addToken
(
TOK_STRING
,
str
,
start
);
open_braces
.
pop
();
return
;
}
else
if
(
c
==
_
(
'\\'
))
{
...
...
@@ -272,7 +274,7 @@ void TokenIterator::readStringToken() {
if
(
pos
>=
input
.
size
())
{
add_error
(
_
(
"Unexpected end of input in string constant"
));
// fix up
addToken
(
TOK_STRING
,
str
);
addToken
(
TOK_STRING
,
str
,
start
);
return
;
}
c
=
input
.
GetChar
(
pos
++
);
...
...
@@ -282,8 +284,8 @@ void TokenIterator::readStringToken() {
}
else
if
(
c
==
_
(
'{'
))
{
// smart string
// "a{e}b" --> "a" "{ e }" "b"
addToken
(
TOK_STRING
,
str
);
addToken
(
TOK_LPAREN
,
_
(
"
\"
{"
));
addToken
(
TOK_STRING
,
str
,
start
);
addToken
(
TOK_LPAREN
,
_
(
"
\"
{"
)
,
pos
-
1
);
return
;
}
else
{
str
+=
c
;
...
...
@@ -302,7 +304,7 @@ void TokenIterator::add_error(const String& message) {
errors
.
push_back
(
ScriptParseError
(
pos
,
line
,
filename
,
message
));
}
void
TokenIterator
::
expected
(
const
String
&
expected
)
{
size_t
error_pos
=
p
os
-
peek
(
0
).
value
.
size
()
;
size_t
error_pos
=
p
eek
(
0
).
pos
;
if
(
!
errors
.
empty
()
&&
errors
.
back
().
start
==
pos
)
return
;
// already an error here
// find line number
int
line
=
1
;
...
...
tools/msw-installer/installer.iss
View file @
981fbedf
...
...
@@ -173,6 +173,7 @@ Source: "data/en.mse-locale/*"; DestDir: "{app}/data/en.mse-locale/";
#emit Package(1, 'magic', 'future', 'style', 'mtg/future/base')
#emit Package(1, 'magic', 'future-textless', 'style', 'mtg/future/textless')
#emit Font (0, 'ModMatrix.ttf', 'ModMatrix', 'mtg')
#emit Font (0, 'matrixb.ttf', 'Matrix', 'mtg style/yugioh')
#emit Font (0, 'matrixbsc.ttf', 'MatrixBoldSmallCaps', 'mtg')
#emit Font (0, 'magmed.ttf', 'MagicMedieval', 'mtg/old')
...
...
@@ -212,6 +213,8 @@ Source: "data/en.mse-locale/*"; DestDir: "{app}/data/en.mse-locale/";
#emit FontNoReg (0, 'MatrixRegularSmallCaps.pfm', 'MatrixRegularSmallCaps', 'yugioh')
#emit FontNoReg (0, 'MatrixRegularSmallCaps.pfb', 'MatrixRegularSmallCaps', 'yugioh')
#emit Font (0, 'pala.ttf', 'Palatino Linotype', 'yugioh')
#emit Font (0, 'palab.ttf', 'Palatino Linotype Bold', 'yugioh')
#emit Font (0, 'MatriBoo.ttf', 'MatrixBook', 'yugioh')
; ------------------------------------------------------------------------- : Rest of installer
...
...
@@ -228,7 +231,7 @@ Name: "{commonprograms}\Magic Set Editor"; Filename: "{app}\mse.exe"; WorkingDir
#emit Association('.mse-set', 'Set', '2')
#emit Association('.mse-symbol', 'Symbol', '3')
;
#emit Association('.mse-installer', 'Installer', '1')
#emit Association('.mse-installer', 'Installer', '1')
[Run]
Filename: "{app}\mse.exe"; Description: "Start Magic Set Editor"; Flags: postinstall nowait skipifsilent unchecked
...
...
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