Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alvarez, Gonzalo
PsimagLite
Commits
d3a56511
Commit
d3a56511
authored
Jun 27, 2022
by
Alvarez, Gonzalo
Browse files
Ainur: optional _ before keyword allowed
parent
cb075007
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Ainur/AinurSpirit1.cpp
View file @
d3a56511
...
...
@@ -67,8 +67,9 @@ Ainur::Ainur(String str)
value
%=
qi
::
lexeme
[
+
(
qi
::
char_
-
qi
::
char_
(
";"
))];
aToZ
=
ascii
::
char_
(
"a"
,
"z"
)
|
ascii
::
char_
(
"A"
,
"Z"
);
zeroToNine
=
ascii
::
char_
(
"0"
,
"9"
);
typeQualifier
%=
+
(
aToZ
|
ascii
::
char_
(
"."
)
|
ascii
::
char_
(
"!"
));
keywords
=
+
aToZ
>>
*
(
ascii
::
char_
(
"a"
,
"z"
)
keywords
=
*
(
ascii
::
char_
(
"_"
))
>>
+
aToZ
>>
*
(
ascii
::
char_
(
"a"
,
"z"
)
|
ascii
::
char_
(
"A"
,
"Z"
)
|
ascii
::
char_
(
"0"
,
"9"
)
|
ascii
::
char_
(
":"
)
...
...
src/Ainur/AinurState1.cpp
View file @
d3a56511
...
...
@@ -63,6 +63,10 @@ private:
static
std
::
complex
<
RealType
>
toComplex
(
std
::
string
str
)
{
typedef
std
::
complex
<
RealType
>
ComplexType
;
if
(
str
==
"i"
)
return
ComplexType
(
0.
,
1.
);
if
(
str
==
"-i"
)
return
ComplexType
(
0.
,
-
1.
);
String
buffer
;
bool
flag
=
false
;
const
SizeType
n
=
str
.
length
();
...
...
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