272 |
272 |
273 super initialize. |
273 super initialize. |
274 |
274 |
275 allowDegeneratedMantissa := true. "/ something like 123. |
275 allowDegeneratedMantissa := true. "/ something like 123. |
276 keywordTable := self class keywordTable. |
276 keywordTable := self class keywordTable. |
|
277 saveComments := true. |
|
278 |
|
279 "Modified: / 30-08-2013 / 02:48:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
277 ! ! |
280 ! ! |
278 |
281 |
279 !JavaScanner methodsFor:'private'! |
282 !JavaScanner methodsFor:'private'! |
280 |
283 |
281 checkForKeyword:string |
284 checkForKeyword:string |
924 "Modified: / 16-05-1998 / 19:12:29 / cg" |
927 "Modified: / 16-05-1998 / 19:12:29 / cg" |
925 "Modified: / 17-03-2012 / 17:35:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
928 "Modified: / 17-03-2012 / 17:35:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
926 ! |
929 ! |
927 |
930 |
928 skipComment |
931 skipComment |
929 |commentStream commentType startPos| |
932 |startPos| |
930 |
933 |
931 startPos := source position. |
934 startPos := source position. |
932 source next. |
935 source next. |
933 hereChar := source peekOrNil. |
936 hereChar := source peekOrNil. |
934 |
937 |
935 [ |
938 [ |
936 [hereChar notNil and:[hereChar ~~ $*]] whileTrue:[ |
939 [hereChar notNil and:[hereChar ~~ $*]] whileTrue:[ |
937 hereChar == (Character cr) ifTrue:[ |
940 hereChar == (Character cr) ifTrue:[ |
938 lineNr := lineNr + 1. |
941 lineNr := lineNr + 1. |
939 ]. |
942 ]. |
940 hereChar := source nextPeek |
943 hereChar := source nextPeek |
941 ]. |
944 ]. |
942 ] doUntil:[ |
945 ] doUntil:[ |
943 hereChar := source nextPeek. |
946 hereChar := source nextPeek. |
944 hereChar isNil or:[hereChar == $/]. |
947 hereChar isNil or:[hereChar == $/]. |
945 ]. |
948 ]. |
946 |
949 |
947 "skip final /" |
950 "skip final /" |
948 source next. |
951 source next. |
949 |
952 |
950 hereChar isNil ifTrue:[ |
953 hereChar isNil ifTrue:[ |
951 self warning:'unclosed comment' position:startPos to:(source position) |
954 self warning:'unclosed comment' position:startPos - 2" '/*' already eaten" to:(source position) |
952 ]. |
955 ]. |
953 |
956 |
954 "/ saveComments ifTrue:[ |
957 saveComments ifTrue:[ |
955 "/ self endComment:(commentStream contents) type:commentType. |
958 self addComment: (startPos - 2" '/*' already eaten" to: source position - 1) |
956 "/ ]. |
959 ]. |
957 ^ nil. "/ force nextToken again |
960 ^ nil. "/ force nextToken again |
958 |
961 |
959 "Modified: / 31.3.1998 / 23:45:26 / cg" |
962 "Modified: / 31-03-1998 / 23:45:26 / cg" |
|
963 "Modified: / 30-08-2013 / 02:51:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
960 ! |
964 ! |
961 |
965 |
962 skipEOLComment |
966 skipEOLComment |
963 hereChar := source peek. |
967 hereChar := source peek. |
964 [hereChar notNil and:[hereChar ~~ Character cr]] whileTrue:[ |
968 [hereChar notNil and:[hereChar ~~ Character cr]] whileTrue:[ |