[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:
parent
fdd37e7c3b
commit
acc3a537fb
2 changed files with 5 additions and 5 deletions
|
@ -52,7 +52,7 @@ Public Sub Main()
|
|||
' <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, "<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, "</body></html>"
|
||||
hFile.Close
|
||||
|
|
|
@ -17,13 +17,13 @@ Static Public Sub _init()
|
|||
|
||||
$aKeywords = New String[]
|
||||
|
||||
For Each sStr In ["break", "case", "catch", "const", "continue", "debugger", "default", "delete", "do", "else", "finally", "for",
|
||||
"function", "if", "in", "instanceof", "new", "return", "switch", "throw", "try", "typeof", "var", "void", "while", "with"]
|
||||
For Each sStr In ["break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "enum", "export", "extends", "finally", "for",
|
||||
"function", "if", "import", "in", "instanceof", "new", "return", "super", "switch", "throw", "try", "typeof", "var", "void", "while", "with", "yield"]
|
||||
$cKeyword[sStr] = 0
|
||||
$aKeywords.Add(sStr)
|
||||
Next
|
||||
|
||||
For Each sStr In ["false", "null", "this", "true", "undefined"]
|
||||
For Each sStr In ["false", "null", "this", "true", "undefined", "NaN", "Infinity"]
|
||||
$cKeyword[sStr] = 1
|
||||
$aKeywords.Add(sStr)
|
||||
Next
|
||||
|
@ -180,7 +180,7 @@ Public Sub Run(sText As String)
|
|||
If $cKeyword.Exist(sIdent) Then
|
||||
iState = Highlight.Keyword
|
||||
If sIdent = "function" Then bTestShowLimit = True
|
||||
If $cKeyword[sIdent] = 1 Then bLastExpr = True
|
||||
bLastExpr = $cKeyword[sIdent] = 1
|
||||
Else
|
||||
iState = Highlight.Symbol
|
||||
bLastExpr = True
|
||||
|
|
Loading…
Reference in a new issue