Skip to content

Commit

Permalink
Update BASIC language
Browse files Browse the repository at this point in the history
  • Loading branch information
Sannis committed Dec 12, 2015
1 parent 1d9631e commit 74ef3a8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions AUTHORS.ru.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,4 @@ URL: https://highlightjs.org/
- Небулеон Фумика <nebuleon.fumika@gmail.com>
- prince <MC.prince.0203@gmail.com>
- Брэндан Рокс <rocks.brendan@gmail.com>
- Рафаэль Ассенат <raph@raphnet.net>
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
New languages:

- *Stan* by [Brendan Rocks][]
- *BASIC* by [Raphaël Assénat][]

[Brendan Rocks]: http://brendanrocks.com
[Raphaël Assénat]: https://github.com/raphnet

## Version 9.0.0

Expand All @@ -29,7 +31,6 @@ New languages in this release:
- *YAML* by [Stefan Wienert][]
- *MIPS Assembler* by [Nebuleon Fumika][]
- *HSP* by [prince][]
- *BASIC* by [Raphaël Assénat][]

Improvements to existing languages and styles:

Expand Down
21 changes: 10 additions & 11 deletions src/languages/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Description: Based on the BASIC reference from the Tandy 1000 guide
function(hljs) {
return {
case_insensitive: true,
illegal: '^\.',
// Support explicitely typed variables that end with $%! or #.
lexemes: '[a-zA-Z][a-zA-Z0-9_\$\%\!\#]*',
keywords: {
Expand All @@ -21,36 +22,34 @@ function(hljs) {
'PUT RANDOMIZE READ REM RENUM RESET|0 RESTORE RESUME RETURN|0 RIGHT$ RMDIR RND RSET ' +
'RUN SAVE SCREEN SGN SHELL SIN SOUND SPACE$ SPC SQR STEP STICK STOP STR$ STRING$ SWAP ' +
'SYSTEM TAB TAN TIME$ TIMER TROFF TRON TO USR VAL VARPTR VARPTR$ VIEW WAIT WHILE ' +
'WEND WIDTH WINDOW WRITE XOR',
'WEND WIDTH WINDOW WRITE XOR'
},
contains: [
hljs.QUOTE_STRING_MODE,
hljs.COMMENT('REM','$',{relevance:10}),
hljs.COMMENT('\'','$',{relevance:0}),
hljs.COMMENT('REM', '$', {relevance: 10}),
hljs.COMMENT('\'', '$', {relevance: 0}),
{
// Match line numbers
className: 'symbol',
begin: '^[0-9]+\ ',
relevance: 10,
relevance: 10
},
{
// Match typed numeric constants (1000, 12.34!, 1.2e5, 1.5#, 1.2D2)
className: 'number',
begin: '\\b([0-9]+[0-9edED\.]*[#\!]?)',
relevance: 0
relevance: 0
},
{
// Match hexadecimal numbers (&Hxxxx)
className: 'number',
begin: '(\&[hH][0-9a-fA-F]{1,4})',
begin: '(\&[hH][0-9a-fA-F]{1,4})'
},
{
// Match octal numbers (&Oxxxxxx)
className: 'number',
begin: '(\&[oO][0-7]{1,6})',
},
],
//
illegal: '^\.',
begin: '(\&[oO][0-7]{1,6})'
}
]
};
}

0 comments on commit 74ef3a8

Please sign in to comment.