File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,6 @@ export function tokenizeSyx(source: string): Token[] {
7777 const src = source . split ( '' ) ;
7878 let lastString = 'n' ;
7979 let inString = false ;
80- //TODO single quotes aren't working
8180 function t ( s : string ) {
8281 if ( lastString === 'n' ) { lastString = s ; inString = true ; }
8382 else if ( lastString === '\'' && s === '\'' || ( lastString === '"' && s === '"' ) ) { lastString = 'n' ; inString = false ; } ;
@@ -145,7 +144,7 @@ export function tokenizeSyx(source: string): Token[] {
145144 * @param {string } source Source string.
146145 * @returns A list of tokens generated from the source file.
147146 * @author efekos
148- * @version 1.0.5
147+ * @version 1.0.6
149148 * @since 0.0.2-alpha
150149 */
151150export function tokenizeSys ( source : string ) : Token [ ] {
@@ -154,9 +153,8 @@ export function tokenizeSys(source: string): Token[] {
154153 let lastString = 'n' ;
155154 let inString = false ;
156155 function t ( s : string ) {
157- if ( lastString === '\'' && s === '\'' ) { lastString = 'n' ; inString = ! inString ; }
158- if ( lastString === '"' && s === '"' ) { lastString = 'n' ; inString = ! inString ; }
159- if ( lastString === 'n' ) { lastString = s ; inString = ! inString ; }
156+ if ( lastString === 'n' ) { lastString = s ; inString = true ; }
157+ else if ( lastString === '\'' && s === '\'' || ( lastString === '"' && s === '"' ) ) { lastString = 'n' ; inString = false ; } ;
160158 }
161159
162160 let curPos = 0 ;
You can’t perform that action at this time.
0 commit comments