Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CompilerConstruction
CodeSamples
Commits
55794c3e
Commit
55794c3e
authored
Apr 23, 2021
by
Ronald Charles Moore
Browse files
Fix for Issue#1
parent
5a284edb
Changes
2
Show whitespace changes
Inline
Side-by-side
recursiveDescentParsers/cplusplus/halfBakedCompiler/lexer.cpp
View file @
55794c3e
...
@@ -113,7 +113,7 @@ Token gettok( ) {
...
@@ -113,7 +113,7 @@ Token gettok( ) {
};
};
// else if strtod found a real number (or at least a double)
// else if strtod found a real number (or at least a double)
result
.
first
=
tok_number
;
result
.
first
=
tok_number
;
result
.
second
=
tmpValue
;
// let C++ do any converisons
result
.
second
=
static_cast
<
numberType
>
(
tmpValue
);
currentColumnNumber
+=
(
omega
-
alpha
)
-
1
;
currentColumnNumber
+=
(
omega
-
alpha
)
-
1
;
// minus one because we incremented it before the switch
// minus one because we incremented it before the switch
...
...
recursiveDescentParsers/cplusplus/halfBakedCompiler/lexer.h
View file @
55794c3e
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
namespace
lex
{
namespace
lex
{
// Utility Types
// Utility Types
typedef
double
numberType
;
//
feel fee to change this to something else like int or float or bigint....
typedef
double
numberType
;
//
also works with (at least) float or long
// See https://en.cppreference.com/w/cpp/numeric/math/nan
// See https://en.cppreference.com/w/cpp/numeric/math/nan
static
const
numberType
bad_number
=
std
::
nan
(
"1"
);
static
const
numberType
bad_number
=
std
::
nan
(
"1"
);
...
...
Ronald Charles Moore
@r.moore
mentioned in issue
#1 (closed)
·
Apr 23, 2021
mentioned in issue
#1 (closed)
mentioned in issue #1
Toggle commit list
Write
Preview
Supports
Markdown
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