mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-17 20:58:08 +02:00
Update Julia syntax highlighting from pygments (#472)
This commit is contained in:
parent
d67a2bfdc2
commit
f4cddf039f
File diff suppressed because one or more lines are too long
187
lexers/testdata/julia.actual
vendored
187
lexers/testdata/julia.actual
vendored
@ -1,18 +1,179 @@
|
||||
% Defining basic types
|
||||
## Test keywords are identified
|
||||
|
||||
struct Value
|
||||
v::Int
|
||||
end
|
||||
const r = 33
|
||||
mutable struct MutableType end
|
||||
struct ImmutableType end
|
||||
abstract type AbstractMyType end
|
||||
primitive type MyPrimitive 32 end
|
||||
(abstract, mutable, type) = true, π, missing
|
||||
|
||||
A = zeros(3,3)
|
||||
B = rand(4,3)
|
||||
abstract type AbstractMyType end
|
||||
primitive type MyPrimitive 32 end
|
||||
mutable struct MutableType end
|
||||
|
||||
type = typeof(B)
|
||||
C = A * B'
|
||||
res = C' .+ r
|
||||
## Test that macros are parsed, including ones which are defined as symbols
|
||||
|
||||
const abstract = 33
|
||||
abstract type K end
|
||||
@generated function
|
||||
@. a + b
|
||||
@~ a + b
|
||||
@± a + b
|
||||
@mymacro(a, b)
|
||||
@+¹ᵀ a
|
||||
|
||||
primitive type MyFloat32 32 end
|
||||
## Test that the range of Julia variable names are correctly identified
|
||||
|
||||
a # single character variable
|
||||
a_simple_name
|
||||
_leading_underscore
|
||||
5implicit_mul
|
||||
6_more_mul
|
||||
nums1
|
||||
nums_2
|
||||
nameswith!
|
||||
multiple!!
|
||||
embedded!_inthemiddle
|
||||
embed!1
|
||||
prime_suffix′
|
||||
for_each # starts with keyword substring
|
||||
|
||||
# variables with characters > \u00A1
|
||||
ð # category Ll
|
||||
Aʺ # category Lm -- \U02BA (MODIFIER LETTER DOUBLE PRIME), not \U2033 (DOUBLE PRIME)
|
||||
א # category Lo
|
||||
Ð # category Lu
|
||||
A̅ # category Mn -- \U0305 (COMBINING OVERLINE)
|
||||
ⅿ # category Nl -- \U217F (SMALL ROMAN NUMERAL ONE THOUSAND)
|
||||
A₁ # category No
|
||||
A² # category No
|
||||
€ # category Sc
|
||||
© # category So
|
||||
|
||||
# number-like names
|
||||
𝟙 # category Nd
|
||||
𝟏 # category Nd
|
||||
|
||||
## Tests identification of number forms
|
||||
|
||||
# floats
|
||||
1e1 1e+1 1e-1
|
||||
1.1e1 1.1e+1 1.1e-1 .1e1 .1_1e1 1_1.1e1 1.1_1e1 1.1_11e1
|
||||
1.1E1 1.1E+1 1.1E-1 .1E1 .1_1E1 1_1.1E1 1.1_1E1 1.1_11E1
|
||||
1.1f1 1.1f+1 1.1f-1 .1f1 .1_1f1 1_1.1f1 1.1_1f1 1.1_11f1
|
||||
1E1 1E+1 1E-1
|
||||
1f1 1f+1 1f-1
|
||||
.1 1. 1.1 1.1_1 1.1_11 .1_1 .1_11 1_1.1_1
|
||||
# hex floats
|
||||
0x1p1 0xa_bp10 0x01_ap11 0x01_abp1
|
||||
0x1.1p1 0xA.Bp10 0x0.1_Ap9 0x0_1.Ap1 0x0_1.A_Bp9
|
||||
|
||||
# integers
|
||||
1 01 10_1 10_11
|
||||
|
||||
# non-decimal
|
||||
0xf 0xf_0 0xfff_000
|
||||
0o7 0o7_0 0o777_000
|
||||
0b1 0b1_0 0b111_000
|
||||
|
||||
# invalid in Julia - out of range values
|
||||
0xg 0o8 0b2 0x1pA
|
||||
# invalid in Julia - no trailing underscores
|
||||
1_ 1.1_ 0xf_ 0o7_ 0b1_ 0xF_p1
|
||||
# parsed as juxtaposed numeral + variable in Julia (no underscores in exponents)
|
||||
1e1_1 1E1_1 1f1_1 0xfp1_1
|
||||
|
||||
# not floats -- range-like expression parts
|
||||
1..1 ..1 1..
|
||||
|
||||
## Test that operators --- dotted and unicode --- are identified correctly.
|
||||
|
||||
a += b.c
|
||||
a .÷= .~b.c
|
||||
a = !b ⋆ c!
|
||||
a = b ? c : d ⊕ e
|
||||
a = √(5)
|
||||
a -> (a...) .+ 1
|
||||
a \ b
|
||||
1..2
|
||||
a = a === b
|
||||
a <: T
|
||||
a >: T
|
||||
a::T
|
||||
[adjoint]'
|
||||
(identity)''
|
||||
adjoint'''
|
||||
transpose'ᵀ
|
||||
suffixed +¹ operator
|
||||
suffixed +¹²³ operator
|
||||
|
||||
%% Test string forms
|
||||
|
||||
"global function"
|
||||
"An $interpolated variable"
|
||||
"An $(a + 1) expression"
|
||||
"""a"""
|
||||
"""
|
||||
global function
|
||||
de e f
|
||||
"inner string"
|
||||
"""
|
||||
raw"\\ a \" $interp $(1 + 1) \""
|
||||
raw"""
|
||||
"inner string"
|
||||
$interp
|
||||
$(1 + 1)
|
||||
"""
|
||||
# commented "string"
|
||||
|
||||
@sprintf "%0.2f" var
|
||||
v"1.0"
|
||||
var"#nonstandard#"
|
||||
|
||||
r"^[abs]+$"m
|
||||
arbi"trary"suff
|
||||
arbi"trary"1234
|
||||
|
||||
`global function`
|
||||
`abc \` \$ $interpolated`
|
||||
`abc $(a + 1)`
|
||||
```a```
|
||||
```
|
||||
global function
|
||||
"thing" ` \$
|
||||
`now` $(now())
|
||||
```
|
||||
# commented `command`
|
||||
|
||||
arbi`trary`suff
|
||||
arbi`trary`1234
|
||||
|
||||
## Tests that symbols are parsed as special literals
|
||||
|
||||
:abc_123
|
||||
:abc_def
|
||||
:α
|
||||
Val{:mysymbol}
|
||||
|
||||
# non-symbols
|
||||
a:b
|
||||
1:b
|
||||
1.:b
|
||||
a::T
|
||||
a<:T
|
||||
a>:T
|
||||
UInt(1):UInt(2)
|
||||
|
||||
## Tests identifying names which must be types from context
|
||||
|
||||
Union{}
|
||||
MyType{Nothing, Any}
|
||||
f(::Union{T,S}) where S where T = 1
|
||||
f(::T) where {T} = 1
|
||||
f(::Type{<:T}) = 1
|
||||
f(::AT) where AT <: AbstractArray{MyType,1} = 1
|
||||
f(::Val{:named}) = 1
|
||||
f(::typeof(sin)) = 1
|
||||
MyInt <: Integer
|
||||
Number >: MyInt
|
||||
AT{T,1} <: B
|
||||
B>:AT{T,1}
|
||||
A <: f(B)
|
||||
g(C) <: T
|
||||
|
910
lexers/testdata/julia.expected
vendored
910
lexers/testdata/julia.expected
vendored
@ -1,103 +1,847 @@
|
||||
[
|
||||
{"type":"Operator","value":"%"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"Defining"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"basic"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"types"},
|
||||
{"type":"Comment","value":"## Test keywords are identified"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Keyword","value":"struct"},
|
||||
{"type":"Keyword","value":"mutable struct"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"MutableType"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"Value"},
|
||||
{"type":"Text","value":"\n "},
|
||||
{"type":"Name","value":"v"},
|
||||
{"type":"Operator","value":"::"},
|
||||
{"type":"KeywordType","value":"Int"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Keyword","value":"end"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordDeclaration","value":"const"},
|
||||
{"type":"Keyword","value":"struct"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"r"},
|
||||
{"type":"KeywordType","value":"ImmutableType"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"33"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Name","value":"A"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"zeros"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"LiteralNumberInteger","value":"3"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"LiteralNumberInteger","value":"3"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"B"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"rand"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"LiteralNumberInteger","value":"4"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"LiteralNumberInteger","value":"3"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Name","value":"type"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"typeof"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"B"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"C"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"A"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"*"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"B"},
|
||||
{"type":"Operator","value":"'"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"res"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"C"},
|
||||
{"type":"Operator","value":"'"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":".+"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"r"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"KeywordDeclaration","value":"const"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"abstract"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"33"},
|
||||
{"type":"Keyword","value":"end"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Keyword","value":"abstract type"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"K"},
|
||||
{"type":"KeywordType","value":"AbstractMyType"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Keyword","value":"end"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Keyword","value":"primitive type"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"MyFloat32"},
|
||||
{"type":"KeywordType","value":"MyPrimitive"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"32"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Keyword","value":"end"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"abstract"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"mutable"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"type"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameBuiltin","value":"true"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameBuiltin","value":"π"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameBuiltin","value":"missing"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Keyword","value":"abstract type"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"AbstractMyType"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Keyword","value":"end"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Keyword","value":"primitive type"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"MyPrimitive"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"32"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Keyword","value":"end"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Keyword","value":"mutable struct"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"MutableType"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Keyword","value":"end"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"## Test that macros are parsed, including ones which are defined as symbols"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"NameDecorator","value":"@generated"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Keyword","value":"function"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"NameDecorator","value":"@."},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"+"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"NameDecorator","value":"@~"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"+"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"NameDecorator","value":"@±"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"+"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"NameDecorator","value":"@mymacro"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"NameDecorator","value":"@+¹ᵀ"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"## Test that the range of Julia variable names are correctly identified"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# single character variable"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"a_simple_name"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"_leading_underscore"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberInteger","value":"5"},
|
||||
{"type":"Name","value":"implicit_mul"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberInteger","value":"6"},
|
||||
{"type":"Name","value":"_more_mul"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"nums1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"nums_2"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"nameswith!"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"multiple!!"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"embedded!_inthemiddle"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"embed!1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"prime_suffix′"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"for_each"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# starts with keyword substring"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"# variables with characters \u003e \\u00A1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"ð"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category Ll"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"Aʺ"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category Lm -- \\U02BA (MODIFIER LETTER DOUBLE PRIME), not \\U2033 (DOUBLE PRIME)"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"א"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category Lo"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"Ð"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category Lu"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"A̅"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category Mn -- \\U0305 (COMBINING OVERLINE)"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"ⅿ"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category Nl -- \\U217F (SMALL ROMAN NUMERAL ONE THOUSAND)"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"A₁"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category No"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"A²"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category No"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"€"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category Sc"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"©"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category So"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"# number-like names"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"𝟙"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category Nd"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"𝟏"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Comment","value":"# category Nd"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"## Tests identification of number forms"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"# floats"},
|
||||
{"type":"Text","value":"\n "},
|
||||
{"type":"LiteralNumberFloat","value":"1e1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1e+1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1e-1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberFloat","value":"1.1e1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1e+1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1e-1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":".1e1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":".1_1e1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1_1.1e1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1_1e1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1_11e1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberFloat","value":"1.1E1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1E+1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1E-1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":".1E1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":".1_1E1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1_1.1E1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1_1E1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1_11E1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberFloat","value":"1.1f1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1f+1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1f-1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":".1f1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":".1_1f1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1_1.1f1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1_1f1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1_11f1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberFloat","value":"1E1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1E+1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1E-1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberFloat","value":"1f1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1f+1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1f-1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberFloat","value":".1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1."},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1_1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1_11"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":".1_1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":".1_11"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1_1.1_1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Comment","value":"# hex floats"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberFloat","value":"0x1p1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"0xa_bp10"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"0x01_ap11"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"0x01_abp1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberFloat","value":"0x1.1p1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"0xA.Bp10"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"0x0.1_Ap9"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"0x0_1.Ap1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"0x0_1.A_Bp9"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"# integers"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"01"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"10_1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"10_11"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"# non-decimal"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberHex","value":"0xf"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberHex","value":"0xf_0"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberHex","value":"0xfff_000"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberOct","value":"0o7"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberOct","value":"0o7_0"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberOct","value":"0o777_000"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberBin","value":"0b1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberBin","value":"0b1_0"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberBin","value":"0b111_000"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"# invalid in Julia - out of range values"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberInteger","value":"0"},
|
||||
{"type":"Name","value":"xg"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"0"},
|
||||
{"type":"Name","value":"o8"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"0"},
|
||||
{"type":"Name","value":"b2"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberHex","value":"0x1"},
|
||||
{"type":"Name","value":"pA"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Comment","value":"# invalid in Julia - no trailing underscores"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Name","value":"_"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1.1"},
|
||||
{"type":"Name","value":"_"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberHex","value":"0xf"},
|
||||
{"type":"Name","value":"_"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberOct","value":"0o7"},
|
||||
{"type":"Name","value":"_"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberBin","value":"0b1"},
|
||||
{"type":"Name","value":"_"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberHex","value":"0xF"},
|
||||
{"type":"Name","value":"_p1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Comment","value":"# parsed as juxtaposed numeral + variable in Julia (no underscores in exponents)"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberFloat","value":"1e1"},
|
||||
{"type":"Name","value":"_1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1E1"},
|
||||
{"type":"Name","value":"_1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"1f1"},
|
||||
{"type":"Name","value":"_1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberFloat","value":"0xfp1"},
|
||||
{"type":"Name","value":"_1"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"# not floats -- range-like expression parts"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Operator","value":".."},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":".."},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Operator","value":".."},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"## Test that operators --- dotted and unicode --- are identified correctly."},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"+="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Operator","value":"."},
|
||||
{"type":"Name","value":"c"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":".÷="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":".~"},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Operator","value":"."},
|
||||
{"type":"Name","value":"c"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"!"},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"⋆"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"c!"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"?"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"c"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":":"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"d"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"⊕"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"e"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"√"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"LiteralNumberInteger","value":"5"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"-\u003e"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Operator","value":"..."},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":".+"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"\\"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Operator","value":".."},
|
||||
{"type":"LiteralNumberInteger","value":"2"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"==="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"\u003c:"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"\u003e:"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Operator","value":"::"},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Punctuation","value":"["},
|
||||
{"type":"Name","value":"adjoint"},
|
||||
{"type":"Punctuation","value":"]"},
|
||||
{"type":"Operator","value":"'"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"identity"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Operator","value":"''"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"adjoint"},
|
||||
{"type":"Operator","value":"'''"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"transpose"},
|
||||
{"type":"Operator","value":"'ᵀ"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"suffixed"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"+¹"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"operator"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"suffixed"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"+¹²³"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"operator"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Operator","value":"%%"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"Test"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"string"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"forms"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"LiteralString","value":"\"global function\""},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralString","value":"\"An "},
|
||||
{"type":"LiteralStringInterpol","value":"$interpolated"},
|
||||
{"type":"LiteralString","value":" variable\""},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralString","value":"\"An "},
|
||||
{"type":"LiteralStringInterpol","value":"$"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"+"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"LiteralString","value":" expression\""},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralString","value":"\"\"\"a\"\"\""},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralString","value":"\"\"\"\nglobal function\nde e f\n\"inner string\"\n\"\"\""},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringAffix","value":"raw"},
|
||||
{"type":"LiteralString","value":"\"\\\\ a "},
|
||||
{"type":"LiteralStringEscape","value":"\\\""},
|
||||
{"type":"LiteralString","value":" $interp $(1 + 1) "},
|
||||
{"type":"LiteralStringEscape","value":"\\\""},
|
||||
{"type":"LiteralString","value":"\""},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringAffix","value":"raw"},
|
||||
{"type":"LiteralString","value":"\"\"\"\n\"inner string\"\n$interp\n$(1 + 1)\n\"\"\""},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Comment","value":"# commented \"string\""},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"NameDecorator","value":"@sprintf"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralString","value":"\""},
|
||||
{"type":"LiteralStringInterpol","value":"%0.2f"},
|
||||
{"type":"LiteralString","value":"\""},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"var"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringAffix","value":"v"},
|
||||
{"type":"LiteralString","value":"\"1.0\""},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringAffix","value":"var"},
|
||||
{"type":"LiteralString","value":"\"#nonstandard#\""},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"LiteralStringAffix","value":"r"},
|
||||
{"type":"LiteralStringRegex","value":"\"^[abs]+$\""},
|
||||
{"type":"LiteralStringAffix","value":"m"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringAffix","value":"arbi"},
|
||||
{"type":"LiteralString","value":"\"trary\""},
|
||||
{"type":"LiteralStringAffix","value":"suff"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringAffix","value":"arbi"},
|
||||
{"type":"LiteralString","value":"\"trary\""},
|
||||
{"type":"LiteralStringAffix","value":"1234"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"LiteralStringBacktick","value":"`global function`"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringBacktick","value":"`abc "},
|
||||
{"type":"LiteralStringEscape","value":"\\`"},
|
||||
{"type":"LiteralStringBacktick","value":" "},
|
||||
{"type":"LiteralStringEscape","value":"\\$"},
|
||||
{"type":"LiteralStringBacktick","value":" "},
|
||||
{"type":"LiteralStringInterpol","value":"$interpolated"},
|
||||
{"type":"LiteralStringBacktick","value":"`"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringBacktick","value":"`abc "},
|
||||
{"type":"LiteralStringInterpol","value":"$"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"+"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"LiteralStringBacktick","value":"`"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringBacktick","value":"```a```"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringBacktick","value":"```\nglobal function\n\"thing\" ` "},
|
||||
{"type":"LiteralStringEscape","value":"\\$"},
|
||||
{"type":"LiteralStringBacktick","value":"\n`now` "},
|
||||
{"type":"LiteralStringInterpol","value":"$"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"now"},
|
||||
{"type":"Punctuation","value":"())"},
|
||||
{"type":"LiteralStringBacktick","value":"\n```"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Comment","value":"# commented `command`"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"LiteralStringAffix","value":"arbi"},
|
||||
{"type":"LiteralStringBacktick","value":"`trary`"},
|
||||
{"type":"LiteralStringAffix","value":"suff"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringAffix","value":"arbi"},
|
||||
{"type":"LiteralStringBacktick","value":"`trary`"},
|
||||
{"type":"LiteralStringAffix","value":"1234"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"## Tests that symbols are parsed as special literals"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"LiteralStringSymbol","value":":abc_123"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringSymbol","value":":abc_def"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralStringSymbol","value":":α"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"Val"},
|
||||
{"type":"Punctuation","value":"{"},
|
||||
{"type":"LiteralStringSymbol","value":":mysymbol"},
|
||||
{"type":"Punctuation","value":"}"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"# non-symbols"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Operator","value":":"},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Operator","value":":"},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"LiteralNumberFloat","value":"1."},
|
||||
{"type":"Operator","value":":"},
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Operator","value":"::"},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"a"},
|
||||
{"type":"Operator","value":"\u003c:"},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"a"},
|
||||
{"type":"Operator","value":"\u003e:"},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"UInt"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Operator","value":":"},
|
||||
{"type":"KeywordType","value":"UInt"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"LiteralNumberInteger","value":"2"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Comment","value":"## Tests identifying names which must be types from context"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"KeywordType","value":"Union"},
|
||||
{"type":"Punctuation","value":"{}"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"MyType"},
|
||||
{"type":"Punctuation","value":"{"},
|
||||
{"type":"KeywordType","value":"Nothing"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"Any"},
|
||||
{"type":"Punctuation","value":"}"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"f"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Operator","value":"::"},
|
||||
{"type":"KeywordType","value":"Union"},
|
||||
{"type":"Punctuation","value":"{"},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"KeywordType","value":"S"},
|
||||
{"type":"Punctuation","value":"})"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Keyword","value":"where"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"S"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Keyword","value":"where"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"f"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Operator","value":"::"},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Keyword","value":"where"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Punctuation","value":"{"},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Punctuation","value":"}"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"f"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Operator","value":"::"},
|
||||
{"type":"KeywordType","value":"Type"},
|
||||
{"type":"Punctuation","value":"{"},
|
||||
{"type":"Operator","value":"\u003c:"},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Punctuation","value":"})"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"f"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Operator","value":"::"},
|
||||
{"type":"KeywordType","value":"AT"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Keyword","value":"where"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"AT"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"\u003c:"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"AbstractArray"},
|
||||
{"type":"Punctuation","value":"{"},
|
||||
{"type":"KeywordType","value":"MyType"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Punctuation","value":"}"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"f"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Operator","value":"::"},
|
||||
{"type":"KeywordType","value":"Val"},
|
||||
{"type":"Punctuation","value":"{"},
|
||||
{"type":"LiteralStringSymbol","value":":named"},
|
||||
{"type":"Punctuation","value":"})"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"f"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Operator","value":"::"},
|
||||
{"type":"Name","value":"typeof"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"sin"},
|
||||
{"type":"Punctuation","value":"))"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"MyInt"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"\u003c:"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"Integer"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"Number"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"\u003e:"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"MyInt"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"AT"},
|
||||
{"type":"Punctuation","value":"{"},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Punctuation","value":"}"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"\u003c:"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"B"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"B"},
|
||||
{"type":"Operator","value":"\u003e:"},
|
||||
{"type":"KeywordType","value":"AT"},
|
||||
{"type":"Punctuation","value":"{"},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Punctuation","value":"}"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordType","value":"A"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"\u003c:"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"f"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"B"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Name","value":"g"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"C"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"\u003c:"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"T"},
|
||||
{"type":"Text","value":"\n"}
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user