[GB.EVAL.HIGHLIGHT]

* BUG: Javascript: Fix regular expressions highlighting.


git-svn-id: svn://localhost/gambas/trunk@8126 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2017-04-27 06:01:29 +00:00
parent fdd37e7c3b
commit acc3a537fb
2 changed files with 5 additions and 5 deletions

View file

@ -52,7 +52,7 @@ Public Sub Main()
' <meta http-equiv="content-type" content="text/html; charset=utf-8"> ' <meta http-equiv="content-type" content="text/html; charset=utf-8">
Print #hFile, "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"></head><body>" Print #hFile, "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"></head><body>"
Print #hFile, "<div style=\"font-family:monospace;\">"; Print #hFile, "<div style=\"font-family:monospace;\">";
Print #hFile, TextHighlighter["WebPage"].ToHTML(File.Load("~/asap/guygle/trunk/gambas/guygle.cgi/.src/Site/Login.webpage")) Print #hFile, TextHighlighter["javascript"].ToHTML(File.Load("~/er/WebRadio/WebRadio/erfm.js"))
Print #hFile, "</div>" Print #hFile, "</div>"
Print #hFile, "</body></html>" Print #hFile, "</body></html>"
hFile.Close hFile.Close

View file

@ -17,13 +17,13 @@ Static Public Sub _init()
$aKeywords = New String[] $aKeywords = New String[]
For Each sStr In ["break", "case", "catch", "const", "continue", "debugger", "default", "delete", "do", "else", "finally", "for", For Each sStr In ["break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "enum", "export", "extends", "finally", "for",
"function", "if", "in", "instanceof", "new", "return", "switch", "throw", "try", "typeof", "var", "void", "while", "with"] "function", "if", "import", "in", "instanceof", "new", "return", "super", "switch", "throw", "try", "typeof", "var", "void", "while", "with", "yield"]
$cKeyword[sStr] = 0 $cKeyword[sStr] = 0
$aKeywords.Add(sStr) $aKeywords.Add(sStr)
Next Next
For Each sStr In ["false", "null", "this", "true", "undefined"] For Each sStr In ["false", "null", "this", "true", "undefined", "NaN", "Infinity"]
$cKeyword[sStr] = 1 $cKeyword[sStr] = 1
$aKeywords.Add(sStr) $aKeywords.Add(sStr)
Next Next
@ -180,7 +180,7 @@ Public Sub Run(sText As String)
If $cKeyword.Exist(sIdent) Then If $cKeyword.Exist(sIdent) Then
iState = Highlight.Keyword iState = Highlight.Keyword
If sIdent = "function" Then bTestShowLimit = True If sIdent = "function" Then bTestShowLimit = True
If $cKeyword[sIdent] = 1 Then bLastExpr = True bLastExpr = $cKeyword[sIdent] = 1
Else Else
iState = Highlight.Symbol iState = Highlight.Symbol
bLastExpr = True bLastExpr = True