Skip to content

Commit af28f0c

Browse files
committed
Fix spelling of contextual
:-/
1 parent 11796f7 commit af28f0c

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

Tokenize/src/lexer.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ end
849849

850850
function lex_prime(l, doemit = true)
851851
if l.last_token == Tokens.IDENTIFIER ||
852-
Tokens.iscontexturalkeyword(l.last_token) ||
852+
Tokens.iscontextualkeyword(l.last_token) ||
853853
Tokens.iswordoperator(l.last_token) ||
854854
l.last_token == Tokens.DOT ||
855855
l.last_token == Tokens.RPAREN ||
@@ -900,7 +900,7 @@ end
900900
# A '"' has been consumed
901901
function lex_quote(l::Lexer)
902902
raw = l.last_token == Tokens.IDENTIFIER ||
903-
Tokens.iscontexturalkeyword(l.last_token) ||
903+
Tokens.iscontextualkeyword(l.last_token) ||
904904
Tokens.iswordoperator(l.last_token)
905905
pc, dpc = dpeekchar(l)
906906
triplestr = pc == '"' && dpc == '"'

Tokenize/src/token.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ iskeyword(k::Kind) = begin_keywords < k < end_keywords
1111
isliteral(k::Kind) = begin_literal < k < end_literal
1212
isoperator(k::Kind) = begin_ops < k < end_ops
1313

14-
iscontexturalkeyword(k::Kind) = begin_contextural_keywords < k < end_contextural_keywords
14+
iscontextualkeyword(k::Kind) = begin_contextual_keywords < k < end_contextual_keywords
1515

1616
function iswordoperator(k::Kind)
1717
# Keyword-like operators

Tokenize/src/token_kinds.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
TRY,
3838
USING,
3939
WHILE,
40-
begin_contextural_keywords,
40+
begin_contextual_keywords,
4141
ABSTRACT,
4242
AS,
4343
DOC,
@@ -46,7 +46,7 @@
4646
PRIMITIVE,
4747
TYPE,
4848
VAR,
49-
end_contextural_keywords,
49+
end_contextual_keywords,
5050
end_keywords,
5151

5252
begin_cstparser,

Tokenize/test/lexer.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ end
333333
@test ts[4] ~ (T.DQUOTE , "\"" )
334334
@test ts[5] ~ (T.ENDMARKER , "" )
335335

336-
# Contextural keywords and operators allowed as raw string prefixes
336+
# Contextual keywords and operators allowed as raw string prefixes
337337
ts = collect(tokenize(raw""" var"x $ \ y" """))
338338
@test ts[2] ~ (T.VAR , "var")
339339
@test ts[4] ~ (T.STRING , "x \$ \\ y")
@@ -782,7 +782,7 @@ const all_kws = Set([
782782
"try",
783783
"using",
784784
"while",
785-
# Contextural keywords
785+
# Contextual keywords
786786
"abstract",
787787
"as",
788788
"doc",

src/parser.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ end
237237

238238
function is_reserved_word(k)
239239
k = kind(k)
240-
is_keyword(k) && !is_contextural_keyword(k)
240+
is_keyword(k) && !is_contextual_keyword(k)
241241
end
242242

243243
# Return true if the next word (or word pair) is reserved, introducing a
@@ -246,7 +246,7 @@ function peek_initial_reserved_words(ps::ParseState)
246246
k = peek(ps)
247247
if is_initial_reserved_word(ps, k)
248248
return true
249-
elseif is_contextural_keyword(k)
249+
elseif is_contextual_keyword(k)
250250
k2 = peek(ps,2)
251251
return (k == K"mutable" && k2 == K"struct") ||
252252
(k == K"primitive" && k2 == K"type") ||
@@ -1636,7 +1636,7 @@ end
16361636
# parse expressions or blocks introduced by syntactic reserved words.
16371637
#
16381638
# The caller should use peek_initial_reserved_words to determine whether
1639-
# to call parse_resword, or whether contextural keywords like `mutable` are
1639+
# to call parse_resword, or whether contextual keywords like `mutable` are
16401640
# simple identifiers.
16411641
#
16421642
# flisp: parse-resword

src/token_kinds.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Dict([
4242
"try" => Ts.TRY
4343
"using" => Ts.USING
4444
"while" => Ts.WHILE
45-
# contextural keywords
45+
# contextual keywords
4646
"abstract" => Ts.ABSTRACT
4747
"as" => Ts.AS
4848
"doc" => Ts.DOC

src/tokens.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ kind(raw::TzTokens.RawToken) = TzTokens.exactkind(raw)
4343
# Some renaming for naming consistency
4444
is_literal(k) = TzTokens.isliteral(kind(k))
4545
is_keyword(k) = TzTokens.iskeyword(kind(k))
46-
is_contextural_keyword(k) = TzTokens.iscontexturalkeyword(kind(k))
46+
is_contextual_keyword(k) = TzTokens.iscontextualkeyword(kind(k))
4747
is_operator(k) = TzTokens.isoperator(kind(k))
4848
is_word_operator(k) = TzTokens.iswordoperator(kind(k))
4949

0 commit comments

Comments
 (0)