summaryrefslogtreecommitdiffstats
path: root/Sencha-lang
diff options
context:
space:
mode:
authorJustyna Ilczuk <justyna.ilczuk@gmail.com>2013-01-01 18:15:54 +0100
committerJustyna Ilczuk <justyna.ilczuk@gmail.com>2013-01-01 18:15:54 +0100
commit7e4ac66f3446f4dc5b871a047400265f0c046952 (patch)
treebcbcc5786af4641a5831454294425a23b042afac /Sencha-lang
parentd65e408e5545963852df43cea93d9c82cd6b8f68 (diff)
downloadsencha-lang-7e4ac66f3446f4dc5b871a047400265f0c046952.tar.gz
sencha-lang-7e4ac66f3446f4dc5b871a047400265f0c046952.tar.bz2
sencha-lang-7e4ac66f3446f4dc5b871a047400265f0c046952.zip
Some changes in formatting.
Diffstat (limited to 'Sencha-lang')
-rw-r--r--Sencha-lang/Lexer.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Sencha-lang/Lexer.cpp b/Sencha-lang/Lexer.cpp
index 02caa44..7d41a75 100644
--- a/Sencha-lang/Lexer.cpp
+++ b/Sencha-lang/Lexer.cpp
@@ -132,7 +132,10 @@ pair<string, Token> Lexer::parse_token(string line)
}
}
}
- if(isalnum(line[i]) || line[i]== '_') token_value += line[i];
+ if(isalnum(line[i]) || line[i]== '_')
+ {
+ token_value += line[i];
+ }
else if(ispunct(line[i]))
{
if(token_value=="")
@@ -153,9 +156,11 @@ pair<string, Token> Lexer::parse_token(string line)
else break;
}
auto type = guess_type(token_value);
- if(type == t_literal) token_value = unescape_string(token_value);
+ if(type == t_literal) token_value = unescape_string(token_value);
+
Token token = Token(type, token_value);
string truncated_line = line.substr(i);
+
return pair<string, Token>(truncated_line, token);
}
@@ -220,7 +225,6 @@ type_of_token Lexer::guess_type(string value)
}
if(!isdigit(value[i])) is_number = false;
}
-
if(is_number)
{
if(dot_used)
@@ -228,8 +232,7 @@ type_of_token Lexer::guess_type(string value)
return t_float;
}
else return t_integer;
- }
-
+ }
else return t_invalid_token;
}
if(isalpha(value[0]))