This repository has been archived by the owner on Apr 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 899
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Applied Nicholas Curry's patch for IE7 newlines to fix issue 104
- Loading branch information
1 parent
25f6d69
commit 819298e
Showing
3 changed files
with
175 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright (C) 2010 Google Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
|
||
/** | ||
* @fileoverview | ||
* Registers a language handler for Scala. | ||
* | ||
* Derived from http://lampsvn.epfl.ch/svn-repos/scala/scala-documentation/trunk/src/reference/SyntaxSummary.tex | ||
* | ||
* @author [email protected] | ||
*/ | ||
|
||
PR.registerLangHandler( | ||
PR.createSimpleLexer( | ||
[ | ||
// Whitespace | ||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'], | ||
// A double or single quoted string | ||
// or a triple double-quoted multi-line string. | ||
[PR.PR_STRING, | ||
/^(?:"(?:(?:""(?:""?(?!")|[^\\"]|\\.)*"{0,3})|(?:[^"\r\n\\]|\\.)*"?))/, | ||
null, '"'], | ||
[PR.PR_LITERAL, /^`(?:[^\r\n\\`]|\\.)*`?/, null, '`'], | ||
[PR.PR_PUNCTUATION, /^[!#%&()*+,\-:;<=>?@\[\\\]^{|}~]+/, null, | ||
'!#%&()*+,-:;<=>?@[\\]^{|}~'] | ||
], | ||
[ | ||
// A symbol literal is a single quote followed by an identifier with no | ||
// single quote following | ||
// A character literal has single quotes on either side | ||
[PR.PR_STRING, /^'(?:[^\r\n\\']|\\(?:'|[^\r\n']+))'/], | ||
[PR.PR_LITERAL, /^'[a-zA-Z_$][\w$]*(?!['$\w])/], | ||
[PR.PR_KEYWORD, /^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], | ||
[PR.PR_LITERAL, /^(?:true|false|null|this)\b/], | ||
[PR.PR_LITERAL, /^(?:(?:0(?:[0-7]+|X[0-9A-F]+))L?|(?:(?:0|[1-9][0-9]*)(?:(?:\.[0-9]+)?(?:E[+\-]?[0-9]+)?F?|L?))|\\.[0-9]+(?:E[+\-]?[0-9]+)?F?)/i], | ||
// Treat upper camel case identifiers as types. | ||
[PR.PR_TYPE, /^[$_]*[A-Z][_$A-Z0-9]*[a-z][\w$]*/], | ||
[PR.PR_PLAIN, /^[$a-zA-Z_][\w$]*/], | ||
[PR.PR_COMMENT, /^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/], | ||
[PR.PR_PUNCTUATION, /^(?:\.+|\/)/] | ||
]), | ||
['scala']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters