Remove RGL Source Browser

This has moved to:
https://github.com/GrammaticalFramework/rgl-source-browser
This commit is contained in:
John J. Camilleri
2018-07-22 14:55:27 +02:00
parent e94f94fcf1
commit 5d058bcfc0
35 changed files with 0 additions and 8730 deletions

View File

@@ -1 +0,0 @@
tags/*.gf-tags

View File

@@ -1,14 +0,0 @@
##
# Makefile for GF RGL Browser
# John J. Camilleri, 2012
##
dir=../../src
all:
./build-tags.sh
clean:
find -name '*.gf-tags' | xargs rm
cd $(dir) ; find -name '*.gfo' | xargs rm
cd $(dir) ; find -name '*.gf-tags' | xargs rm

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

View File

@@ -1,68 +0,0 @@
#!/bin/sh
#
# Script for building tags files for all RGL
# John J. Camilleri, 2014
#
#set -o errexit
dir=`pwd`
basedir=${dir}/../../src
tagsdir=${dir}/tags
index=${dir}/index.json
ignore="demo old-demo tmp"
start=`date +%s`
# Commands on GNU linux
# FIND="find -maxdepth 1 -name '*.gf'"
# STAT="stat --format=%Y"
# SED='sed'
# Commands on OSX
FIND="find *.gf -maxdepth 1"
STAT="stat -f %a"
SED='gsed'
# Function for testing array membership
in_ignore() {
local search="$1"
for i in $ignore; do
if [ "$i" = "$search" ]; then
return 0
fi
done
return 1
}
# Make the dir just to be sure
[ -d ${tagsdir} ] || mkdir ${tagsdir}
# Iterate and build all the tags (takes some time)
rm -f $index
echo "{\n\"urlprefix\": \"/\"," >> $index
echo "\"languages\": {" >> $index
for dir in `ls "$basedir/"`
do
if ! in_ignore $dir && [ -d "$basedir/$dir" ] ; then
cd $basedir/$dir
echo "Processing folder:" `pwd`
echo " \"${dir}\": [" >> $index
$FIND | while read -r file
do
echo " \""`echo $file | sed 's|./||;s|.gf||'`"\"," >> $index
filemtime=`$STAT "${tagsdir}/${file}-tags" 2>/dev/null`
if [ -z "$filemtime" ] || [ "$filemtime" -lt "$start" ]
then
gf --batch --quiet --tags --output-dir=${tagsdir} $file 2>/dev/null
fi
done
echo " \"\"\n ]," >> $index
fi
done
echo " \"\":{}\n}\n}" >> $index
# Replace all URLs
echo "Replacing URLs"
cd $tagsdir
$SED --in-place --regexp-extended "s|\S+?/lib/|/lib/|g" *.gf-tags
exit 0

View File

@@ -1,2 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,
null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]);

View File

@@ -1,18 +0,0 @@
/*
Copyright (C) 2011 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.
*/
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a],
["typ",/^:[\dA-Za-z-]+/]]),["clj"]);

View File

@@ -1,2 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);

View File

@@ -1,15 +0,0 @@
/*
GF language
Customised from lang-hs.js (Haskell)
*/
PR.registerLangHandler(PR.createSimpleLexer([
["pln", /^[\t-\r ]+/, null, "\t\n \r "],
["str", /^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/, null, '"'],
// ["str", /^'(?:[^\n\f\r'\\]|\\[^&])'?/, null, "'"],
["lit", /^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i, null, "0123456789"]
], [
["com", /^(?:--[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],
["kwd", /^(?:abstract|case|cat|concrete|data|def|flags|fun|in|incomplete|instance|interface|let|lin|lincat|lindef|of|open|oper|param|pre|printname|resource|strs|table|transfer|variants|where|with)(?=[^\d'A-Za-z_]|$)/, null],
["pln", /^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],
["pun", /^[^\d\t-\r "'A-Za-z]+/]
]), ["gf"]);

View File

@@ -1 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]);

View File

@@ -1,2 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n \r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/,
null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]);

View File

@@ -1,3 +0,0 @@
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a],
["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","scm"]);

View File

@@ -1,2 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],
["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]);

View File

@@ -1,2 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/],
["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]);

View File

@@ -1,4 +0,0 @@
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\xa0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/,
a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/,
a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]);

View File

@@ -1 +0,0 @@
PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]);

View File

@@ -1,2 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?: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/],
["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]);

View File

@@ -1,2 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|merge|national|nocheck|nonclustered|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|percent|plan|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rule|save|schema|select|session_user|set|setuser|shutdown|some|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|union|unique|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|writetext)(?=[^\w-]|$)/i,
null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]);

View File

@@ -1 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]);

View File

@@ -1,2 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r Â\xa0

"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"“â€<C3A2>'],["com",/^['\u2018\u2019].*/,null,"'‘’"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i,
null],["com",/^rem.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]);

View File

@@ -1,3 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i,
null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i],
["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]);

View File

@@ -1,2 +0,0 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t Â\xa0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]);
PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]);

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +0,0 @@
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]);

View File

@@ -1,71 +0,0 @@
.pln
{
color:#000
}
@media screen
{
.str
{
color:#080
}
.kwd
{
color:#c0f
}
.com
{
color:#800
}
.typ
{
color:#606
}
.lit
{
color:#066
}
.pun,.opn,.clo
{
color:#660
}
.tag
{
color:#008
}
.atn
{
color:#606
}
.atv
{
color:#080
}
.dec,.var
{
color:#606
}
.fun
{
color:red
}
}
pre.prettyprint
{
}
ol.linenums
{
color:#eee;
margin:0 0 0 1em;
}
li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8
{
/* list-style-type:none */
}
li.L0,li.L2,li.L4,li.L6,li.L8
{
background:#ffffff;
}
li.L1,li.L3,li.L5,li.L7,li.L9
{
background:#fafafa;
}

View File

@@ -1 +0,0 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

View File

@@ -1,28 +0,0 @@
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

View File

@@ -1,171 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>RGL Source Browser</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="shortcut icon" href="icon.png" type="image/png">
<link rel="stylesheet" href="google-code-prettify/prettify-gf.css">
<link rel="stylesheet" href="layout-default-latest.css" />
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" type="text/css" href="http://cloud.grammaticalframework.org/syntax-editor/editor.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery.layout-latest.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('body').layout({
applyDemoStyles: false,
north: {
closable: false,
resizable: false,
spacing_open: 0,
}
});
});
</script>
<script src="jquery.history.min.js"></script>
<script src="google-code-prettify/prettify.js"></script>
<script src="google-code-prettify/lang-gf.js"></script>
<script src="script.js"></script>
</head>
<body>
<div id="loading">
<img src="ajax-loader.gif" /> Loading...
</div>
<div class="ui-layout-center">
<div id="scope" class="panel scope">
<div id="controls">
<input type="text" id="search" />
&nbsp;<span id="count">0</span> items&nbsp;
<input type="reset" id="clear" value="Clear" />
<!-- input type="checkbox" id="case_sensitive" /><label for="case_sensitive">Case sensitive?</label -->
<input type="radio" name="show" id="show_all" checked="checked" /><label for="show_all">Show all</label>
<input type="radio" name="show" id="show_local" /><label for="show_local">Local only</label>
</div>
<table id="results"></table>
</div><!-- panel scope -->
<div id="code" class="panel code">
<pre class="prettyprint lang-gf linenums"></pre>
</div><!-- panel code -->
<div id="api" class="panel api">
Search the API by constructor name <strong>or</strong> type signature:
<div id="controls">
<input type="text" id="search" />
&nbsp;<span id="count">0</span> items&nbsp;
<input type="reset" id="clear" value="Clear" />
</div>
<table id="results"></table>
</div><!-- panel api -->
<!-- Syntax editor -->
<script type="text/javascript" src="http://cloud.grammaticalframework.org/js/grammar_manager.js"></script>
<script type="text/javascript" src="http://cloud.grammaticalframework.org/js/support.js"></script>
<script type="text/JavaScript" src="http://cloud.grammaticalframework.org/js/localstorage.js"></script>
<script type="text/javascript" src="http://cloud.grammaticalframework.org/js/pgf_online.js"></script>
<script type="text/javascript" src="http://cloud.grammaticalframework.org/syntax-editor/ast.js"></script>
<script type="text/javascript" src="http://cloud.grammaticalframework.org/syntax-editor/editor_menu.js"></script>
<script type="text/javascript" src="http://cloud.grammaticalframework.org/syntax-editor/editor.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var server = pgf_online({
grammars_url: "http://www.grammaticalframework.org/grammars/"
});
var gm = new GrammarManager(server, {
initial: {
grammar: "http://www.grammaticalframework.org/grammars/LibraryBrowser.pgf",
startcat: "Utt"
}
});
var editor = new Editor(gm, {
target: "editor",
show_grammar_menu: false
});
});
</script>
<div id="editor" class="panel editor">
</div><!-- panel editor -->
<div id="help" class="panel help">
<h3>About</h3>
<p>A basic tool for looking through scopes and quickly jumping to code within GF's resource grammar library (RGL), created out of necessity. All feedback is welcome.</p>
<h3>Understanding the scope information</h3>
<p>The scope information shown by this tool is basically the output of running GF with the <code>--tags</code> flag. This lists all the functions visible in the scope of a module, one per line. Each line can have two possible forms:</p>
<h4>1. Local functions</h4>
<pre>mkPrep oper-type /lib/src/english/ParadigmsEng.gf:204 Str -> {s : Str; lock_Prep : {}}</pre>
<p>For locally defined functions, the second column <code>oper-type</code> indicates the judgement type, followed by the location in the souce file and its type information.</p>
<h4>2. External functions</h4>
<pre>Number indir ResEng R /lib/doc/browse/tags/ParamX.gf-tags</pre>
<p>The <code>indir</code> indicates this function is defined in an external module (note that no distinction is made between functions from opened modules and inherited ones.) <code>ResEng</code> is the name of the opened or inherited module, while <code>R</code> is the alias under which it was opened. The final column points to another tags file where the type information for this function can be found. Note that though the function is available in the given context via the <code>ResEng</code> module, it is actually originally defined in <code>ParamX</code>.</p>
<h3>The RGL directory structure</h3>
<p>The drop-down at the top left lists all child directories under <code><a href="http://www.grammaticalframework.org/lib/src/">/lib/src</a></code> in the GF source code repository. Most directories represent individual languages, however many have special functions:</p>
<dl>
<dt><code>abstract</code></dt><dd>Abstract syntaxes shared by all resource grammars</dd>
<dt><code>api</code></dt><dd>The RGL API and instantiations of the API modules in all languages</dd>
<dt><code>common</code></dt><dd>Resource modules common to all languages</dd>
<dt><code>parametric</code></dt><dd></dd>
<dt><code>prelude</code></dt><dd>Common low-level functions</dd>
</dl>
In addition, the following directories are not individual languages but language functors, shared by resource grammars for related language families:
<dl>
<dt><code>hindustani</code></dt><dd>Used by Hindi, Persian, Punjabi, Urdu</dd>
<dt><code>romance</code></dt><dd>Used by Catalan, French, Italian, Romanian, Spanish</dd>
<dt><code>scandinavian</code></dt><dd>Used by Danish, Norwegian, Swedish</dd>
</dl>
<h3>Issues</h3>
<h4>Something is missing or out of date</h4>
<p>All the scoping information shown is not read directly from the RGL on-demand. There is an in-between processing stage which must be run, so if something seems out of date just let me know and I can udpate things manually.</p>
</div><!-- panel help -->
</div><!-- ui-layout-center -->
<div class="ui-layout-north">
<header>
<img src="../../../doc/Logos/gf0.png" alt="" />
<h1 title="...or GFRGLSB as we like to call it">GF Resource Grammar Library Source Browser</h1>
<div id="tabbar">
<span class="module">
Module: <span id="module_name">...</span>
<a class="tab scope" href="#scope">scope</a>
<a class="tab code" href="#code">code</a>
</span>
<a class="tab api" href="#api">API</a>
<a class="tab editor" href="#editor">Tree Builder</a>
<a class="tab help" href="#help">Help</a>
<a class="synopsis" href="http://www.grammaticalframework.org/lib/doc/synopsis.html" target="_blank">Synopsis</a>
</div>
</header>
<footer id="footer">
John J. Camilleri<br/><em>Updated 2014-01-29</em>
</footer>
</div><!-- ui-layout-north -->
<div class="ui-layout-west">
<div id="languages"></div>
<div id="modules"></div>
</div><!-- ui-layout-west -->
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +0,0 @@
/*! jQuery.history v1.1.0 | Copyright 2013 yeikos - MIT license | https://github.com/yeikos/jquery.history */
;(function(e,t){var n=function(t){var i=e.Event("push");n.context.trigger(i,[t,u]);if(i.isDefaultPrevented())return n;if(u==="pathname"){if(c!==t)window.history.pushState({},null,c=t)}else if(u==="hash"){if(c!==t){location.hash=c=t;if(o){if(!e("#jQueryHistory").length)throw new Error("jQuery."+r+".push: iframe not found.");if(l){l=0;f.contentWindow.document.open().close();f.contentWindow.location.hash="/"}f.contentWindow.document.open().close();f.contentWindow.location.hash=t}}}else{throw new Error("jQuery."+r+".push: the listening is not active.")}n.context.trigger("pushed",[t,u]);return n},r="history";n.context=e({});e.each(["on","off","trigger"],function(e,t){n[t]=function(){n.context[t].apply(n.context,arguments);return n}});n.push=n;n.type=function(){return u};n.url=function(e){e=e||location;if(u===null)throw new Error("jQuery."+r+".url: the listening has not started.");if(u==="pathname")return e.pathname+e.search+e.hash;if(e.hash.length>1){spl=e.href.split("#");spl.shift();spl=spl.join("#");return spl}return""};n.listen=function(l,h){n.unlisten();var p=arguments.length;if(!p||l==="auto"){l=i?"pathname":"hash";p=1}else if(l!=="pathname"&&l!=="hash"){throw new Error("jQuery."+r+".listen: type is not valid.")}if(l==="hash"){if(!s&&p===1||h===true){h=n.config.interval;p=2}if(p===2&&(isNaN(h)||h<1))throw new Error("jQuery."+r+".listen: interval delay is not valid.")}if((u=l)==="pathname"){if(!i)throw new Error("jQuery."+r+".listen: this browser has not support to pushState.");e(window).on("popstate.history",function(e){if(e.originalEvent&&e.originalEvent.state&&c!==location.pathname)n.trigger("change",[c=n.url(),"pathname"])});if(location.pathname.length>1)n.trigger("load",[n.url(),"pathname"])}else{if(s&&!h){e(window).on("hashchange.history",function(e){var t=n.url();if(c!==t)n.trigger("change",[c=t,"hash"])})}else{if(o===t)o=n.ieCondition("lte IE 7");if(o){if(!(p=e("body")).length)throw new Error("jQuery."+r+".listen: document is not ready.");f=e('<iframe id="jQueryHistory" style="display:none" src="javascript:void(0);" />').appendTo(p)[0];var d=f.contentWindow;if(location.hash.length>1){d.document.open().close();d.location.hash="#"+n.url()}a=setInterval(function(){if((c="#"+n.url())!=="#"+n.url(d.location)){d.document.open().close();d.location.hash=c;n.trigger("change",[c.substr(1),"hash"])}},h)}else{c=n.url();a=setInterval(function(){var e=n.url();if(c!==e)n.trigger("change",[c=e,"hash"])},h)}}if(location.hash.length>1){n.trigger("load",[n.url(),"hash"])}}return n};n.unlisten=function(){u=c=f=null;e(window).off("popstate.history hashchange.history");e("#jQueryHistory").remove();clearInterval(a);return n};n.getSupports=function(e){var n={},r=arguments.length,i;if(!r||e==="pushState")n.pushState="pushState"in window.history;if(!r||e==="onhashchange")n.onhashchange="onhashchange"in window&&((i=document.documentMode)===t||i>7);if(r)return n[e];return n};n.ieCondition=function(n){var r=Math.random().toString(36).substring(2),i="_ie_condition_"+r,s,o;s=e("<span><!--[if "+e("<i/>").html(n).text()+']><script type="text/javascript">window.'+i+"=true;</script><![endif]--></span>").appendTo(document.body);o=window[i]===true;try{delete window[i]}catch(u){window[i]=t}s.remove();return o};n.supports=n.getSupports();n.config={interval:100};var i=n.supports.pushState,s=n.supports.onhashchange,o=n.ieCondition("lte IE 7"),u=null,a,f,l=1,c;e[r]=n})(jQuery);

File diff suppressed because it is too large Load Diff

View File

@@ -1,224 +0,0 @@
/*
* Default Layout Theme
*
* Created for jquery.layout
*
* Copyright (c) 2010
* Fabrizio Balliano (http://www.fabrizioballiano.net)
* Kevin Dalman (http://allpro.net)
*
* Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
* and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
*
* Last Updated: 2010-02-10
* NOTE: For best code readability, view this with a fixed-space font and tabs equal to 4-chars
*/
/*
* DEFAULT FONT
* Just to make demo-pages look better - not actually relevant to Layout!
*/
body {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 100%;
*font-size: 80%;
}
/*
* PANES & CONTENT-DIVs
*/
.ui-layout-pane { /* all 'panes' */
background: #FFF;
border: 1px solid #BBB;
padding: 10px;
overflow: auto;
/* DO NOT add scrolling (or padding) to 'panes' that have a content-div,
otherwise you may get double-scrollbars - on the pane AND on the content-div
- use ui-layout-wrapper class if pane has a content-div
- use ui-layout-container if pane has an inner-layout
*/
}
/* (scrolling) content-div inside pane allows for fixed header(s) and/or footer(s) */
.ui-layout-content {
padding: 10px;
position: relative; /* contain floated or positioned elements */
overflow: auto; /* add scrolling to content-div */
}
/*
* UTILITY CLASSES
* Must come AFTER pane-class above so will override
* These classes are NOT auto-generated and are NOT used by Layout
*/
.layout-child-container,
.layout-content-container {
padding: 0;
overflow: hidden;
}
.layout-child-container {
border: 0; /* remove border because inner-layout-panes probably have borders */
}
.layout-scroll {
overflow: auto;
}
.layout-hide {
display: none;
}
/*
* RESIZER-BARS
*/
.ui-layout-resizer { /* all 'resizer-bars' */
background: #DDD;
border: 1px solid #BBB;
border-width: 0;
}
.ui-layout-resizer-drag { /* REAL resizer while resize in progress */
}
.ui-layout-resizer-hover { /* affects both open and closed states */
}
/* NOTE: It looks best when 'hover' and 'dragging' are set to the same color,
otherwise color shifts while dragging when bar can't keep up with mouse */
.ui-layout-resizer-open-hover , /* hover-color to 'resize' */
.ui-layout-resizer-dragging { /* resizer beging 'dragging' */
background: #C4E1A4;
}
.ui-layout-resizer-dragging { /* CLONED resizer being dragged */
border: 1px solid #BBB;
}
.ui-layout-resizer-north-dragging,
.ui-layout-resizer-south-dragging {
border-width: 1px 0;
}
.ui-layout-resizer-west-dragging,
.ui-layout-resizer-east-dragging {
border-width: 0 1px;
}
/* NOTE: Add a 'dragging-limit' color to provide visual feedback when resizer hits min/max size limits */
.ui-layout-resizer-dragging-limit { /* CLONED resizer at min or max size-limit */
background: #E1A4A4; /* red */
}
.ui-layout-resizer-closed-hover { /* hover-color to 'slide open' */
background: #EBD5AA;
}
.ui-layout-resizer-sliding { /* resizer when pane is 'slid open' */
opacity: .10; /* show only a slight shadow */
filter: alpha(opacity=10);
}
.ui-layout-resizer-sliding-hover { /* sliding resizer - hover */
opacity: 1.00; /* on-hover, show the resizer-bar normally */
filter: alpha(opacity=100);
}
/* sliding resizer - add 'outside-border' to resizer on-hover
* this sample illustrates how to target specific panes and states */
.ui-layout-resizer-north-sliding-hover { border-bottom-width: 1px; }
.ui-layout-resizer-south-sliding-hover { border-top-width: 1px; }
.ui-layout-resizer-west-sliding-hover { border-right-width: 1px; }
.ui-layout-resizer-east-sliding-hover { border-left-width: 1px; }
/*
* TOGGLER-BUTTONS
*/
.ui-layout-toggler {
border: 1px solid #BBB; /* match pane-border */
background-color: #BBB;
}
.ui-layout-resizer-hover .ui-layout-toggler {
opacity: .60;
filter: alpha(opacity=60);
}
.ui-layout-toggler-hover , /* need when NOT resizable */
.ui-layout-resizer-hover .ui-layout-toggler-hover { /* need specificity when IS resizable */
background-color: #FC6;
opacity: 1.00;
filter: alpha(opacity=100);
}
.ui-layout-toggler-north ,
.ui-layout-toggler-south {
border-width: 0 1px; /* left/right borders */
}
.ui-layout-toggler-west ,
.ui-layout-toggler-east {
border-width: 1px 0; /* top/bottom borders */
}
/* hide the toggler-button when the pane is 'slid open' */
.ui-layout-resizer-sliding .ui-layout-toggler {
display: none;
}
/*
* style the text we put INSIDE the togglers
*/
.ui-layout-toggler .content {
color: #666;
font-size: 12px;
font-weight: bold;
width: 100%;
padding-bottom: 0.35ex; /* to 'vertically center' text inside text-span */
}
/*
* PANE-MASKS
* these styles are hard-coded on mask elems, but are also
* included here as !important to ensure will overrides any generic styles
*/
.ui-layout-mask {
border: none !important;
padding: 0 !important;
margin: 0 !important;
overflow: hidden !important;
position: absolute !important;
opacity: 0 !important;
filter: Alpha(Opacity="0") !important;
}
.ui-layout-mask-inside-pane { /* masks always inside pane EXCEPT when pane is an iframe */
top: 0 !important;
left: 0 !important;
width: 100% !important;
height: 100% !important;
}
div.ui-layout-mask {} /* standard mask for iframes */
iframe.ui-layout-mask {} /* extra mask for objects/applets */
/*
* Default printing styles
*/
@media print {
/*
* Unless you want to print the layout as it appears onscreen,
* these html/body styles are needed to allow the content to 'flow'
*/
html {
height: auto !important;
overflow: visible !important;
}
body.ui-layout-container {
position: static !important;
top: auto !important;
bottom: auto !important;
left: auto !important;
right: auto !important;
/* only IE6 has container width & height set by Layout */
_width: auto !important;
_height: auto !important;
}
.ui-layout-resizer, .ui-layout-toggler {
display: none !important;
}
/*
* Default pane print styles disables positioning, borders and backgrounds.
* You can modify these styles however it suit your needs.
*/
.ui-layout-pane {
border: none !important;
background: transparent !important;
position: relative !important;
top: auto !important;
bottom: auto !important;
left: auto !important;
right: auto !important;
width: auto !important;
height: auto !important;
overflow: visible !important;
}
}

View File

@@ -1,573 +0,0 @@
/*
GF RGL Browser
John J. Camilleri, 2013
*/
var thing = null;
$(document).ready(function(){
thing = new Thing();
// ===== URL history =====
$.history.on('load change push pushed', function(event, url, type) {
var stripExt = function(s) {
var i = s.lastIndexOf('.');
return (i>-1) ? s.substr(0, i) : s;
};
var s = url.split("/");
var lang = s[0];
var module = stripExt(s[1]);
var parseLineNo = s[1].match(/:(\d+)(-(\d+))?$/);
if (thing.state.current.equals(lang, module)) {
if (parseLineNo) {
thing.scrollToCodeLine(parseInt(parseLineNo[1]));
}
// else there's nothing to do!
} else {
if (parseLineNo != undefined)
thing.loadFile(lang, module, parseInt(parseLineNo[1]));
else
thing.loadFile(lang, module);
}
}).listen('hash');
});
function Thing() {
var t = this;
// ===== State information =====
this.state = {
index: undefined,
lookup: {},
loadCount: 0,
recentCount: 5,
language: undefined, // lang of drop-down
current: { // current file
language: undefined,
module: undefined,
set: function(lang, module) {
t.state.current.language = lang;
t.state.current.module = module;
},
equals: function(a, b) {
if (!b)
return (a == t.state.current.module);
else
return (a == t.state.current.language) && (b == t.state.current.module);
}
},
title: "RGL Source Browser",
urlPrefix: "/",
defaultLangs: ['abstract','api','common','prelude']
} ;
this.lookupModuleLanguage = function(module) {
var l = t.state.lookup[module];
if (l==undefined || l.length==0)
return null;
else if (l.length==1)
return l[0];
else {
for (i in l) {
if ($.inArray(l[i], t.state.defaultLangs))
return l[i];
}
return l[0]; // no preferred default, just return first...
}
}
this.lookupAllModuleLanguages = function(module) {
return t.state.lookup[module];
}
// ===== Utility/UI functions =====
this.showLoading = function(){
t.state.loadCount++;
$("#loading").show();
}
this.hideLoading = function(){
t.state.loadCount = Math.max(t.state.loadCount-1, 0);
if (t.state.loadCount == 0)
$("#loading").hide();
}
this.scrollToTop = function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
}
this.scrollToCodeLine = function(lineNo) {
t.showPanel("#code", function() {
// Find exact line, using the classes generated by google prettify
try {
var obj = $("#code pre li.L"+(lineNo%10)+":eq("+Math.floor(lineNo/10)+")").prev();
var y = Math.max(obj.offset().top - obj.parent().offset().top - 75, 0);
$("#code").parent().animate({ scrollTop: y }, "slow", function(){
t.highlight(obj);
});
} catch (e) {}
});
}
this.highlight = function(obj) {
obj.css('background-color', "yellow");
setTimeout(function(){
obj.css('background-color', "");
}, 1500);
}
this.clearScope = function(msg) {
$('#scope #results').empty();
t.updateScopeCount();
if (msg) {
$('#scope #results').html("<em>"+msg+"</em>");
}
}
this.setScope = function(code) {
$('#scope #results').html(code);
}
this.clearCode = function(msg) {
$('#code pre').empty();
if (msg) {
$('#codes pre').html("<em>"+msg+"</em>");
}
}
this.setCode = function(code) {
$('#code pre').text(code);
prettyPrint();
}
this.updateScopeCount = function(){
$('#scope #count').text( $("#scope #results tr:visible").length );
}
this.updateAPICount = function(){
$('#api #count').text( $("#api #results tr:visible").length );
}
this.setLanguage = function(lang){
t.state.language = lang;
$("#languages select").val(lang);
t.initModules(lang);
}
// hash should be "#code"
this.showPanel = function(hash, callback){
t.showLoading();
setTimeout(function(){
$(".panel:visible").hide();
$("a.tab").removeClass('active');
$("a.tab[href='"+hash+"']").addClass('active');
$(hash).show(0, callback);
t.updateScopeCount();
t.hideLoading();
}, 200); // this ensures the loading displays
}
this.getPanel = function() {
return $('.panel:visible').first();
}
this.setTitle = function(s){
$('#module_name').html(s);
$('title').html(t.state.title + ": " + s);
}
// ===== Initialization =====
// Initialize the panels, tabs
$("a.tab").click(function(){
var panel = $(this).attr("href");
t.showPanel(panel);
return false;
});
t.showPanel("#scope");
// Load the index file and populate language & module lists
$.ajax({
url: "index.json",
dataType: "json",
type: "GET",
success: function(data) {
t.state.index = data;
if (data['urlprefix']) t.state.urlPrefix = data['urlprefix'];
// Build language lookup index
for (var lang in data['languages']) {
for (var i in data['languages'][lang]) {
var module = data['languages'][lang][i];
if (!module) continue;
if (!t.state.lookup[module]) t.state.lookup[module] = [];
t.state.lookup[module].push(lang);
}
}
// Initialize the language list
var lang_select = $("<select>")
.attr('id', 'language_select')
.change(function(){
t.setLanguage($(this).val());
})
.appendTo("#languages")
var language_list = data['languages'];
for (var i in language_list) {
if (!i) continue;
var lang = i;
$('<option>')
.html(lang)
.appendTo(lang_select);
}
t.setLanguage("english");
// Module search box
var module_search = $("<input>")
.attr('id', 'module_search')
.keyup(function(){
t.searchModule($(this).val());
})
.appendTo("#languages");
$("<a>")
.attr('href','#')
.click(t.clearSearchModule)
.html("Clear")
.appendTo("#languages");
// Recent modules
var recent = $("<div>")
.attr('id', 'recent')
.appendTo("#languages");
// Initialize API results
t.initAPI();
// Done
t.hideLoading();
},
error: function(){
t.hideLoading();
alert("Error getting index. Try reloading page, or just give up.");
}
});
// ===== Loading functionality =====
// Initialize the module list
this.initModules = function(lang){
t.state.index['languages'][lang] = t.state.index['languages'][lang].sort();
$("#modules").empty();
for (var i in t.state.index['languages'][lang]) {
var module = t.state.index['languages'][lang][i];
if (!module) continue;
$('<a>')
.html(module)
.attr('href', "#"+lang+"/"+module+".gf")
.appendTo("#modules");
}
}
// Load both scope & source for a file
this.loadFile = function(lang, module, lineNo){
t.setTitle(lang+"/"+module);
t.state.current.set(lang, module);
t.loadTagsFile(module);
t.loadSourceFile(lang, module, lineNo);
if ($('.tab.api').hasClass('active'))
t.showPanel("#scope");
t.addRecent(lang, module);
}
// Add item to recent list
this.addRecent = function(lang, module) {
var full_module = lang+'/'+module;
// If already there, do nothing
if ($('#recent').text().indexOf(full_module) > -1) return;
// Delete oldest if at limit
if ($('#recent a').length >= t.state.recentCount) {
$('#recent a').last().remove();
}
// Add it
$('<a>')
.html(full_module)
.attr('href', "#"+lang+"/"+module+".gf")
.prependTo("#recent");
}
// Load a tags file
this.loadTagsFile = function(module) {
t.clearScope();
t.showLoading();
$.ajax({
url: "tags/"+module+".gf-tags",
type: "GET",
dataType: "text",
success: function(data){
data = data.replace(/^(\S+)\s(\S+)\s(.+)?$/gm, function(a,b,c,d){
var s = d.split("\t");
if (c == "indir") {
var module = s[2].substring(s[2].lastIndexOf('/')+1, s[2].lastIndexOf('.'));
var lang = t.lookupModuleLanguage(module);
var name = lang+"/"+module;
var url = "#"+lang+"/"+module;
var anchor = '<a href="'+url+'">'+name+'</a>';
return '<tr class="indir" name="'+b+'"><th>'+b+'</th><td>'+c+'</td><td>'+s[0]+'</td><td>'+s[1]+'</td><td>'+anchor+'</td><td></td></tr>'
} else {
var bits = s[0].split("/"); // ["lib", "src", "english", "AdjectiveEng.gf:43-46"]
var name = bits[3]+"/"+bits[4];
var url = "#"+bits[3]+"/"+bits[4];
var anchor = '<a href="'+url+'">'+name+'</a>';
return '<tr class="local" name="'+b+'"><th>'+b+'</th><td>'+c+'</td><td></td><td></td><td>'+anchor+'</td><td>'+s[1]+'</td></tr>'
}
});
t.setScope(data);
t.runFilter();
t.hideLoading();
},
error: function(data){
t.clearScope("No scope available");
t.hideLoading();
},
});
}
// Load a source module
this.loadSourceFile = function(lang, module, lineNo) {
t.clearCode();
t.showLoading();
$.ajax({
url: t.state.urlPrefix + "lib/src/"+lang+"/"+module+".gf",
type: "GET",
dataType: "text",
success: function(data, status, xhr){
t.setCode(data);
t.hideLoading();
if (lineNo) {
t.scrollToCodeLine(lineNo);
}
},
error: function(data){
t.clearCode("No code available");
t.hideLoading();
}
});
}
// Which modules do we include for API?
this.apiModules = [
// api
"Syntax",
// "Constructors", "Cat", "Structural", "Combinators",
// abstract
// "Adjective",
// "Adverb",
// "Backward",
// "Cat",
// "Common",
// "Compatibility",
// "Conjunction",
// "Extra",
// "Grammar",
// "Idiom",
// "Lang",
// "Lexicon",
// "Noun",
// "Numeral",
// "NumeralTransfer",
// "Phrase",
// "Question",
// "Relative",
// "Sentence",
// "Structural",
// "Symbol",
// "Tense",
// "Text",
// "Transfer",
// "Verb",
];
this.initAPI = function() {
t.showLoading();
$('#api #results').empty();
for (var i in t.apiModules) {
var module = t.apiModules[i];
$.ajax({
url: "tags/"+module+".gf-tags",
type: "GET",
dataType: "text",
success: function(data){
data = data.replace(/^(\S+)\s(\S+)\s(.+)?$/gm, function(a,b,c,d){
var out = '';
var s = d.split("\t");
if (c != "indir") {
var type = s[1];
if (type) {
var bits = s[0].split("/"); // ["lib", "src", "english", "AdjectiveEng.gf:43-46"]
var name = bits[3]+"/"+bits[4];
var url = "#"+bits[3]+"/"+bits[4];
var anchor = '<a href="'+url+'">'+name+'</a>';
out += '<tr name="'+b+'"><th>'+b+'</th><td>'+c+'</td><td>'+anchor+'</td><td>'+s[1]+'</td></tr>'
}
}
return out;
});
$('#api #results').append($(data));
$("#api #results tr").removeClass('odd');
$("#api #results tr:odd").addClass('odd');
$('#api #count').text( $("#api #results tr").length );
},
error: function(data){
console.log("Error loading tags file: " + module);
},
});
}
t.hideLoading();
}
// ===== Module search =====
this.searchModule = function(s) {
if (!s) {
return t.clearSearchModule();
}
$('#language_select').hide();
$("#modules").empty();
for (var lang in t.state.index['languages']) {
var modules = t.state.index['languages'][lang];
for (var j in modules) {
var module = modules[j];
var full_module = lang+'/'+module;
if (!module) continue;
if (full_module.toLowerCase().indexOf(s.toLowerCase())==-1) continue;
$('<a>')
.html(full_module)
.attr('href', "#"+lang+"/"+module+".gf")
.appendTo("#modules");
}
}
};
this.clearSearchModule = function() {
$('#module_search').val('');
$('#language_select').show();
t.setLanguage(t.state.language);
return false;
};
// ===== Filtering of scope info =====
// Custom selector
$.expr[':'].match = function(a,b,c) {
var obj = $(a);
var needle = c[3];
var haystack = obj.attr('name');
if (haystack == undefined)
return false;
if ($("#scope #case_sensitive").is(":checked"))
return haystack.indexOf(needle)>=0;
else
return haystack.toLowerCase().indexOf(needle.toLowerCase())>=0;
};
this.runFilter = function() {
t.showLoading();
$("#scope #results tr").removeClass('odd');
var s = $("#scope #search").val();
try {
if (s) {
$("#scope #results tr").hide();
$("#scope #results tr:match(\""+s+"\")").show();
} else {
$("#scope #results tr").show();
}
if ($("#scope #show_local").is(":checked") ) {
$("#scope #results tr.indir").hide();
}
} catch (error) {
alert(error.message);
}
t.updateScopeCount();
$("#scope #results tr:visible:odd").addClass('odd');
t.hideLoading();
}
// Instant results
this.prevSearch = $("#scope #search").val();
$("#scope #search").keyup(function(){
var s = $("#scope #search").val();
if (s!=t.prevSearch) {
t.runFilter();
t.prevSearch = s;
}
});
$("#scope #search").keypress(function(e){
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { // Enter
t.runFilter();
}
});
$("#scope #clear").click(function(){
$("#scope #search")
.val('')
.focus()
t.runFilter();
});
$("#scope #case_sensitive").change(t.runFilter);
$("#scope #show_all").change(t.runFilter);
$("#scope #show_local").change(t.runFilter);
// ===== API search =====
// Custom selector
$.expr[':'].matchAPI = function(a,b,c) {
var obj = $(a); // tr
var ident = $(obj.children().get(0)).text();
var type = $(obj.children().get(3)).text();
var needle = c[3];
var match_ident = ident.toLowerCase().indexOf(needle.toLowerCase())>=0;
var match_type = type.toLowerCase().indexOf(needle.toLowerCase())>=0;
// if ($("#scope #case_sensitive").is(":checked"))
// return haystack.indexOf(needle)>=0;
// else
return match_ident || match_type ;
};
this.runFilterAPI = function() {
t.showLoading();
$("#api #results tr").removeClass('odd');
var s = $("#api #search").val();
try {
if (s) {
$("#api #results tr").hide();
$("#api #results tr:matchAPI(\""+s+"\")").show();
} else {
$("#api #results tr").show();
}
} catch (error) {
alert(error.message);
}
t.updateAPICount();
$("#api #results tr:visible:odd").addClass('odd');
t.hideLoading();
}
// Instant results
this.prevAPISearch = $("#api #search").val();
$("#api #search").keyup(function(){
var s = $("#api #search").val();
if (s!=t.prevAPISearch) {
t.runFilterAPI();
t.prevAPISearch = s;
}
});
$("#api #search").keypress(function(e){
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { // Enter
t.runFilterAPI();
}
});
$("#api #clear").click(function(){
$("#api #search")
.val('')
.focus();
t.runFilterAPI();
});
};

View File

@@ -1,198 +0,0 @@
/*
GF RGL Browser
John J. Camiller, 2012
*/
body {
background: url('http://cloud.grammaticalframework.org/minibar/brushed-metal.png') #ddd;
margin:0;
font: 13px sans-serif;
}
h1,h2,h3,h4 {
font-family: sans-serif;
color: #303030;
text-shadow: rgba(0,0,0,0.25) 2px 2px 5px;
}
header {
}
header img {
height:2em;
vertical-align:bottom;
}
header h1 {
margin:0 1em 0 0;
font-size:110%;
display: inline-block;
}
.ui-layout-north {
background:none;
border:none;
}
.ui-layout-resizer-north {
}
.ui-layout-resizer {
background:none;
}
.ui-layout-toggler {
background:#999;
}
.ui-layout-center,
.ui-layout-west {
}
#language_select {
width:100%;
}
#recent {
border-bottom:1px #999 solid;
}
#recent a {
color: #999;
}
#recent a,
#modules a {
display: block;
text-decoration: none;
margin: 2px 5px;
}
#recent a:hover,
#modules a:hover {
text-decoration:underline;
}
#tabbar {
display:inline-block;
}
#tabbar .module {
border-left: 1px dotted #333;
border-right: 1px dotted #333;
padding:0.5em 0.2em 0.5em 1em;
margin-right:0.7em;
}
#module_name {
font-weight: bold;
margin-right:0.7em;
}
.tab {
cursor:pointer;
padding:0.5em 0.5em;
margin-right:0.5em;
display:inline-block;
text-transform:capitalize;
text-decoration:none;
font-family:sans-serif;
font-weight:bold;
background: #aaa;
color: white;
border-radius: 0.5em;
line-height: 1;
}
.tab:hover {
background: #666;
}
.tab.active {
background: #222;
}
#loading {
position: fixed;
top: 10px;
right: 10px;
white-space: nowrap;
padding: 0.5em 1em;
border: 1px solid #F0C36D;
background: #F9EDBE;
color: #333;
vertical-align: top;
font: bold 13px sans-serif;
z-index:100;
}
.scope {
}
.code {
}
.api {
}
.help {
}
a.synopsis {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=') center right no-repeat;
padding-right:14px;
}
input#search {
font-family:monospace;
width:25em;
padding:0.25em;
background:#eee;
}
.panel {
}
.panel.code,
.panel.api,
.panel.help {
display:none;
}
#controls {
border-bottom: 1px solid #CCC;
padding-bottom: 0.5em;
}
#results {
font: 12px monospace;
width:100%;
margin-top:1em;
border-collapse: collapse;
}
/* this is set in code */
#results tr.odd {
background:ghostwhite;
}
#results tr.indir {
font-style:italic;
}
#results tr.local td:nth-child(2) {
font-weight:bold;
}
#results th {
text-align:left;
}
#results th, #results td {
padding:0.4em;
/*
border-style: solid;
border-width: 0 0 1px 0;
border-color: #eee;
*/
background:none;
white-space:nowrap;
}
#results td:nth-child(6) {
white-space:normal;
}
#code pre {
margin:0;
color:#000;
font: 12px monospace;
}
#code ol.linenums {
color: #aaa;
margin: 0;
}
dt {
font-weight:bold;
}
footer {
padding:3px 6px;
color:#333;
font-size:13px;
text-align:right;
position:absolute;
top:0; right:0;
}