commit 14685059ace96afcb2d7199831322ccacf3212b2
parent 8300c2e27f25d45e49eb668d83ecd6345939220e
Author: Adam Malone <[email protected]>
Date: Thu, 6 Dec 2018 16:30:38 -0600
rename parseNumber to parseFloat
Diffstat:
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/dtpulse.cpp b/src/dtpulse.cpp
@@ -491,7 +491,7 @@ Parser::Parser(std::string expr) {
tokenStack = {};
setForAtExpand(tokens[0]);
}
-}
+ }
void Parser::setExpression(Token t) {
while (t.type!="NULL") {
ParseExactValue(t);
@@ -538,7 +538,7 @@ void Parser::ParseExactValue(Token t) {
t=skipAndPeekToken();
}
if(t.type=="Digit" || t.type=="Period") {
- num += parseNumber(t);
+ num += parseFloat(t);
}
t=peekToken();
if(t.type=="RightAngle") {
@@ -715,7 +715,7 @@ Token Parser::skipAndPeekToken() {
skipToken();
return peekToken();
}
-std::string Parser::parseNumber(Token t)
+std::string Parser::parseFloat(Token t)
{
std::string number = "";
if (t.type != "Period")
diff --git a/src/dtpulse.hpp b/src/dtpulse.hpp
@@ -6,6 +6,7 @@
#include <vector>
#include <algorithm>
#include <typeinfo>
+#include <stdexcept>
#ifndef MY_GLOBALS_H
#define MY_GLOBALS_H
@@ -41,7 +42,7 @@ class Parser {
void setForRandoms(Token t);
void setForInterleave(Token t);
void setForAtExpand(Token t);
- std::string parseNumber(Token t);
+ std::string parseFloat(Token t);
std::vector<Token> tokenStack;
std::vector<float> exactFloats;
std::vector<std::vector<Token>> randomVector;